From 981745717e881fa15c2e73119740d8f0f5cc0da6 Mon Sep 17 00:00:00 2001
From: toshihiro <toshihiro>
Date: Sun, 3 Jun 2007 11:39:00 +0000
Subject: [PATCH] Fix mishandled closing tag

---
 .../xml/ui/internal/text/XMLCDATAScanner.java      |   23 +++++--------------
 1 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/net.sourceforge.phpeclipse.xml.ui/src/net/sourceforge/phpeclipse/xml/ui/internal/text/XMLCDATAScanner.java b/net.sourceforge.phpeclipse.xml.ui/src/net/sourceforge/phpeclipse/xml/ui/internal/text/XMLCDATAScanner.java
index 4ae4325..848f207 100644
--- a/net.sourceforge.phpeclipse.xml.ui/src/net/sourceforge/phpeclipse/xml/ui/internal/text/XMLCDATAScanner.java
+++ b/net.sourceforge.phpeclipse.xml.ui/src/net/sourceforge/phpeclipse/xml/ui/internal/text/XMLCDATAScanner.java
@@ -8,7 +8,7 @@
  * Contributors:
  *     Igor Malinin - initial contribution
  *
- * $Id: XMLCDATAScanner.java,v 1.3 2007-04-05 07:50:15 toshihiro Exp $
+ * $Id: XMLCDATAScanner.java,v 1.4 2007-06-03 11:39:00 toshihiro Exp $
  */
 
 package net.sourceforge.phpeclipse.xml.ui.internal.text;
@@ -67,25 +67,15 @@ public class XMLCDATAScanner implements ITokenScanner {
 		offset += length;
 
 		if (position == begin) {
-//#1622108
-//			position += 3; // <![
-//			try {
-//				if (document.get(position, 6).equals("CDATA[")) {
-//					position += 6;
-//				}
-//			} catch (BadLocationException e) {
-//			}
+
 			try {
-				if (document.get(position, 3).equals("<![")) {
-					position += 3;
-					if (document.get(position, 6).equals("CDATA[")) {
-						position += 6;
-					}
-				} // else: xml cdata part is divided by php script block
+				if (document.get(position, 9).equals("<![CDATA[")) {
+					position += 9;
+					return getToken(IXMLSyntaxConstants.XML_CDATA);
+				}
 			} catch (BadLocationException e) {
 			}
 
-			return getToken(IXMLSyntaxConstants.XML_CDATA);
 		}
 
 		if (position == end) {
@@ -99,7 +89,6 @@ public class XMLCDATAScanner implements ITokenScanner {
 					position = end;
 					return getToken(IXMLSyntaxConstants.XML_CDATA);
 				}
-
 				position = p;
 			} else {
 				position = end;
-- 
1.7.1