This commit was manufactured by cvs2svn to create branch 'R3_2_2_patches'.
diff --git a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.core.prefs
index 66ddc69..911428b 100644
--- a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled

 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error

 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled

-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore

+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning

 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore

 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning

 org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore

diff --git a/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
index 2d66309..eaaf5db 100644
--- a/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jst.jsp.core; singleton:=true
-Bundle-Version: 1.2.101.qualifier
+Bundle-Version: 1.2.302.qualifier
 Bundle-Activator: org.eclipse.jst.jsp.core.internal.JSPCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -42,19 +42,22 @@
  org.eclipse.jst.jsp.css.core.internal.modelhandler;x-friends:="org.eclipse.jst.jsp.ui",
  org.eclipse.jst.jsp.css.core.internal.parser;x-internal:=true,
  org.eclipse.jst.jsp.css.core.internal.parserz;x-internal:=true
-Require-Bundle: com.ibm.icu;bundle-version="[3.8.1,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.filebuffers;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,3.5.0)",
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8",
+ javax.servlet.jsp.tagext;version="2.0.0"
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.jobs;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.filebuffers;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jdt.core;bundle-version="[3.5.0,3.7.0)",
  org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)",
- javax.servlet.jsp;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)";resolution:=optional,
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,2.0.0)";resolution:=optional
-Bundle-ActivationPolicy: lazy; exclude:="org.eclipse.jst.jsp.core.internal.contenttype"
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.css.core;bundle-version="[1.1.300,1.2.0)",
+ org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)",
+ org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.0,2.0.0)";resolution:=optional,
+ org.eclipse.wst.common.modulecore;bundle-version="[1.1.300,2.0.0)";resolution:=optional,
+ org.eclipse.osgi.services;bundle-version="3.2.0"
+Bundle-ActivationPolicy: lazy; exclude:="org.eclipse.jst.jsp.core.internal.contenttype,org.eclipse.jst.jsp.css.core.internal.contenttype,org.eclipse.jst.jsp.core.internal.provisional.contenttype"
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.jst.jsp.core/build.properties b/bundles/org.eclipse.jst.jsp.core/build.properties
index 92ef44d..09a522d 100644
--- a/bundles/org.eclipse.jst.jsp.core/build.properties
+++ b/bundles/org.eclipse.jst.jsp.core/build.properties
@@ -16,7 +16,6 @@
                about.html
 bin.excludes = @dot/**,\
                temp.folder/**
-src.includes = component.xml,\
-               DevTimeSupport/,\
+src.includes = DevTimeSupport/,\
                schema/
 source.. = src/
diff --git a/bundles/org.eclipse.jst.jsp.core/component.xml b/bundles/org.eclipse.jst.jsp.core/component.xml
deleted file mode 100644
index ab88fac..0000000
--- a/bundles/org.eclipse.jst.jsp.core/component.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jst.jsp">
-	<component-depends unrestricted="true" />
-	<plugin id="org.eclipse.jst.jsp.core" fragment="false" />
-	<package name="org.eclipse.jst.jsp.core.taglib" api="false">
-		<type name="IJarRecord" implement="false" />
-		<type name="ITagDirRecord" implement="false" />
-		<type name="ITaglibIndexDelta" implement="false" />
-		<type name="ITaglibIndexListener" implement="true" />
-		<type name="ITaglibDescriptor" implement="false" />
-		<type name="ITaglibRecord" implement="false" />
-		<!-- <type name="ITaglibRecordEvent" implement="false" /> -->
-		<type name="ITLDRecord" implement="false" />
-		<type name="IURLRecord" implement="false" />
-		<type name="TaglibIndex" subclass="false" instantiate="false" />
-		<type name="TaglibIndexDelta" subclass="false" instantiate="false" />
-	</package>
-	<plugin id="org.eclipse.jst.jsp.ui" fragment="false" />
-	<package name="org.eclipse.jst.jsp.ui" api="false">
-		<type name="StructuredTextViewerConfigurationJSP" subclass="true" instantiate="true" />
-	</package>
-	<package name="org.eclipse.jst.jsp.ui.views.contentoutline" api="false">
-		<type name="JSPContentOutlineConfiguration" subclass="true" instantiate="true" />
-	</package>
-	<plugin id="org.eclipse.jst.jsp.ui.infopop" fragment="false" />
-	<description url="http://eclipse.org/webtools/jst/components/jsp/overview.html" />
-</component>
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/plugin.properties b/bundles/org.eclipse.jst.jsp.core/plugin.properties
index f6fdf1e..f63b037 100644
--- a/bundles/org.eclipse.jst.jsp.core/plugin.properties
+++ b/bundles/org.eclipse.jst.jsp.core/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 pluginName=Structured Source JSP Model
 Structured_JSP_Document_Factory_Extension.name=Structured JSP Document Factory Extension
 JSP_Content_Type_Extension_Element.name=JSP
@@ -20,6 +20,7 @@
 JSP_Directive_Validator.name=JSP Directive Validator
 EL_Syntax_Validator.name=EL Syntax Validator
 JSP_Content_Validator.name=JSP Content Validator
+TLDValidator.name=Tag Library Descriptor Validator
 Structured_JSP_Document_Setup_participant.name=Structured JSP Document Setup Participant
 _validationMarker.name=JSP Problem
 _taskMarker.name=JSP Task
diff --git a/bundles/org.eclipse.jst.jsp.core/plugin.xml b/bundles/org.eclipse.jst.jsp.core/plugin.xml
index ad6153c..be0b012 100644
--- a/bundles/org.eclipse.jst.jsp.core/plugin.xml
+++ b/bundles/org.eclipse.jst.jsp.core/plugin.xml
@@ -108,7 +108,7 @@
 		</processor>
 	</extension>
 
-	<extension point="org.eclipse.core.runtime.contentTypes">
+	<extension point="org.eclipse.core.contenttype.contentTypes">
 		<!-- create content type for JSP files -->
 		<content-type
 			file-extensions="jsp,jsv,jtpl,jspx"
@@ -146,7 +146,13 @@
 			name="%JSP_TLD_Content_Type_Extension_Element.name"
 			id="tldsource"
 			base-type="org.eclipse.core.runtime.xml"
-			default-charset="UTF-8"/>
+			default-charset="UTF-8">
+			<!-- add the describer so it's properly detected when opened from within .jar files -->
+			<describer class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber">
+				<parameter name="element" value="taglib"/>
+			</describer>
+		</content-type>
+		
 
   	<!--======================================================================================-->
 	<!-- minimal content-type css jsp support                                                 -->
@@ -186,7 +192,8 @@
             class="org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator"
             manual="true"
             version="1"
-            markerId="org.eclipse.jst.jsp.core.validationMarker">
+            markerId="org.eclipse.jst.jsp.core.validationMarker"
+            sourceid="org.eclipse.jst.jsp.jspelsourcevalidator, org.eclipse.jst.jsp.ui.internal.validation.jspactionvalidator, org.eclipse.jst.jsp.tldsourcevalidator, org.eclipse.jst.jsp.jspsourcevalidator">
          <include>
             <rules>
 	           <projectNature id="org.eclipse.jdt.core.javanature"/>
@@ -238,7 +245,8 @@
             class="org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator"
             manual="true"
             version="1"
-            markerId="org.eclipse.jst.jsp.core.validationMarker">
+            markerId="org.eclipse.jst.jsp.core.validationMarker"
+            sourceid="org.eclipse.jst.jsp.ui.internal.validation.markupvalidator, org.eclipse.jst.jsp.ui.internal.validation.htmlsyntaxvalidator">
          <include>
             <rules>
 				<contentType id="org.eclipse.jst.jsp.core.jspsource"/>
@@ -277,6 +285,26 @@
          <group id="org.eclipse.wst.sse.core.structuredModelGroup"/>
       </validator>
    </extension>
+   
+   <extension id="TLDValidator" name="%TLDValidator.name" point="org.eclipse.wst.validation.validatorV2">
+      <validator
+            build="true"
+            class="org.eclipse.jst.jsp.core.internal.validation.TLDValidator"
+            manual="true"
+            version="1"
+            markerId="org.eclipse.jst.jsp.core.validationMarker">
+         <include>
+            <rules>
+				<contentType id="org.eclipse.jst.jsp.core.tldsource"/>
+               <fileext
+                     caseSensitive="false"
+                     ext="tld">
+               </fileext>
+           </rules>
+         </include>
+         <group id="org.eclipse.wst.sse.core.structuredModelGroup"/>
+      </validator>
+   </extension>
 		
     <extension
        point="org.eclipse.jst.jsp.core.elTranslator">
@@ -325,4 +353,17 @@
 			class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
 	</extension>	
 	-->
+	<extension point="org.eclipse.wst.xml.core.modelQueryExtensions">
+		<modelQueryExtension
+			class="org.eclipse.jst.jsp.core.internal.modelquery.JSPModelQueryExtension"
+			contentType="org.eclipse.jst.jsp.core.jspsource">
+		</modelQueryExtension>
+	</extension>
+	<extension point="org.eclipse.wst.xml.core.modelQueryExtensions">
+		<modelQueryExtension
+			class="org.eclipse.jst.jsp.core.internal.modelquery.TaglibModelQueryExtension"
+			contentType="org.eclipse.jst.jsp.core.jspsource">
+		</modelQueryExtension>
+	</extension>
+
 </plugin>
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCoreMessages.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCoreMessages.java
index e6a72fc..697124d 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCoreMessages.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCoreMessages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,7 +29,12 @@
 	public static String JSPDirectiveValidator_6;
 	public static String JSPDirectiveValidator_7;
 	public static String JSPDirectiveValidator_8;
+	public static String JSPDirectiveValidator_9;
+	public static String JSPDirectiveValidator_10;
+	public static String JSPDirectiveValidator_11;
 	public static String JSPActionValidator_0;
+
+	public static String JSPActionValidator_1;
 	public static String JSPIndexManager_0;
 	public static String JSPIndexManager_2;
 	public static String JSP_Search;
@@ -47,6 +52,14 @@
 	public static String JSPTranslator_1;
 	public static String JSPTranslator_2;
 	public static String JSPTranslator_3;
+	public static String JSPTranslator_4;
+	public static String JSPTranslator_5;
+	public static String JSPELTranslator_0;
+	public static String TLDValidator_MissingValidator;
+	public static String TLDValidator_MissingVariable;
+	public static String TLDValidator_MissingListener;
+	public static String Initializing;
+	public static String Persisting_JSP_Translations;
 	
 	/**
 	 * @deprecated
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
index cda29d7..2b4fab5 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,11 +10,21 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.core.internal;
 
+import org.eclipse.core.resources.ISaveContext;
+import org.eclipse.core.resources.ISaveParticipant;
+import org.eclipse.core.resources.ISavedState;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
 import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentPropertiesManager;
 import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslatorPersister;
 import org.eclipse.jst.jsp.core.internal.java.search.JSPIndexManager;
 import org.eclipse.jst.jsp.core.internal.taglib.TaglibHelperManager;
 import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
@@ -26,6 +36,9 @@
 public class JSPCorePlugin extends Plugin {
 	// The shared instance.
 	private static JSPCorePlugin plugin;
+	
+	/** Save participant for this plugin */
+	ISaveParticipant fSaveParticipant;
 
 	/**
 	 * The constructor.
@@ -33,13 +46,11 @@
 	public JSPCorePlugin() {
 		super();
 		plugin = this;
+		fSaveParticipant = new SaveParticipant();
 	}
 
 	/**
 	 * Returns the shared instance.
-	 * 
-	 * @deprecated - will be removed. Currently used to get "model
-	 *             preferences", but there are other, better ways.
 	 */
 	public static JSPCorePlugin getDefault() {
 		return plugin;
@@ -63,7 +74,35 @@
 		// listen for classpath changes
 		JavaCore.addElementChangedListener(TaglibHelperManager.getInstance());
 
-
+		//restore save state and process any events that happened before plugin loaded
+		if (JSPTranslatorPersister.ACTIVATED) {
+			Job persister = new Job(JSPCoreMessages.Initializing) {
+				protected IStatus run(IProgressMonitor monitor) {
+					ISavedState savedState = null;
+					try {
+						savedState = ResourcesPlugin.getWorkspace().addSaveParticipant(plugin.getBundle().getSymbolicName(), fSaveParticipant);
+					}
+					catch (CoreException e) {
+						Logger.logException("Could not load previous save state", e);
+					}
+					if (savedState != null) {
+						try {
+							Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
+						}
+						finally {
+							savedState.processResourceChangeEvents(JSPTranslatorPersister.getDefault());
+						}
+					}
+					return Status.OK_STATUS;
+				}
+			};
+			persister.setUser(false);
+			persister.schedule(2000);
+			// set up persister to listen to resource change events
+			ResourcesPlugin.getWorkspace().addResourceChangeListener(JSPTranslatorPersister.getDefault());
+		}
+		
+		//init the JSP index
 		JSPIndexManager.getInstance().initialize();
 
 		// listen for resource changes to update content properties keys
@@ -86,6 +125,14 @@
 		 */
 		JSPFContentPropertiesManager.shutdown();
 
+		//remove the plugin save participant
+		ResourcesPlugin.getWorkspace().removeSaveParticipant(plugin.getBundle().getSymbolicName());
+		
+		//remove the translator persister
+		if(JSPTranslatorPersister.ACTIVATED) {
+			ResourcesPlugin.getWorkspace().removeResourceChangeListener(JSPTranslatorPersister.getDefault());
+		}
+		
 		// stop any indexing
 		JSPIndexManager.getInstance().shutdown();
 
@@ -98,4 +145,44 @@
 
 		super.stop(context);
 	}
+	
+	/**
+	 * Used so that all of the IResourceChangeEvents that occurred before
+	 * this plugin loaded can be processed.
+	 */
+	private static class SaveParticipant implements ISaveParticipant {
+		/**
+		 * <p>Default constructor</p>
+		 */
+		protected SaveParticipant() {
+		}
+		
+		/**
+		 * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
+		 */
+		public void doneSaving(ISaveContext context) {
+			//ignore
+		}
+	
+		/**
+		 * @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
+		 */
+		public void prepareToSave(ISaveContext context) throws CoreException {
+			//ignore
+		}
+	
+		/**
+		 * @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
+		 */
+		public void rollback(ISaveContext context) {
+			//ignore
+		}
+	
+		/**
+		 * @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
+		 */
+		public void saving(ISaveContext context) throws CoreException {
+			context.needDelta();
+		}
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties
index 2ff51e7..e7e91b5 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2009 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -18,21 +18,33 @@
 JSPFContentPropertiesManager_Updating=Updating JSP Fragment Content Settings
 JSPFContentPropertiesManager_Problems_Updating=Problem saving JSP Fragment Content Settings for {0}
 JSPDirectiveValidator_0={0} is a reserved prefix.  Try another
-JSPDirectiveValidator_1=Cannot find the tag library descriptor for "{0}"
+JSPDirectiveValidator_1=Can not find the tag library descriptor for "{0}"
 JSPDirectiveValidator_2=The prefix "{0} "is used more than once
 JSPDirectiveValidator_3=A {0} value is required in this directive
-JSPDirectiveValidator_4=Fragment "{0}" was not be found at expected path {1}
+JSPDirectiveValidator_4=Fragment "{0}" was not found at expected path {1}
 JSPDirectiveValidator_5=Missing required attribute "{0}"
 JSPDirectiveValidator_6=Undefined attribute name "{0}"
 JSPDirectiveValidator_7=A {0} or {1} value is required in this directive
-JSPDirectiveValidator_8=The superclass "{0}" was not found on the build path
+JSPDirectiveValidator_8=The superclass "{0}" was not found on the Java Build Path
+JSPDirectiveValidator_9=Can not find the tag library descriptor for "{0}".  Try increasing the version of the Dynamic Web Module project facet.
+JSPDirectiveValidator_10=Can not find the tag library descriptor for "{0}".  Try using a newer grammar or declared version in the Web Deployment Descriptor.
+JSPDirectiveValidator_11=Can not find the tag directory "{0}"
 JSPActionValidator_0=Tag ({0}) must be empty
+JSPActionValidator_1="{0}" does not support runtime expressions
 JSPBatchValidator_0=Gathering files in {0}
-TaglibHelper_0=The TagExtraInfo class for {0} ({1}) was not found on the build path
-TaglibHelper_1=The TagExtraInfo class for {0} ({1}) could not be instantiated
-TaglibHelper_2=A problem was encountered using TagExtraInfo class {1} for {0} 
-TaglibHelper_3=The tag handler class for {0} ({1}) was not found on the build path
+TaglibHelper_0=The TagExtraInfo class for "{0}" ({1}) was not found on the Java Build Path
+TaglibHelper_1=The TagExtraInfo class for "{0}" ({1}) could not be instantiated
+TaglibHelper_2=A problem was encountered using TagExtraInfo class {1} for '{0}' 
+TaglibHelper_3=The tag handler class for "{0}" ({1}) was not found on the Java Build Path
 JSPTranslator_0=Invalid identifier: "{0}"
 JSPTranslator_1=Undefined type: {0}
-JSPTranslator_2=Cannot declare both "class" and "beanName" attributes
+JSPTranslator_2=Can not declare both "class" and "beanName" attributes
 JSPTranslator_3=Unknown type for identifier "{0}"
+JSPTranslator_4=Missing start tag for "{0}"
+JSPTranslator_5=Missing end tag for "{0}"
+JSPELTranslator_0=The function {0} is undefined
+TLDValidator_MissingValidator=The TagLibraryValidator subclass '{0}' was not found on the Java Build Path
+TLDValidator_MissingVariable=The variable class '{0}' was not found on the Java Build Path
+TLDValidator_MissingListener=The listener class '{0}' was not found on the Java Build Path
+Initializing=Processing JSP changes since last activation
+Persisting_JSP_Translations=Persisting JSP Translations
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JSPCMDocumentFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JSPCMDocumentFactory.java
index 59b2b3e..3ae1d2e 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JSPCMDocumentFactory.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JSPCMDocumentFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -25,7 +25,7 @@
 	}
 
 	public static CMDocument getCMDocument() {
-		return getCMDocument(CMDocType.JSP20_DOC_TYPE);
+		return getCMDocument(CMDocType.JSP21_DOC_TYPE);
 	}
 
 	/**
@@ -40,11 +40,13 @@
 	}
 
 	public static CMDocument getCMDocument(float jspVersion) {
-		if (jspVersion >= 2)
+		if (jspVersion >= 2.1f)
+			return getCMDocument(CMDocType.JSP21_DOC_TYPE);
+		else if (jspVersion >= 2)
 			return getCMDocument(CMDocType.JSP20_DOC_TYPE);
-		if (jspVersion >= 1.2)
+		else if (jspVersion >= 1.2f)
 			return getCMDocument(CMDocType.JSP12_DOC_TYPE);
-		if (jspVersion >= 1)
+		else if (jspVersion >= 1)
 			return getCMDocument(CMDocType.JSP11_DOC_TYPE);
 		return getCMDocument();
 	}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibController.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibController.java
index e4454cc..bea60aa 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibController.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibController.java
@@ -28,13 +28,13 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
 import org.eclipse.jst.jsp.core.taglib.ITaglibIndexDelta;
 import org.eclipse.jst.jsp.core.taglib.ITaglibIndexListener;
 import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
 import org.eclipse.wst.sse.core.internal.util.Assert;
+import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
 
 /**
  * Provides a direct mapping from IStructuredDocument to supporting
@@ -135,7 +135,7 @@
 					info.location = buffer.getLocation();
 					info.locationKind = LocationKind.NORMALIZE;
 					info.tldDocumentManager = new TLDCMDocumentManager();
-					info.tldDocumentManager.setSourceParser((JSPSourceParser) info.document.getParser());
+					info.tldDocumentManager.setSourceParser((XMLSourceParser) info.document.getParser());
 					synchronized (_instance.fDocumentMap) {
 						_instance.fDocumentMap.put(document, info);
 					}
@@ -364,7 +364,7 @@
 		synchronized (_instance.fDocumentMap) {
 			_instance.fDocumentMap.put(document, info);
 		}
-		info.tldDocumentManager.setSourceParser((JSPSourceParser) info.document.getParser());
+		info.tldDocumentManager.setSourceParser((XMLSourceParser) info.document.getParser());
 		if (document instanceof BasicStructuredDocument && document.getLength() > 0) {
 			((BasicStructuredDocument) document).reparse(this);
 		}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java
index 41d7ed9..6bfdfde 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -24,7 +24,9 @@
 
 public class CMAttributeDeclarationImpl implements TLDAttributeDeclaration {
 
-	private CMDataType attrType = new CMDataTypeImpl(CMDataType.CDATA);
+	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=170556
+	private static final CMDataType attrType = new CMDataTypeImpl(CMDataType.CDATA);
+	
 	private String fDescription;
 
 	//
@@ -135,7 +137,7 @@
 	 * 
 	 * @return java.lang.Object
 	 * 
-	 * Returns the object property desciped by the propertyName
+	 * Returns the object property described by the propertyName
 	 * 
 	 */
 	public Object getProperty(String propertyName) {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentFactoryTLD.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentFactoryTLD.java
index 2b5acef..09daa42 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentFactoryTLD.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentFactoryTLD.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,7 +16,6 @@
 import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.net.URLConnection;
 
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.SAXParser;
@@ -82,7 +81,6 @@
  * TLDAttributeDeclaration interfaces for extended properties.
  */
 public class CMDocumentFactoryTLD implements CMDocumentFactory {
-
 	static final boolean _debug = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/tldcmdocument/factory")); //$NON-NLS-1$ //$NON-NLS-2$
 
 	/**
@@ -402,6 +400,9 @@
 				else if (nodeName.equals(JSP20TLDNames.TAG_EXTENSION) && child.getNodeType() == Node.ELEMENT_NODE) {
 					ed.getExtensions().add(child);
 				}
+				else if (nodeName.equals(JSP20TLDNames.DYNAMIC_ATTRIBUTES) && child.hasChildNodes()) {
+					ed.setDynamicAttributes(getContainedText(child));
+				}
 			}
 			child = child.getNextSibling();
 		}
@@ -562,7 +563,7 @@
 	protected String getContainedText(Node parent) {
 		NodeList children = parent.getChildNodes();
 		if (children.getLength() == 1) {
-			return children.item(0).getNodeValue().trim();
+			return getValue(children.item(0));
 		}
 		StringBuffer s = new StringBuffer();
 		Node child = parent.getFirstChild();
@@ -577,13 +578,22 @@
 				}
 			}
 			else {
-				s.append(child.getNodeValue().trim());
+				s.append(getValue(child));
 			}
 			child = child.getNextSibling();
 		}
 		return s.toString().trim();
 	}
 
+	private String getValue(Node n) {
+		if (n == null)
+			return ""; //$NON-NLS-1$
+		String value = n.getNodeValue();
+		if (value == null)
+			return ""; //$NON-NLS-1$
+		return value.trim();
+	}
+
 	public boolean isBuilderForGrammar(String grammarFileName) {
 		String fileName = grammarFileName.toLowerCase();
 		return fileName.endsWith(".tld") || fileName.endsWith(".jar"); //$NON-NLS-2$//$NON-NLS-1$
@@ -661,7 +671,7 @@
 			}
 			// New JSP 1.2
 			// description
-			else if (nodeName.equals(JSP12TLDNames.DESCRIPTION)) {
+			else if (nodeName.equals(JSP12TLDNames.DESCRIPTION) && child.hasChildNodes()) {
 				document.setDescription(getContainedText(child));
 			}
 			// display name
@@ -810,10 +820,14 @@
 
 	private void loadTagFile(CMElementDeclarationImpl ed, IFile tagFile, boolean allowIncludes) {
 		try {
-			IStructuredDocument document = (IStructuredDocument) new ModelHandlerForJSP().getDocumentLoader().createNewStructuredDocument(tagFile);
-			IStructuredDocumentRegion documentRegion = document.getFirstStructuredDocumentRegion();
 			ed.setPath(tagFile.getFullPath().toString());
 			ed.setTagSource(TLDElementDeclaration.SOURCE_TAG_FILE);
+			ed.setLocationString(tagFile.getFullPath().toString());
+			if (!tagFile.isAccessible())
+				return;
+
+			IStructuredDocument document = (IStructuredDocument) new ModelHandlerForJSP().getDocumentLoader().createNewStructuredDocument(tagFile);
+			IStructuredDocumentRegion documentRegion = document.getFirstStructuredDocumentRegion();
 			while (documentRegion != null) {
 				if (documentRegion.getType().equals(DOMJSPRegionContexts.JSP_DIRECTIVE_NAME)) {
 					if (documentRegion.getNumberOfRegions() > 2) {
@@ -973,12 +987,11 @@
 
 		}
 		catch (IOException e) {
-			Logger.logException("problem parsing " + tagFile, e);
+			// Logger.logException("problem parsing " + tagFile, e); // can be caused by a still-in-development file
 		}
 		catch (CoreException e) {
-			Logger.logException("problem parsing " + tagFile, e);
+			// Logger.logException("problem parsing " + tagFile, e); // frequently out of sync
 		}
-		ed.setLocationString(tagFile.getFullPath().toString());
 	}
 
 	/**
@@ -1033,35 +1046,26 @@
 				break;
 			case (ITaglibRecord.URL) : {
 				IURLRecord record = (IURLRecord) reference;
-				InputStream urlContents = null;
-				URLConnection connection = null;
-				try {
-					connection = record.getURL().openConnection();
-					if (connection != null) {
-						connection.setUseCaches(false);
-						urlContents = connection.getInputStream();
-						document = (CMDocumentImpl) buildCMDocument(record.getBaseLocation(), urlContents);
-						document.setLocationString(record.getURL().toString());
-						if (document.getSmallIcon() != null) {
-							String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), record.getURL().toString(), "/"); //$NON-NLS-1$
-							document.setProperty(JSP12TLDNames.SMALL_ICON, iconPath);
-						}
-						if (document.getLargeIcon() != null) {
-							String iconPath = URIHelper.normalize(((TLDDocument) document).getLargeIcon(), record.getURL().toString(), "/"); //$NON-NLS-1$
-							document.setProperty(JSP12TLDNames.LARGE_ICON, iconPath);
-						}
+				URL url = record.getURL();
+				InputStream urlContents = JarUtilities.getInputStream(url);
+				if (urlContents != null) {
+					document = (CMDocumentImpl) buildCMDocument(record.getBaseLocation(), urlContents);
+					String urlString = url.toString();
+					document.setLocationString(urlString);
+					if (document.getSmallIcon() != null) {
+						String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), urlString, "/"); //$NON-NLS-1$
+						document.setProperty(JSP12TLDNames.SMALL_ICON, iconPath);
+					}
+					if (document.getLargeIcon() != null) {
+						String iconPath = URIHelper.normalize(((TLDDocument) document).getLargeIcon(), urlString, "/"); //$NON-NLS-1$
+						document.setProperty(JSP12TLDNames.LARGE_ICON, iconPath);
 					}
 				}
-				catch (IOException e) {
-					// not uncommon given invalid URLs
-				}
-				finally {
-					if (urlContents != null) {
-						try {
-							urlContents.close();
-						}
-						catch (IOException e) {
-						}
+				if (urlContents != null) {
+					try {
+						urlContents.close();
+					}
+					catch (IOException e) {
 					}
 				}
 			}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java
index 52d0136..7984fba 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -322,6 +322,9 @@
 			}
 			return getOwnerDocument().getProperty(propertyName);
 		}
+		else if(TLDElementDeclaration.IS_LIBRARY_TAG.equals(propertyName)) {
+			return Boolean.TRUE;
+		}
 		return null;
 	}
 
@@ -512,7 +515,7 @@
 	 * 
 	 */
 	public boolean supports(String propertyName) {
-		return propertyName == null || propertyName.equals("tagInfo") || propertyName.equals(JSP12TLDNames.DESCRIPTION) || propertyName.equals(TLDDocument.CM_KIND) || propertyName.equals(JSP12TLDNames.SMALL_ICON) || propertyName.equals(JSP12TLDNames.LARGE_ICON) || propertyName.equals(TLDElementDeclaration.TAG_SOURCE);//$NON-NLS-1$ //$NON-NLS-2$
+		return propertyName == null || propertyName.equals("tagInfo") || propertyName.equals(JSP12TLDNames.DESCRIPTION) || propertyName.equals(TLDDocument.CM_KIND) || propertyName.equals(JSP12TLDNames.SMALL_ICON) || propertyName.equals(JSP12TLDNames.LARGE_ICON) || propertyName.equals(TLDElementDeclaration.TAG_SOURCE) || propertyName.equals(TLDElementDeclaration.IS_LIBRARY_TAG);//$NON-NLS-1$ //$NON-NLS-2$
 	}
 
 	public String toString() {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java
index b392a68..ee00cbb 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -37,7 +37,6 @@
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
 import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
 import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache.PropertyGroup;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport;
@@ -53,6 +52,7 @@
 import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
 import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
 import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
+import org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser;
 import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandler;
 import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandlerExtension;
 import org.eclipse.wst.sse.core.internal.ltk.parser.TagMarker;
@@ -66,6 +66,7 @@
 import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 
 public class TLDCMDocumentManager implements ITaglibIndexListener {
@@ -75,7 +76,7 @@
 		 * Adds a block tagname (fully namespace qualified) into the list of
 		 * block tag names for the parser. The marker
 		 * IStructuredDocumentRegion along with position cues during reparses
-		 * allow the JSPSourceParser to enable/ignore the tags as blocks.
+		 * allow the XMLSourceParser to enable/ignore the tags as blocks.
 		 */
 		protected void addBlockTag(String tagnameNS, ITextRegionCollection marker) {
 			if (getParser() == null)
@@ -148,7 +149,7 @@
 			}
 		}
 		
-		protected void processRegionCollection(ITextRegionCollection regionCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, JSPSourceParser textSource) {
+		protected void processRegionCollection(ITextRegionCollection regionCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, XMLSourceParser textSource) {
 			/*
 			 * Would test > 1, but since we only care if there are 8 (<%@,
 			 * taglib, uri, =, where, prefix, =, what) [or 4 for include
@@ -196,7 +197,7 @@
 		 * anchorStructuredDocumentRegion. Includes use the including file as
 		 * the point of reference, not necessarily the "top" file.
 		 */
-		protected void processInclude(ITextRegionCollection includeDirectiveCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, JSPSourceParser textSource) {
+		protected void processInclude(ITextRegionCollection includeDirectiveCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, XMLSourceParser textSource) {
 			ITextRegionList regions = includeDirectiveCollection.getRegions();
 			String includedFile = null;
 			boolean isFilename = false;
@@ -266,9 +267,11 @@
 						includeHelper.parse(filePath);
 						List references = includeHelper.taglibReferences;
 						fTLDCMReferencesMap.put(filePath, references);
-						for (int i = 0; references != null && i < references.size(); i++) {
-							TLDCMDocumentReference reference = (TLDCMDocumentReference) references.get(i);
-							getParser().addNestablePrefix(new TagMarker(reference.prefix + ":")); //$NON-NLS-1$
+						if (getParser() instanceof JSPCapableParser) {
+							for (int i = 0; references != null && i < references.size(); i++) {
+								TLDCMDocumentReference reference = (TLDCMDocumentReference) references.get(i);
+								((JSPCapableParser) getParser()).addNestablePrefix(new TagMarker(reference.prefix + ":")); //$NON-NLS-1$
+							}
 						}
 						/*
 						 * TODO: walk up the include hierarchy and add
@@ -287,7 +290,9 @@
 							 * relative to the JSP fragment.
 							 */
 							enableTaglibFromURI(reference.prefix, reference.uri, anchorStructuredDocumentRegion);
-							getParser().addNestablePrefix(new TagMarker(reference.prefix + ":")); //$NON-NLS-1$
+							if (getParser() instanceof JSPCapableParser) {
+								((JSPCapableParser) getParser()).addNestablePrefix(new TagMarker(reference.prefix + ":")); //$NON-NLS-1$
+							}
 						}
 					}
 				}
@@ -298,7 +303,7 @@
 			}
 		}
 
-		protected void processXMLStartTag(ITextRegionCollection startTagRegionCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, JSPSourceParser textSource) {
+		protected void processXMLStartTag(ITextRegionCollection startTagRegionCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, XMLSourceParser textSource) {
 			ITextRegionList regions = startTagRegionCollection.getRegions();
 			String uri = null;
 			String prefix = null;
@@ -351,7 +356,7 @@
 		 * Pulls the URI and prefix from the given taglib directive
 		 * IStructuredDocumentRegion and makes sure the tags are known.
 		 */
-		protected void processTaglib(ITextRegionCollection taglibDirectiveCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, JSPSourceParser textSource) {
+		protected void processTaglib(ITextRegionCollection taglibDirectiveCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, XMLSourceParser textSource) {
 			ITextRegionList regions = taglibDirectiveCollection.getRegions();
 			String uri = null;
 			String prefix = null;
@@ -463,20 +468,20 @@
 		public void setStructuredDocument(IStructuredDocument newDocument) {
 			Assert.isTrue(newDocument != null, "null document"); //$NON-NLS-1$
 			Assert.isTrue(newDocument.getParser() != null, "null document parser"); //$NON-NLS-1$
-			Assert.isTrue(newDocument.getParser() instanceof JSPSourceParser, "can only listen to document with a JSPSourceParser"); //$NON-NLS-1$
+			Assert.isTrue(newDocument.getParser() instanceof XMLSourceParser, "can only listen to document with a XMLSourceParser"); //$NON-NLS-1$
 			getSourceParser().removeStructuredDocumentRegionHandler(this);
-			setSourceParser((JSPSourceParser) newDocument.getParser());
+			setSourceParser((XMLSourceParser) newDocument.getParser());
 			getSourceParser().addStructuredDocumentRegionHandler(this);
 		}
 	}
 
 	protected class IncludeHelper extends DirectiveStructuredDocumentRegionHandler {
 		protected IStructuredDocumentRegion fAnchor = null;
-		protected JSPSourceParser fLocalParser = null;
-		protected JSPSourceParser fParentParser = null;
+		protected XMLSourceParser fLocalParser = null;
+		protected XMLSourceParser fParentParser = null;
 		List taglibReferences = null;
 
-		public IncludeHelper(IStructuredDocumentRegion anchor, JSPSourceParser rootParser) {
+		public IncludeHelper(IStructuredDocumentRegion anchor, XMLSourceParser rootParser) {
 			super();
 			fAnchor = anchor;
 			fParentParser = rootParser;
@@ -504,7 +509,7 @@
 		 *            the fullpath for the resource to be parsed
 		 */
 		void parse(IPath path) {
-			JSPSourceParser p = new JSPSourceParser();
+			XMLSourceParser p = (XMLSourceParser) getParser().newInstance();
 			fLocalParser = p;
 			String s = getContents(path);
 			// Should we consider preludes on this segment?
@@ -515,9 +520,11 @@
 				BlockMarker marker = (BlockMarker) blockTags.get(i);
 				fLocalParser.addBlockMarker(new BlockMarker(marker.getTagName(), null, marker.getContext(), marker.isCaseSensitive()));
 			}
-			TagMarker[] knownPrefixes = (TagMarker[]) fParentParser.getNestablePrefixes().toArray(new TagMarker[0]);
-			for (int i = 0; i < knownPrefixes.length; i++) {
-				fLocalParser.addNestablePrefix(new TagMarker(knownPrefixes[i].getTagName(), null));
+			if (fParentParser instanceof JSPCapableParser && fLocalParser instanceof JSPCapableParser) {
+				TagMarker[] knownPrefixes = (TagMarker[]) ((JSPCapableParser) fParentParser).getNestablePrefixes().toArray(new TagMarker[0]);
+				for (int i = 0; i < knownPrefixes.length; i++) {
+					((JSPCapableParser) fLocalParser).addNestablePrefix(new TagMarker(knownPrefixes[i].getTagName(), null));
+				}
 			}
 			// force parse
 			fLocalParser.getDocumentRegions();
@@ -537,15 +544,6 @@
 		int referenceCount;
 	}
 
-	private static class TLDCMDocumentDescriptor {
-		Object cacheKey;
-		CMDocument document;
-
-		TLDCMDocumentDescriptor() {
-			super();
-		}
-	}
-
 	private class TLDCMDocumentReference {
 		String prefix;
 		String uri;
@@ -639,7 +637,7 @@
 
 	private Stack fIncludes = null;
 
-	private JSPSourceParser fParser = null;
+	private XMLSourceParser fParser = null;
 
 	private List fTaglibTrackers = null;
 
@@ -681,7 +679,11 @@
 	 * @return
 	 */
 	protected Object getCacheKey(String uri) {
-		ITaglibRecord record = TaglibIndex.resolve(getCurrentParserPath().toString(), uri, false);
+		IPath currentParserPath = getCurrentParserPath();
+		if (currentParserPath == null)
+			return null;
+		
+		ITaglibRecord record = TaglibIndex.resolve(currentParserPath.toString(), uri, false);
 		if (record != null) {
 			return getUniqueIdentifier(record);
 		}
@@ -697,6 +699,9 @@
 			return null;
 		String reference = uri;
 		Object cacheKey = getCacheKey(reference);
+		if (cacheKey == null)
+			return null;
+		
 		long lastModified = getModificationStamp(reference);
 		CMDocument doc = (CMDocument) getDocuments().get(cacheKey);
 		if (doc == null) {
@@ -740,10 +745,10 @@
 				if (_debugCache) {
 					System.out.println("TLDCMDocument cache miss on " + cacheKey);
 				}
-				TLDCMDocumentDescriptor descriptor = loadTaglib(reference);
-				if (descriptor != null) {
+				CMDocument document = loadTaglib(reference);
+				if (document != null) {
 					TLDCacheEntry entry = new TLDCacheEntry();
-					doc = entry.document = descriptor.document;
+					doc = entry.document = document;
 					entry.referenceCount = 1;
 					entry.modificationStamp = getModificationStamp(reference);
 					getSharedDocumentCache().put(cacheKey, entry);
@@ -797,7 +802,18 @@
 				}
 					break;
 				case (ITaglibRecord.URL) : {
-					modificationStamp = IResource.NULL_STAMP;
+                    String loc = ((IURLRecord) record).getBaseLocation();
+                    if (loc != null && loc.endsWith(".jar")) { //$NON-NLS-1$
+                        File jarfile = new File(loc);
+                        if (jarfile.exists()) {
+                            try {
+                                modificationStamp = jarfile.lastModified();
+                            }
+                            catch (SecurityException e) {
+                                modificationStamp = IResource.NULL_STAMP;
+                            }
+                        }
+                    }
 				}
 					break;
 				default :
@@ -822,9 +838,9 @@
 
 	public List getCMDocumentTrackers(int offset) {
 		List validDocs = new ArrayList();
-		Iterator alldocs = getTaglibTrackers().iterator();
-		while (alldocs.hasNext()) {
-			TaglibTracker aTracker = (TaglibTracker) alldocs.next();
+		Object[] alldocs = getTaglibTrackers().toArray();
+		for (int i = 0; i < alldocs.length; i++) {
+			TaglibTracker aTracker = (TaglibTracker) alldocs[i];
 			if (aTracker.getStructuredDocumentRegion().getStartOffset() <= offset || offset < 0) {
 				validDocs.add(aTracker);
 			}
@@ -834,11 +850,11 @@
 
 	public List getCMDocumentTrackers(String prefix, int offset) {
 		List validDocs = new ArrayList();
-		Iterator alldocs = getTaglibTrackers().iterator();
-		while (alldocs.hasNext()) {
-			TaglibTracker aTracker = (TaglibTracker) alldocs.next();
+		Object[] alldocs = getTaglibTrackers().toArray();
+		for (int i = 0; i < alldocs.length; i++) {
+			TaglibTracker aTracker = (TaglibTracker) alldocs[i];
 			/**
-			 * '<' is used to support the immediate use of a custom tag in jspx files
+			 * '<' is used to support the immediate use of a custom tag in jspx files (instead of '<=')
 			 */
 			if ((aTracker.getStructuredDocumentRegion().getStartOffset() <= offset || offset < 0) && aTracker.getPrefix().equals(prefix)) {
 				validDocs.add(aTracker);
@@ -858,6 +874,8 @@
 	IPath getCurrentBaseLocation() {
 		IPath baseLocation = null;
 		IPath path = getCurrentParserPath();
+		if (path == null || path.segmentCount() < 2)
+			return path;
 		baseLocation = ResourcesPlugin.getWorkspace().getRoot().getFile(path).getLocation();
 		if (baseLocation == null) {
 			baseLocation = path;
@@ -912,11 +930,11 @@
 		return fIncludes;
 	}
 
-	JSPSourceParser getParser() {
+	XMLSourceParser getParser() {
 		return fParser;
 	}
 
-	public JSPSourceParser getSourceParser() {
+	public XMLSourceParser getSourceParser() {
 		return fParser;
 	}
 
@@ -951,9 +969,11 @@
 							includeHelper.parse(preludes[i]);
 							List references = includeHelper.taglibReferences;
 							fTLDCMReferencesMap.put(preludes[i], references);
-							for (int j = 0; j < references.size(); j++) {
-								TLDCMDocumentReference reference = (TLDCMDocumentReference) references.get(j);
-								getParser().addNestablePrefix(new TagMarker(reference.prefix + ":")); //$NON-NLS-1$
+							if (getParser() instanceof JSPCapableParser) {
+								for (int j = 0; j < references.size(); j++) {
+									TLDCMDocumentReference reference = (TLDCMDocumentReference) references.get(j);
+									((JSPCapableParser) getParser()).addNestablePrefix(new TagMarker(reference.prefix + ":")); //$NON-NLS-1$
+								}
 							}
 						}
 						else
@@ -1039,19 +1059,13 @@
 	 * Loads the taglib from the specified URI. It must point to a valid
 	 * taglib descriptor to work.
 	 */
-	protected TLDCMDocumentDescriptor loadTaglib(String uri) {
-		TLDCMDocumentDescriptor entry = null;
+	protected CMDocument loadTaglib(String uri) {
+		CMDocument document = null;
 		IPath currentPath = getCurrentParserPath();
 		if (currentPath != null) {
-			CMDocument document = null;
 			ITaglibRecord record = TaglibIndex.resolve(currentPath.toString(), uri, false);
 			if (record != null) {
 				document = getCMDocumentBuilder().createCMDocument(record);
-				if (document != null) {
-					entry = new TLDCMDocumentDescriptor();
-					entry.document = document;
-					entry.cacheKey = getUniqueIdentifier(record);
-				}
 			}
 			else {
 				/* Not a very-often used code path (we hope) */
@@ -1063,14 +1077,11 @@
 							System.out.println("Loading tags from " + uri + " at " + location); //$NON-NLS-2$//$NON-NLS-1$
 						}
 						document = getCMDocumentBuilder().createCMDocument(location);
-						entry = new TLDCMDocumentDescriptor();
-						entry.document = document;
-						entry.cacheKey = location;
 					}
 				}
 			}
 		}
-		return entry;
+		return document;
 	}
 
 	protected void resetTaglibTrackers() {
@@ -1081,7 +1092,7 @@
 		getTaglibTrackers().clear();
 	}
 
-	public void setSourceParser(JSPSourceParser parser) {
+	public void setSourceParser(XMLSourceParser parser) {
 		if (fParser != null)
 			fParser.removeStructuredDocumentRegionHandler(getStructuredDocumentRegionHandler());
 		fParser = parser;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/provisional/TLDElementDeclaration.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/provisional/TLDElementDeclaration.java
index 1057164..dd34980 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/provisional/TLDElementDeclaration.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/provisional/TLDElementDeclaration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,12 @@
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 
 public interface TLDElementDeclaration extends CMElementDeclaration {
+	/** 
+	 * Property stating whether the {@link CMElementDeclaration}
+	 * is a library tag or not
+	 */
+	String IS_LIBRARY_TAG = "isLibraryTag"; //$NON-NLS-1$
+	
 	String TAG_SOURCE = "Tag Definition Source"; //$NON-NLS-1$
 	String SOURCE_JSP_TLD = "JSP Tag Library Descriptor"; //$NON-NLS-1$
 	String SOURCE_TAG_FILE = "JSP Tag 2.0 File"; //$NON-NLS-1$
@@ -41,6 +47,16 @@
 	 */
 	String getDisplayName();
 
+
+	/**
+	 * Indicates that the declared tag handler supports dynamic attributes. It
+	 * is not a guarantee that the class itself implements
+	 * javax.servlet.jsp.tagext.DynamicAttributes.
+	 * 
+	 * @see JSP 2.0
+	 */
+	String getDynamicAttributes();
+	
 	/**
 	 * Optional informal description of an example of a use of this tag
 	 * 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/DeploymentDescriptorPropertyCache.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/DeploymentDescriptorPropertyCache.java
index 7802c77..d64107a 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/DeploymentDescriptorPropertyCache.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/DeploymentDescriptorPropertyCache.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -47,6 +47,7 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
 import org.w3c.dom.Element;
 import org.w3c.dom.EntityReference;
 import org.w3c.dom.Node;
@@ -58,15 +59,16 @@
 import org.xml.sax.SAXParseException;
 
 /**
- * A cache fo property group information stored in web.xml files. Information
+ * A cache for property group information stored in web.xml files. Information
  * is not persisted.
  */
 public final class DeploymentDescriptorPropertyCache {
 	private static final PropertyGroup[] NO_PROPERTY_GROUPS = new PropertyGroup[0];
 
-	private static class DeploymentDescriptor {
+	static class DeploymentDescriptor {
 		PropertyGroup[] groups;
 		long modificationStamp;
+		StringMatcher[] urlPatterns;
 		Float version = new Float(defaultWebAppVersion);
 	}
 
@@ -223,11 +225,11 @@
 		}
 
 		public String toString() {
-			return number + ":" + url_pattern;
+			return number + ":" + url_pattern; //$NON-NLS-1$
 		}
 	}
 
-	private static class ResourceChangeListener implements IResourceChangeListener {
+	static class ResourceChangeListener implements IResourceChangeListener {
 		public void resourceChanged(IResourceChangeEvent event) {
 			IResourceDelta delta = event.getDelta();
 			if (event.getType() != IResourceChangeEvent.POST_CHANGE)
@@ -241,7 +243,7 @@
 					if (resource.getType() == IResource.FILE) {
 						if (delta.getKind() == IResourceDelta.CHANGED && (delta.getFlags() == IResourceDelta.ENCODING || delta.getFlags() == IResourceDelta.MARKERS))
 							return false;
-						
+
 						IPath path = resource.getFullPath();
 						int segmentCount = path.segmentCount();
 						if (segmentCount > 1 && path.lastSegment().equals(WEB_XML) && path.segment(segmentCount - 2).equals(WEB_INF)) {
@@ -250,10 +252,12 @@
 					}
 					else if (resource.getType() == IResource.PROJECT) {
 						String name = resource.getName();
-						if(_debugResolutionCache) {
+						if (_debugResolutionCache) {
 							System.out.println("Removing DeploymentDescriptorPropertyCache resolution cache for project " + name); //$NON-NLS-1$ 
 						}
-						getInstance().resolvedMap.remove(name);
+						synchronized (LOCK) {
+							getInstance().resolvedMap.remove(name);
+						}
 					}
 					return true;
 				}
@@ -299,7 +303,7 @@
 	/**
 	 * Copied from org.eclipse.core.internal.propertytester.StringMatcher, but
 	 * should be replaced with a more accurate implementation of the rules in
-	 * Servlet spec SRV.11.2
+	 * Servlet spec SRV.11.2 and RFC 2396
 	 */
 	private static class StringMatcher {
 		private static final char SINGLE_WILD_CARD = '\u0000';
@@ -313,7 +317,7 @@
 
 		private boolean hasTrailingStar;
 
-		private final String pattern;
+		final String pattern;
 
 		private final int patternLength;
 
@@ -378,8 +382,8 @@
 
 		/**
 		 * Given the starting (inclusive) and the ending (exclusive) positions
-		 * in the <code>text</code>, determine if the given substring
-		 * matches with aPattern
+		 * in the <code>text</code>, determine if the given substring matches
+		 * with aPattern
 		 * 
 		 * @return true if the specified portion of the text matches the
 		 *         pattern
@@ -540,29 +544,33 @@
 			}
 			return true;
 		}
+		
+		public String toString() {
+			return "StringMatcher: " + pattern; //$NON-NLS-1$
+		}
 	}
 
-	private static DeploymentDescriptorPropertyCache _instance = new DeploymentDescriptorPropertyCache();
+	private static final DeploymentDescriptorPropertyCache _instance = new DeploymentDescriptorPropertyCache();
 	private static final boolean _debugResolutionCache = false;
 
-	private static final float defaultWebAppVersion = 2.4f;
-	private static String EL_IGNORED = "el-ignored";
-	private static String ID = "id";
-	private static String INCLUDE_CODA = "include-coda";
-	private static String INCLUDE_PRELUDE = "include-prelude";
+	private static final float defaultWebAppVersion = 3f;
+	static final String EL_IGNORED = "el-ignored"; //$NON-NLS-1$
+	static final String ID = "id"; //$NON-NLS-1$
+	static final String INCLUDE_CODA = "include-coda"; //$NON-NLS-1$
+	static final String INCLUDE_PRELUDE = "include-prelude"; //$NON-NLS-1$
 
-	private static String IS_XML = "is-xml";
-	private static String JSP_PROPERTY_GROUP = "jsp-property-group";
-	private static String PAGE_ENCODING = "page-encoding";
+	static final String IS_XML = "is-xml"; //$NON-NLS-1$
+	private static String JSP_PROPERTY_GROUP = "jsp-property-group"; //$NON-NLS-1$
+	static final String PAGE_ENCODING = "page-encoding"; //$NON-NLS-1$
 
-	private static String SCRIPTING_INVALID = "scripting-invalid";
-	private static String URL_PATTERN = "url-pattern";
-	private static final String WEB_APP_ELEMENT_LOCAL_NAME = ":web-app";
-	private static final String WEB_APP_ELEMENT_NAME = "web-app";
+	static final String SCRIPTING_INVALID = "scripting-invalid"; //$NON-NLS-1$
+	static final String URL_PATTERN = "url-pattern"; //$NON-NLS-1$
+	private static final String WEB_APP_ELEMENT_LOCAL_NAME = ":web-app"; //$NON-NLS-1$
+	private static final String WEB_APP_ELEMENT_NAME = "web-app"; //$NON-NLS-1$
 
-	private static final String WEB_APP_VERSION_NAME = "version";
-	private static final String WEB_INF = "WEB-INF";
-	private static final String WEB_XML = "web.xml";
+	private static final String WEB_APP_VERSION_NAME = "version"; //$NON-NLS-1$
+	private static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$
+	private static final String WEB_XML = "web.xml"; //$NON-NLS-1$
 	// private static final String WEB_INF_WEB_XML = WEB_INF + IPath.SEPARATOR
 	// + WEB_XML;
 	private static final String SLASH_WEB_INF_WEB_XML = Path.ROOT.toString() + WEB_INF + IPath.SEPARATOR + WEB_XML;
@@ -618,31 +626,54 @@
 
 	// for use when reading TLDs
 	private EntityResolver resolver;
-	
+
 	Map resolvedMap = new HashMap();
 
+	final static Object LOCK = new Object();
+
 	private DeploymentDescriptorPropertyCache() {
 		super();
 	}
 
-	private void _parseDocument(IPath path, Float[] version, List groupList, SubProgressMonitor subMonitor, Document document) {
+	private void _parseDocument(IPath path, Float[] version, List groupList, List urlPatterns, SubProgressMonitor subMonitor, Document document) {
 		Element webapp = document.getDocumentElement();
 		if (webapp != null) {
 			if (webapp.getTagName().equals(WEB_APP_ELEMENT_NAME) || webapp.getNodeName().endsWith(WEB_APP_ELEMENT_LOCAL_NAME)) {
-				String versionValue = webapp.getAttribute(WEB_APP_VERSION_NAME);
-				if (versionValue != null) {
-					try {
-						version[0] = Float.valueOf(versionValue);
+				// this convention only started with 2.4?
+				if (webapp.hasAttribute(WEB_APP_VERSION_NAME)) {
+					String versionValue = webapp.getAttribute(WEB_APP_VERSION_NAME);
+					versionValue = versionValue.trim();
+					if (versionValue.length() > 0) {
+						try {
+							version[0] = Float.valueOf(versionValue);
+						}
+						catch (NumberFormatException e) {
+							// doesn't matter
+						}
 					}
-					catch (NumberFormatException e) {
-						// doesn't matter
+				}
+				if (version[0] == null) {
+					// try determining the version from the doctype reference
+					DocumentType doctype = document.getDoctype();
+					if (doctype != null) {
+						String systemId = doctype.getSystemId();
+						String publicId = doctype.getPublicId();
+						if ((systemId != null && systemId.endsWith("web-app_2_3.dtd")) || (publicId != null && publicId.indexOf("Web Application 2.3") > 0)) { //$NON-NLS-1$ //$NON-NLS-2$
+							version[0] = new Float(2.3);
+						}
+						else if ((systemId != null && systemId.endsWith("web-app_2_2.dtd")) || (publicId != null && publicId.indexOf("Web Application 2.2") > 0)) { //$NON-NLS-1$ //$NON-NLS-2$
+							version[0] = new Float(2.2);
+						}
+						else if ((systemId != null && systemId.endsWith("web-app_2_1.dtd")) || (publicId != null && publicId.indexOf("Web Application 2.1") > 0)) { //$NON-NLS-1$ //$NON-NLS-2$
+							version[0] = new Float(2.1);
+						}
 					}
 				}
 			}
 		}
 		NodeList propertyGroupElements = document.getElementsByTagName(JSP_PROPERTY_GROUP);
 		int length = propertyGroupElements.getLength();
-		subMonitor.beginTask("Reading Property Groups", length);
+		subMonitor.beginTask("Reading Property Groups", length); //$NON-NLS-1$
 		for (int i = 0; i < length; i++) {
 			PropertyGroup group = PropertyGroup.createFrom(path, propertyGroupElements.item(i), i);
 			subMonitor.worked(1);
@@ -650,6 +681,14 @@
 				groupList.add(group);
 			}
 		}
+		
+		NodeList urlPatternElements = document.getElementsByTagName(URL_PATTERN);
+		for (int i = 0; i < urlPatternElements.getLength(); i++) {
+			String urlPattern = getContainedText(urlPatternElements.item(i));
+			if(urlPattern != null && urlPattern.length() > 0) {
+				urlPatterns.add(new StringMatcher(urlPattern));
+			}
+		}
 	}
 
 	/**
@@ -657,6 +696,8 @@
 	 */
 	private float convertSpecVersions(float version) {
 		if (version > 0) {
+			if (version == 3f)
+				return 2.2f;
 			if (version == 2.5f)
 				return 2.1f;
 			else if (version == 2.4f)
@@ -682,25 +723,26 @@
 	 * SSE XML parser to find the property groups.
 	 */
 	private DeploymentDescriptor fetchDescriptor(IPath path, IProgressMonitor monitor) {
-		monitor.beginTask("Reading Deployment Descriptor", 3);
+		monitor.beginTask(Messages.DeploymentDescriptorPropertyCache_1, 3);
 		IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
 
 		PropertyGroup groups[] = null;
 
 		IStructuredModel model = null;
 		List groupList = new ArrayList();
+		List urlPatterns = new ArrayList();
 		Float[] version = new Float[1];
 		SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, 2);
 		DocumentBuilder builder = CommonXML.getDocumentBuilder(false);
 		builder.setEntityResolver(getEntityResolver());
 		builder.setErrorHandler(getErrorHandler(path));
-		try {			
+		try {
 			InputSource inputSource = new InputSource();
 			String s = FileContentCache.getInstance().getContents(path);
 			inputSource.setCharacterStream(new StringReader(s));
 			inputSource.setSystemId(path.toString());
 			Document document = builder.parse(inputSource);
-			_parseDocument(path, version, groupList, subMonitor, document);
+			_parseDocument(path, version, groupList, urlPatterns, subMonitor, document);
 		}
 		catch (SAXException e1) {
 			/* encountered a fatal parsing error, try our own parser */
@@ -714,7 +756,7 @@
 				monitor.worked(1);
 				if (model instanceof IDOMModel) {
 					IDOMDocument document = ((IDOMModel) model).getDocument();
-					_parseDocument(path, version, groupList, subMonitor, document);
+					_parseDocument(path, version, groupList, urlPatterns, subMonitor, document);
 				}
 			}
 			catch (Exception e) {
@@ -741,12 +783,31 @@
 		DeploymentDescriptor deploymentDescriptor = new DeploymentDescriptor();
 		deploymentDescriptor.modificationStamp = file.getModificationStamp();
 		deploymentDescriptor.groups = groups;
+		deploymentDescriptor.urlPatterns = ((StringMatcher[]) urlPatterns.toArray(new StringMatcher[urlPatterns.size()]));
 		deploymentDescriptor.version = version[0];
 		monitor.done();
 		fDeploymentDescriptors.put(path, new SoftReference(deploymentDescriptor));
 		return deploymentDescriptor;
 	}
 
+	private DeploymentDescriptor getCachedDescriptor(IPath jspFilePath) {
+		IPath webxmlPath = getWebXMLPath(jspFilePath);
+		if (webxmlPath == null)
+			return null;
+
+		IFile webxmlFile = ResourcesPlugin.getWorkspace().getRoot().getFile(webxmlPath);
+		if (!webxmlFile.isAccessible())
+			return null;
+
+		Reference descriptorHolder = (Reference) fDeploymentDescriptors.get(webxmlPath);
+		DeploymentDescriptor descriptor = null;
+
+		if (descriptorHolder == null || ((descriptor = (DeploymentDescriptor) descriptorHolder.get()) == null) || (descriptor.modificationStamp == IResource.NULL_STAMP) || (descriptor.modificationStamp != webxmlFile.getModificationStamp())) {
+			descriptor = fetchDescriptor(webxmlPath, new NullProgressMonitor());
+		}
+		return descriptor;
+	}
+
 	private EntityResolver getEntityResolver() {
 		if (resolver == null) {
 			resolver = new EntityResolver() {
@@ -781,22 +842,10 @@
 	public float getJSPVersion(IPath fullPath) {
 		float version = defaultWebAppVersion;
 		/* try applicable web.xml file first */
-		IPath webxmlPath = getWebXMLPath(fullPath);
-		if (webxmlPath != null) {
-			IFile webxmlFile = ResourcesPlugin.getWorkspace().getRoot().getFile(webxmlPath);
-			if (webxmlFile.isAccessible()) {
-				Reference descriptorHolder = (Reference) fDeploymentDescriptors.get(webxmlPath);
-				DeploymentDescriptor descriptor = null;
-
-				if (descriptorHolder == null || ((descriptor = (DeploymentDescriptor) descriptorHolder.get()) == null) || (descriptor.modificationStamp == IResource.NULL_STAMP) || (descriptor.modificationStamp != webxmlFile.getModificationStamp())) {
-					descriptor = fetchDescriptor(webxmlPath, new NullProgressMonitor());
-				}
-
-				if (descriptor.version != null) {
-					version = descriptor.version.floatValue();
-					return convertSpecVersions(version);
-				}
-			}
+		DeploymentDescriptor descriptor = getCachedDescriptor(fullPath);
+		if (descriptor != null && descriptor.version != null) {
+			version = descriptor.version.floatValue();
+			return convertSpecVersions(version);
 		}
 
 		/* check facet settings */
@@ -815,21 +864,10 @@
 	 */
 	public PropertyGroup[] getPropertyGroups(IPath jspFilePath) {
 		List matchingGroups = new ArrayList(1);
-		IPath webxmlPath = getWebXMLPath(jspFilePath);
-		if (webxmlPath == null)
+		DeploymentDescriptor descriptor = getCachedDescriptor(jspFilePath);
+		if (descriptor == null)
 			return NO_PROPERTY_GROUPS;
 
-		IFile webxmlFile = ResourcesPlugin.getWorkspace().getRoot().getFile(webxmlPath);
-		if (!webxmlFile.isAccessible())
-			return NO_PROPERTY_GROUPS;
-
-		Reference descriptorHolder = (Reference) fDeploymentDescriptors.get(webxmlPath);
-		DeploymentDescriptor descriptor = null;
-
-		if (descriptorHolder == null || ((descriptor = (DeploymentDescriptor) descriptorHolder.get()) == null) || (descriptor.modificationStamp == IResource.NULL_STAMP) || (descriptor.modificationStamp != webxmlFile.getModificationStamp())) {
-			descriptor = fetchDescriptor(webxmlPath, new NullProgressMonitor());
-		}
-
 		for (int i = 0; i < descriptor.groups.length; i++) {
 			if (descriptor.groups[i].matches(FacetModuleCoreSupport.getRuntimePath(jspFilePath).toString(), false)) {
 				matchingGroups.add(descriptor.groups[i]);
@@ -845,6 +883,28 @@
 		return (PropertyGroup[]) matchingGroups.toArray(new PropertyGroup[matchingGroups.size()]);
 	}
 
+	/**
+	 * @param jspFilePath
+	 *            the path of the JSP file
+	 * @param reference
+	 *            a path reference to test for
+	 * @return a matching url-mapping value in the corresponding deployment
+	 *         descriptor for the given JSP file path, if a deployment
+	 *         descriptor could be found, null otherwise
+	 */
+	public String getURLMapping(IPath jspFilePath, String reference) {
+		DeploymentDescriptor descriptor = getCachedDescriptor(jspFilePath);
+		if (descriptor == null)
+			return null;
+		StringMatcher[] mappings = descriptor.urlPatterns;
+		for (int i = 0; i < mappings.length; i++) {
+			if (mappings[i].match(reference)) {
+				return mappings[i].pattern;
+			}
+		}
+		return null;
+	}
+	
 	private IPath getWebXMLPath(IPath fullPath) {
 		/*
 		 * It can take the better part of a full second to do this, so cache
@@ -852,15 +912,16 @@
 		 */
 		IPath resolved = null;
 		Map mapForProject = null;
-		mapForProject = (Map) resolvedMap.get(fullPath.segment(0));
-		if (mapForProject != null) {
-			resolved = (IPath) mapForProject.get(fullPath);
+		synchronized (LOCK) {
+			mapForProject = (Map) resolvedMap.get(fullPath.segment(0));
+			if (mapForProject != null) {
+				resolved = (IPath) mapForProject.get(fullPath);
+			}
+			else {
+				mapForProject = new HashMap();
+				resolvedMap.put(fullPath.segment(0), mapForProject);
+			}
 		}
-		else {
-			mapForProject = new HashMap();
-			resolvedMap.put(fullPath.segment(0), mapForProject);
-		}
-
 		if (resolved != null) {
 			if (_debugResolutionCache) {
 				System.out.println("DeploymentDescriptorPropertyCache resolution cache hit for " + fullPath); //$NON-NLS-1$ 
@@ -876,6 +937,14 @@
 		return resolved;
 	}
 
+	public IFile getWebXML(IPath jspFilePath) {
+		IPath webxmlPath = getWebXMLPath(jspFilePath);
+		if (webxmlPath == null)
+			return null;
+
+		return ResourcesPlugin.getWorkspace().getRoot().getFile(webxmlPath);
+	}
+
 	private void updateCacheEntry(IPath fullPath) {
 		/* don't update right now; remove and wait for another query to update */
 		fDeploymentDescriptors.remove(fullPath);
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IntStack.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IntStack.java
index 99c7477..89fdc13 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IntStack.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IntStack.java
@@ -94,6 +94,21 @@
 	}
 
 	public int size() {
-		return list.length;
+		return size;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	public String toString() {
+		StringBuffer s = new StringBuffer(getClass().getName() + ":" +size + " [");
+		for (int i = 0; i < size; i++) {
+			s.append(list[i]);
+			if(i < size - 1) {
+				s.append(", ");
+			}
+		}
+		s.append("]");
+		return s.toString();
 	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
index f3f3e9c..8a6e5c6 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,9 +28,12 @@
 import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
 import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
 import org.eclipse.wst.sse.core.internal.encoding.NonContentBasedEncodingRules;
+import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
 import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
 
+import com.ibm.icu.util.StringTokenizer;
+
 public class JSPResourceEncodingDetector implements IResourceCharsetDetector {
 
 	private String fCharset;
@@ -341,33 +344,49 @@
 	 * @param contentType
 	 */
 	private void parseContentTypeValue(String contentType) {
-		Pattern pattern = Pattern.compile(";\\s*charset\\s*=\\s*"); //$NON-NLS-1$
-		String[] parts = pattern.split(contentType);
-		if (parts.length > 0) {
-			// if only one item, it can still be charset instead of
-			// contentType
-			if (parts.length == 1) {
-				if (parts[0].length() > 6) {
-					String checkForCharset = parts[0].substring(0, 7);
-					if (checkForCharset.equalsIgnoreCase("charset")) { //$NON-NLS-1$
-						int eqpos = parts[0].indexOf('=');
-						eqpos = eqpos + 1;
-						if (eqpos < parts[0].length()) {
-							fCharset = parts[0].substring(eqpos);
-							fCharset = fCharset.trim();
-						}
-					}
-					else {
-						fContentType = parts[0];
-					}
-				}
-			}
-			else {
-				fContentType = parts[0];
-			}
+		/*
+		 * Based partially on
+		 * org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapterImpl
+		 * .getMimeTypeFromContentTypeValue(String) , divides the full value
+		 * into segments according to ';', assumes the first specifies the
+		 * content type itself if it has no '=', and that the remainder are
+		 * parameters which may specify a charset
+		 */
+		
+		String cleanContentTypeValue = StringUtils.stripNonLetterDigits(contentType);
+		/* Break the mime header into the main value and its parameters, separated by ';' */
+		StringTokenizer tokenizer = new StringTokenizer(cleanContentTypeValue, ";"); //$NON-NLS-1$
+		int tLen = tokenizer.countTokens();
+		if (tLen == 0)
+			return;
+		String[] tokens = new String[tLen];
+		int j = 0;
+		while (tokenizer.hasMoreTokens()) {
+			tokens[j] = tokenizer.nextToken();
+			j++;
 		}
-		if (parts.length > 1) {
-			fCharset = parts[1];
+		
+		int firstParameter = 0;
+		if (tokens[0].indexOf('=') == -1) {
+			/*
+			 * no equal sign in the first segment, so assume it indicates a
+			 * content type properly
+			 */
+			fContentType = tokens[0].trim();
+			firstParameter = 1;
+		}
+		/*
+		 * now handle parameters as name=value pairs, looking for "charset"
+		 * specifically
+		 */
+		Pattern equalPattern = Pattern.compile("\\s*=\\s*"); //$NON-NLS-1$
+		for (int i = firstParameter; i < tokens.length; i++) {
+			String[] pair = equalPattern.split(tokens[i]);
+			if (pair.length < 2)
+				continue;
+			if (pair[0].trim().equals("charset")) { //$NON-NLS-1$
+				fCharset = pair[1].trim();
+			}
 		}
 	}
 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/Messages.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/Messages.java
new file mode 100644
index 0000000..bd8b462
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/Messages.java
@@ -0,0 +1,15 @@
+package org.eclipse.jst.jsp.core.internal.contenttype;

+

+import org.eclipse.osgi.util.NLS;

+

+public class Messages extends NLS {

+	private static final String BUNDLE_NAME = "org.eclipse.jst.jsp.core.internal.contenttype.messages"; //$NON-NLS-1$

+	public static String DeploymentDescriptorPropertyCache_1;

+	static {

+		// initialize resource bundle

+		NLS.initializeMessages(BUNDLE_NAME, Messages.class);

+	}

+

+	private Messages() {

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/messages.properties b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/messages.properties
new file mode 100644
index 0000000..269d3ad
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/messages.properties
@@ -0,0 +1 @@
+DeploymentDescriptorPropertyCache_1=Reading Deployment Descriptor

diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java
index 026c3a7..4c0cc87 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -144,6 +144,7 @@
 	private String cachedLanguage;
 	private String cachedContentType;
 	private INodeNotifier notifierAtCreation;
+	private String elIgnored = null;
 
 	private int firstLanguagePosition = -1;
 	private int firstContentTypePosition = -1;
@@ -700,4 +701,12 @@
 		}
 		return desc;
 	}
+
+	public String getElIgnored() {
+		return elIgnored;
+	}
+
+	public void setElIgnored(String ignored) {
+		elIgnored = ignored;
+	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcherImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcherImpl.java
index 5058785..be4ce58 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcherImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveWatcherImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -35,19 +35,23 @@
 	public PageDirectiveWatcherImpl(IDOMElement target) {
 		super();
 		targetElement = target;
-		String contentTypeValue = target.getAttribute("contentType"); //$NON-NLS-1$
-		if (contentTypeValue != null) {
+		if (target.hasAttribute("contentType")) { //$NON-NLS-1$
+			String contentTypeValue = target.getAttribute("contentType"); //$NON-NLS-1$
 			// using concrete class below, since "changed" is something of an internal method
 			PageDirectiveAdapterImpl pageDirectiveAdapter = (PageDirectiveAdapterImpl) ((IDOMDocument) targetElement.getOwnerDocument()).getAdapterFor(PageDirectiveAdapter.class);
 			pageDirectiveAdapter.changedContentType(((IndexedRegion) targetElement).getStartOffset(), contentTypeValue);
 		}
-		String languageValue = target.getAttribute("language"); //$NON-NLS-1$
-		if (languageValue != null) {
+		if (target.hasAttribute("language")) { //$NON-NLS-1$
+			String languageValue = target.getAttribute("language"); //$NON-NLS-1$
 			// using concrete class below, since "changed" is something of an internal method
 			PageDirectiveAdapterImpl pageDirectiveAdapter = (PageDirectiveAdapterImpl) ((IDOMDocument) targetElement.getOwnerDocument()).getAdapterFor(PageDirectiveAdapter.class);
 			pageDirectiveAdapter.changedLanguage(((IndexedRegion) targetElement).getStartOffset(), languageValue);
 		}
-
+		if (target.hasAttribute("isELIgnored")) { //$NON-NLS-1$
+			String elIgnored = target.getAttribute("isELIgnored"); //$NON-NLS-1$
+			PageDirectiveAdapterImpl pageDirectiveAdapter = (PageDirectiveAdapterImpl) ((IDOMDocument) targetElement.getOwnerDocument()).getAdapterFor(PageDirectiveAdapter.class);
+			pageDirectiveAdapter.setElIgnored(elIgnored);
+		}
 
 	}
 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/encoding/JSPDocumentLoader.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/encoding/JSPDocumentLoader.java
index 8e1d3cb..9b21526 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/encoding/JSPDocumentLoader.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/encoding/JSPDocumentLoader.java
@@ -39,7 +39,6 @@
 import org.eclipse.wst.sse.core.internal.encoding.ContentTypeEncodingPreferences;
 import org.eclipse.wst.sse.core.internal.encoding.util.BufferedLimitedReader;
 import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser;
 import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
 import org.eclipse.wst.sse.core.internal.ltk.parser.TagMarker;
 import org.eclipse.wst.sse.core.internal.modelhandler.EmbeddedTypeRegistry;
@@ -91,7 +90,7 @@
 
 			EmbeddedTypeHandler embeddedType = getEmbeddedType(iFile);
 			if (embeddedType != null)
-				embeddedType.initializeParser((JSPCapableParser) structuredDocument.getParser());
+				embeddedType.initializeParser(structuredDocument.getParser());
 
 			fFullPreparedReader.reset();
 			setDocumentContentsFromReader(structuredDocument, fFullPreparedReader);
@@ -134,7 +133,7 @@
 			EmbeddedTypeHandler embeddedType = getEmbeddedType((IFile) null);
 			fFullPreparedReader.reset();
 			if (embeddedType != null)
-				embeddedType.initializeParser((JSPCapableParser) ((IStructuredDocument) structuredDocument).getParser());
+				embeddedType.initializeParser(((IStructuredDocument) structuredDocument).getParser());
 			setDocumentContentsFromReader(structuredDocument, fFullPreparedReader);
 		}
 		catch (CoreException e) {
@@ -277,7 +276,7 @@
 		// the
 		// default embeddeded content type handler
 		EmbeddedTypeHandler embeddedType = getJSPDefaultEmbeddedType();
-		embeddedType.initializeParser((JSPCapableParser) structuredDocument.getParser());
+		embeddedType.initializeParser(structuredDocument.getParser());
 		return structuredDocument;
 	}
 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/CompilationUnitHelper.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/CompilationUnitHelper.java
index 8df5524..7ace8d4 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/CompilationUnitHelper.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/CompilationUnitHelper.java
@@ -1,5 +1,7 @@
 package org.eclipse.jst.jsp.core.internal.java;
 
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IProblemRequestor;
 import org.eclipse.jdt.core.WorkingCopyOwner;
 
 /**
@@ -38,6 +40,12 @@
 
         if (fWorkingCopyOwner == null) {
             fWorkingCopyOwner = new WorkingCopyOwner() {
+            	/* (non-Javadoc)
+            	 * @see org.eclipse.jdt.core.WorkingCopyOwner#getProblemRequestor(org.eclipse.jdt.core.ICompilationUnit)
+            	 */
+            	public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) {
+            		return CompilationUnitHelper.this.getProblemRequestor();
+            	}
                 public String toString() {
                     return "JSP Working copy owner"; //$NON-NLS-1$
                 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/IJSPProblem.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/IJSPProblem.java
index ff986cd..8270cd8 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/IJSPProblem.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/IJSPProblem.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.jst.jsp.core.internal.java;
 
 import org.eclipse.jdt.core.compiler.IProblem;
@@ -14,7 +24,12 @@
 	int UseBeanInvalidID = F_PROBLEM_ID_LITERAL + 6;
 	int UseBeanMissingTypeInfo = F_PROBLEM_ID_LITERAL + 7;
 	int UseBeanAmbiguousType  = F_PROBLEM_ID_LITERAL + 8;
-	
+	int StartCustomTagMissing  = F_PROBLEM_ID_LITERAL + 9;
+	int EndCustomTagMissing  = F_PROBLEM_ID_LITERAL + 10;
+	int UseBeanStartTagMissing  = F_PROBLEM_ID_LITERAL + 11;
+	int UseBeanEndTagMissing  = F_PROBLEM_ID_LITERAL + 12;
+	int ELProblem = F_PROBLEM_ID_LITERAL + 13;
+
 	/**
 	 * @return the ID of this JSP problem
 	 */
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSP2ServletNameUtil.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSP2ServletNameUtil.java
index bd6e94a..e9c6bd9 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSP2ServletNameUtil.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSP2ServletNameUtil.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -108,11 +108,11 @@
 	  // ensure rest of characters are valid	
 	  for (int i=0; i< length; i++) {
 		  char currentChar = name.charAt(i);
-		  if (Character.isJavaIdentifierPart(currentChar) == true  ) { 
-			  modifiedName.append(currentChar);
-		  } else {
+		  // [290769] Mangle _ since mangling inserts _ as a delimiter
+		  if (currentChar == '_' || !Character.isJavaIdentifierPart(currentChar))
 			  modifiedName.append(mangleChar(currentChar));
-		  }
+		  else
+			  modifiedName.append(currentChar);
 	  }
 	  return modifiedName.toString();
 	  
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPIncludeRegionHelper.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPIncludeRegionHelper.java
index f0115c8..a9b5be3 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPIncludeRegionHelper.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPIncludeRegionHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@
 
 
 /**
- * Extension of XMLJSPRegionHelper inteded to parse entire included JSP files.
+ * Extension of XMLJSPRegionHelper intended to parse entire included JSP files.
  * Basically it expands the rules for what tags are parsed as JSP.
  * 
  * @author pavery
@@ -91,4 +91,8 @@
 		processIncludeDirective(sdRegion);
 		processPageDirective(sdRegion);
 	}
+
+	protected void prepareText(IStructuredDocumentRegion sdRegion) {
+		fStrippedText = fTextBefore = fTextToParse.substring(sdRegion.getStartOffset(), sdRegion.getEndOffset());
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java
index 29e24f9..866d8b1 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.WorkspaceJob;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -28,8 +29,7 @@
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jdt.core.WorkingCopyOwner;
 import org.eclipse.jface.text.Position;
@@ -76,7 +76,6 @@
 	private HashMap fJava2JspImportsMap = null;
 	private HashMap fJava2JspUseBeanMap = null;
 	private HashMap fJava2JspIndirectMap = null;
-	private List fELProblems = null;
 	
 	// don't want to hold onto model (via translator)
 	// all relevant info is extracted in the constructor.
@@ -92,6 +91,9 @@
 	private String fJspName;
 	private List fTranslationProblems;
 	private Collection fIncludedPaths;
+	
+	/** the {@link JSPTranslator} used by this {@link JSPTranslator} */
+	private JSPTranslator fTranslator;
 
 	public JSPTranslation(IJavaProject javaProj, JSPTranslator translator) {
 
@@ -109,10 +111,18 @@
 			fJava2JspImportsMap = translator.getJava2JspImportRanges();
 			fJava2JspUseBeanMap = translator.getJava2JspUseBeanRanges();
 			fJava2JspIndirectMap = translator.getJava2JspIndirectRanges();
-			fELProblems = translator.getELProblems();
 			fTranslationProblems = translator.getTranslationProblems();
 			fIncludedPaths = translator.getIncludedPaths();
 		}
+		
+		this.fTranslator = translator;
+	}
+	
+	/**
+	 * @return {@link JSPTranslator} used by this {@link JSPTranslation}
+	 */
+	protected JSPTranslator getTranslator() {
+		return this.fTranslator;
 	}
 	
 	public IJavaProject getJavaProject() {
@@ -420,56 +430,15 @@
 	 */
 	private ICompilationUnit createCompilationUnit() throws JavaModelException {
 		
-		IPackageFragment packageFragment = null;
-		IJavaElement je = getJavaProject();
+		IJavaProject je = getJavaProject();
 
 		if (je == null || !je.exists())
 			return null;
-
-		switch (je.getElementType()) {
-			case IJavaElement.PACKAGE_FRAGMENT :
-				je = je.getParent();
-			// fall through
-
-			case IJavaElement.PACKAGE_FRAGMENT_ROOT :
-				IPackageFragmentRoot packageFragmentRoot = (IPackageFragmentRoot) je;
-				packageFragment = packageFragmentRoot.getPackageFragment(IPackageFragmentRoot.DEFAULT_PACKAGEROOT_PATH);
-				break;
-
-			case IJavaElement.JAVA_PROJECT :
-				IJavaProject jProject = (IJavaProject) je;
-
-				if (!jProject.exists()) {
-					if(DEBUG) {
-						System.out.println("** Abort create working copy: cannot create working copy: JSP is not in a Java project"); //$NON-NLS-1$
-					}
-					return null;
-				}
-
-				packageFragmentRoot = null;
-				IPackageFragmentRoot[] packageFragmentRoots = jProject.getPackageFragmentRoots();
-				int i = 0;
-				while (i < packageFragmentRoots.length) {
-					if (!packageFragmentRoots[i].isArchive() && !packageFragmentRoots[i].isExternal()) {
-						packageFragmentRoot = packageFragmentRoots[i];
-						break;
-					}
-					i++;
-				}
-				if (packageFragmentRoot == null) {
-					if(DEBUG) {
-						System.out.println("** Abort create working copy: cannot create working copy: JSP is not in a Java project with source package fragment root"); //$NON-NLS-1$
-					}
-					return null;
-				}
-				packageFragment = packageFragmentRoot.getPackageFragment(IPackageFragmentRoot.DEFAULT_PACKAGEROOT_PATH);
-				break;
-
-			default :
-				return null;
-		}
 		
-		ICompilationUnit cu = packageFragment.getCompilationUnit(getClassname() + ".java").getWorkingCopy(getWorkingCopyOwner(), getProblemRequestor(), getProgressMonitor()); //$NON-NLS-1$
+		final String name = getClassname() + ".java";
+		IFile fakeFile = je.getProject().getFile(name);
+		ICompilationUnit fakeUnit = JavaCore.createCompilationUnitFrom(fakeFile);
+		ICompilationUnit cu = fakeUnit.getWorkingCopy(getWorkingCopyOwner(), getProgressMonitor());
 		setContents(cu);
 
 		if(DEBUG) {
@@ -523,15 +492,6 @@
 		}
 		return fTranslationProblems;
 	}
-	
-	/**
-	 * 
-	 * @return the List of problems collected during reconcile of the compilation unit
-	 */
-	public List getELProblems() {
-		return fELProblems != null ? fELProblems : new ArrayList();
-	}
-
 
 	/**
 	 * Must be set true in order for problems to be collected during reconcile.
@@ -554,7 +514,7 @@
 			try {
 				synchronized(cu) {
 					cu.makeConsistent(getProgressMonitor());
-					cu.reconcile(ICompilationUnit.NO_AST, true, getWorkingCopyOwner(), getProgressMonitor());
+					cu.reconcile(ICompilationUnit.NO_AST, false, getWorkingCopyOwner(), getProgressMonitor());
 				}
 			}
 			catch (JavaModelException e) {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.java
index 5db6c87..1405726 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -47,10 +47,29 @@
 	private JSPTranslator fTranslator = null;
 	private NullProgressMonitor fTranslationMonitor = null;
 
+	/**
+	 * <p>Constructs a {@link JSPTranslationAdapter} that will create a new {@link JSPTranslator}<p>
+	 * 
+	 * @param xmlModel {@link IDOMModel} this {@link JSPTranslationAdapter} is for
+	 */
 	public JSPTranslationAdapter(IDOMModel xmlModel) {
 		setXMLModel(xmlModel);
 		initializeJavaPlugins();
 	}
+	
+	/**
+	 * <p>Constructs a {@link JSPTranslationAdapter} using an existing {@link JSPTranslator}</p>
+	 * 
+	 * @param xmlModel {@link IDOMModel} this {@link JSPTranslationAdapter} is for
+	 * @param translator existing {@link JSPTranslator} this {@link JSPTranslationAdapter} will use
+	 */
+	public JSPTranslationAdapter(IDOMModel xmlModel, JSPTranslator translator) {
+		this(xmlModel);
+		this.fTranslator = translator;
+		this.fJavaDocument = new Document(translator.getTranslation().toString());
+		this.fJSPTranslation = new JSPTranslationExtension(getXMLModel().getStructuredDocument(), fJavaDocument, getJavaProject(), this.fTranslator);
+		this.fDocumentIsDirty = false;
+	}
 
 	/**
 	 * Initialize the required Java Plugins
@@ -114,7 +133,13 @@
 	}
 
 	/**
-	 * Returns the JSPTranslation for this adapter.
+	 * <p>Returns the JSPTranslation for this adapter.</p>
+	 * 
+	 * <p><b>IMPORTANT: </b><i>This will force translation of the
+	 * document if it has not already been called.  To avoid
+	 * accidental translation before calling this method call
+	 * {@link #hasTranslation()} to verify a translation
+	 * has already been forced by this adapter.</i></p>
 	 * 
 	 * @return a JSPTranslationExtension
 	 */
@@ -145,6 +170,18 @@
 		}
 		return fJSPTranslation;
 	}
+	
+	/**
+	 * <p>Knowing weather the translation has already been retrieved
+	 * from this adapter is important if you do not wan't to force
+	 * the translation of a document that has not yet been translated</p>
+	 * 
+	 * @return <code>true</code> if {@link #getJSPTranslation()} has
+	 * been called on this adapter already, <code>false</code> otherwise
+	 */
+	public boolean hasTranslation() {
+		return fJSPTranslation != null;
+	}
 
 	JSPTranslator createTranslator() {
 		return new JSPTranslator();
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapterFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapterFactory.java
index dbe0b4e..52cac51 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapterFactory.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapterFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,8 +13,8 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 
 /**
@@ -25,6 +25,7 @@
  */
 public class JSPTranslationAdapterFactory extends AbstractAdapterFactory {
 
+	/** the adapter associated with this factory */
 	private JSPTranslationAdapter fAdapter = null;
 
 	// for debugging
@@ -34,13 +35,20 @@
 		super(IJSPTranslation.class, true);
 	}
 
-	public INodeAdapterFactory copy() {
-		return new JSPTranslationAdapterFactory();
-	}
 
 	protected INodeAdapter createAdapter(INodeNotifier target) {
 		if (target instanceof IDOMNode && fAdapter == null) {
-			fAdapter = new JSPTranslationAdapter(((IDOMNode) target).getModel());
+			/* attempt to load externalized translator and create adapter from it
+			 * else create new adapter */
+			IDOMModel model = ((IDOMNode) target).getModel();
+			
+			JSPTranslator translator = JSPTranslatorPersister.getPersistedTranslator(model);
+			if(translator != null) {
+				fAdapter = new JSPTranslationAdapter(model, translator);
+			} else {
+				fAdapter= new JSPTranslationAdapter(model);
+			}
+
 			if(DEBUG) {
 				System.out.println("(+) JSPTranslationAdapterFactory [" + this + "] created adapter: " + fAdapter); //$NON-NLS-1$ //$NON-NLS-2$
 			}
@@ -50,12 +58,13 @@
 
 
 	public void release() {
-		if (fAdapter != null) {
+		if(fAdapter != null) {
 			if(DEBUG) {
 				System.out.println("(-) JSPTranslationAdapterFactory [" + this + "] releasing adapter: " + fAdapter); //$NON-NLS-1$ //$NON-NLS-2$
 			}
 			fAdapter.release();
 		}
+	
 		super.release();
 	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java
index 72ed408..b18c398 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java
@@ -357,8 +357,10 @@
 		if (edits.length == 0)
 			return new MultiTextEdit();
 
-		IRegion region = TextEdit.getCoverage(edits);
-		MultiTextEdit multiEdit = new MultiTextEdit(region.getOffset(), region.getLength());
+		/* should not specify a limited region because other edits outside
+		 * these original edits might be added later.
+		 */
+		MultiTextEdit multiEdit = new MultiTextEdit();
 		for (int i = 0; i < edits.length; i++) {
 			addToMultiEdit(edits[i], multiEdit);
 		}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
index b200937..e52f88a 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,15 +7,18 @@
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Frits Jalvingh - contributions for bug 150794
  *******************************************************************************/
 package org.eclipse.jst.jsp.core.internal.java;
 
 import java.io.BufferedInputStream;
 import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
+import java.io.Externalizable;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 import java.io.Reader;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -29,11 +32,10 @@
 
 import javax.servlet.jsp.tagext.VariableInfo;
 
-import org.eclipse.core.filebuffers.FileBuffers;
 import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.IWorkspaceRoot;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
@@ -42,7 +44,6 @@
 import org.eclipse.core.runtime.IExtensionPoint;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.QualifiedName;
@@ -61,10 +62,10 @@
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
 import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
 import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache.PropertyGroup;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.jst.jsp.core.internal.taglib.CustomTag;
 import org.eclipse.jst.jsp.core.internal.taglib.TaglibHelper;
 import org.eclipse.jst.jsp.core.internal.taglib.TaglibHelperManager;
 import org.eclipse.jst.jsp.core.internal.taglib.TaglibVariable;
@@ -73,9 +74,8 @@
 import org.eclipse.jst.jsp.core.jspel.IJSPELTranslator;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.wst.html.core.internal.contentmodel.JSP20Namespace;
-import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
 import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.TagMarker;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
@@ -96,58 +96,143 @@
 import com.ibm.icu.util.StringTokenizer;
 
 /**
- * Translates a JSP document into a HttpServlet. Keeps two way mapping from
+ * Translates a JSP document into a HttpServlet subclass. Keeps two way mapping from
  * Java translation to the original JSP source, which can be obtained through
  * getJava2JspRanges() and getJsp2JavaRanges().
  */
-public class JSPTranslator {
-
-	// the name of the element in the extension point
+public class JSPTranslator implements Externalizable {
+	/**
+	 * <p>This value should be incremented if any of the following methods change:
+	 * <ul>
+	 * <li>{@link #writeExternal(ObjectOutput)}</li>
+	 * <li>{@link #readExternal(ObjectInput)}</li>
+	 * <li>{@link #writeString(ObjectOutput, String)}</li>
+	 * <li>{@link #readString(ObjectInput)}</li>
+	 * <li>{@link #writeRanges(ObjectOutput, HashMap)}</li>
+	 * <li>{@link #readRanges(ObjectInput)}</li>
+	 * </ul>
+	 * 
+	 * This is because if any of these change then previously externalized {@link JSPTranslator}s
+	 * will no longer be able to be read by the new implementation.  This value is used by
+	 * the {@link Externalizable} API automatically to determine if the file being read is of the
+	 * correct version to be read by the current implementation of the {@link JSPTranslator}</p>
+	 * 
+	 * @see #writeExternal(ObjectOutput)
+	 * @see #readExternal(ObjectInput)
+	 * @see #writeString(ObjectOutput, String)
+	 * @see #readString(ObjectInput)
+	 * @see #writeRanges(ObjectOutput, HashMap)
+	 * @see #readRanges(ObjectInput)
+	 */
+	private static final long serialVersionUID = 1L;
+	
+	/** for debugging */
+	private static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspjavamapping")).booleanValue(); //$NON-NLS-1$
+	
+	/** handy plugin ID constant */
+	private static final String JSP_CORE_PLUGIN_ID = "org.eclipse.jst.jsp.core"; //$NON-NLS-1$
+	
+	// constants for reading extension point
+	/** Default EL Translator extension ID */
+	private static final String DEFAULT_JSP_EL_TRANSLATOR_ID = "org.eclipse.jst.jsp.defaultJSP20"; //$NON-NLS-1$
+	
+	/** the name of the element in the extension point */
 	private static final String EL_TRANSLATOR_EXTENSION_NAME = "elTranslator"; //$NON-NLS-1$
-
+	
+	/** the name of the property in the extension point */
 	private static final String ELTRANSLATOR_PROP_NAME = "ELTranslator"; //$NON-NLS-1$
 
-	// Default EL Translator
-	private static final String DEFAULT_JSP_EL_TRANSLATOR_ID = "org.eclipse.jst.jsp.defaultJSP20"; //$NON-NLS-1$
-
-	// handy plugin ID constant
-	private static final String JSP_CORE_PLUGIN_ID = "org.eclipse.jst.jsp.core"; //$NON-NLS-1$
-
-	// for debugging
-	private static final boolean DEBUG = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspjavamapping")); //$NON-NLS-1$  //$NON-NLS-2$
-	private static final boolean DEBUG_SAVE_OUTPUT = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jsptranslationstodisk")); //$NON-NLS-1$  //$NON-NLS-2$
-
-	private IJSPELTranslator fELTranslator = null;
-
+	
+	// these constants are commonly used strings during translation
+	/** end line characters */
 	public static final String ENDL = "\n"; //$NON-NLS-1$
-
-	String fClassHeader = null;
-	String fClassname = null;
-
-	String fImplicitImports = null;
-
-	String fServiceHeader = null;
-
-	private String fSessionVariableDeclaration = "javax.servlet.http.HttpSession session = null;" + ENDL; //$NON-NLS-1$
-	private String fFooter = "}}"; //$NON-NLS-1$
-	private String fException = "Throwable exception = null;"; //$NON-NLS-1$
-	public static final String EXPRESSION_PREFIX = "out.print(\"\"+"; //$NON-NLS-1$
+	
+	/** session variable declaration */
+	private static final String SESSION_VARIABLE_DECLARATION = "javax.servlet.http.HttpSession session = pageContext.getSession();" + ENDL; //$NON-NLS-1$
+	
+	/** footer text */
+	private static final String FOOTER = "}}"; //$NON-NLS-1$
+	
+	/** exception declaration */
+	private static final String EXCEPTION = "Throwable exception = null;"; //$NON-NLS-1$
+	
+	/** expression prefix */
+	public static final String EXPRESSION_PREFIX = "out.print("; //$NON-NLS-1$
+	
+	/** expression suffix */
 	public static final String EXPRESSION_SUFFIX = ");"; //$NON-NLS-1$
+	
+	/** try/catch start */
+	private static final String TRY_CATCH_START = ENDL + "try {" + ENDL; //$NON-NLS-1$
+	
+	/** try/catch end */
+	private static final String TRY_CATCH_END = " } catch (java.lang.Exception e) {} " + ENDL; //$NON-NLS-1$
+	
+	/** JSP tag name prefix */
+	static final String JSP_PREFIX = "jsp:"; //$NON-NLS-1$
+	
+	
+	// these constants are to keep track of what type of code is currently being translated
+	/** code in question is standard JSP */
+	protected final static int STANDARD_JSP = 0;
+	
+	/** code in question is embedded (JSP as an attribute or within comment tags) */
+	protected final static int EMBEDDED_JSP = 1;
+	
+	/** code in question is a JSP declaration */
+	protected final static int DECLARATION = 2;
+	
+	/** code in question is a JSP expression */
+	protected final static int EXPRESSION = 4;
+	
+	/** code in question is a JSP scriptlet */
+	protected final static int SCRIPTLET = 8;
+	
+	
+	// strings specific to this translation
+	/** translated class header */
+	String fClassHeader = null;
+	
+	/** translated class name */
+	String fClassname = null;
+	
+	/** translated class super class */
 	String fSuperclass = null;
 
-	private String fTryCatchStart = ENDL + "try {" + ENDL; //$NON-NLS-1$
-	private List fTranslationProblems = new ArrayList();
-	private String fTryCatchEnd = " } catch (java.lang.Exception e) {} " + ENDL; //$NON-NLS-1$
+	/** translated class imports */
+	String fImplicitImports = null;
 
+	/** translated class service header */
+	String fServiceHeader = null;
+	
+	/** translated user defined imports */
+	private StringBuffer fUserImports = new StringBuffer();
+	
+	//translation specific state
+	/** {@link IDOMModel} for the JSP file being translated */
+	IDOMModel fStructuredModel = null;
+	
+	/** {@link IStructuredDocument} for the JSP file being translated */
+	IStructuredDocument fStructuredDocument = null;
+	
+	/** the EL translator */
+	private IJSPELTranslator fELTranslator = null;
+	
+	/** reported translation problems */
+	private List fTranslationProblems = new ArrayList();
+	
 	/** fSourcePosition = position in JSP source */
 	private int fSourcePosition = -1;
+	
 	/** fRelativeOffest = offset in the buffer there the cursor is */
 	private int fRelativeOffset = -1;
+	
 	/** fCursorPosition = offset in the translated java document */
 	private int fCursorPosition = -1;
 
 	/** some page directive attributes */
-	private boolean fIsErrorPage, fCursorInExpression = false;
+	private boolean fIsErrorPage = false;
+	private boolean fCursorInExpression = false;
 	private boolean fIsInASession = true;
 
 	/** user java code in body of the service method */
@@ -157,36 +242,23 @@
 	/** user defined vars declared in the beginning of the class */
 	private StringBuffer fUserDeclarations = new StringBuffer();
 
-	/** user defined imports */
-	private StringBuffer fUserImports = new StringBuffer();
-
 	/**
 	 * A map of tag names to tag library variable information; used to store
 	 * the ones needed for AT_END variable support.
 	 */
 	private StackMap fTagToVariableMap = null;
+	private Stack fUseBeansStack = new Stack();
 
-	private StringBuffer fResult; // the final traslated java document
-	// string buffer
-	private StringBuffer fCursorOwner = null; // the buffer where the cursor
-	// is
+	/** the final translated java document */
+	private StringBuffer fResult;
+	
+	/** the buffer where the cursor is */
+	private StringBuffer fCursorOwner = null;
 
-	private IDOMModel fStructuredModel = null;
-	private IStructuredDocument fStructuredDocument = null;
 	private IStructuredDocumentRegion fCurrentNode;
-	private boolean fInCodeRegion = false; // flag for if cursor is in the
-	// current region being translated
-
-	/**
-	 * these constants are to keep track of whether the code in question is
-	 * embedded (JSP as an attribute or within comment tags) or is just
-	 * standard JSP code, or identifies if it's an expression
-	 */
-	protected final static int STANDARD_JSP = 0;
-	protected final static int EMBEDDED_JSP = 1;
-	protected final static int DECLARATION = 2;
-	protected final static int EXPRESSION = 4;
-	protected final static int SCRIPTLET = 8;
+	
+	/** flag for if the cursor is in the current regionb eing translated */
+	private boolean fInCodeRegion = false;
 
 	/** used to avoid infinite looping include files */
 	private Stack fIncludes = null;
@@ -239,19 +311,38 @@
 	 */
 	private StringBuffer fJspTextBuffer = new StringBuffer();
 
-
-	/**
-	 * List of EL problems to be translated
-	 */
-	private ArrayList fELProblems = new ArrayList();
-
-	/**
-	 * EL Translator ID
-	 */
+	/** EL Translator ID (pluggable) */
 	private String fELTranslatorID;
 
+	/**
+	 * <code>true</code> if code has been found, such as HTML tags, that is not translated
+	 * <code>false</code> otherwise.  Useful for deciding if a place holder needs to be
+	 * written to translation
+	 */
+	private boolean fFoundNonTranslatedCode;
+
+	/**
+	 * <code>true</code> if code has been translated for the current region,
+	 * <code>false</code> otherwise
+	 */
+	private boolean fCodeTranslated;
+
+	/**
+	 * A structure for holding a region collection marker and list of variable
+	 * information. The region can be used later for positioning validation
+	 * messages.
+	 */
+	static class RegionTags {
+		ITextRegionCollection region;
+		CustomTag tag;
+
+		RegionTags(ITextRegionCollection region, CustomTag tag) {
+			this.region = region;
+			this.tag = tag;
+		}
+	}
+
 	public JSPTranslator() {
-		super();
 		init();
 	}
 
@@ -374,7 +465,7 @@
 
 	/**
 	 * @param node
-	 * @return
+	 * @return the simple class name, not fully qualified
 	 */
 	private String createClassname(IDOMNode node) {
 		String classname = ""; //$NON-NLS-1$
@@ -508,6 +599,7 @@
 		fCursorPosition = -1;
 
 		fIsErrorPage = fCursorInExpression = false;
+		fIsInASession = true;
 
 		fUserCode = new StringBuffer();
 		fUserDeclarations = new StringBuffer();
@@ -540,8 +632,9 @@
 		fIncludedPaths.clear();
 
 		fJspTextBuffer = new StringBuffer();
-
-		fELProblems = new ArrayList();
+		
+		fFoundNonTranslatedCode = false;
+		fCodeTranslated = false;
 
 	}
 
@@ -551,14 +644,18 @@
 	 */
 	public final StringBuffer getEmptyTranslation() {
 		reset();
-		buildResult();
+		buildResult(true);
 		return getTranslation();
 	}
 
 	/**
-	 * put the final java document together
+	 * <p>put the final java document together</p>
+	 * 
+	 * @param updateRanges <code>true</code> if the ranges need to be updated as the result
+	 * is built, <code>false</code> if the ranges have already been updated.  This is useful
+	 * if building a result from a persisted {@link JSPTranslator}.
 	 */
-	private final void buildResult() {
+	private final void buildResult(boolean updateRanges) {
 		// to build the java document this is the order:
 		// 
 		// + default imports
@@ -571,11 +668,9 @@
 		// + user code
 		// + try/catch end
 		// + service method footer
-		fResult = new StringBuffer(fImplicitImports.length() + fUserImports.length() + fClassHeader.length() + fUserDeclarations.length() + fServiceHeader.length() + fTryCatchStart.length() // try/catch
-					// start
-					+ fUserCode.length() + fTryCatchEnd.length() // try/catch
-					// end
-					+ fFooter.length());
+		fResult = new StringBuffer(fImplicitImports.length() + fUserImports.length() + fClassHeader.length() +
+				fUserDeclarations.length() + fServiceHeader.length() + TRY_CATCH_START.length()
+				+ fUserCode.length() + TRY_CATCH_END.length() + FOOTER.length());
 
 		int javaOffset = 0;
 
@@ -583,7 +678,9 @@
 		javaOffset += fImplicitImports.length();
 
 		// updateRanges(fIndirectImports, javaOffset);
-		updateRanges(fImportRanges, javaOffset);
+		if(updateRanges) {
+			updateRanges(fImportRanges, javaOffset);
+		}
 		// user imports
 		append(fUserImports);
 		javaOffset += fUserImports.length();
@@ -594,12 +691,16 @@
 		fResult.append(fSuperclass + "{" + ENDL); //$NON-NLS-1$
 		javaOffset += fSuperclass.length() + 2;
 
-		updateRanges(fDeclarationRanges, javaOffset);
+		if(updateRanges) {
+			updateRanges(fDeclarationRanges, javaOffset);
+		}
 		// user declarations
 		append(fUserDeclarations);
 		javaOffset += fUserDeclarations.length();
 
-		updateRanges(fUserELRanges, javaOffset);
+		if(updateRanges) {
+			updateRanges(fUserELRanges, javaOffset);
+		}
 		append(fUserELExpressions);
 		javaOffset += fUserELExpressions.length();
 
@@ -607,32 +708,34 @@
 		javaOffset += fServiceHeader.length();
 		// session participant
 		if (fIsInASession) {
-			fResult.append(fSessionVariableDeclaration);
-			javaOffset += fSessionVariableDeclaration.length();
+			fResult.append(SESSION_VARIABLE_DECLARATION);
+			javaOffset += SESSION_VARIABLE_DECLARATION.length();
 		}
 		// error page
 		if (fIsErrorPage) {
-			fResult.append(fException);
-			javaOffset += fException.length();
+			fResult.append(EXCEPTION);
+			javaOffset += EXCEPTION.length();
 		}
 
 
-		fResult.append(fTryCatchStart);
-		javaOffset += fTryCatchStart.length();
+		fResult.append(TRY_CATCH_START);
+		javaOffset += TRY_CATCH_START.length();
 
-		updateRanges(fCodeRanges, javaOffset);
+		if(updateRanges) {
+			updateRanges(fCodeRanges, javaOffset);
+		}
 
 		// user code
 		append(fUserCode);
 		javaOffset += fUserCode.length();
 
 
-		fResult.append(fTryCatchEnd);
-		javaOffset += fTryCatchEnd.length();
+		fResult.append(TRY_CATCH_END);
+		javaOffset += TRY_CATCH_END.length();
 
 		// footer
-		fResult.append(fFooter);
-		javaOffset += fFooter.length();
+		fResult.append(FOOTER);
+		javaOffset += FOOTER.length();
 
 		fJava2JspRanges.putAll(fImportRanges);
 		fJava2JspRanges.putAll(fDeclarationRanges);
@@ -767,29 +870,6 @@
 			Logger.log(Logger.INFO_DEBUG, debugString.toString());
 		}
 
-		if (DEBUG_SAVE_OUTPUT) {
-			IProject project = getFile().getProject();
-			String shortenedClassname = StringUtils.replace(getFile().getName(), ".", "_");
-			String filename = shortenedClassname + ".java";
-			IPath path = project.getFullPath().append("src/" + filename);
-			try {
-				IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-				if (!file.exists()) {
-					file.create(new ByteArrayInputStream(new byte[0]), true, new NullProgressMonitor());
-				}
-				ITextFileBufferManager textFileBufferManager = FileBuffers.getTextFileBufferManager();
-				textFileBufferManager.connect(path, new NullProgressMonitor());
-				ITextFileBuffer javaOutputBuffer = textFileBufferManager.getTextFileBuffer(path);
-				javaOutputBuffer.getDocument().set(StringUtils.replace(fResult.toString(), getClassname(), shortenedClassname));
-				javaOutputBuffer.commit(new NullProgressMonitor(), true);
-				textFileBufferManager.disconnect(path, new NullProgressMonitor());
-			}
-			catch (Exception e) {
-				// this is just for debugging, ignore
-			}
-			System.out.println("Updated translation: " + path);
-		}
-
 		return fResult;
 	}
 
@@ -807,112 +887,206 @@
 		return fJspTextBuffer.toString();
 	}
 
-	/**
-	 * @deprecated
-	 * @param tagToAdd
-	 */
-	protected void addTaglibVariables(String tagToAdd) {
-		addTaglibVariables(tagToAdd, getCurrentNode());
-	}
-
+	
 	protected void addTaglibVariables(String tagToAdd, ITextRegionCollection customTag) {
+		addTaglibVariables(tagToAdd, customTag, -1);
+	}
+	/**
+	 * Add the server-side scripting variables used by this tag, along with
+	 * any scoping.
+	 * 
+	 * @param tagToAdd
+	 * @param customTag
+	 */
+	protected void addTaglibVariables(String tagToAdd, ITextRegionCollection customTag, int index) {
+		if (customTag.getFirstRegion().getType().equals(DOMRegionContext.XML_TAG_OPEN)) {
+			/*
+			 * Start tag
+			 */
+			addStartTagVariable(tagToAdd, customTag,index);
+		}
+		else if (customTag.getFirstRegion().getType().equals(DOMRegionContext.XML_END_TAG_OPEN)) {
+			/*
+			 * End tag
+			 */
+			addEndTagVariable(tagToAdd, customTag);
+		}
+	}
+	
+	private void addEndTagVariable(String tagToAdd, ITextRegionCollection customTag){
+		IFile f = getFile();
+		if (f == null || !f.exists())
+			return;
+		String decl = ""; //$NON-NLS-1$
+		RegionTags regionTag = (RegionTags) fTagToVariableMap.pop(tagToAdd);
+		if (regionTag != null) {
+			// even an empty array will indicate a need for a closing brace
+			TaglibVariable[] taglibVars = regionTag.tag.getTagVariables();
+			StringBuffer text = new StringBuffer();
+			if (regionTag.tag.isIterationTag())
+				doAfterBody(text, regionTag);
+			text.append("} // </"); //$NON-NLS-1$
+			text.append(tagToAdd);
+			text.append(">\n"); //$NON-NLS-1$
+			appendToBuffer(text.toString(), fUserCode, false, customTag); //$NON-NLS-1$
+			for (int i = 0; i < taglibVars.length; i++) {
+				if (taglibVars[i].getScope() == VariableInfo.AT_END) {
+					decl = taglibVars[i].getDeclarationString();
+					appendToBuffer(decl, fUserCode, false, customTag);
+				}
+			}
+		}
+		else {
+			/*
+			 * Since something should have been in the map because of a
+			 * start tag, its absence now means an unbalanced end tag.
+			 * Extras will be checked later to flag unbalanced start tags.
+			 */
+			IJSPProblem missingStartTag = createJSPProblem(IJSPProblem.StartCustomTagMissing, IJSPProblem.F_PROBLEM_ID_LITERAL, NLS.bind(JSPCoreMessages.JSPTranslator_4, tagToAdd), customTag.getStartOffset(), customTag.getEndOffset());
+			fTranslationProblems.add(missingStartTag);
+		}
+	}
+	private void addStartTagVariable(String tagToAdd,ITextRegionCollection customTag, int index){
 		IFile f = getFile();
 
 		if (f == null || !f.exists())
 			return;
-
 		TaglibHelper helper = TaglibHelperManager.getInstance().getTaglibHelper(f);
-		/*
-		 * Variables can declare as available when NESTED, AT_BEGIN, or
-		 * AT_END. For AT_END variables, store the entire list of variables in
-		 * the map field so it can be used on the end tag.
-		 */
 		String decl = ""; //$NON-NLS-1$
-		if (customTag.getFirstRegion().getType().equals(DOMRegionContext.XML_TAG_OPEN)) {
-			TaglibVariable[] taglibVars = helper.getTaglibVariables(tagToAdd, getStructuredDocument(), customTag);
-			fTranslationProblems.addAll(helper.getProblems(f.getFullPath()));
-			/*
-			 * These loops are duplicated intentionally to keep the nesting
-			 * scoped variables from interfering with the others
-			 */
-			for (int i = 0; i < taglibVars.length; i++) {
-				if (taglibVars[i].getScope() == VariableInfo.AT_BEGIN) {
-					decl = taglibVars[i].getDeclarationString();
-					appendToBuffer(decl, fUserCode, false, customTag);
-				}
-				if (taglibVars[i].getScope() == VariableInfo.AT_END) {
-					decl = taglibVars[i].getDeclarationString();
-					fTagToVariableMap.push(tagToAdd, taglibVars);
-				}
+		List problems = new ArrayList();
+		CustomTag tag = helper.getCustomTag(tagToAdd, getStructuredDocument(), customTag, problems);
+		TaglibVariable[] taglibVars = tag.getTagVariables();
+		fTranslationProblems.addAll(problems);
+		/*
+		 * Add AT_BEGIN variables
+		 */
+		for (int i = 0; i < taglibVars.length; i++) {
+			if (taglibVars[i].getScope() == VariableInfo.AT_BEGIN) {
+				decl = taglibVars[i].getDeclarationString();
+				appendToBuffer(decl, fUserCode, false, customTag);
 			}
-			for (int i = 0; i < taglibVars.length; i++) {
-				if (taglibVars[i].getScope() == VariableInfo.NESTED) {
-					decl = taglibVars[i].getDeclarationString();
-					appendToBuffer("{", fUserCode, false, customTag);
-					appendToBuffer(decl, fUserCode, false, customTag);
-					fTagToVariableMap.push(tagToAdd, taglibVars);
-				}
-			}
-			if (customTag.getLastRegion().getType().equals(DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
-				/*
-				 * Process NESTED variables backwards so the scopes "unroll"
-				 * correctly.
-				 */
-				for (int i = taglibVars.length; i > 0; i--) {
-					if (taglibVars[i - 1].getScope() == VariableInfo.NESTED) {
-						appendToBuffer("}", fUserCode, false, customTag);
-					}
-				}
-				/* Treat this as the end for empty tags */
-				for (int i = 0; i < taglibVars.length; i++) {
-					if (taglibVars[i].getScope() == VariableInfo.AT_END) {
-						decl = taglibVars[i].getDeclarationString();
-						appendToBuffer(decl, fUserCode, false, customTag);
-					}
-				}
+		}
+		boolean isEmptyTag = false;
+		if (index != -1)
+			isEmptyTag= isEmptyTag(customTag, index);
+		else
+			isEmptyTag= isEmptyTag(customTag);
+		
+		/*
+		 * Add a single  { to limit the scope of NESTED variables
+		 */
+		StringBuffer text = new StringBuffer();
+		if (!isEmptyTag && tag.isIterationTag() && tag.getTagClassName() != null) {
+			text.append("\nwhile(true) "); //$NON-NLS-1$
+		}
+		text.append("{ // <"); //$NON-NLS-1$
+		text.append(tagToAdd);
+		if (isEmptyTag)
+			text.append("/>\n"); //$NON-NLS-1$
+		else
+			text.append(">\n"); //$NON-NLS-1$
+
+		appendToBuffer(text.toString(), fUserCode, false, customTag); //$NON-NLS-1$
+
+		for (int i = 0; i < taglibVars.length; i++) {
+			if (taglibVars[i].getScope() == VariableInfo.NESTED) {
+				decl = taglibVars[i].getDeclarationString();
+				appendToBuffer(decl, fUserCode, false, customTag);
 			}
 		}
 		/*
-		 * Process NESTED variables for an end tag backwards so the scopes
-		 * "unroll" correctly.
+		 * For empty tags, add the corresponding } and AT_END variables immediately.  
 		 */
-		else if (customTag.getFirstRegion().getType().equals(DOMRegionContext.XML_END_TAG_OPEN)) {
-			TaglibVariable[] taglibVars = (TaglibVariable[]) fTagToVariableMap.pop(tagToAdd);
-			if (taglibVars != null) {
-				for (int i = taglibVars.length; i > 0; i--) {
-					if (taglibVars[i - 1].getScope() == VariableInfo.NESTED) {
-						appendToBuffer("}", fUserCode, false, customTag);
-					}
-				}
-				for (int i = 0; i < taglibVars.length; i++) {
-					if (taglibVars[i].getScope() == VariableInfo.AT_END) {
-						decl = taglibVars[i].getDeclarationString();
-						appendToBuffer(decl, fUserCode, false, customTag);
-					}
+		if (isEmptyTag) {
+			text = new StringBuffer();
+			text.append("} // <"); //$NON-NLS-1$
+			text.append(tagToAdd);
+			text.append("/>\n"); //$NON-NLS-1$
+			appendToBuffer(text.toString(), fUserCode, false, customTag); //$NON-NLS-1$
+			/* Treat this as the end for empty tags */
+			for (int i = 0; i < taglibVars.length; i++) {
+				if (taglibVars[i].getScope() == VariableInfo.AT_END) {
+					decl = taglibVars[i].getDeclarationString();
+					appendToBuffer(decl, fUserCode, false, customTag);
 				}
 			}
 		}
+		else {
+			/*
+			 * For non-empty tags, remember the variable information
+			 */
+			fTagToVariableMap.push(tagToAdd, new RegionTags(customTag, tag));
+		}
+		
+	}
+
+	private boolean isEmptyTag(ITextRegionCollection customTag, int index) {
+		String type = null;
+		// custom tag is embedded
+		ITextRegionList regions = customTag.getRegions();
+		ITextRegion nextRegion = regions.get(index);
+		int size = customTag.getNumberOfRegions() ;
+		type = nextRegion.getType();
+		while (index <= size && !(DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(type) || DOMRegionContext.XML_TAG_NAME.equals(type) || DOMRegionContext.XML_TAG_CLOSE.equals(type) )) {
+				nextRegion = regions.get(++index);
+				type = nextRegion.getType();
+		}
+		
+		return DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(type);
+	}
+	
+	private boolean isEmptyTag(ITextRegionCollection customTag) {
+		ITextRegion lastRegion = customTag.getLastRegion();
+		// custom tag is embedded
+		if (customTag instanceof ITextRegionContainer) {
+			ITextRegionList regions = customTag.getRegions();
+			int size = customTag.getNumberOfRegions() - 1;
+			while (size > 0 && !(DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(lastRegion.getType()) || DOMRegionContext.XML_TAG_NAME.equals(lastRegion.getType()) || DOMRegionContext.XML_TAG_CLOSE.equals(lastRegion.getType()) )) {
+				lastRegion = regions.get(--size);
+			}
+		}
+		
+		return DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(lastRegion.getType());
+	}
+
+	private void addCustomTaglibVariables(String tagToAdd, ITextRegionCollection customTag, ITextRegion prevRegion, int index) {
+		//Can't judge by first region as start and end tag are part of same ContextRegionContainer		
+		if (prevRegion != null && prevRegion.getType().equals(DOMRegionContext.XML_END_TAG_OPEN)) {
+			/*
+			 * End tag
+			 */
+			addEndTagVariable(tagToAdd, customTag);
+		}
+		else if (prevRegion != null && prevRegion.getType().equals(DOMRegionContext.XML_TAG_OPEN)) {
+			/*
+			 * Start tag
+			 */
+			addStartTagVariable(tagToAdd,customTag, index);
+		}
 	}
 
+	private void doAfterBody(StringBuffer buffer, RegionTags regionTag) {
+		buffer.append("\tif ( (new "); //$NON-NLS-1$
+		buffer.append(regionTag.tag.getTagClassName());
+		buffer.append("()).doAfterBody() != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)\n\t\tbreak;\n"); //$NON-NLS-1$
+	}
+
+	/**
+	 * @return the workspace file for this model, null otherwise
+	 */
 	private IFile getFile() {
 		IFile f = null;
-		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getStructuredDocument());
-		try {
-			if (sModel != null) {
-				Path path = new Path(sModel.getBaseLocation());
-				if (path.segmentCount() > 1) {
-					f = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-				}
-				if (f != null && f.isAccessible()) {
-					return f;
-				}
+		ITextFileBuffer buffer = FileBufferModelManager.getInstance().getBuffer(getStructuredDocument());
+		if (buffer != null) {
+			IPath path = buffer.getLocation();
+			if (path.segmentCount() > 1) {
+				f = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
 			}
-			return null;
+			if (f != null && f.isAccessible()) {
+				return f;
+			}
 		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
+		return null;
 	}
 
 	/*
@@ -925,7 +1099,7 @@
 	}
 
 	/**
-	 * /* the main control loop for translating the document, driven by the
+	 * the main control loop for translating the document, driven by the
 	 * structuredDocument nodes
 	 */
 	public void translate() {
@@ -940,7 +1114,8 @@
 		setCurrentNode(fStructuredDocument.getFirstStructuredDocumentRegion());
 
 		while (getCurrentNode() != null && !isCanceled()) {
-
+			//no code has been translated for this region yet
+			fCodeTranslated = false;
 			// intercept HTML comment flat node
 			// also handles UNDEFINED (which is what CDATA comes in as)
 			// basically this part will handle any "embedded" JSP containers
@@ -951,18 +1126,68 @@
 				// iterate through each region in the flat node
 				translateRegionContainer(getCurrentNode(), STANDARD_JSP);
 			}
+			
+			//if no code was translated for this region then found "non translated code"
+			if(!fCodeTranslated) {
+				fFoundNonTranslatedCode = true;
+			}
+			
 			if (getCurrentNode() != null)
 				advanceNextNode();
 		}
+		
+		writePlaceHolderForNonTranslatedCode();
 
 		setCurrentNode(new ZeroStructuredDocumentRegion(fStructuredDocument, fStructuredDocument.getLength()));
 		translateCodas();
 
-		buildResult();
+		/*
+		 * Any contents left in the map indicate start tags that never had end
+		 * tags. While the '{' that is present without the matching '}' should
+		 * cause a Java translation fault, that's not particularly helpful to
+		 * a user who may only know how to use custom tags as tags. Ultimately
+		 * unbalanced custom tags should just be reported as unbalanced tags,
+		 * and unbalanced '{'/'}' only reported when the user actually
+		 * unbalanced them with scriptlets.
+		 */
+		Iterator regionAndTaglibVariables = fTagToVariableMap.values().iterator();
+		while (regionAndTaglibVariables.hasNext()) {
+			RegionTags regionTag = (RegionTags) regionAndTaglibVariables.next();
+			ITextRegionCollection extraStartRegion = regionTag.region;
+			IJSPProblem missingEndTag = createJSPProblem(IJSPProblem.EndCustomTagMissing, IJSPProblem.F_PROBLEM_ID_LITERAL, NLS.bind(JSPCoreMessages.JSPTranslator_5,regionTag.tag.getTagName()), extraStartRegion.getStartOffset(), extraStartRegion.getEndOffset());
+			fTranslationProblems.add(missingEndTag);
 
+			StringBuffer text = new StringBuffer();
+			// Account for iteration tags that have a missing end tag
+			if (regionTag.tag.isIterationTag())
+				doAfterBody(text, regionTag);
+			text.append("} // [</"); //$NON-NLS-1$
+			text.append(regionTag.tag.getTagName());
+			text.append(">]"); //$NON-NLS-1$
+			appendToBuffer(text.toString(), fUserCode, false, fStructuredDocument.getLastStructuredDocumentRegion());
+		}
 		fTagToVariableMap.clear();
+
+		/*
+		 * Now do the same for jsp:useBean tags, whose contents get their own
+		 * { & }
+		 */
+		while (!fUseBeansStack.isEmpty()) {
+			appendToBuffer("}", fUserCode, false, fStructuredDocument.getLastStructuredDocumentRegion()); //$NON-NLS-1$
+			ITextRegionCollection extraStartRegion = (ITextRegionCollection) fUseBeansStack.pop();
+			IJSPProblem missingEndTag = createJSPProblem(IJSPProblem.UseBeanEndTagMissing, IJSPProblem.F_PROBLEM_ID_LITERAL, NLS.bind(JSPCoreMessages.JSPTranslator_5,JSP11Namespace.ElementName.USEBEAN), extraStartRegion.getStartOffset(), extraStartRegion.getEndOffset());
+			fTranslationProblems.add(missingEndTag);
+		}
+
+		buildResult(true);
 	}
 
+ 	/**
+	 * Translates a region container (and XML JSP container, or <% JSP
+	 * container). This method should only be called in this class and for
+	 * containers in the primary structured document as all buffer appends
+	 * will be direct.
+	 */
 	protected void setDocumentContent(IDocument document, InputStream contentStream, String charset) {
 		Reader in = null;
 		try {
@@ -992,9 +1217,9 @@
 	}
 
 	protected void init() {
-		fClassHeader = "public class _JSPServlet extends "; //$NON-NLS-1$
 		fClassname = "_JSPServlet"; //$NON-NLS-1$
-
+		fClassHeader = "public class " + fClassname + " extends "; //$NON-NLS-1$ //$NON-NLS-2$
+		
 		fImplicitImports = "import javax.servlet.*;" + ENDL + //$NON-NLS-1$
 					"import javax.servlet.http.*;" + ENDL + //$NON-NLS-1$
 					"import javax.servlet.jsp.*;" + ENDL + ENDL; //$NON-NLS-1$
@@ -1002,11 +1227,11 @@
 		fServiceHeader = "public void _jspService(javax.servlet.http.HttpServletRequest request," + //$NON-NLS-1$
 					" javax.servlet.http.HttpServletResponse response)" + ENDL + //$NON-NLS-1$
 					"\t\tthrows java.io.IOException, javax.servlet.ServletException {" + ENDL + //$NON-NLS-1$
-					"javax.servlet.jsp.PageContext pageContext = null;" + ENDL + //$NON-NLS-1$
-					"javax.servlet.ServletContext application = null;" + ENDL + //$NON-NLS-1$
-					"javax.servlet.ServletConfig config = null;" + ENDL + //$NON-NLS-1$ 
-					"javax.servlet.jsp.JspWriter out = null;" + ENDL + //$NON-NLS-1$
-					"Object page = null;" + ENDL; //$NON-NLS-1$
+					"javax.servlet.jsp.PageContext pageContext = JspFactory.getDefaultFactory().getPageContext(this, request, response, null, true, JspWriter.DEFAULT_BUFFER, true);" + ENDL + //$NON-NLS-1$
+					"javax.servlet.ServletContext application = pageContext.getServletContext();" + ENDL + //$NON-NLS-1$
+					"javax.servlet.ServletConfig config = pageContext.getServletConfig();" + ENDL + //$NON-NLS-1$ 
+					"javax.servlet.jsp.JspWriter out = pageContext.getOut();" + ENDL + //$NON-NLS-1$
+					"Object page = this;" + ENDL; //$NON-NLS-1$
 		fSuperclass = "javax.servlet.http.HttpServlet"; //$NON-NLS-1$
 	}
 
@@ -1052,20 +1277,14 @@
 
 		ITextRegionCollection containerRegion = container;
 
-		// custom tags need their own scope {}
-		handleScopingIfNecessary(containerRegion);
-
 		Iterator regions = containerRegion.getRegions().iterator();
 		ITextRegion region = null;
 		while (regions.hasNext()) {
-
 			region = (ITextRegion) regions.next();
-
 			String type = region.getType();
 
-			// content assist was not showing up in JSP inside a javascript
-			// region
-			if (type == DOMRegionContext.BLOCK_TEXT) {
+			// content assist was not showing up in JSP inside a javascript region
+			if (DOMRegionContext.BLOCK_TEXT == type) {
 				// check if it's nested jsp in a script tag...
 				if (region instanceof ITextRegionContainer) {
 					// pass in block text's container & iterator
@@ -1073,6 +1292,25 @@
 					translateJSPNode(region, regionIterator, type, EMBEDDED_JSP);
 				}
 				else {
+					//be sure to combine all of the text from the block region
+					StringBuffer fullText = new StringBuffer(containerRegion.getFullText(region));
+					while(regions.hasNext()) {
+						region = (ITextRegion)regions.next();
+						if (region instanceof ITextRegionContainer) {
+							// pass in block text's container & iterator
+							Iterator regionIterator = ((ITextRegionCollection) region).getRegions().iterator();
+							translateJSPNode(region, regionIterator, type, EMBEDDED_JSP);
+						}
+						
+						if(region.getType() == DOMRegionContext.BLOCK_TEXT) {
+							fullText.append(containerRegion.getFullText(region));
+						} else {
+							//update type for when we exit if statement for BLOCK_TEXT
+							type = region.getType();
+							break;
+						}
+					}
+					
 					/**
 					 * LIMITATION - Normally the script content within a
 					 * script tag is a single document region with a single
@@ -1096,7 +1334,7 @@
 					// PARTITIONING HAS
 					// SUPPORT FOR NESTED XML-JSP
 					// CMVC 241882
-					decodeScriptBlock(containerRegion.getFullText(region), containerRegion.getStartOffset());
+					decodeScriptBlock(fullText.toString(), containerRegion.getStartOffset());
 					// ////////////////////////////////////////////////////////////////////////////////
 				}
 			}
@@ -1113,97 +1351,16 @@
 			else if (type != null && (type == DOMRegionContext.XML_TAG_OPEN || type == DOMRegionContext.XML_END_TAG_OPEN)) {
 				translateXMLNode(containerRegion, regions);
 			}
-		}
-		// }
-	}
-
-	private void handleScopingIfNecessary(ITextRegionCollection containerRegion) {
-		/*
-		 * 199047 - Braces missing from translation of custom tags not
-		 * defining variables
-		 */
-
-		// code within a custom tag gets its own scope
-		// so if we encounter a start of a custom tag, we add '{'
-		// and for the end of a custom tag we add '}'
-		if (containerRegion.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN) {
-			// don't add '{' if it's a self closing tag
-			if (!isSelfClosingTag(containerRegion)) {
-				if (isCustomTag(containerRegion)) {
-					startScope();
-				}
+			else if(type != null && type == DOMRegionContext.XML_CONTENT && region instanceof ITextRegionContainer) {
+				//this case was put in to parse EL that is not in an attribute
+				translateXMLContent((ITextRegionContainer)region);
+			}
+			//the end tags of these regions are "translated" in a sense
+			else if(type == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE ||
+					type == DOMJSPRegionContexts.JSP_CLOSE) {
+				this.fCodeTranslated = true;
 			}
 		}
-		else if (containerRegion.getFirstRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN) {
-			if (isCustomTag(containerRegion)) {
-				endScope();
-			}
-		}
-	}
-
-	private void startScope() {
-		// fScopeDepth++;
-		StringBuffer text = new StringBuffer();
-		// for(int i=0; i<fScopeDepth; i++) text.append(" "); //$NON-NLS-1$
-		text.append("{ // <"); //$NON-NLS-1$
-		text.append(getRegionName(fCurrentNode));
-		text.append(">\n"); //$NON-NLS-1$
-		appendToBuffer(text.toString(), fUserCode, false, fCurrentNode); //$NON-NLS-1$
-	}
-
-	private void endScope() {
-		StringBuffer text = new StringBuffer();
-		text.append("} // </"); //$NON-NLS-1$
-		text.append(getRegionName(fCurrentNode));
-		text.append(">\n"); //$NON-NLS-1$
-		appendToBuffer(text.toString(), fUserCode, false, fCurrentNode); //$NON-NLS-1$
-	}
-
-	private boolean isSelfClosingTag(ITextRegionCollection containerRegion) {
-
-		if (containerRegion == null)
-			return false;
-
-		ITextRegionList regions = containerRegion.getRegions();
-		ITextRegion r = regions.get(regions.size() - 1);
-		return r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE;
-	}
-
-	private boolean isCustomTag(ITextRegionCollection containerRegion) {
-		String tagName = getRegionName(containerRegion);
-
-		if (tagName == null)
-			return false;
-
-		JSPSourceParser parser = (JSPSourceParser) fStructuredDocument.getParser();
-		int colonIndex = tagName.indexOf(":");
-		if (colonIndex > 0) {
-			String prefix = tagName.substring(0, colonIndex);
-			if (prefix.equals("jsp")) { //$NON-NLS-1$
-				return false;
-			}
-			TagMarker[] prefixes = (TagMarker[]) parser.getNestablePrefixes().toArray(new TagMarker[0]);
-			for (int i = 0; i < prefixes.length; i++) {
-				if (prefix.equals(prefixes[i].getTagName())) {
-					return true;
-				}
-			}
-		}
-
-		return false;
-	}
-
-	private String getRegionName(ITextRegionCollection containerRegion) {
-		ITextRegionList regions = containerRegion.getRegions();
-		ITextRegion nameRegion = null;
-		for (int i = 0; i < regions.size(); i++) {
-			ITextRegion r = regions.get(i);
-			if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
-				nameRegion = r;
-				break;
-			}
-		}
-		return nameRegion != null ? containerRegion.getText(nameRegion).trim() : null;
 	}
 
 	/*
@@ -1212,7 +1369,7 @@
 	 * jsp:scriptlet, jsp:expression, and jsp:declaration @param blockText
 	 * @return
 	 */
-	private void decodeScriptBlock(String blockText, int startOfBlock) {
+	void decodeScriptBlock(String blockText, int startOfBlock) {
 		XMLJSPRegionHelper helper = new XMLJSPRegionHelper(this, false);
 		helper.addBlockMarker(new BlockMarker("jsp:scriptlet", null, DOMJSPRegionContexts.JSP_CONTENT, false)); //$NON-NLS-1$
 		helper.addBlockMarker(new BlockMarker("jsp:expression", null, DOMJSPRegionContexts.JSP_CONTENT, false)); //$NON-NLS-1$
@@ -1265,6 +1422,43 @@
 	}
 
 	/**
+	 * This currently only detects EL content and translates it,
+	 * but if other cases arise later then they could be added in here
+	 * 
+	 * @param embeddedContainer the container that may contain EL
+	 */
+	protected void translateXMLContent(ITextRegionContainer embeddedContainer) {
+		ITextRegionList embeddedRegions = embeddedContainer.getRegions();
+		int length = embeddedRegions.size();
+		for (int i = 0; i < length; i++) {
+			ITextRegion delim = embeddedRegions.get(i);
+			String type = delim.getType();
+
+			// check next region to see if it's EL content
+			if (i + 1 < length) {
+				if((type == DOMJSPRegionContexts.JSP_EL_OPEN || type == DOMJSPRegionContexts.JSP_VBL_OPEN)) {
+					ITextRegion region = null;
+					
+					int start = delim.getEnd();
+					while (++i < length) {
+						region = embeddedRegions.get(i);
+						if (region == null || !isELType(region.getType()))
+							break;
+					}
+					fLastJSPType = EXPRESSION;
+					String elText = embeddedContainer.getFullText().substring(start, (region != null ? region.getStart() : embeddedContainer.getLength() - 1));
+					translateEL(elText, embeddedContainer.getText(delim), fCurrentNode,
+							embeddedContainer.getEndOffset(delim), elText.length());
+				}
+			}
+		}
+	}
+
+	private boolean isELType(String type) {
+		return DOMJSPRegionContexts.JSP_EL_CONTENT.equals(type) || DOMJSPRegionContexts.JSP_EL_DQUOTE.equals(type) || DOMJSPRegionContexts.JSP_EL_QUOTED_CONTENT.equals(type) || DOMJSPRegionContexts.JSP_EL_SQUOTE.equals(type);
+	}
+
+	/**
 	 * translates the various XMLJSP type nodes
 	 * 
 	 * @param regions
@@ -1281,8 +1475,8 @@
 
 			{
 				String fullTagName = container.getText(r);
-				if (fullTagName.indexOf(':') > -1) {
-					addTaglibVariables(fullTagName, container); // it
+				if (fullTagName.indexOf(':') > -1 && !fullTagName.startsWith(JSP_PREFIX)) {
+					addTaglibVariables(fullTagName, container,-1); // it
 					// may
 					// be a
 					// custom
@@ -1477,16 +1671,21 @@
 		int end = sdr.getEndOffset();
 		String sdrText = ""; //$NON-NLS-1$
 
-		// read structured document regions until
-		// </jsp:scriptlet> or EOF
+		StringBuffer regionText = new StringBuffer();
+		// read structured document regions until </jsp:scriptlet> or EOF
 		while (sdr != null && sdr.getType() != DOMRegionContext.XML_TAG_NAME) {
 
 			// setup for next region
-			start = sdr.getStartOffset();
+			if (regionText.length() == 0)
+				start = sdr.getStartOffset();
 			sdrText = sdr.getText();
 
 			if (sdr.getType() == DOMRegionContext.XML_CDATA_TEXT) {
-
+				// Clear out the buffer
+				if (regionText.length() > 0) {
+					writeToBuffer(type, regionText.toString(), start, end);
+					regionText = new StringBuffer();
+				}
 				// just to be safe, make sure CDATA start & end are there
 				if (sdrText.startsWith("<![CDATA[") && sdrText.endsWith("]]>")) { //$NON-NLS-1$ //$NON-NLS-2$
 
@@ -1497,14 +1696,15 @@
 				}
 			}
 			else {
-
 				// handle entity references
-				sdrText = EscapedTextUtil.getUnescapedText(sdrText);
+				regionText.append(EscapedTextUtil.getUnescapedText(sdrText));
 				end = sdr.getEndOffset();
-				writeToBuffer(type, sdrText, start, end);
 			}
 			sdr = sdr.getNext();
 		}
+
+		if (regionText.length() > 0)
+			writeToBuffer(type, regionText.toString(), start, end);
 		setCurrentNode(sdr);
 		setSourceReferencePoint();
 	}
@@ -1539,6 +1739,11 @@
 				// jsp...iterate
 				// regions...
 			}
+			else if (DOMRegionContext.XML_COMMENT_TEXT.equals(commentRegion.getType())) {
+				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=222215
+				// support custom tags hidden in a comment region
+				decodeScriptBlock(node.getFullText(commentRegion), node.getStartOffset(commentRegion));
+			}
 		}
 	}
 
@@ -1558,7 +1763,12 @@
 				translateEmbeddedJSPInBlock((ITextRegionCollection) region, regions);
 				// ensure the rest of this method won't be called
 			}
-			if (contentRegion != null) {
+			/* NOTE: the type here is of the node preceding the current node
+			 * thus must check to see if the current node is JSP close, if it is
+			 * then the JSP is something akin to <%%> and should not be translated
+			 * (Bug 189318)
+			 */
+			if (contentRegion != null && contentRegion.getType() != DOMJSPRegionContexts.JSP_CLOSE) {
 				if (type == DOMJSPRegionContexts.JSP_EXPRESSION_OPEN) {
 					translateExpression(contentRegion);
 				}
@@ -1581,7 +1791,8 @@
 	private void translateEL(String elText, String delim, IStructuredDocumentRegion currentNode, int contentStart, int contentLength) {
 		IJSPELTranslator translator = getELTranslator();
 		if (null != translator) {
-			translator.translateEL(elText, delim, currentNode, contentStart, contentLength, fUserELExpressions, fUserELRanges, fStructuredDocument);
+			List elProblems = translator.translateEL(elText, delim, currentNode, contentStart, contentLength, fUserELExpressions, fUserELRanges, fStructuredDocument);
+			fTranslationProblems.addAll(elProblems);
 		}
 	}
 
@@ -1675,18 +1886,30 @@
 		ITextRegion delim = null;
 		ITextRegion content = null;
 		String type = null;
+		String quotetype = null;
 		for (int i = 0; i < embeddedRegions.size(); i++) {
 
 			// possible delimiter, check later
 			delim = embeddedRegions.get(i);
 			type = delim.getType();
+			if (type == DOMRegionContext.XML_TAG_NAME ) {
+				String fullTagName = embeddedContainer.getText(delim);
+				if (fullTagName.indexOf(':') > -1 && !fullTagName.startsWith(JSP_PREFIX)) {
+					ITextRegion prevRegion =null;
+					if (i>0)
+						prevRegion = embeddedRegions.get(i-1);
+					addCustomTaglibVariables(fullTagName, embeddedContainer,prevRegion,i+1); // it may be a custom tag
+				}
+			}
+			if(type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE || type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE
+				|| type == DOMJSPRegionContexts.JSP_TAG_ATTRIBUTE_VALUE_DQUOTE || type == DOMJSPRegionContexts.JSP_TAG_ATTRIBUTE_VALUE_SQUOTE)
+				quotetype = type;
 
 			// check next region to see if it's content
 			if (i + 1 < embeddedRegions.size()) {
 				String regionType = embeddedRegions.get(i + 1).getType();
 				if (regionType == DOMJSPRegionContexts.JSP_CONTENT || regionType == DOMJSPRegionContexts.JSP_EL_CONTENT)
 					content = embeddedRegions.get(i + 1);
-
 			}
 
 			if (content != null) {
@@ -1702,7 +1925,7 @@
 					fLastJSPType = EXPRESSION;
 					// translateExpressionString(embeddedContainer.getText(content),
 					// fCurrentNode, contentStart, content.getLength());
-					translateExpressionString(embeddedContainer.getText(content), embeddedContainer, contentStart, content.getLength(), false);
+					translateExpressionString(embeddedContainer.getText(content), embeddedContainer, contentStart, content.getLength(), quotetype);
 				}
 				else if (type == DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN) {
 					fLastJSPType = SCRIPTLET;
@@ -1853,9 +2076,9 @@
 		if (varName != null) {
 			if (isFragment) {
 				// 2.0:JSP.8.5.2
-				varType = "javax.servlet.jsp.tagext.JspFragment";
+				varType = "javax.servlet.jsp.tagext.JspFragment"; //$NON-NLS-1$
 			}
-			String declaration = new TaglibVariable(varType, varName, "", description).getDeclarationString(true, TaglibVariable.M_PRIVATE);
+			String declaration = new TaglibVariable(varType, varName, "", description).getDeclarationString(true, TaglibVariable.M_PRIVATE); //$NON-NLS-1$
 			appendToBuffer(declaration, fUserDeclarations, false, fCurrentNode);
 		}
 	}
@@ -1928,7 +2151,7 @@
 			CMDocumentTracker tracker = null;
 			while (it.hasNext()) {
 				tracker = (CMDocumentTracker) it.next();
-				addBlockMarkers(prefix + ":", tracker.getDocument());
+				addBlockMarkers(prefix + ":", tracker.getDocument()); //$NON-NLS-1$
 			}
 		}
 	}
@@ -2030,7 +2253,7 @@
 		}
 		else if (attrName.equals("session")) //$NON-NLS-1$
 		{
-			fIsInASession = "true".equalsIgnoreCase(attrValue);
+			fIsInASession = Boolean.valueOf(attrValue).booleanValue();
 		}
 		else if (attrName.equals("buffer")) //$NON-NLS-1$
 		{
@@ -2046,7 +2269,7 @@
 		}
 		else if (attrName.equals("isErrorPage")) //$NON-NLS-1$
 		{
-			fIsErrorPage = "true".equalsIgnoreCase(attrValue);
+			fIsErrorPage = Boolean.valueOf(attrValue).booleanValue();
 		}
 	}
 
@@ -2091,8 +2314,46 @@
 	}
 
 	protected void translateExpressionString(String newText, ITextRegionCollection embeddedContainer, int jspPositionStart, int jspPositionLength, boolean isIndirect) {
-		appendToBuffer(EXPRESSION_PREFIX, fUserCode, false, embeddedContainer);
-		appendToBuffer(newText, fUserCode, true, embeddedContainer, jspPositionStart, jspPositionLength, isIndirect);
+		appendToBuffer(EXPRESSION_PREFIX, fUserCode, false, embeddedContainer, true);
+		appendToBuffer(newText, fUserCode, true, embeddedContainer, jspPositionStart, jspPositionLength, isIndirect, true);
+		appendToBuffer(EXPRESSION_SUFFIX, fUserCode, false, embeddedContainer);
+	}
+	
+	protected void translateExpressionString(String newText, ITextRegionCollection embeddedContainer, int jspPositionStart, int jspPositionLength, String quotetype) {
+		if(quotetype == null || quotetype == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE ||quotetype == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE ) {
+			translateExpressionString(newText, embeddedContainer, jspPositionStart, jspPositionLength, false);
+			return;
+		}
+
+		//-- This is a quoted attribute. We need to unquote as per the JSP spec: JSP 2.0 page 1-36
+		appendToBuffer(EXPRESSION_PREFIX, fUserCode, false, embeddedContainer, true);
+
+		int length = newText.length();
+		int runStart = 0;
+		int i = 0;
+		for ( ; i < length; i++) {
+			//-- collect a new run
+			char c = newText.charAt(i);
+			if (c == '\\') {
+				//-- Escaped value. Add the run, then unescape
+				int runLength = i-runStart;
+				if (runLength > 0) {
+					appendToBuffer(newText.substring(runStart, i), fUserCode, true, embeddedContainer, jspPositionStart, runLength, true, true);
+					jspPositionStart += runLength + 1;
+					jspPositionLength -= runLength + 1;
+				}
+				runStart = ++i;
+				if (i >= length) { // Escape but no data follows?!
+					//- error.
+					break;
+				}
+				c = newText.charAt(i);				// The escaped character, copied verbatim
+			}
+		}
+		//-- Copy last-run
+		int runLength = i - runStart;
+		if (runLength > 0)
+			appendToBuffer(newText.substring(runStart, i), fUserCode, true, embeddedContainer, jspPositionStart, runLength, true, false);
 		appendToBuffer(EXPRESSION_SUFFIX, fUserCode, false, embeddedContainer);
 	}
 
@@ -2117,8 +2378,8 @@
 	// <%= %>
 	protected void translateExpression(ITextRegionCollection region) {
 		String newText = getUnescapedRegionText(region, EXPRESSION);
-		appendToBuffer(EXPRESSION_PREFIX, fUserCode, false, region);
-		appendToBuffer(newText, fUserCode, true, fCurrentNode);
+		appendToBuffer(EXPRESSION_PREFIX, fUserCode, false, region, true);
+		appendToBuffer(newText, fUserCode, true, region, true);
 		appendToBuffer(EXPRESSION_SUFFIX, fUserCode, false, region);
 	}
 
@@ -2154,6 +2415,30 @@
 		}
 		appendToBuffer(newText, buffer, addToMap, jspReferenceRegion, start, length, false);
 	}
+	
+	/**
+	 * Append using a region, probably indirect mapping (eg. <%@page
+	 * include=""%>)
+	 * 
+	 * @param newText
+	 * @param buffer
+	 * @param addToMap
+	 * @param jspReferenceRegion
+	 * @param nonl
+	 */
+	private void appendToBuffer(String newText, StringBuffer buffer, boolean addToMap, ITextRegionCollection jspReferenceRegion, boolean nonl) {
+		int start = 0, length = 0;
+		if (jspReferenceRegion != null) {
+			start = jspReferenceRegion.getStartOffset();
+			length = jspReferenceRegion.getLength();
+		}
+		appendToBuffer(newText, buffer, addToMap, jspReferenceRegion, start, length, false, nonl);
+	}
+	
+	private void appendToBuffer(String newText, StringBuffer buffer, boolean addToMap, ITextRegionCollection jspReferenceRegion, int jspPositionStart, int jspPositionLength, boolean isIndirect) {
+		appendToBuffer(newText, buffer, addToMap, jspReferenceRegion, jspPositionStart, jspPositionLength, isIndirect, false);
+	}
+
 
 	/**
 	 * Adds newText to the buffer passed in, and adds to translation mapping
@@ -2165,7 +2450,7 @@
 	 * @param buffer
 	 * @param addToMap
 	 */
-	private void appendToBuffer(String newText, StringBuffer buffer, boolean addToMap, ITextRegionCollection jspReferenceRegion, int jspPositionStart, int jspPositionLength, boolean isIndirect) {
+	private void appendToBuffer(String newText, StringBuffer buffer, boolean addToMap, ITextRegionCollection jspReferenceRegion, int jspPositionStart, int jspPositionLength, boolean isIndirect, boolean nonl) {
 
 		int origNewTextLength = newText.length();
 
@@ -2174,9 +2459,15 @@
 			return;
 
 		// add a newline so translation looks cleaner
-		if (!newText.endsWith(ENDL))
+		if (! nonl && !newText.endsWith(ENDL))
 			newText += ENDL;
 
+		//dump any non translated code before writing translated code
+		writePlaceHolderForNonTranslatedCode();
+
+		//if appending to the buffer can assume something got translated
+		fCodeTranslated = true;
+
 		if (buffer == fUserCode) {
 			buffer.append(newText);
 			if (addToMap) {
@@ -2531,14 +2822,7 @@
 		// iterate XMLCONTENT and CDATA regions
 		// loop fCurrentNode until you hit </jsp:scriptlet> (or other closing
 		// tag name)
-		while (getCurrentNode() != null && getCurrentNode().getType() != DOMRegionContext.XML_TAG_NAME) // need
-		// to
-		// stop
-		// on
-		// the
-		// ending
-		// tag
-		// name...
+		while (getCurrentNode() != null && getCurrentNode().getType() != DOMRegionContext.XML_TAG_NAME && getCurrentNode().getType() != DOMJSPRegionContexts.JSP_CLOSE) // need to stop on the ending tag name...
 		{
 			start = getCurrentNode().getStartOffset();
 			end = getCurrentNode().getEndOffset();
@@ -2623,6 +2907,20 @@
 		String beanName = null;
 		ITextRegion beanNameRegion = null;
 
+		if (DOMRegionContext.XML_END_TAG_OPEN.equals(container.getFirstRegion().getType())) {
+			if (!fUseBeansStack.isEmpty()) {
+				fUseBeansStack.pop();
+				appendToBuffer("}", fUserCode, false, fCurrentNode); //$NON-NLS-1$ 
+			}
+			else {
+				// no useBean start tag being remembered
+				ITextRegionCollection extraEndRegion = container;
+				IJSPProblem missingStartTag = createJSPProblem(IJSPProblem.UseBeanStartTagMissing, IJSPProblem.F_PROBLEM_ID_LITERAL, NLS.bind(JSPCoreMessages.JSPTranslator_4,JSP11Namespace.ElementName.USEBEAN), extraEndRegion.getStartOffset(), extraEndRegion.getEndOffset());
+				fTranslationProblems.add(missingStartTag);
+			}
+			return;
+		}
+
 		Iterator regions = container.getRegions().iterator();
 		while (regions.hasNext() && (r = (ITextRegion) regions.next()) != null && (r.getType() != DOMRegionContext.XML_TAG_CLOSE || r.getType() != DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
 			attrName = attrValue = null;
@@ -2674,21 +2972,31 @@
 				Object problem = createJSPProblem(IJSPProblem.UseBeanAmbiguousType, IProblem.AmbiguousType, JSPCoreMessages.JSPTranslator_2, container.getStartOffset(nameRegion), container.getTextEndOffset(nameRegion) - 1);
 				fTranslationProblems.add(problem);
 			}
-			// Only have a class or a beanName at this point, and potentially
-			// a type
-			// has id w/ type and/or classname/beanName
+			/*
+			 * Only have a class or a beanName at this point, and potentially
+			 * a type has id w/ type and/or classname/beanName
+			 */
 			// Type id = new Classname/Beanname();
 			// or
 			// Type id = null; // if there is no classname or beanname
 			if ((type != null || className != null)) {
+				if (className != null)
+					className = decodeType(className);
+
 				if (type == null) {
 					type = className;
 					typeRegion = classnameRegion;
 				}
+				else
+					type = decodeType(type);
 
-				if (!isTypeFound(type)) {
-					Object problem = createJSPProblem(IJSPProblem.F_PROBLEM_ID_LITERAL, IProblem.UndefinedType, MessageFormat.format(JSPCoreMessages.JSPTranslator_1, new String[]{type}), container.getStartOffset(typeRegion), container.getTextEndOffset(typeRegion) - 1);
-					fTranslationProblems.add(problem);
+				/* Now check the types (multiple of generics may be involved) */
+				List errorTypeNames = new ArrayList(2);
+				if (!isTypeFound(type, errorTypeNames)) {
+					for (int i = 0; i < errorTypeNames.size(); i++) {
+						Object problem = createJSPProblem(IJSPProblem.F_PROBLEM_ID_LITERAL, IProblem.UndefinedType, MessageFormat.format(JSPCoreMessages.JSPTranslator_1, new String[]{errorTypeNames.get(i).toString()}), container.getStartOffset(typeRegion), container.getTextEndOffset(typeRegion) - 1);
+						fTranslationProblems.add(problem);
+					}
 				}
 				else {
 					String prefix = type + " " + id + " = "; //$NON-NLS-1$ //$NON-NLS-2$
@@ -2701,37 +3009,111 @@
 				}
 			}
 		}
+		/*
+		 * Add a brace and remember the start tag regardless of whether a
+		 * variable was correctly created
+		 */
+		if (!DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(container.getLastRegion().getType())) {
+			fUseBeansStack.push(container);
+			appendToBuffer("{", fUserCode, false, fCurrentNode); //$NON-NLS-1$ 
+		}
+	}
+
+	/**
+	 * Decodes type strings for XML-style JSPs
+	 * 
+	 * @param type the string to decode
+	 * @return the decoded string
+	 */
+	private String decodeType(String type) {
+		final int length = type.length();
+		final StringBuffer buffer = new StringBuffer(length);
+		for (int i = 0; i < length; i++) {
+			final char c = type.charAt(i);
+			if (c == '&') {
+				if (length > i + 3) {
+					final String code = type.substring(i + 1, i + 4);
+					final boolean isGt = "gt;".equals(code); //$NON-NLS-1$
+					if (isGt || "lt;".equals(code)) { //$NON-NLS-1$
+						i+=3;
+						buffer.append(isGt ? '>' : '<');
+						continue;
+					}
+				}
+			}
+			buffer.append(c);
+		}
+		return buffer.toString();
 	}
 
 	/**
 	 * @param type
 	 * @return
 	 */
-	private boolean isTypeFound(String typeName) {
-		IType type = null;
-		IProject project = getFile().getProject();
-		try {
-			IJavaProject p = JavaCore.create(project);
-			if (p.exists()) {
-				if (typeName.indexOf('<') > 0 && typeName.indexOf('>') > 0) {
-					StringTokenizer toker = new StringTokenizer(typeName);
-					String generic = toker.nextToken("<");
-					String element = toker.nextToken(">");
-					IType genericType = p.findType(generic);
-					IType elementType = p.findType(element);
-					return genericType!= null && genericType.exists() && elementType!= null && elementType.exists();
+	private boolean isTypeFound(String rawTypeValue, List errorTypeNames) {
+		IFile file = getFile();
+		if(file == null)
+			return true;
+		
+		IProject project = file.getProject();
+		IJavaProject p = JavaCore.create(project);
+		if (p.exists()) {
+			String types[] = new String[3];
+			if (rawTypeValue.indexOf('<') > 0) {
+				// JSR 14 : Generics are being used, parse them out
+				try {
+					StringTokenizer toker = new StringTokenizer(rawTypeValue);
+					// generic
+					types[0] = toker.nextToken("<"); //$NON-NLS-1$
+					// type 1 or key
+					types[1] = toker.nextToken(",>"); //$NON-NLS-1$
+					// type 2 or value
+					types[2] = toker.nextToken(",>"); //$NON-NLS-1$
 				}
-				type = p.findType(typeName);
-				return type != null && type.exists();
+				catch (NoSuchElementException e) {
+					// StringTokenizer failure with unsupported syntax
+				}
+			}
+			else {
+				types[0] = rawTypeValue;
+			}
+
+			for (int i = 0; i < types.length; i++) {
+				if (types[i] != null) {
+					// remove any array suffixes 
+					if (types[i].indexOf('[') > 0) {
+						types[i] = types[i].substring(0, types[i].indexOf('[')); //$NON-NLS-1$
+					}
+					// remove any "extends" prefixes (JSR 14)
+					if (types[i].indexOf("extends") > 0) { //$NON-NLS-1$
+						types[i] = StringUtils.strip(types[i].substring(types[i].indexOf("extends"))); //$NON-NLS-1$
+					}
+
+					addNameToListIfTypeNotFound(p, types[i], errorTypeNames);
+				}
+			}
+		}
+		return errorTypeNames.isEmpty();
+	}
+	
+	private void addNameToListIfTypeNotFound(IJavaProject p, String typeName, List collectedNamesNotFound) {
+		try {
+			if (typeName != null) {
+				IType type = p.findType(typeName);
+				if (type == null || !type.exists()) {
+					collectedNamesNotFound.add(typeName);
+				}
+				else {
+					IResource typeResource = type.getResource();
+					if(typeResource != null) {
+						
+					}
+				}
 			}
 		}
 		catch (JavaModelException e) {
 			// Not a Java Project
 		}
-		catch(NoSuchElementException e) {
-			// StringTokenizer failure with unsupported syntax
-		}
-		return true;
 	}
 
 	private boolean isValidJavaIdentifier(String id) {
@@ -2793,24 +3175,15 @@
 		return fCurrentNode;
 	}
 
-	public ArrayList getELProblems() {
-		return fELProblems;
-	}
-
 	public IStructuredDocument getStructuredDocument() {
 		return fStructuredDocument;
 	}
 
 	private IPath getModelPath() {
 		IPath path = null;
-		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getStructuredDocument());
-		try {
-			if (sModel != null)
-				path = new Path(sModel.getBaseLocation());
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
+		ITextFileBuffer buffer = FileBufferModelManager.getInstance().getBuffer(getStructuredDocument());
+		if (buffer != null) {
+			path = buffer.getLocation();
 		}
 		return path;
 	}
@@ -2854,4 +3227,361 @@
 		}
 		fProcessIncludes = true;
 	}
+
+	/**
+	 * <p>Writes an empty expression to {@link #fUserCode} if previously
+	 * found non translated code</p>
+	 * <p>This should be done before appending any newly translated code.</p>
+	 */
+	private void writePlaceHolderForNonTranslatedCode() {
+		if(fFoundNonTranslatedCode) {
+			String text = ("{" + EXPRESSION_PREFIX + "\"\"" + EXPRESSION_SUFFIX + "}" + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+					" //markup"+ ENDL); //$NON-NLS-1$
+			fUserCode.append(text);
+			fOffsetInUserCode += text.length();
+			fFoundNonTranslatedCode = false;
+		}
+	}
+
+	/**
+	 * <p><b>NOTE: </b>If the implementation of this method is changed be sure to update
+	 *  {@link #readExternal(ObjectInput)} and {@link #serialVersionUID}</p>
+	 *
+	 * @see #readExternal(ObjectInput)
+	 * @see #serialVersionUID
+	 * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
+	 */
+	public void writeExternal(ObjectOutput out) throws IOException {
+		writeString(out, this.fClassHeader);
+		writeString(out, this.fClassname);
+		writeString(out, this.fSuperclass);
+		writeString(out, this.fImplicitImports);
+		writeString(out, this.fServiceHeader);
+		writeBuffer(out, this.fUserImports);
+		out.writeInt(this.fSourcePosition);
+		out.writeInt(this.fRelativeOffset);
+		out.writeInt(this.fCursorPosition);
+		out.writeBoolean(this.fIsErrorPage);
+		out.writeBoolean(this.fCursorInExpression);
+		out.writeBoolean(this.fIsInASession);
+		writeBuffer(out, this.fUserCode);
+		writeBuffer(out, this.fUserELExpressions);
+		writeBuffer(out, this.fUserDeclarations);
+		writeBuffer(out, this.fCursorOwner);
+		out.writeBoolean(this.fInCodeRegion);
+		out.writeBoolean(this.fProcessIncludes);
+		out.writeInt(this.fOffsetInUserImports);
+		out.writeInt(this.fOffsetInUserDeclarations);
+		out.writeInt(this.fOffsetInUserCode);
+		
+		//write included paths
+		out.writeInt(this.fIncludedPaths.size());
+		Iterator iter = this.fIncludedPaths.iterator();
+		while(iter.hasNext()) {
+			writeString(out, (String)iter.next());
+		}
+		
+		writeRanges(out, this.fImportRanges);
+		writeRanges(out, this.fCodeRanges);
+		writeRanges(out, this.fDeclarationRanges);
+		writeRanges(out, this.fUseBeanRanges);
+		writeRanges(out, this.fUserELRanges);
+		writeRanges(out, this.fIndirectRanges);
+		writeString(out, this.fELTranslatorID);
+	}
+	
+	/**
+	 * <p><b>NOTE 1: </b>After reading in an externalized {@link JSPTranslator} the caller must
+	 * manually call {@link #postReadExternalSetup(IStructuredModel)} to finish setting up
+	 * the {@link JSPTranslator} for use.</p>
+	 * 
+	 * <p><b>NOTE 2: </b>If the implementation of this method is changed be sure to update
+	 * {@link #writeExternal(ObjectOutput)} and {@link #serialVersionUID}</p>
+	 * 
+	 * @see #writeExternal(ObjectOutput)
+	 * @see #serialVersionUID
+	 * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
+	 */
+	public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+		this.fClassHeader = readString(in);
+		this.fClassname = readString(in);
+		this.fSuperclass = readString(in);
+		this.fImplicitImports = readString(in);
+		this.fServiceHeader = readString(in);
+		this.fUserImports = new StringBuffer(readString(in));
+		this.fSourcePosition = in.readInt();
+		this.fRelativeOffset = in.readInt();
+		this.fCursorPosition = in.readInt();
+		this.fIsErrorPage = in.readBoolean();
+		this.fCursorInExpression = in.readBoolean();
+		this.fIsInASession = in.readBoolean();
+		this.fUserCode = new StringBuffer(readString(in));
+		this.fUserELExpressions = new StringBuffer(readString(in));
+		this.fUserDeclarations = new StringBuffer(readString(in));
+		this.fCursorOwner = new StringBuffer(readString(in));
+		this.fInCodeRegion = in.readBoolean();
+		this.fProcessIncludes = in.readBoolean();
+		this.fOffsetInUserImports = in.readInt();
+		this.fOffsetInUserDeclarations = in.readInt();
+		this.fOffsetInUserCode = in.readInt();
+		
+		//read included paths
+		int size = in.readInt();
+		this.fIncludedPaths = new HashSet(size);
+		for(int i = 0; i < size; ++i) {
+			this.fIncludedPaths.add(readString(in));
+		}
+		
+		this.fImportRanges = readRanges(in);
+		this.fCodeRanges = readRanges(in);
+		this.fDeclarationRanges = readRanges(in);
+		this.fUseBeanRanges = readRanges(in);
+		this.fUserELRanges = readRanges(in);
+		this.fIndirectRanges = readRanges(in);
+		this.fELTranslatorID = readString(in);
+		
+		//build result
+		this.buildResult(false);
+	}
+	
+	/**
+	 * <p>This does mandatory setup needed after a JSPTranslator is restored from
+	 * a persisted file</p>
+	 * 
+	 * @param jspModel {@link IStructuredModel} representing the JSP file that this
+	 * is a translator for
+	 */
+	protected void postReadExternalSetup(IStructuredModel jspModel) {
+		this.fStructuredDocument = jspModel.getStructuredDocument();
+		this.fJspTextBuffer = new StringBuffer(this.fStructuredDocument.get());
+		if(jspModel instanceof IDOMModel) {
+			this.fStructuredModel = (IDOMModel)jspModel;
+		}
+	}
+	
+	/**
+	 * <p>Writes a string to an {@link ObjectOutput} stream</p>
+	 * 
+	 * <p><b>NOTE: </b>If the implementation of this method is changed be sure to update
+	 * {@link #readString(ObjectInput)} and {@link #serialVersionUID}</p>
+	 * 
+	 * @param out {@link ObjectOutput} stream to write <code>s</code> too
+	 * @param s {@link String} to write to <code>out</code>
+	 * 
+	 * @throws IOException IO can throw exceptions
+	 * 
+	 * @see #readString(ObjectInput)
+	 */
+	private static void writeString(ObjectOutput out, String s) throws IOException {
+		if(s != null) {
+			out.writeInt(s.length());
+			out.writeBytes(s);
+		} else {
+			out.writeInt(0);
+		}
+	}
+	
+	/**
+	 * <p>Reads a {@link String} written by {@link #writeString(ObjectOutput, String)} from
+	 * a {@link ObjectInput} stream.</p>
+	 * 
+	 * <p><b>NOTE: </b>If the implementation of this method is changed be sure to update
+	 * {@link #writeString(ObjectOutput, String)} and {@link #serialVersionUID}</p>
+	 * 
+	 * @param in {@link ObjectInput} stream to read the {@link String} from
+	 * @return {@link String} read from <code>in</code>
+	 * 
+	 * @throws IOException IO Can throw exceptions
+	 * 
+	 * @see #writeString(ObjectOutput, String)
+	 */
+	private static String readString(ObjectInput in) throws IOException {
+		int length = in.readInt();
+		byte[] bytes = new byte[length];
+		in.readFully(bytes);
+		return new String(bytes);
+	}
+	
+	/**
+	 * <p>Writes a {@link StringBuffer} to an {@link ObjectOutput} stream</p>
+	 * 
+	 * @param out {@link ObjectOutput} stream to write <code>s</code> too
+	 * @param s {@link String} to write to <code>out</code>
+	 * 
+	 * @throws IOException IO can throw exceptions
+	 * 
+	 * @see #readString(ObjectInput)
+	 */
+	private static void writeBuffer(ObjectOutput out, StringBuffer buff) throws IOException {
+		if(buff != null && buff.length() > 0) {
+			writeString(out, buff.toString());
+		} else {
+			writeString(out, null);
+		}
+	}
+	
+	/**
+	 * <p>Writes a {@link HashMap} of {@link Position}s to an {@link ObjectOutput} stream</p>
+	 * 
+	 * <p><b>NOTE: </b>If the implementation of this method is changed be sure to update
+	 * {@link #readRanges(ObjectInput)} and {@link #serialVersionUID}</p>
+	 * 
+	 * @param out {@link ObjectOutput} stream to write to
+	 * @param ranges {@link HashMap} of {@link Position}s to write to <code>out</code>
+	 * 
+	 * @throws IOException IO can throw exceptions
+	 * 
+	 * @see #readRanges(ObjectInput)
+	 */
+	private static void writeRanges(ObjectOutput out, HashMap ranges) throws IOException {
+		//this is a strange hack because Position is not designed to be used as keys in a Map, see Position doc
+		HashMap temp = new HashMap();
+		temp.putAll(ranges);
+		
+		Iterator iter = temp.keySet().iterator();
+		out.writeInt(ranges.size());
+		while(iter.hasNext()) {
+			Position javaPos = (Position)iter.next();
+			Position jspPos = (Position)temp.get(javaPos);
+			out.writeInt(javaPos.offset);
+			out.writeInt(javaPos.length);
+			out.writeBoolean(javaPos.isDeleted);
+			
+			if(jspPos != null) {
+				out.writeInt(jspPos.offset);
+				out.writeInt(jspPos.length);
+				out.writeBoolean(jspPos.isDeleted);
+			} else {
+				out.writeInt(-1);
+				out.writeInt(-1);
+			}
+		}
+	}
+	
+	/**
+	 * <p>Reads a {@link HashMap} of {@link Position}s from an {@link ObjectInput} stream that was written by
+	 * {@link #writeRanges(ObjectOutput, HashMap)}</p>
+	 * 
+	 * <p><b>NOTE: </b>If the implementation of this method is changed be sure to update
+	 * {@link #writeRanges(ObjectOutput, HashMap)} and {@link #serialVersionUID}</p>
+	 * 
+	 * @param in {@link ObjectInput} stream to read the {@link HashMap} of {@link Position}s from
+	 * @return {@link HashMap} of {@link Position}s read from <code>in</code>
+	 * 
+	 * @throws IOException IO can throw exceptions
+	 * 
+	 * @see #writeRanges(ObjectOutput, HashMap)
+	 */
+	private static HashMap readRanges(ObjectInput in) throws IOException {
+		int size = in.readInt();
+		HashMap ranges = new HashMap(size);
+		for(int i = 0; i < size; ++i) {
+			Position javaPos = new Position(in.readInt(), in.readInt());
+			if(in.readBoolean()) {
+				javaPos.delete();
+			}
+			
+			//if the jspPos was null for some reason then -1 was written for length and offset
+			Position jspPos = null;
+			int jspPosOffset = in.readInt();
+			int jspPosLength = in.readInt();
+			if(jspPosOffset != -1 && jspPosLength != -1) {
+				jspPos = new Position(jspPosOffset, jspPosLength);
+			}
+			
+			//only read a boolean if the jspPos was not null
+			if(jspPos != null && in.readBoolean()) {
+				jspPos.delete();
+			}
+			
+			ranges.put(javaPos, jspPos);
+		}
+		
+		return ranges;
+	}
+	
+	/**
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	public boolean equals(Object obj) {
+		boolean equal = false;
+		if(obj instanceof JSPTranslator) {
+			JSPTranslator other = (JSPTranslator)obj;
+			equal = this.fClassHeader.equals(other.fClassHeader) &&
+				this.fClassname.equals(other.fClassname) &&
+				this.fSuperclass.equals(other.fSuperclass) &&
+				this.fImplicitImports.equals(other.fImplicitImports) &&
+				this.fServiceHeader.equals(other.fServiceHeader) &&
+				buffersEqual(this.fUserImports, other.fUserImports) &&
+				this.fSourcePosition == other.fSourcePosition &&
+				this.fRelativeOffset == other.fRelativeOffset &&
+				this.fCursorPosition == other.fCursorPosition &&
+				this.fIsErrorPage == other.fIsErrorPage &&
+				this.fCursorInExpression == other.fCursorInExpression &&
+				this.fIsInASession == other.fIsInASession &&
+				buffersEqual(this.fUserCode, other.fUserCode) &&
+				buffersEqual(this.fUserELExpressions, other.fUserELExpressions) &&
+				buffersEqual(this.fUserDeclarations, other.fUserDeclarations) &&
+				buffersEqual(this.fCursorOwner, other.fCursorOwner) &&
+				this.fInCodeRegion == other.fInCodeRegion &&
+				this.fProcessIncludes == other.fProcessIncludes &&
+				this.fOffsetInUserImports == other.fOffsetInUserImports &&
+				this.fOffsetInUserDeclarations == other.fOffsetInUserDeclarations &&
+				this.fOffsetInUserCode == other.fOffsetInUserCode &&
+				rangesEqual(this.fImportRanges, other.fImportRanges) &&
+				rangesEqual(this.fCodeRanges, other.fCodeRanges) &&
+				rangesEqual(this.fDeclarationRanges, other.fDeclarationRanges) &&
+				rangesEqual(this.fUseBeanRanges, other.fUseBeanRanges) &&
+				rangesEqual(this.fUserELRanges, other.fUserELRanges) &&
+				rangesEqual(this.fIndirectRanges, other.fIndirectRanges) &&
+				(
+					(this.fELTranslatorID != null && other.fELTranslatorID != null) ||
+					(this.fELTranslatorID == null && other.fELTranslatorID != null && other.fELTranslatorID.length() == 0) ||
+					(this.fELTranslatorID != null && this.fELTranslatorID.length() == 0 && other.fELTranslatorID == null) ||
+					(this.fELTranslatorID.equals(other.fELTranslator))
+				);
+		}
+		return equal;
+	}
+	
+	/**
+	 * <p><code>null</code> is considered equivlent to an empty buffer</p>
+	 * 
+	 * @param buff1 can be <code>null</code>
+	 * @param buff2 can be <code>null</code>
+	 * @return <code>true</code> if the two given buffers are equal, <codee>false</code> otherwise
+	 */
+	private static boolean buffersEqual(StringBuffer buff1, StringBuffer buff2) {
+		return (buff1 == null && buff2 == null) ||
+			(buff1 != null && buff2!= null && buff1.toString().equals(buff2.toString())) ||
+			(buff1 == null && buff2 != null && buff2.length() == 0) ||
+			(buff1 != null && buff1.length() == 0 && buff2 == null);
+	}
+	
+	/**
+	 * @param ranges1
+	 * @param ranges2
+	 * @return <code>true</code> if the two maps of ranges contains the same key/value pares,
+	 * <code>false</code> otherwise
+	 */
+	private static boolean rangesEqual(HashMap ranges1, HashMap ranges2) {
+		//this is a strange hack because Position is not designed to be used as keys in a Map, see Position doc
+		HashMap temp = new HashMap();
+		temp.putAll(ranges1);
+		ranges1 = temp;
+		
+		boolean equal = false;
+		if(ranges1 != null && ranges2 != null) {
+			equal = true;
+			Iterator ranges1Keys = ranges1.keySet().iterator();
+			while(ranges1Keys.hasNext() && equal) {
+				Position key = (Position)ranges1Keys.next();
+				Position ranges1Value = (Position)ranges1.get(key);
+				Position ranges2Value = (Position)ranges2.get(key);
+				equal = ranges1Value.equals(ranges2Value);
+			}
+		}
+		
+		return equal;
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslatorPersister.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslatorPersister.java
new file mode 100644
index 0000000..5cafc54
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslatorPersister.java
@@ -0,0 +1,529 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.core.internal.java;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InvalidClassException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.LinkedList;
+import java.util.zip.CRC32;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
+import org.eclipse.jst.jsp.core.internal.Logger;
+import org.eclipse.jst.jsp.core.internal.modelhandler.ModelHandlerForJSP;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+/**
+ * <p>This {@link IResourceChangeListener} is used to keep the {@link JSPTranslator}s for JSP
+ * resources persisted to disk.  It can also be used to get persisted translators</p>
+ * <p>This class should be registered as an {@link IResourceChangeListener} on the Workspace
+ * as well as processing resource change events from a saved state, for example use see below.<p>
+ * <p><b>Plugin Activation:</b>
+ * <pre>
+ * try {
+ *   ISavedState savedState = ResourcesPlugin.getWorkspace().addSaveParticipant(
+ *     plugin.getBundle().getSymbolicName(), this.fSaveParticipant);
+ *   if (savedState != null) {
+ *     savedState.processResourceChangeEvents(JSPTranslatorPersistor.getDefault());
+ *   }
+ * } catch(CoreException e) {}
+ * ResourcesPlugin.getWorkspace().addResourceChangeListener(JSPTranslatorPersistor.getDefault());
+ * </pre>
+ * <b>Plugin Deactivation:</b>
+ * <pre>
+ * ResourcesPlugin.getWorkspace().removeSaveParticipant(plugin.getBundle().getSymbolicName());
+ * ResourcesPlugin.getWorkspace().removeResourceChangeListener(JSPTranslatorPersistor.getDefault());
+ * </pre></p>
+ * 
+ * <p>This class can be deactivated through the <code>persistJSPTranslations</code> system property,
+ * a value of <code>true</code> means the persister is activated (which is the default), value of
+ * <code>false</code> means the persister is not activated.</p>
+ */
+public class JSPTranslatorPersister implements IResourceChangeListener {
+	/**
+	 * <code>true</code> if the persister is activated, <code>false</code>
+	 * otherwise.  This is determined by checking the system property
+	 * <code>persistJSPTranslations</code>, if no value supplied then
+	 * default is <code>true</code>
+	 */
+	public static final boolean ACTIVATED =
+		Boolean.valueOf(System.getProperty("persistJSPTranslations", "true")).booleanValue(); //$NON-NLS-1$ //$NON-NLS-2$
+	
+	/** the location where {@link JSPTranslator}s are externalized too for persistence purposes */
+	private static final IPath PERSIST_LOCATION = JSPCorePlugin.getDefault().getStateLocation().append("translators"); //$NON-NLS-1$
+	
+	/** used to calculate persisted translator file names */
+	private static final CRC32 CHECKSUM_CALC = new CRC32();
+	
+	/** singleton instance of the {@link JSPTranslatorPersister} */
+	private static final JSPTranslatorPersister INSTANCE = new JSPTranslatorPersister();
+	
+	/**
+	 * Used to handle resource change events
+	 * @see #resourceChanged(IResourceChangeEvent)
+	 */
+	private IResourceDeltaVisitor fResourceDeltaVisitor;
+	
+	/** {@link Job} that actually does all the persisting */
+	protected PersisterJob fPersisterJob;
+	
+	/**
+	 * <p>Private singleton default constructor</p>
+	 */
+	private JSPTranslatorPersister() {
+		this.fResourceDeltaVisitor = new JSPResourceVisitor();
+		this.fPersisterJob = new PersisterJob();
+	}
+	
+	/**
+	 * <p><b>NOTE: </b><i>This can possible return <code>null</code></i></p>
+	 * 
+	 * @return Singleton instance of the {@link JSPTranslatorPersister} if
+	 * {@link #ACTIVATED} is <code>true</code>, <code>null</code> otherwise.
+	 */
+	public static JSPTranslatorPersister getDefault() {
+		return ACTIVATED ? INSTANCE : null;
+	}
+	
+	/**
+	 * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
+	 */
+	public void resourceChanged(IResourceChangeEvent event) {
+		switch(event.getType()) {
+			case IResourceChangeEvent.PRE_CLOSE:
+			case IResourceChangeEvent.PRE_DELETE:
+				//pre-close or pre-delete stop the persister job so it does not interfere
+				this.fPersisterJob.stop();
+				break;
+			case IResourceChangeEvent.POST_CHANGE:
+				//post change start up the persister job and process the delta
+				this.fPersisterJob.start();
+				
+				// only analyze the full (starting at root) delta hierarchy
+				IResourceDelta delta = event.getDelta();
+				if (delta != null && delta.getFullPath().toString().equals("/")) { //$NON-NLS-1$
+					try {
+						//use visitor to visit all children
+						delta.accept(this.fResourceDeltaVisitor, false);
+					} catch (CoreException e) {
+						Logger.logException("Processing resource change event delta failed, " +
+								"persisted JSPTranslators may not have been updated.", e);
+					}
+				}
+				break;
+		}
+	}
+	
+	/**
+	 * <p>Given the {@link IStructuredModel} of a JSP file attempts to retrieve the persisted
+	 * {@link JSPTranslator} for that model.</p>
+	 * <p><b>NOTE: </b><i>It is possible for there not to be a persisted translator</i></p>
+	 * 
+	 * @param model {@link IStructuredModel} to get the persisted {@link JSPTranslator} for
+	 * @return the persisted {@link JSPTranslator} for the given <code>model</code>, or
+	 * <code>null</code> if none could be found or an existing one could not be read
+	 */
+	public static JSPTranslator getPersistedTranslator(IStructuredModel model) {
+		String persistedTranslatorFilePath = getPersistedTranslatorFilePath(model.getBaseLocation());
+		File persistedTranslatorFile = new File(persistedTranslatorFilePath);
+		
+		//attempt to read in the externalized translator
+		JSPTranslator translator = null;
+		ObjectInputStream in = null;
+		try {
+			//get the persisted translator file if one exists
+			if(persistedTranslatorFile.exists()) {
+				long persistedTranslatorFileTimestamp = persistedTranslatorFile.lastModified();
+				long jspFileTimestamp = FileBufferModelManager.getInstance().getBuffer(
+						model.getStructuredDocument()).getModificationStamp();
+				
+				/* if the persisted translator timestamp is newer then the jsp file timestamp
+				 * then the translation has not become stale, otherwise it has so delete
+				 * it and don't use it */
+				if(persistedTranslatorFileTimestamp > jspFileTimestamp) {
+					FileInputStream fis = new FileInputStream(persistedTranslatorFile);
+					in = new ObjectInputStream(fis);
+					translator = (JSPTranslator)in.readObject();
+					
+					//do post read external setup
+					if(translator != null) {
+						translator.postReadExternalSetup(model);
+					}
+				} else {
+					persistedTranslatorFile.delete();
+				}
+			}
+		} catch(InvalidClassException e) {
+			/* this means that the externalized translator is for an older version
+			 * of the JSPTranslator, so delete it */
+			persistedTranslatorFile.delete();
+		}catch (IOException e) {
+			Logger.logException("Could not read externalized JSPTranslator at " + persistedTranslatorFilePath, e); //$NON-NLS-1$
+		} catch (ClassNotFoundException e) {
+			Logger.logException("Class of a serialized JSPTranslator cannot be found", e); //$NON-NLS-1$
+		} finally {
+			if(in != null) {
+				try {
+					in.close();
+				} catch (IOException e) {
+					Logger.logException("Could not close externalized JSPTranslator that was just read", e); //$NON-NLS-1$
+				}
+			}
+		}
+		
+		return translator;
+	}
+	
+	/**
+	 * <p>Given the path to a JSP file determines the path to its persisted {@link JSPTranslator}</p>
+	 * 
+	 * @param jspFilePath {@link IPath} to JSP file for which the path to its persisted {@link JSPTranslator}
+	 * should be determined
+	 * 
+	 * @return OS file path to the persisted {@link JSPTranslator} associated with the JSP file at
+	 * <code>jspFilePath</code>
+	 */
+	protected static String getPersistedTranslatorFilePath(String jspFilePath) {
+		CHECKSUM_CALC.reset();
+		CHECKSUM_CALC.update(jspFilePath.getBytes());
+		String persistedTranslatorFileName = Long.toString(CHECKSUM_CALC.getValue()) + ".translator"; //$NON-NLS-1$
+		IPath location = PERSIST_LOCATION;
+		
+		// ensure the folder exists on disk
+        File folder = new File(location.toOSString());
+		if (!folder.isDirectory()) {
+			try {
+				folder.mkdir();
+			}
+			catch (SecurityException e) {
+			}
+		}
+		
+		location = location.addTrailingSeparator();
+		location = location.append(persistedTranslatorFileName);
+		return location.toOSString();
+	}
+	
+	/**
+	 * @see JSPResourceVisitor#visit(IResourceDelta)
+	 */
+	private class JSPResourceVisitor implements IResourceDeltaVisitor {
+		/**
+		 * <p>Default constructor</p>
+		 */
+		protected JSPResourceVisitor() {
+		}
+		
+		/**
+		 * <p>For each {@link IResourceDelta} determine if its a JSP resource and if it is
+		 * add the appropriate action to the {@link PersisterJob} so as not to hold up
+		 * the {@link IResourceDelta}</p>
+		 * 
+		 * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
+		 */
+		public boolean visit(IResourceDelta delta) throws CoreException {
+			if(isJSPResource(delta.getResource())) {
+				switch (delta.getKind()) {
+					case IResourceDelta.CHANGED :
+					case IResourceDelta.ADDED : {
+						/* if a move, then move the persisted translation
+						 * else create a new persisted translation, if its a change then
+						 *   the old persisted translation will be overwritten */
+						if((delta.getFlags() & IResourceDelta.MOVED_FROM) != 0) {
+							final File from = getPersistedFile(delta.getMovedFromPath());
+							final File to = getPersistedFile(delta.getFullPath());
+							//add the move action to the persister job
+							JSPTranslatorPersister.this.fPersisterJob.addAction(new ISafeRunnable() {
+								public void run() throws Exception {
+									renamePersistedTranslator(from, to);
+								}
+
+								public void handleException(Throwable exception) {}
+							});
+						} else {
+							final String filePath = getPersistedTranslatorFilePath(delta.getFullPath().toPortableString());
+							final IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(delta.getFullPath());
+							//add the add action to the persister job
+							JSPTranslatorPersister.this.fPersisterJob.addAction(new ISafeRunnable() {
+								public void run() throws Exception {
+									JSPTranslator translator = getJSPTranslator(file);
+									if(translator != null) {
+										persistTranslator(translator, filePath);
+									}
+								}
+
+								public void handleException(Throwable exception) {}
+							});
+						}
+						
+						break;
+					}
+					case IResourceDelta.REMOVED : {
+						/* only remove if its not a move,
+						 * if it is a move the added file delta event will move translation */
+						if((delta.getFlags() & IResourceDelta.MOVED_TO) == 0) {
+							final File file = getPersistedFile(delta.getFullPath());
+							//add the delete action to the persister job
+							JSPTranslatorPersister.this.fPersisterJob.addAction(new ISafeRunnable() {
+								public void run() throws Exception {
+									deletePersistedTranslator(file);
+								}
+
+								public void handleException(Throwable exception) {}
+							});
+						}
+						break;
+					}
+				}
+			}
+			
+			//visit children deltas
+			return true;
+		}
+		
+		/**
+		 * <p>Determines if an {@link IResource} is a JSP resource</p>
+		 * 
+		 * @param resource determine if this {@link IResource} is a JSP resource
+		 * @return <code>true</code> if <code>resource</code> is a JSP resource,
+		 * <code>false</code> otherwise.
+		 */
+		private boolean isJSPResource(IResource resource) {
+			boolean isJSP = false;
+			
+			//general rule for getting files in the workspace
+			if(resource.getFullPath().segmentCount() >= 2) {
+				IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(resource.getFullPath());
+				if(file.getType() == IResource.FILE) {
+					//get JSP content type each time because there is a possibility it could change
+					IContentType contentTypeJSP = Platform.getContentTypeManager().getContentType(
+							ContentTypeIdForJSP.ContentTypeID_JSP);
+					
+					isJSP = contentTypeJSP.isAssociatedWith(file.getName());
+				}
+			}
+			
+			return isJSP;
+		}
+		
+		/**
+		 * <p>Gets the associated {@link JSPTranslator} for a specific JSP file.</p>
+		 * <p><b>NOTE: </b><i>This does not get the persisted translator but rather the
+		 * associated translator in memory</i></p>
+		 * 
+		 * @param jspFile {@link IFile} to the JSP file that the associated {@link JSPTranslator}
+		 * is needed for
+		 * @return {@link JSPTranslator} associated with the given <code>jspFilePath</code>, or
+		 * <code>null</code> if none can be found.
+		 */
+		protected JSPTranslator getJSPTranslator(IFile jspFile) {
+			IStructuredModel model = null;
+			JSPTranslator translator = null;
+			try {
+				model = StructuredModelManager.getModelManager().getModelForRead(jspFile);
+				if(model instanceof IDOMModel) {
+					IDOMDocument doc = ((IDOMModel)model).getDocument();
+					ModelHandlerForJSP.ensureTranslationAdapterFactory(model);
+					JSPTranslationAdapter adapter = (JSPTranslationAdapter)doc.getAdapterFor(IJSPTranslation.class);
+					
+					//don't want to persist a translator that has not already been requested
+					if(adapter != null && adapter.hasTranslation()) {
+						translator = adapter.getJSPTranslation().getTranslator();
+					}
+				}
+			} catch (IOException e) {
+				Logger.logException("Could not get translator for " + jspFile.getName() + //$NON-NLS-1$
+						" because could not read model for same.", e); //$NON-NLS-1$
+			} catch (CoreException e) {
+				Logger.logException("Could not get translator for " + jspFile.getName() + //$NON-NLS-1$
+						" because could not read model for same.", e); //$NON-NLS-1$
+			} finally {
+				if(model != null) {
+					model.releaseFromRead();
+				}
+			}
+			
+			return translator;
+		}
+		
+		/**
+		 * <p>Persists a {@link JSPTranslator} to disk for a specific JSP file</p>
+		 * 
+		 * @param translator {@link JSPTranslator} to persist to disk
+		 * @param jspFilePath {@link IPath} to the JSP file the given <code>translator</code> is for
+		 */
+		protected void persistTranslator(JSPTranslator translator, String filePath) {
+			try {
+				FileOutputStream fos = new FileOutputStream(filePath);
+				ObjectOutputStream out = new ObjectOutputStream(fos);
+				out.writeObject(translator);
+				out.close();
+			} catch (IOException e) {
+				Logger.logException("Was unable to externalize JSPTranslator " + translator + //$NON-NLS-1$
+						" to " + filePath, e); //$NON-NLS-1$
+			}
+		}
+		
+		/**
+		 * <p>Deletes a persisted translation for a JSP file that has been deleted</p>
+		 * 
+		 * @param jspFilePath {@link IPath} to the JSP file that has been deleted
+		 */
+		protected void deletePersistedTranslator(File file) {
+			file.delete();
+		}
+		
+		/**
+		 * <p>Renames a persisted translation for a JSP file that has moved</p>
+		 * 
+		 * @param jspPrevFilePath {@link IPath} to the previous location of JSP file</p>
+		 * @param jspNewFilePath {@link IPath} to new location of JSP file</p>
+		 */
+		protected void renamePersistedTranslator(File from, File to) {
+			//do the move
+			from.renameTo(to);
+		}
+
+		private File getPersistedFile(IPath path) {
+			return new File(getPersistedTranslatorFilePath(path.toPortableString()));
+		}
+	}
+	
+	/**
+	 * <p>{@link Job} responsible for reacting to {@link IResourceDelta} visited
+	 * by {@link JSPResourceVisitor}.  This way the actions that need to be taken
+	 * in reaction to the delta to not hold up the {@link IResourceChangeListener}
+	 * or the {@link IResourceDelta}.</p>
+	 *
+	 */
+	private class PersisterJob extends Job {
+		/** Length to delay when scheduling job */
+		private static final int DELAY = 500;
+		
+		/** 
+		 *  <code>{@link LinkedList}&lt{@link ISafeRunnable}&gt</code>
+		 * <p>The persister actions that have been queued up by the {@link JSPResourceVisitor}</p>
+		 */
+		private LinkedList fActions;
+		
+		/** Whether this job has been stopped or not */
+		private boolean fIsStopped;
+		
+		/**
+		 * <p>Sets job up as a system job</p>
+		 */
+		protected PersisterJob() {
+			super(JSPCoreMessages.Persisting_JSP_Translations);
+			this.setUser(false);
+			this.setSystem(true);
+			this.setPriority(Job.LONG);
+			
+			this.fActions = new LinkedList();
+			this.fIsStopped = false;
+		}
+		
+		/**
+		 * <p>Starts this job.  This has no effect if the job is already started.</p>
+		 * <p>This should be used in place of {@link Job#schedule()} to reset state
+		 * caused by calling {@link #stop()}</p>
+		 * 
+		 * @see #stop()
+		 */
+		protected synchronized void start() {
+			this.fIsStopped = false;
+			
+			//get the job running again depending on its current state
+			if(this.getState() == Job.SLEEPING) {
+				this.wakeUp(DELAY);
+			} else {
+				this.schedule(DELAY);
+			}
+		}
+		
+		/**
+		 * <p>Stops this job, even if it is running</p>
+		 * <p>This should be used in place of {@link Job#sleep()} because {@link Job#sleep()}
+		 * will not stop a job that is already running but calling this will stop this job
+		 * even if it is running. {@link #start()} must be used to start this job again</p>
+		 * 
+		 * @see #start()
+		 */
+		protected synchronized void stop() {
+			//sleep the job if it is waiting to run
+			this.sleep();
+			
+			//if job is already running will force it to stop
+			this.fIsStopped = true;
+		}
+		
+		/**
+		 * @param action {@link ISafeRunnable} containing a persister action to take
+		 * based on an {@link IResourceDelta} processed by {@link JSPResourceVisitor}
+		 */
+		protected void addAction(ISafeRunnable action) {
+			//add the action
+			synchronized (this.fActions) {
+				this.fActions.addLast(action);
+			}
+			
+			//if job has not been manually stopped, then start it
+			if(!this.fIsStopped) {
+				this.start();
+			}
+		}
+
+		/**
+		 * <p>Process the actions until there are none left</p>
+		 * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+		 */
+		protected IStatus run(IProgressMonitor monitor) {
+			/*  run so long as job has not been stopped,
+			 *monitor canceled, and have actions to process */
+			while(!this.fIsStopped && !monitor.isCanceled() && !this.fActions.isEmpty()) {
+				ISafeRunnable action;
+				synchronized (this.fActions) {
+					action = (ISafeRunnable)this.fActions.removeFirst();
+				}
+				
+				SafeRunner.run(action);
+			}
+			
+			return Status.OK_STATUS;
+		}
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/StackMap.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/StackMap.java
index ecd42a0..2412687 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/StackMap.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/StackMap.java
@@ -11,7 +11,10 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.core.internal.java;
 
+import java.util.Collection;
 import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.Map;
 import java.util.Stack;
 
@@ -121,4 +124,35 @@
 		}
 		return null;
 	}
+
+    /**
+	 * Returns the number of entries in this StackMap, the sum of the sizes of
+	 * every remembered stack.
+	 * 
+	 * @return the number of entries in this map.
+	 */
+	int size() {
+		int size = 0;
+		Iterator i = fInternalMap.values().iterator();
+		while (i.hasNext()) {
+			Collection c = (Collection) i.next();
+			size += c.size();
+		}
+		return size;
+	}
+
+	/**
+	 * Returns all of the values of this StackMap.
+	 * 
+	 * @return the values of every Stack within this StackMap.
+	 */
+	Collection values() {
+		Collection values = new LinkedList();
+		Iterator i = fInternalMap.values().iterator();
+		while (i.hasNext()) {
+			Collection c = (Collection) i.next();
+			values.addAll(c);
+		}
+		return values;
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/TagTranslationAdapterFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/TagTranslationAdapterFactory.java
index a43e906..4807976 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/TagTranslationAdapterFactory.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/TagTranslationAdapterFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,17 +11,22 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.core.internal.java;
 
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 
-public class TagTranslationAdapterFactory extends JSPTranslationAdapterFactory {
+public class TagTranslationAdapterFactory extends AbstractAdapterFactory {
 
+	// for debugging
+	static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jsptranslation")).booleanValue(); //$NON-NLS-1$;
+	
 	private TagTranslationAdapter fAdapter = null;
 
 	public TagTranslationAdapterFactory() {
-		super();
+		super(IJSPTranslation.class, true);
 	}
 
 	public INodeAdapterFactory copy() {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
index 0535b36..6ba3238 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,23 +13,26 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jst.jsp.core.internal.Logger;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
+import org.eclipse.jst.jsp.core.internal.encoding.JSPDocumentLoader;
 import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.jst.jsp.core.internal.util.FileContentCache;
-import org.eclipse.wst.sse.core.internal.document.StructuredDocumentFactory;
+import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
 import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
 import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.TagMarker;
+import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerRegistry;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
@@ -86,13 +89,30 @@
 
 	public void reset(String textToParse, int start) {
 		fStartOfTextToParse = start;
-		getLocalParser().reset(textToParse);
 		fTextToParse = textToParse;
 	}
 
 	public void forceParse() {
-		getLocalParser().getDocumentRegions();
-		fLocalParser = null;
+		String contents = fTextToParse;
+
+		IStructuredDocument document = (IStructuredDocument) new JSPDocumentLoader().createNewStructuredDocument();
+		if(contents != null && document != null) {		
+			// from outer class
+			List blockMarkers = this.fTranslator.getBlockMarkers();
+			// this adds the current markers from the outer class list
+			// to this parser so parsing works correctly
+			for (int i = 0; i < blockMarkers.size(); i++) {
+				addBlockMarker((BlockMarker) blockMarkers.get(i));
+			}
+			reset(contents);
+	
+			document.set(contents);
+			IStructuredDocumentRegion cursor = document.getFirstStructuredDocumentRegion();
+			while(cursor != null) {
+				nodeParsed(cursor);
+				cursor = cursor.getNext();
+			}
+		}
 	}
 
 	/*
@@ -100,41 +120,51 @@
 	 * 
 	 * @param filename @return
 	 */
-	public boolean parse(String filePath) {
-		getLocalParser().removeStructuredDocumentRegionHandler(this);
-		// from outer class
-		List blockMarkers = this.fTranslator.getBlockMarkers();
-		IStructuredDocument document = StructuredDocumentFactory.getNewStructuredDocumentInstance(getLocalParser());
-		String contents = getContents(filePath);
-		if (contents == null)
-			return false;
-		// this adds the current markers from the outer class list
-		// to this parser so parsing works correctly
-		for (int i = 0; i < blockMarkers.size(); i++) {
-			addBlockMarker((BlockMarker) blockMarkers.get(i));
+	public boolean parse(String filePathString) {
+		boolean parsed = false;
+		IStructuredDocument document = null;
+		String contents = null;
+
+		IPath filePath = new Path(filePathString);
+		IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
+		if (f == null || !f.isAccessible()) {
+			f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(filePath);
 		}
-		// RATLC01139770
-//		getLocalParser().getNestablePrefixes().addAll(((JSPSourceParser)fTranslator.getStructuredDocument().getParser()).getNestablePrefixes());
-		TLDCMDocumentManager documentManager = this.fTranslator.getTLDCMDocumentManager();
-		if (documentManager != null) {
-			List trackers = documentManager.getTaglibTrackers();
-			for (Iterator it = trackers.iterator(); it.hasNext();) {
-				TaglibTracker tracker = (TaglibTracker) it.next();
-				String prefix = tracker.getPrefix();
-				getLocalParser().getNestablePrefixes().add(new TagMarker(prefix));
+		if (f != null && f.isAccessible()) {
+			/*
+			 * using a real document allows us to pull out text in the
+			 * translator for dealing with TEI variables
+			 */
+			try {
+				IModelHandler handler = ModelHandlerRegistry.getInstance().getHandlerFor(f, false);
+				if (handler == null)
+					handler = ModelHandlerRegistry.getInstance().getHandlerForContentTypeId(ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT);
+				document = (IStructuredDocument) handler.getDocumentLoader().createNewStructuredDocument();
+				contents = FileContentCache.getInstance().getContents(f.getFullPath());
+			}
+			catch (CoreException e) {
+				Logger.logException(e);
 			}
 		}
-
-		reset(contents);
-		// forceParse();
-		document.set(contents);
-		IStructuredDocumentRegion cursor = document.getFirstStructuredDocumentRegion();
-		while (cursor != null) {
-			nodeParsed(cursor);
-			cursor = cursor.getNext();
+		if (contents != null && document != null) {
+			// from outer class
+			List blockMarkers = this.fTranslator.getBlockMarkers();
+			// this adds the current markers from the outer class list
+			// to this parser so parsing works correctly
+			for (int i = 0; i < blockMarkers.size(); i++) {
+				addBlockMarker((BlockMarker) blockMarkers.get(i));
+			}
+			reset(contents);
+			// forces parse
+			document.set(contents);
+			IStructuredDocumentRegion cursor = document.getFirstStructuredDocumentRegion();
+			while (cursor != null) {
+				nodeParsed(cursor);
+				cursor = cursor.getNext();
+			}
+			parsed = true;
 		}
-		getLocalParser().addStructuredDocumentRegionHandler(this);
-		return true;
+		return parsed;
 	}
 
 
@@ -146,8 +176,6 @@
 	public void nodeParsed(IStructuredDocumentRegion sdRegion) {
 
 		try {
-
-			handleScopingIfNecessary(sdRegion);
 			if (isJSPEndRegion(sdRegion)) {
 				String nameStr = getRegionName(sdRegion);
 				if (isPossibleCustomTag(nameStr)) {
@@ -157,6 +185,9 @@
 				fTagname = null;
 			}
 			else if (isJSPStartRegion(sdRegion)) {
+				int illegalContent = hasIllegalContent(sdRegion);
+				if (illegalContent >= 0)
+					decodeRemainingRegions(sdRegion, illegalContent);
 				String nameStr = getRegionName(sdRegion);
 				if (sdRegion.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN) {
 					if (isPossibleCustomTag(nameStr)) {
@@ -174,7 +205,7 @@
 				// IS the opening tag
 
 				// handle include and directive
-				if (fTagname != null && sdRegion.getFirstRegion().getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN) {
+				if (fTagname != null) {
 					processOtherRegions(sdRegion);
 				}
 
@@ -202,6 +233,24 @@
 			}
 			else {
 				fTagname = null;
+				/*
+				 * We may have been asked to decode a script block with an XML
+				 * comment in it (a common provision for browsers not
+				 * supporting client scripting). While
+				 * scriptlets/expressions/declarations will be identified as
+				 * part of the normal parsing process, the temporary document
+				 * used here will be parsed differently, respecting the
+				 * comment since it's not in a tag block region any more, and
+				 * the custom tags in the comment will not be found. Run those
+				 * comment text pieces through the translator on their own.
+				 */
+				Iterator regions = sdRegion.getRegions().iterator();
+				while (regions.hasNext()) {
+					ITextRegion region = (ITextRegion) regions.next();
+					if (DOMRegionContext.XML_COMMENT_TEXT.equals(region.getType()) && region.getStart() != 0) {
+						fTranslator.decodeScriptBlock(sdRegion.getFullText(region), sdRegion.getStartOffset(region));
+					}
+				}
 			}
 			// this updates cursor position
 			checkCursorInRegion(sdRegion);
@@ -219,56 +268,27 @@
 		}
 	}
 
-
-	private void handleScopingIfNecessary(IStructuredDocumentRegion sdRegion) {
-		/* 199047 - Braces missing from translation of custom tags not defining variables */
-		// fix to make sure custom tag block have their own scope
-		// we add '{' for custom tag open and '}' for custom tag close
-		// in the translation
-		if (sdRegion.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN) {
-			if (!isSelfClosingTag(sdRegion)) {
-				String nameStr = getRegionName(sdRegion);
-				if (isPossibleCustomTag(nameStr)) {
-					startScope(nameStr);
-				}
-			}
-		}
-		else if (sdRegion.getFirstRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN) {
-			String nameStr = getRegionName(sdRegion);
-			if (isPossibleCustomTag(nameStr)) {
-				endScope(nameStr);
-			}
+	private void decodeRemainingRegions(IStructuredDocumentRegion sdRegion, int start) {
+		ITextRegionList regionList = sdRegion.getRegions();
+		if(regionList != null) {
+			ITextRegion region = regionList.get(start);
+			String text = sdRegion.getFullText();
+			if (text != null && region.getStart() <= text.length())
+				fTranslator.decodeScriptBlock(text.substring(region.getStart(), text.length()), 0);
 		}
 	}
 
-	private boolean isSelfClosingTag(ITextRegionCollection containerRegion) {
-
-		if (containerRegion == null)
-			return false;
-
-		ITextRegionList regions = containerRegion.getRegions();
-		ITextRegion r = regions.get(regions.size() - 1);
-		return r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE;
-	}
-
-	private void startScope(String tagName) {
-		IStructuredDocumentRegion currentNode = fTranslator.getCurrentNode();
-		StringBuffer text = new StringBuffer();
-		text.append("{ // <"); //$NON-NLS-1$
-		text.append(tagName);
-		text.append(">\n"); //$NON-NLS-1$
-		this.fTranslator.translateScriptletString(text.toString(), currentNode, currentNode.getStartOffset(), currentNode.getLength(), fAppendAsIndirectSource); //$NON-NLS-1$
-
-	}
-
-	private void endScope(String tagName) {
-		IStructuredDocumentRegion currentNode = fTranslator.getCurrentNode();
-		StringBuffer text = new StringBuffer();
-		text.append("} // </"); //$NON-NLS-1$
-		text.append(tagName);
-		text.append(">\n"); //$NON-NLS-1$
-		this.fTranslator.translateScriptletString(text.toString(), currentNode, currentNode.getStartOffset(), currentNode.getLength(), fAppendAsIndirectSource); //$NON-NLS-1$
-
+	private int hasIllegalContent(IStructuredDocumentRegion sdRegion) {
+		ITextRegionList list = sdRegion.getRegions();
+		for (int i = 0; i < list.size(); i++) {
+			ITextRegion region = list.get(i);
+			String type = region.getType();
+			if (type == DOMRegionContext.UNDEFINED)
+				return i;
+			if (type == DOMRegionContext.XML_END_TAG_OPEN || type == DOMRegionContext.XML_EMPTY_TAG_CLOSE || type == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE)
+				return -1;
+		}
+		return -1;
 	}
 
 	public void resetNodes() {
@@ -374,10 +394,6 @@
 			String fileLocation = getAttributeValue("file", sdRegion); //$NON-NLS-1$
 			this.fTranslator.handleIncludeFile(fileLocation);
 		}
-		else if (isPossibleCustomTag(fTagname)) {
-			// this custom tag may define variables
-			this.fTranslator.addTaglibVariables(fTagname);
-		}
 		else if (isTaglibDirective(fTagname)) {
 			// also add the ones created here to the parent document
 			String prefix = getAttributeValue("prefix", sdRegion); //$NON-NLS-1$
@@ -480,22 +496,23 @@
 	}
 
 	protected boolean isPossibleCustomTag(String tagName) {
-		int colonIndex = tagName.indexOf(":");
-		if (colonIndex > 0) {
-			String prefix = tagName.substring(0, colonIndex);
-			if (prefix.equals("jsp")) { //$NON-NLS-1$
-				return false;
-			}
-			if (prefix.length() > 0) {
-				TagMarker[] prefixes = (TagMarker[]) fLocalParser.getNestablePrefixes().toArray(new TagMarker[0]);
-				for (int i = 0; i < prefixes.length; i++) {
-					if (prefix.equals(prefixes[i].getTagName())) {
-						return true;
-					}
-				}
-			}
-		}
-		return false;
+//		int colonIndex = tagName.indexOf(":");
+//		if (colonIndex > 0) {
+//			String prefix = tagName.substring(0, colonIndex);
+//			if (prefix.equals("jsp")) { //$NON-NLS-1$
+//				return false;
+//			}
+//			if (prefix.length() > 0) {
+//				TagMarker[] prefixes = (TagMarker[]) fLocalParser.getNestablePrefixes().toArray(new TagMarker[0]);
+//				for (int i = 0; i < prefixes.length; i++) {
+//					if (prefix.equals(prefixes[i].getTagName())) {
+//						return true;
+//					}
+//				}
+//			}
+//		}
+//		return false;
+		return tagName.indexOf(':') > -1 && !tagName.startsWith(JSPTranslator.JSP_PREFIX);
 	}
 
 	protected boolean isTaglibDirective(String tagName) {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGenerator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGenerator.java
index ef40a9e..99a7bf9 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGenerator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGenerator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 BEA Systems and others.
+ * Copyright (c) 2005, 2010 BEA Systems and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,8 +12,10 @@
 
 package org.eclipse.jst.jsp.core.internal.java.jspel;
 
+import java.util.List;
 import java.util.Map;
 
+import org.eclipse.jst.jsp.core.jspel.ELProblem;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
@@ -30,16 +32,25 @@
     public ELGenerator() {
     } // constructor
 	
-
     /**
      * Check the netuiel AST and set diagnostics as necessary.
-     * @param translator TODO
-     * @param jspReferenceRegion TODO
-     * @param contentStart 
-     * @param contentLength 
+     * 
+     * @param root
+     * @param currentNode
+     * @param result
+     * @param codeMap
+     * @param document
+     * @param jspReferenceRegion
+     * @param contentStart
+     * @param contentLength
+     * @return a {@link List} of {@link ELProblem}s reported by the {@link ELGeneratorVisitor} this {@link ELGenerator} uses
      */
-    public void generate(ASTExpression root, IStructuredDocumentRegion currentNode, StringBuffer result, Map codeMap, IStructuredDocument document, ITextRegionCollection jspReferenceRegion, int contentStart, int contentLength) {
+    public List generate(ASTExpression root, IStructuredDocumentRegion currentNode, StringBuffer result, Map codeMap, IStructuredDocument document, ITextRegionCollection jspReferenceRegion, int contentStart, int contentLength) {
 		ELGeneratorVisitor visitor = new ELGeneratorVisitor(result, currentNode, codeMap, document, jspReferenceRegion, contentStart);
+		visitor.startFunctionDefinition(root.getFirstToken().beginColumn - 1);
 		root.jjtAccept(visitor, null);
+		visitor.endFunctionDefinition(root.getLastToken().endColumn - 1);
+		
+		return visitor.getELProblems();
     }
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGeneratorVisitor.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGeneratorVisitor.java
index d8cb3a2..f6ea3da 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGeneratorVisitor.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGeneratorVisitor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 BEA Systems and others.
+ * Copyright (c) 2005, 2010 BEA Systems and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,17 +15,27 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.core.internal.java.jspel;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jface.text.Position;
+import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
 import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentImpl;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDFunction;
+import org.eclipse.jst.jsp.core.jspel.ELProblem;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
@@ -36,7 +46,7 @@
 	
 	private static final String fExpressionHeader1 = "public String _elExpression"; //$NON-NLS-1$
 	private static final String fExpressionHeader2 = "()" + ENDL + //$NON-NLS-1$
-	"\t\tthrows java.io.IOException, javax.servlet.ServletException {" + ENDL + //$NON-NLS-1$
+	"\t\tthrows java.io.IOException, javax.servlet.ServletException, javax.servlet.jsp.JspException {" + ENDL + //$NON-NLS-1$
 	"javax.servlet.jsp.PageContext pageContext = null;" + ENDL + //$NON-NLS-1$
 	"java.util.Map param = null;" + ENDL + //$NON-NLS-1$
 	"java.util.Map paramValues = null;" + ENDL + //$NON-NLS-1$
@@ -48,7 +58,22 @@
 	"java.util.Map requestScope = null;" + ENDL + //$NON-NLS-1$
 	"java.util.Map sessionScope = null;" + ENDL + //$NON-NLS-1$
 	"java.util.Map applicationScope = null;" + ENDL + //$NON-NLS-1$
-	"return \"\"+"; //$NON-NLS-1$
+	"return \"\"+( "; //$NON-NLS-1$
+
+	private static final String fExpressionHeader2_param = "()" + ENDL + //$NON-NLS-1$
+	"\t\tthrows java.io.IOException, javax.servlet.ServletException, javax.servlet.jsp.JspException {" + ENDL + //$NON-NLS-1$
+	"javax.servlet.jsp.PageContext pageContext = null;" + ENDL + //$NON-NLS-1$
+	"java.util.Map<String, String> param = null;" + ENDL + //$NON-NLS-1$
+	"java.util.Map<String, String[]> paramValues = null;" + ENDL + //$NON-NLS-1$
+	"java.util.Map<String, String> header = null;" + ENDL + //$NON-NLS-1$ 
+	"java.util.Map<String, String[]> headerValues = null;" + ENDL + //$NON-NLS-1$
+	"java.util.Map<String, javax.servlet.http.Cookie> cookie = null;" + ENDL + //$NON-NLS-1$ 
+	"java.util.Map<String, String> initParam = null;" + ENDL + //$NON-NLS-1$
+	"java.util.Map<String, Object> pageScope = null;" + ENDL + //$NON-NLS-1$
+	"java.util.Map<String, Object> requestScope = null;" + ENDL + //$NON-NLS-1$
+	"java.util.Map<String, Object> sessionScope = null;" + ENDL + //$NON-NLS-1$
+	"java.util.Map<String, Object> applicationScope = null;" + ENDL + //$NON-NLS-1$
+	"return \"\"+( "; //$NON-NLS-1$
 	
 	private static final String fJspImplicitObjects[] = { "pageContext" }; //$NON-NLS-1$
 	
@@ -67,7 +92,7 @@
 		}
 	}
 	
-	private static final String fFooter = " ;" + ENDL + "}" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$
+	private static final String fFooter = " );" + ENDL + "}" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$
 
 	private StringBuffer fResult;
 	private Map fCodeMap;
@@ -76,13 +101,19 @@
 	private IStructuredDocument fDocument = null;
 	private int fContentStart;
 	private static Map fOperatorMap;
-	
+	// start of the generated function definition, if any:
+	private int fGeneratedFunctionStart;
+
 	// this flag lets us know if we were unable to generate for some reason.  One possible reason is that the expression 
 	// contains a reference to a variable for which information is only available at runtime.
 	private boolean fCanGenerate = true;
 
 	private IStructuredDocumentRegion fCurrentNode;
 
+	private boolean fUseParameterizedTypes;
+
+	private List fELProblems;
+
 	/**
 	 * Tranlsation of XML-style operators to java
 	 */
@@ -116,6 +147,9 @@
 		fContentStart = contentStart;
 		fDocument = document;
 		fCurrentNode = currentNode;
+		fGeneratedFunctionStart = -1; //set when generating function definition
+		fUseParameterizedTypes = compilerSupportsParameterizedTypes();
+		fELProblems = new ArrayList();
 	}
 
 	/**
@@ -191,7 +225,10 @@
 				for(Iterator it = functions.iterator(); it.hasNext(); ) {
 					TLDFunction function = (TLDFunction)it.next();
 					if(function.getName().equals(functionName)) {
-						return function.getClassName() + "." + function.getName(); //$NON-NLS-1$
+						String javaFuncName = getFunctionNameFromSignature(function.getSignature());
+						if (javaFuncName == null)
+							javaFuncName = functionName;
+						return function.getClassName() + "." + javaFuncName; //$NON-NLS-1$
 					}
 				}
 			}
@@ -214,24 +251,63 @@
 	 * Handle top-level expression
 	 */
 	public Object visit(ASTExpression node, Object data) {
-		int start = node.getFirstToken().beginColumn - 1;
-		int end = node.lastToken.endColumn - 1;
-		append(fExpressionHeader1, start, start);
-		append(Integer.toString(getMethodCounter()), start, start);
-		append(fExpressionHeader2, start, start);
-		
-		Object retval = node.childrenAccept(this, data);
-
-		append(fFooter, end, end);
-		
-		// something is preventing good code generation so empty out the result and the map.
-		if(!fCanGenerate) {
-			fResult.delete(0, fResult.length());
-			fCodeMap.clear();			
-		}
-		return retval;
+		return node.childrenAccept(this, data);
 	}
 
+	public void startFunctionDefinition(int start) {
+		fGeneratedFunctionStart = fResult.length();
+		append(fExpressionHeader1, start, start);
+		append(Integer.toString(getMethodCounter()), start, start);
+		if (fUseParameterizedTypes)
+			append(fExpressionHeader2_param, start, start);
+		else
+			append(fExpressionHeader2, start, start);
+	}
+
+	public void endFunctionDefinition(int end) {
+		if (fGeneratedFunctionStart < 0) {
+			throw new IllegalStateException("Cannot end function definition because none has been started."); //$NON-NLS-1$
+		}
+		append(fFooter, end, end);
+
+		// something is preventing good code generation so empty out the result
+		// and the map.
+		if (!fCanGenerate) {
+			fResult.delete(fGeneratedFunctionStart, fResult.length());
+			fOffsetInUserCode = fResult.length();
+			// remove all fCodeMap entries for the removed code:
+			for (Iterator it = fCodeMap.entrySet().iterator(); it.hasNext();) {
+				Map.Entry entry = (Entry) it.next();
+				if (entry.getKey() instanceof Position) {
+					Position pos = (Position) entry.getKey();
+					if (pos.getOffset() >= fGeneratedFunctionStart) {
+						it.remove();
+					}
+				}
+			}
+		}
+		fGeneratedFunctionStart = -1;
+	}
+
+
+	private boolean compilerSupportsParameterizedTypes() {
+		if (fDocument != null) {
+			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+			IPath location = TaglibController.getLocation(fDocument);
+			if (location != null && location.segmentCount() > 0) {
+				IJavaProject project = JavaCore.create(root.getProject(location.segment(0)));
+				String compliance = project.getOption(JavaCore.COMPILER_SOURCE, true);
+				try {
+					return Float.parseFloat(compliance) >= 1.5;
+				}
+				catch (NumberFormatException e) {
+					return false;
+				}
+			}
+		}
+		return false;
+	}
+	
 	/**
 	 * Generically generate an operator node.
 	 * 
@@ -364,8 +440,9 @@
 			if(node.jjtGetChild(0) instanceof ASTValuePrefix && node.jjtGetChild(1) instanceof ASTValueSuffix) {
 				ASTValuePrefix prefix = (ASTValuePrefix) node.jjtGetChild(0);
 				ASTValueSuffix suffix = (ASTValueSuffix) node.jjtGetChild(1);
-				if(prefix.firstToken.image.equals("pageContext") && suffix.getPropertyNameToken().image.equals("request")) {
-					append("((HTTPServletRequest)");
+				//content assist can cause a null pointer here without the extra null check
+				if(prefix.firstToken.image.equals("pageContext") && suffix.getPropertyNameToken() != null && suffix.getPropertyNameToken().image.equals("request")) {
+					append("((HttpServletRequest)");
 				}
 			}
 		}
@@ -378,7 +455,7 @@
 	 */
 	public Object visit(ASTValuePrefix node, Object data) {
 		// this is a raw identifier.  May sure it's an implicit object.
-		// This is the primary plae where modification is needed to 
+		// This is the primary place where modification is needed to 
 		// support JSF backing beans.
 		if(null == node.children) {
 			if(isCompletingObject(node.firstToken.image)) {
@@ -426,7 +503,10 @@
 				append(")");
 			} 
 
-
+		} else if(node.getLastToken().image.equals(".") && node.getLastToken().next.image.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$
+			//this allows for content assist in the case of something along the lines of "pageContext." and then ctl-space
+			append(node.firstToken);
+			append("get()", node.getLastToken().beginColumn, node.getLastToken().beginColumn); //$NON-NLS-1$
 		} else {
 			append(node.firstToken);
 		}
@@ -439,26 +519,143 @@
 	 */
 	public Object visit(ASTFunctionInvocation node, Object data) {
 		String functionTranslation = genFunction(node.getFullFunctionName());
-		if(null != functionTranslation)
-		{
-			append(functionTranslation + "(", node.getFirstToken()); //$NON-NLS-1$
-			for(int i = 0; i < node.children.length; i++) {
-				node.children[i].jjtAccept(this, data);
-				if( node.children.length - i > 1){
-					append(","); //$NON-NLS-1$
+		if(null != functionTranslation) {
+
+			//find the token representing the function name
+			Token jspFuncNameToken = getJSPFuncNameToken(node);
+			
+			/* if there is a dot in the function name then separate out the class path
+			 * from the function name and append.
+			 * else just append
+			 * in both cases use the jsp function name token as the mapped token
+			 */
+			int indexOfDot = functionTranslation.lastIndexOf('.');
+			if(indexOfDot != -1) {
+				String funcClass = functionTranslation.substring(0,indexOfDot+1);
+				String funcName = functionTranslation.substring(indexOfDot+1);
+				append(funcClass, jspFuncNameToken);
+				append(funcName, jspFuncNameToken);
+			} else {
+				append(functionTranslation, jspFuncNameToken);
+			}
+			
+			//append any parameters
+			append("(");
+			if(node.children != null) {
+				for(int i = 0; i < node.children.length; i++) {
+					node.children[i].jjtAccept(this, data);
+					if( node.children.length - i > 1){
+						append(","); //$NON-NLS-1$
+					}
 				}
 			}
 			append(")"); //$NON-NLS-1$
 		}
+		else {
+			//column offsets are 1 based not 0 based, thus subtract one
+			final int problemOffset = fContentStart + node.getFirstToken().beginColumn - 1;
+			final int problemLength = node.getLastToken().endColumn - 1;
+
+			//could not find function translation so report error
+			fELProblems.add(new ELProblem(new Position(problemOffset, problemLength), NLS.bind(JSPCoreMessages.JSPELTranslator_0, node.getFullFunctionName())));
+			
+			//error message to be injected into translation purely for debugging purposes
+			String errorMsg = "\"Could not find function translation for: " + node.getFullFunctionName() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
+			append(errorMsg);
+ 		}
 		return null;
 	}
 
 	/**
+	 * @return the {@link ELProblem}s found by this visitor
+	 */
+	public List getELProblems() {
+		return fELProblems;
+	}
+
+	/**
 	 * Literal
 	 */
 	public Object visit(ASTLiteral node, Object data) {
-		// TODO any further translation needed?
+		if (isSingleQuotedStringLiteral(node)) {
+			//replace the single quotes with double quotes quotes
+			//so java compiler will be happy
+			//(see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=104943)
+			String image = node.firstToken.image;
+			image = "\"" + image.substring(1, image.length()-1) + "\""; //$NON-NLS-1$ //$NON-NLS-2$
+			node.firstToken.image = image;
+		}
+		
 		append(node.firstToken);
 		return null;
 	}
+	
+	/**
+	 * Indicates whether the given ASTLiteral is a single quoted string literal,
+	 * As opposed to a double quoted ASTLiteral
+	 * 
+	 * @param node the ASTLiteral to check to see if it is single quoted
+	 * 
+	 * @return true, if the given token is a single quoted string literal,
+	 * false otherwise
+	 */
+	private static boolean isSingleQuotedStringLiteral(ASTLiteral node) {
+		String content = node.firstToken.image;
+		return content.length() > 1 && content.startsWith("'") && content.endsWith("'"); //$NON-NLS-1$ // $NON-NLS-2$
+	}
+
+	/**
+	 * <p>Given a method signature parse out the method name and return it.
+	 * The method name in the signature is found by finding a word with
+	 * whitespace before it and a '<code>(</code>' after it.</p>
+	 * 
+	 * @param methodSignature the signature of the method to get the method name out of.
+	 * @return the method name from the given signature, or <code>null</code> if it
+	 * can not be found.
+	 */
+	private static String getFunctionNameFromSignature (String methodSignature) {
+		int length = methodSignature.length();
+		char c = 0;
+		int identifierStart = -1;
+		int whitespaceStart = -1;
+		// keep track of the index of the last identifier before the (
+		for (int i = 0; i < length; i++) {
+			c = methodSignature.charAt(i);
+			if (Character.isJavaIdentifierPart(c) && whitespaceStart >= identifierStart)
+				identifierStart = i;
+			else if (Character.isWhitespace(c))
+				whitespaceStart = i;
+			else if (c == '(') {
+				if (identifierStart >= 0) {
+					return methodSignature.substring(identifierStart, i).trim();
+				}
+			}
+		}
+		return null;
+	}
+	
+	/**
+	 * Returns the {@link Token} the represents the function name in
+	 * the {@link ASTFunctionInvocation}. This is designated as the
+	 * first token after the {@link Token} whose image is ":".
+	 * If such a token can not be found then the first token of the
+	 * {@link ASTFunctionInvocation} is returned.
+	 * 
+	 * @param funcInvo the {@link ASTFunctionInvocation} to find the function name {@link Token} in
+	 * @return the {@link Token} in the given {@link ASTFunctionInvocation} that represents the
+	 * function name, or if that can't be found the first {@link Token} in the {@link ASTFunctionInvocation}.
+	 */
+	private Token getJSPFuncNameToken(ASTFunctionInvocation funcInvo) {
+		Token funcNameToken = funcInvo.getFirstToken();
+		
+		Token temp = funcInvo.getFirstToken();
+		do {
+			if(temp.image.equals(":")) {
+				funcNameToken = temp.next;
+			}
+		} while(temp.next != null && funcNameToken == null);
+			
+		
+		return funcNameToken;
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPEL.jj b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPEL.jj
index 0e383b4..57c3c74 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPEL.jj
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPEL.jj
@@ -1,4 +1,5 @@
-*******************************************************************************

+/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. JSPEL.jj */

+/*@egen*//*******************************************************************************

  * Copyright (c) 2005 BEA Systems and others.

  * All rights reserved. This program and the accompanying materials

  * are made available under the terms of the Eclipse Public License v1.0

@@ -9,8 +10,7 @@
  *     BEA Systems - initial implementation

  *     

  *******************************************************************************/

-/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. JSPEL.jj */

-/*@egen*//* I know that haing some of these options on one line is rude but 

+/* I know that having some of these options on one line is rude but 

  * if we don't do that the line number reported from javacc are off

  * which, trust me, is far more annoying.  --tcarroll@bea.com

  */

@@ -177,12 +177,12 @@
 {/*@bgen(jjtree) Expression */

         try {

 /*@egen*/

-        (LOOKAHEAD("?") ChoiceExpression() | OrExpression())/*@bgen(jjtree)*/

-                                                             {

-                                                               jjtree.closeNodeScope(jjtn000, true);

-                                                               jjtc000 = false;

-                                                               jjtreeCloseNodeScope(jjtn000);

-                                                             }

+        (LOOKAHEAD(ChoiceExpression()) ChoiceExpression() | OrExpression())/*@bgen(jjtree)*/

+                                                                            {

+                                                                              jjtree.closeNodeScope(jjtn000, true);

+                                                                              jjtc000 = false;

+                                                                              jjtreeCloseNodeScope(jjtn000);

+                                                                            }

 /*@egen*/ { return jjtn000; }/*@bgen(jjtree)*/

         } catch (Throwable jjte000) {

           if (jjtc000) {

@@ -545,7 +545,7 @@
 {/*@bgen(jjtree) ValuePrefix */

     try {

 /*@egen*/

-    Literal() | (<LPAREN> Expression() <RPAREN>) | LOOKAHEAD(3) FunctionInvocation() | <IDENTIFIER>/*@bgen(jjtree)*/

+    Literal() | (<LPAREN> (Expression())? <RPAREN>) | LOOKAHEAD(3) FunctionInvocation() | <IDENTIFIER>/*@bgen(jjtree)*/

     } catch (Throwable jjte000) {

       if (jjtc000) {

         jjtree.clearNodeScope(jjtn000);

@@ -631,7 +631,7 @@
             else if(null != name)

                     jjtn000.setFullFunctionName(name.image);

         }

-        (<LPAREN> Expression() (<COMMA> Expression())* try  { (<RPAREN>) } catch (Exception e) {} )?/*@bgen(jjtree)*/

+        (<LPAREN> (Expression())? (<COMMA> Expression())* try  { (<RPAREN>) } catch (Exception e) {} )?/*@bgen(jjtree)*/

     } catch (Throwable jjte000) {

       if (jjtc000) {

         jjtree.clearNodeScope(jjtn000);

diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPEL.jjt b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPEL.jjt
index 9fd40d9..677fbb9 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPEL.jjt
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPEL.jjt
@@ -1,4 +1,4 @@
-*******************************************************************************

+/*******************************************************************************

  * Copyright (c) 2005 BEA Systems and others.

  * All rights reserved. This program and the accompanying materials

  * are made available under the terms of the Eclipse Public License v1.0

@@ -166,7 +166,7 @@
 

 ASTExpression Expression() : {}

 {

-        (LOOKAHEAD("?") ChoiceExpression() | OrExpression()) { return jjtThis; }

+        (LOOKAHEAD(ChoiceExpression()) ChoiceExpression() | OrExpression()) { return jjtThis; }

 }

 

 void OrExpression() #OrExpression(>1) : 

@@ -248,7 +248,7 @@
 

 void ValuePrefix() : {}

 {

-    Literal() | (<LPAREN> Expression() <RPAREN>) | LOOKAHEAD(3) FunctionInvocation() | <IDENTIFIER> 

+    Literal() | (<LPAREN> (Expression())? <RPAREN>) | LOOKAHEAD(3) FunctionInvocation() | <IDENTIFIER> 

 }

 

 void ValueSuffix() : 

@@ -272,7 +272,7 @@
             else if(null != name)

                     jjtThis.setFullFunctionName(name.image);

         }

-        (<LPAREN> Expression() (<COMMA> Expression())* try  { (<RPAREN>) } catch (Exception e) {} )?

+        (<LPAREN> (Expression())? (<COMMA> Expression())* try  { (<RPAREN>) } catch (Exception e) {} )?

 }

 

 void Literal() : {}

diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELParser.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELParser.java
index 5c01bae..56e6425 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELParser.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELParser.java
@@ -65,10 +65,10 @@
           throw new ParseException();
         }
       }
-                                                               jjtree.closeNodeScope(jjtn000, true);
-                                                               jjtc000 = false;
-                                                               jjtreeCloseNodeScope(jjtn000);
-                                                               {if (true) return jjtn000;}
+      jjtree.closeNodeScope(jjtn000, true);
+      jjtc000 = false;
+      jjtreeCloseNodeScope(jjtn000);
+      {if (true) return jjtn000;}
     } catch (Throwable jjte000) {
           if (jjtc000) {
             jjtree.clearNodeScope(jjtn000);
@@ -105,7 +105,6 @@
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
         case OR1:
         case OR2:
-          
           break;
         default:
           jj_la1[1] = jj_gen;
@@ -161,7 +160,6 @@
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
         case AND1:
         case AND2:
-          
           break;
         default:
           jj_la1[3] = jj_gen;
@@ -219,7 +217,6 @@
         case EQ2:
         case NEQ1:
         case NEQ2:
-          
           break;
         default:
           jj_la1[5] = jj_gen;
@@ -287,7 +284,6 @@
         case LE2:
         case GE1:
         case GE2:
-          
           break;
         default:
           jj_la1[7] = jj_gen;
@@ -361,7 +357,6 @@
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
         case PLUS:
         case MINUS:
-          
           break;
         default:
           jj_la1[9] = jj_gen;
@@ -420,7 +415,6 @@
         case DIVIDE2:
         case MODULUS1:
         case MODULUS2:
-          
           break;
         default:
           jj_la1[11] = jj_gen;
@@ -588,7 +582,6 @@
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
         case DOT:
         case LBRACKET:
-          
           break;
         default:
           jj_la1[15] = jj_gen;
@@ -636,11 +629,28 @@
         break;
       case LPAREN:
         jj_consume_token(LPAREN);
-        Expression();
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+        case INTEGER_LITERAL:
+        case FLOATING_POINT_LITERAL:
+        case STRING_LITERAL:
+        case TRUE:
+        case FALSE:
+        case NULL:
+        case LPAREN:
+        case MINUS:
+        case NOT1:
+        case NOT2:
+        case EMPTY:
+        case IDENTIFIER:
+          Expression();
+          break;
+        default:
+          jj_la1[16] = jj_gen;
+        }
         jj_consume_token(RPAREN);
         break;
       default:
-        jj_la1[16] = jj_gen;
+        jj_la1[17] = jj_gen;
         if (jj_2_2(3)) {
           FunctionInvocation();
         } else {
@@ -649,7 +659,7 @@
             jj_consume_token(IDENTIFIER);
             break;
           default:
-            jj_la1[17] = jj_gen;
+            jj_la1[18] = jj_gen;
             jj_consume_token(-1);
             throw new ParseException();
           }
@@ -692,8 +702,7 @@
           t = jj_consume_token(IDENTIFIER);
           break;
         default:
-          jj_la1[18] = jj_gen;
-          
+          jj_la1[19] = jj_gen;
         }
                                       jjtree.closeNodeScope(jjtn000, true);
                                       jjtc000 = false;
@@ -706,7 +715,7 @@
         jj_consume_token(RBRACKET);
         break;
       default:
-        jj_la1[19] = jj_gen;
+        jj_la1[20] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -747,8 +756,7 @@
         name = jj_consume_token(IDENTIFIER);
         break;
       default:
-        jj_la1[20] = jj_gen;
-        
+        jj_la1[21] = jj_gen;
       }
             if(null != prefix && null != name)
                     jjtn000.setFullFunctionName(prefix.image + ":" + (null == name ? "" : name.image));
@@ -757,15 +765,31 @@
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
       case LPAREN:
         jj_consume_token(LPAREN);
-        Expression();
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+        case INTEGER_LITERAL:
+        case FLOATING_POINT_LITERAL:
+        case STRING_LITERAL:
+        case TRUE:
+        case FALSE:
+        case NULL:
+        case LPAREN:
+        case MINUS:
+        case NOT1:
+        case NOT2:
+        case EMPTY:
+        case IDENTIFIER:
+          Expression();
+          break;
+        default:
+          jj_la1[22] = jj_gen;
+        }
         label_8:
         while (true) {
           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
           case COMMA:
-            
             break;
           default:
-            jj_la1[21] = jj_gen;
+            jj_la1[23] = jj_gen;
             break label_8;
           }
           jj_consume_token(COMMA);
@@ -778,8 +802,7 @@
         }
         break;
       default:
-        jj_la1[22] = jj_gen;
-        
+        jj_la1[24] = jj_gen;
       }
     } catch (Throwable jjte000) {
       if (jjtc000) {
@@ -830,7 +853,7 @@
         jj_consume_token(NULL);
         break;
       default:
-        jj_la1[23] = jj_gen;
+        jj_la1[25] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -856,89 +879,439 @@
     finally { jj_save(1, xla); }
   }
 
-  final private boolean jj_3R_10() {
-    if (jj_scan_token(LPAREN)) return true;
+  final private boolean jj_3_1() {
+    if (jj_3R_9()) return true;
     return false;
   }
 
-  final private boolean jj_3R_9() {
+  final private boolean jj_3R_11() {
+    if (jj_3R_13()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_14()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  final private boolean jj_3R_34() {
+    if (jj_3R_37()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_38() {
+    if (jj_3R_9()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_37() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_38()) {
+    jj_scanpos = xsp;
+    if (jj_3R_39()) return true;
+    }
+    return false;
+  }
+
+  final private boolean jj_3R_10() {
     if (jj_scan_token(IDENTIFIER)) return true;
     if (jj_scan_token(COLON)) return true;
     Token xsp;
     xsp = jj_scanpos;
     if (jj_scan_token(47)) jj_scanpos = xsp;
     xsp = jj_scanpos;
-    if (jj_3R_10()) jj_scanpos = xsp;
+    if (jj_3R_12()) jj_scanpos = xsp;
+    return false;
+  }
+
+  final private boolean jj_3R_36() {
+    if (jj_scan_token(LBRACKET)) return true;
+    if (jj_3R_37()) return true;
+    if (jj_scan_token(RBRACKET)) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_29() {
+    if (jj_3R_32()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_31() {
+    if (jj_scan_token(LPAREN)) return true;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_34()) jj_scanpos = xsp;
+    if (jj_scan_token(RPAREN)) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_32() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_35()) {
+    jj_scanpos = xsp;
+    if (jj_3R_36()) return true;
+    }
+    return false;
+  }
+
+  final private boolean jj_3R_35() {
+    if (jj_scan_token(DOT)) return true;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(47)) jj_scanpos = xsp;
+    return false;
+  }
+
+  final private boolean jj_3R_28() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_30()) {
+    jj_scanpos = xsp;
+    if (jj_3R_31()) {
+    jj_scanpos = xsp;
+    if (jj_3_2()) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(47)) return true;
+    }
+    }
+    }
+    return false;
+  }
+
+  final private boolean jj_3R_30() {
+    if (jj_3R_33()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_27() {
+    if (jj_3R_28()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_29()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  final private boolean jj_3R_26() {
+    if (jj_3R_27()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_23() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_25()) {
+    jj_scanpos = xsp;
+    if (jj_3R_26()) return true;
+    }
+    return false;
+  }
+
+  final private boolean jj_3R_22() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(32)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(33)) return true;
+    }
+    if (jj_3R_21()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_25() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(39)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(40)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(33)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(45)) return true;
+    }
+    }
+    }
+    if (jj_3R_23()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_24() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(34)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(35)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(36)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(37)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(38)) return true;
+    }
+    }
+    }
+    }
+    if (jj_3R_23()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_9() {
+    if (jj_3R_11()) return true;
+    if (jj_scan_token(COND)) return true;
+    if (jj_3R_11()) return true;
+    if (jj_scan_token(COLON)) return true;
+    if (jj_3R_11()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_21() {
+    if (jj_3R_23()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_24()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  final private boolean jj_3R_39() {
+    if (jj_3R_11()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_19() {
+    if (jj_3R_21()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_22()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  final private boolean jj_3R_20() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(16)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(17)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(14)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(15)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(22)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(23)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(20)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(21)) return true;
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    if (jj_3R_19()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_16() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(41)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(42)) return true;
+    }
+    if (jj_3R_15()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_41() {
+    if (jj_scan_token(COMMA)) return true;
+    if (jj_3R_37()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_17() {
+    if (jj_3R_19()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_20()) { jj_scanpos = xsp; break; }
+    }
     return false;
   }
 
   final private boolean jj_3_2() {
-    if (jj_3R_9()) return true;
+    if (jj_3R_10()) return true;
     return false;
   }
 
-  final private boolean jj_3_1() {
-    if (jj_scan_token(COND)) return true;
+  final private boolean jj_3R_18() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(18)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(19)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(24)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(25)) return true;
+    }
+    }
+    }
+    if (jj_3R_17()) return true;
     return false;
   }
 
+  final private boolean jj_3R_15() {
+    if (jj_3R_17()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_18()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  final private boolean jj_3R_14() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(43)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(44)) return true;
+    }
+    if (jj_3R_13()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_40() {
+    if (jj_3R_37()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_13() {
+    if (jj_3R_15()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_16()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  final private boolean jj_3R_33() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(10)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(11)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(5)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(6)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(8)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(12)) return true;
+    }
+    }
+    }
+    }
+    }
+    return false;
+  }
+
+  final private boolean jj_3R_12() {
+    if (jj_scan_token(LPAREN)) return true;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_40()) jj_scanpos = xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_41()) { jj_scanpos = xsp; break; }
+    }
+    if (jj_scan_token(RPAREN)) return true;
+    return false;
+  }
+
+  /** Generated Token Manager. */
   public JSPELParserTokenManager token_source;
   SimpleCharStream jj_input_stream;
-  public Token token, jj_nt;
+  /** Current token. */
+  public Token token;
+  /** Next token. */
+  public Token jj_nt;
   private int jj_ntk;
   private Token jj_scanpos, jj_lastpos;
   private int jj_la;
-  public boolean lookingAhead = false;
-//  private boolean jj_semLA;
   private int jj_gen;
-  final private int[] jj_la1 = new int[24];
+  final private int[] jj_la1 = new int[26];
   static private int[] jj_la1_0;
   static private int[] jj_la1_1;
   static {
-      jj_la1_0();
-      jj_la1_1();
+      jj_la1_init_0();
+      jj_la1_init_1();
    }
-   private static void jj_la1_0() {
-      jj_la1_0 = new int[] {0x4001d60,0x0,0x0,0x0,0x0,0x30c0000,0x30c0000,0xf3c000,0xf3c000,0x0,0x0,0x0,0x0,0x0,0x4001d60,0x40002000,0x4001d60,0x0,0x0,0x40002000,0x0,0x10000000,0x4000000,0x1d60,};
+   private static void jj_la1_init_0() {
+      jj_la1_0 = new int[] {0x4001d60,0x0,0x0,0x0,0x0,0x30c0000,0x30c0000,0xf3c000,0xf3c000,0x0,0x0,0x0,0x0,0x0,0x4001d60,0x40002000,0x4001d60,0x4001d60,0x0,0x0,0x40002000,0x0,0x4001d60,0x10000000,0x4000000,0x1d60,};
    }
-   private static void jj_la1_1() {
-      jj_la1_1 = new int[] {0xa182,0x1800,0x1800,0x600,0x600,0x0,0x0,0x0,0x0,0x3,0x3,0x7c,0x7c,0x2182,0xa182,0x0,0x0,0x8000,0x8000,0x0,0x8000,0x0,0x0,0x0,};
+   private static void jj_la1_init_1() {
+      jj_la1_1 = new int[] {0xa182,0x1800,0x1800,0x600,0x600,0x0,0x0,0x0,0x0,0x3,0x3,0x7c,0x7c,0x2182,0xa182,0x0,0xa182,0x0,0x8000,0x8000,0x0,0x8000,0xa182,0x0,0x0,0x0,};
    }
   final private JJCalls[] jj_2_rtns = new JJCalls[2];
   private boolean jj_rescan = false;
   private int jj_gc = 0;
 
+  /** Constructor with InputStream. */
   public JSPELParser(java.io.InputStream stream) {
+     this(stream, null);
+  }
+  /** Constructor with InputStream and supplied encoding */
+  public JSPELParser(java.io.InputStream stream, String encoding) {
     jj_input_stream = new SimpleCharStream(stream, 1, 1);
     token_source = new JSPELParserTokenManager(jj_input_stream);
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 26; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
+  /** Reinitialise. */
   public void ReInit(java.io.InputStream stream) {
+     ReInit(stream, null);
+  }
+  /** Reinitialise. */
+  public void ReInit(java.io.InputStream stream, String encoding) {
     jj_input_stream.ReInit(stream, 1, 1);
     token_source.ReInit(jj_input_stream);
     token = new Token();
     jj_ntk = -1;
     jjtree.reset();
     jj_gen = 0;
-    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 26; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
+  /** Constructor. */
   public JSPELParser(java.io.Reader stream) {
     jj_input_stream = new SimpleCharStream(stream, 1, 1);
     token_source = new JSPELParserTokenManager(jj_input_stream);
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 26; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
+  /** Reinitialise. */
   public void ReInit(java.io.Reader stream) {
     jj_input_stream.ReInit(stream, 1, 1);
     token_source.ReInit(jj_input_stream);
@@ -946,26 +1319,28 @@
     jj_ntk = -1;
     jjtree.reset();
     jj_gen = 0;
-    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 26; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
+  /** Constructor with generated Token Manager. */
   public JSPELParser(JSPELParserTokenManager tm) {
     token_source = tm;
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 26; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
+  /** Reinitialise. */
   public void ReInit(JSPELParserTokenManager tm) {
     token_source = tm;
     token = new Token();
     jj_ntk = -1;
     jjtree.reset();
     jj_gen = 0;
-    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 26; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -1018,6 +1393,8 @@
     return false;
   }
 
+
+/** Get the next Token. */
   final public Token getNextToken() {
     if (token.next != null) token = token.next;
     else token = token.next = token_source.getNextToken();
@@ -1026,8 +1403,9 @@
     return token;
   }
 
+/** Get the specific Token. */
   final public Token getToken(int index) {
-    Token t = lookingAhead ? jj_scanpos : token;
+    Token t = token;
     for (int i = 0; i < index; i++) {
       if (t.next != null) t = t.next;
       else t = t.next = token_source.getNextToken();
@@ -1071,11 +1449,11 @@
           if (exists) break;
         }
       }
-      if (!exists) jj_expentries.addElement(jj_expentry);
       if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
     }
   }
 
+  /** Generate ParseException. */
   public ParseException generateParseException() {
     jj_expentries.removeAllElements();
     boolean[] la1tokens = new boolean[51];
@@ -1086,7 +1464,7 @@
       la1tokens[jj_kind] = true;
       jj_kind = -1;
     }
-    for (int i = 0; i < 24; i++) {
+    for (int i = 0; i < 26; i++) {
       if (jj_la1[i] == jj_gen) {
         for (int j = 0; j < 32; j++) {
           if ((jj_la1_0[i] & (1<<j)) != 0) {
@@ -1115,15 +1493,18 @@
     return new ParseException(token, exptokseq, tokenImage);
   }
 
+  /** Enable tracing. */
   final public void enable_tracing() {
   }
 
+  /** Disable tracing. */
   final public void disable_tracing() {
   }
 
   final private void jj_rescan_token() {
     jj_rescan = true;
     for (int i = 0; i < 2; i++) {
+    try {
       JJCalls p = jj_2_rtns[i];
       do {
         if (p.gen > jj_gen) {
@@ -1135,6 +1516,7 @@
         }
         p = p.next;
       } while (p != null);
+      } catch(LookaheadSuccess ls) { }
     }
     jj_rescan = false;
   }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELTranslator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELTranslator.java
index 745f9e6..c995a1a 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELTranslator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELTranslator.java
@@ -47,7 +47,8 @@
 			
 				ASTExpression expression = elParser.Expression();
 				ELGenerator gen = new ELGenerator();
-				gen.generate(expression, currentNode, fUserELExpressions, fUserELRanges, document, currentNode, contentStart, contentLength);
+				List generatorELProblems = gen.generate(expression, currentNode, fUserELExpressions, fUserELRanges, document, currentNode, contentStart, contentLength);
+				elProblems.addAll(generatorELProblems);
 			}
 		} catch (ParseException e) {
 			Token curTok = e.currentToken;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/IndexWorkspaceJob.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/IndexWorkspaceJob.java
index 2bd3ffa..c4a43ef 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/IndexWorkspaceJob.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/IndexWorkspaceJob.java
@@ -123,6 +123,7 @@
 	protected IStatus run(IProgressMonitor monitor) {
 		
 		IStatus status = Status.OK_STATUS;
+		Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
 		
 		if(monitor.isCanceled()) {
 			setCanceledState();
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager.java
index cd976e5..a6e8d55 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
 import java.util.List;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.IResourceChangeEvent;
 import org.eclipse.core.resources.IResourceChangeListener;
@@ -239,6 +240,7 @@
 				return Status.CANCEL_STATUS;
 			}
 
+			Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
 			long start = System.currentTimeMillis();
 
 			try {
@@ -261,17 +263,19 @@
 					}
 					IFile file = filesToBeProcessed[lastFileCursor];
 					try {
-						IJavaProject project = JavaCore.create(file.getProject());
-						if (project.exists()) {
-							ss.addJspFile(file);
+						IProject project = file.getProject();
+						if (project != null) {
+							IJavaProject jproject = JavaCore.create(project);
+							if (jproject.exists()) {
+								ss.addJspFile(file);
+								if (DEBUG) {
+									System.out.println("JSPIndexManager Job added file: " + file.getName()); //$NON-NLS-1$
+								}
+							}
 							// JSP Indexer processing n files
 							processingNFiles = NLS.bind(JSPCoreMessages.JSPIndexManager_2, new String[]{Integer.toString((filesToBeProcessed.length - lastFileCursor))});
 							monitor.subTask(processingNFiles + " - " + file.getName()); //$NON-NLS-1$
 							monitor.worked(1);
-
-							if (DEBUG) {
-								System.out.println("JSPIndexManager Job added file: " + file.getName()); //$NON-NLS-1$
-							}
 						}
 					}
 					catch (Exception e) {
@@ -378,6 +382,7 @@
 
 		if (!singleInstance.initialized) {
 			singleInstance.initialized = true;
+			singleInstance.initializing = true;
 
 			singleInstance.indexJobCoordinator = new IndexJobCoordinator();
 			singleInstance.jspResourceChangeListener = new JSPResourceChangeListener();
@@ -395,7 +400,6 @@
 			// makes sure IndexManager is aware of our indexes
 			saveIndexes();
 			singleInstance.initializing = false;
-
 		}
 
 	}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java
index 78332d1..b78944f 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java
@@ -44,14 +44,11 @@
  * those fields are lightweight since it's possible for many JSP search
  * documents to exist in memory at one time (eg. after importing a project
  * with a large number of JSP files)
- * 
- * @author pavery
  */
 public class JSPSearchDocument {
 
-	private String UNKNOWN_PATH = "**path unknown**"; //$NON-NLS-1$
-	private String fJSPPathString = UNKNOWN_PATH;
-	private String fCUPath = UNKNOWN_PATH;
+	private String fJSPPathString = null;
+	private String fCUPath = null;
 	private SearchParticipant fParticipant = null;
 	private long fLastModifiedStamp;
 	private char[] fCachedCharContents;
@@ -62,7 +59,7 @@
 	 * @throws CoreException
 	 */
 	public JSPSearchDocument(String filePath, SearchParticipant participant) {
-
+		//Assert.isNotNull(filePath, "Search support for JSP requires file paths"); //$NON-NLS-1$ 
 		this.fJSPPathString = filePath;
 		this.fParticipant = participant;
 	}
@@ -158,7 +155,7 @@
 	public String getPath() {
 	    // caching the path since it's expensive to get translation
 		// important that isDirty() check is second to cache modification stamp
-	    if(this.fCUPath == null || isDirty() || this.fCUPath == UNKNOWN_PATH) {
+	    if(this.fCUPath == null || isDirty()) {
 	        JSPTranslation trans = getJSPTranslation();
 	        if(trans != null) {
 	            this.fCUPath = trans.getJavaPath();
@@ -166,7 +163,7 @@
 	            fCachedCharContents = trans.getJavaText().toCharArray();
 	        }
 	    }
-		return fCUPath != null ? fCUPath : UNKNOWN_PATH;
+		return fCUPath;
 	}
 
 	public int getJspOffset(int javaOffset) {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java
index 398982a..ed3ef8b 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java
@@ -90,8 +90,6 @@
 
         int fMatchMode = SearchPattern.R_PATTERN_MATCH;
 
-        boolean fIsCaseSensitive = false;
-
         SearchRequestor fRequestor = null;
 
         IJavaElement fElement = null;
@@ -114,7 +112,6 @@
             this.fSearchFor = searchFor;
             this.fLimitTo = limitTo;
             this.fMatchMode = matchMode;
-            this.fIsCaseSensitive = isCaseSensitive;
             this.fRequestor = requestor;
         }
 
@@ -174,8 +171,6 @@
 
         int fMatchMode = SearchPattern.R_PATTERN_MATCH;
 
-        boolean fIsCaseSensitive = false;
-
         SearchRequestor fRequestor = null;
 
         IJavaElement fElement = null;
@@ -188,18 +183,6 @@
             this.fRequestor = requestor;
         }
 
-        // constructor w/ search text
-        public SearchRunnable(String searchText, IJavaSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
-
-            this.fSearchText = searchText;
-            this.fScope = scope;
-            this.fSearchFor = searchFor;
-            this.fLimitTo = limitTo;
-            this.fMatchMode = matchMode;
-            this.fIsCaseSensitive = isCaseSensitive;
-            this.fRequestor = requestor;
-        }
-
         public void run(IProgressMonitor monitor) throws CoreException {
 
             if (monitor != null && monitor.isCanceled())
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelhandler/JSPModelLoader.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelhandler/JSPModelLoader.java
index a646956..23b90ab 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelhandler/JSPModelLoader.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelhandler/JSPModelLoader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -50,7 +50,6 @@
 import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
 import org.eclipse.wst.sse.core.internal.document.StructuredDocumentFactory;
 import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser;
 import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
 import org.eclipse.wst.sse.core.internal.model.AbstractModelLoader;
 import org.eclipse.wst.sse.core.internal.modelhandler.EmbeddedTypeRegistry;
@@ -157,7 +156,7 @@
 		// least the
 		// default embeddeded content type handler
 		EmbeddedTypeHandler embeddedType = getJSPDefaultEmbeddedType(null);
-		embeddedType.initializeParser((JSPCapableParser) structuredDocument.getParser());
+		embeddedType.initializeParser(structuredDocument.getParser());
 		return structuredDocument;
 	}
 
@@ -350,7 +349,7 @@
 		// ((INodeNotifier)
 		// document).getExistingAdapter(ModelQueryAdapter.class);
 		oldEmbeddedContentType.uninitializeFactoryRegistry(model.getFactoryRegistry());
-		oldEmbeddedContentType.uninitializeParser((JSPCapableParser) structuredDocument.getParser());
+		oldEmbeddedContentType.uninitializeParser(structuredDocument.getParser());
 		// since 'document' is not recreated in this
 		// reinit path, we need to remove all adapters,
 		// except for the propagated adapters (including page
@@ -390,7 +389,7 @@
 			((DOMModelImpl) model).setModelParser(null);
 
 			newEmbeddedContentType.initializeFactoryRegistry(model.getFactoryRegistry());
-			newEmbeddedContentType.initializeParser((JSPCapableParser) structuredDocument.getParser());
+			newEmbeddedContentType.initializeParser(structuredDocument.getParser());
 
 			// partitioner setup is the responsibility of this loader
 			IDocumentPartitioner documentPartitioner = structuredDocument.getDocumentPartitioner();
@@ -442,13 +441,13 @@
 		// the old embedded type (during createModel), we need to unitialize
 		// parts of it, based on the old (or default) ones
 		oldEmbeddedContentType.uninitializeFactoryRegistry(model.getFactoryRegistry());
-		oldEmbeddedContentType.uninitializeParser((JSPCapableParser) structuredDocument.getParser());
+		oldEmbeddedContentType.uninitializeParser(structuredDocument.getParser());
 		// remember, embedded type factories are automatically cleared when
 		// embededType changed
 		pageDirectiveAdapter.setEmbeddedType(newEmbeddedContentType);
 		if (newEmbeddedContentType != null) {
 			newEmbeddedContentType.initializeFactoryRegistry(model.getFactoryRegistry());
-			newEmbeddedContentType.initializeParser((JSPCapableParser) structuredDocument.getParser());
+			newEmbeddedContentType.initializeParser(structuredDocument.getParser());
 		}
 		// adding language here, in this convienent central
 		// location, but some obvious renaming or refactoring
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelhandler/ModelHandlerForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelhandler/ModelHandlerForJSP.java
index b139f25..aa74637 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelhandler/ModelHandlerForJSP.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelhandler/ModelHandlerForJSP.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/JSPModelQueryExtension.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/JSPModelQueryExtension.java
new file mode 100644
index 0000000..0b00471
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/JSPModelQueryExtension.java
@@ -0,0 +1,203 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.core.internal.modelquery;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jst.jsp.core.internal.contentmodel.JSPCMDocumentFactory;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP20Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.wst.html.core.internal.contentmodel.JSPCMDocument;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension;
+import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * An implementation of {@link ModelQueryExtension} for JSP tags in JSP documents
+ */
+public class JSPModelQueryExtension extends ModelQueryExtension {
+	
+	private static final String TAG_JSP_ROOT = "jsp:root";
+
+	/**
+	 * Originally taken from JSPContentAssistProcessor
+	 * 
+	 * @see org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension#getAvailableElementContent(org.w3c.dom.Element, java.lang.String, int)
+	 */
+	public CMNode[] getAvailableElementContent(Element parentElement,
+			String namespace, int includeOptions) {
+		
+		CMNode[] nodes = EMPTY_CMNODE_ARRAY;
+		ArrayList nodeList = new ArrayList();
+		
+		//only returns anything if looking for child nodes
+		if(((includeOptions & ModelQuery.INCLUDE_CHILD_NODES) != 0) && parentElement instanceof IDOMNode) {
+			IDOMNode node = (IDOMNode)parentElement;
+			// get position dependent CMDocuments and insert their tags as
+			// proposals
+			ModelQueryAdapter mqAdapter = null;
+			if (node.getNodeType() == Node.DOCUMENT_NODE) {
+				mqAdapter = (ModelQueryAdapter) node.getAdapterFor(ModelQueryAdapter.class);
+			} else {
+				mqAdapter = (ModelQueryAdapter) ((IDOMNode) node.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
+			}
+
+			if (mqAdapter != null) {
+				CMDocument doc = mqAdapter.getModelQuery().getCorrespondingCMDocument(node);
+				if (doc != null) {
+					CMDocument jcmdoc = getDefaultJSPCMDocument(node);
+					CMNamedNodeMap jspelements = jcmdoc.getElements();
+
+					/* For a built-in JSP action the content model is properly
+					 * set up, so don't just blindly add the rest--unless this
+					 * will be a direct child of the document
+					 */
+					if (jspelements != null && (!(doc instanceof JSPCMDocument) || node.getNodeType() == Node.DOCUMENT_NODE)) {
+						List rejectElements = new ArrayList();
+
+						// determine if the document is in XML form
+						Document domDoc = null;
+						if (node.getNodeType() == Node.DOCUMENT_NODE) {
+							domDoc = (Document) node;
+						} else {
+							domDoc = node.getOwnerDocument();
+						}
+
+						// Show XML tag forms of JSP markers if jsp:root is
+						// the document element OR it's HTML but
+						// isn't really in the text.
+						// If the document isn't strictly XML, pull out the
+						// XML tag forms it is xml format
+						rejectElements.add(JSP12Namespace.ElementName.SCRIPTLET);
+						rejectElements.add(JSP12Namespace.ElementName.EXPRESSION);
+						rejectElements.add(JSP12Namespace.ElementName.DECLARATION);
+						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_INCLUDE);
+						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_PAGE);
+						rejectElements.add(JSP12Namespace.ElementName.TEXT);
+						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
+						rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_TAG);
+						rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_ATTRIBUTE);
+						rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_VARIABLE);
+						if (isXMLFormat(domDoc)) {
+							// jsp actions
+							rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
+							rejectElements.add(JSP12Namespace.ElementName.USEBEAN);
+							rejectElements.add(JSP12Namespace.ElementName.GETPROPERTY);
+							rejectElements.add(JSP12Namespace.ElementName.SETPROPERTY);
+							rejectElements.add(JSP12Namespace.ElementName.INCLUDE);
+							rejectElements.add(JSP12Namespace.ElementName.FORWARD);
+							rejectElements.add(JSP12Namespace.ElementName.PLUGIN);
+							rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
+							rejectElements.add(JSP12Namespace.ElementName.PARAM);
+							rejectElements.add(JSP12Namespace.ElementName.PARAMS);
+						}
+
+
+						// don't show jsp:root if a document element already
+						// exists
+						Element docElement = domDoc.getDocumentElement();
+						if (docElement != null &&((docElement.getNodeName().equals(TAG_JSP_ROOT)) ||
+								((((IDOMNode) docElement).getStartStructuredDocumentRegion() != null ||
+										((IDOMNode) docElement).getEndStructuredDocumentRegion() != null)))) {
+							
+							rejectElements.add(JSP12Namespace.ElementName.ROOT);
+						}
+
+						for (int j = 0; j < jspelements.getLength(); j++) {
+							CMElementDeclaration ed = (CMElementDeclaration) jspelements.item(j);
+							if (!rejectElements.contains(ed.getNodeName())) {
+								nodeList.add(ed);
+							}
+						}
+
+					}
+				}
+				// No cm document (such as for the Document (a non-Element) node itself)
+				else {
+					CMNamedNodeMap jspElements = getDefaultJSPCMDocument(node).getElements();
+					int length = jspElements.getLength();
+					for (int i = 0; i < length; i++) {
+						nodeList.add(jspElements.item(i));
+					}
+				}
+			}
+			
+			nodes = (CMNode[])nodeList.toArray(new CMNode[nodeList.size()]);
+		}
+		
+		return nodes;
+	}
+	
+	/**
+	 * <p>For JSP files and segments, this is just the JSP
+	 *         document, but when editing tag files and their fragments, it
+	 *         should be the tag document.</p>
+	 * 
+	 * <p>It may also vary based on the model being edited in the future.</p>
+	 * 
+	 * <p><b>NOTE:</b>Copied from JSPContentAssistProcessor</p>
+	 *
+	 * @return the default non-embedded CMDocument for the document being
+	 *         edited. 
+	 */
+	private CMDocument getDefaultJSPCMDocument(IDOMNode node) {
+		CMDocument jcmdoc = null; 
+		
+		// handle tag files here
+		String contentType = node.getModel().getContentTypeIdentifier();
+		if (ContentTypeIdForJSP.ContentTypeID_JSPTAG.equals(contentType)) {
+			jcmdoc =  JSPCMDocumentFactory.getCMDocument(CMDocType.TAG20_DOC_TYPE);
+		} else {
+			String modelPath = node.getModel().getBaseLocation();
+			if (modelPath != null && !IModelManager.UNMANAGED_MODEL.equals(modelPath)) {
+				float version = DeploymentDescriptorPropertyCache.getInstance().getJSPVersion(new Path(modelPath));
+				jcmdoc = JSPCMDocumentFactory.getCMDocument(version);
+			}
+			if (jcmdoc == null) {
+				jcmdoc = JSPCMDocumentFactory.getCMDocument();
+			}
+		}
+
+		return jcmdoc;
+	}
+	
+	/**
+	 * <p><b>NOTE:</b>Copied from JSPContentAssistProcessor</p>
+	 *
+	 * @param doc determine if this {@link Document} is in an XML format
+	 * @return is the given document in an XML format
+	 */
+	private boolean isXMLFormat(Document doc) {
+		boolean result = false;
+		if (doc != null) {
+			Element docElement = doc.getDocumentElement();
+			result = docElement != null &&
+				((docElement.getNodeName().equals(TAG_JSP_ROOT)) ||
+						((((IDOMNode) docElement).getStartStructuredDocumentRegion() == null &&
+								((IDOMNode) docElement).getEndStructuredDocumentRegion() == null)));
+		}
+		return result;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/ModelQueryAdapterFactoryForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/ModelQueryAdapterFactoryForJSP.java
index 5149774..7d5c14c 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/ModelQueryAdapterFactoryForJSP.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/ModelQueryAdapterFactoryForJSP.java
@@ -131,7 +131,7 @@
 		return modelQueryAdapterImpl;
 	}
 
-	ModelQuery createModelQuery(IStructuredModel model, URIResolver resolver) {
+	protected ModelQuery createModelQuery(IStructuredModel model, URIResolver resolver) {
 		return new JSPModelQueryImpl(model, resolver);
 	}
 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/ModelQueryAdapterFactoryForTag.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/ModelQueryAdapterFactoryForTag.java
index 443c8eb..ec9abb7 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/ModelQueryAdapterFactoryForTag.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/ModelQueryAdapterFactoryForTag.java
@@ -15,7 +15,6 @@
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.ModelQueryImpl;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.SimpleAssociationProvider;
 
 public class ModelQueryAdapterFactoryForTag extends ModelQueryAdapterFactoryForJSP {
@@ -31,7 +30,7 @@
 		return new ModelQueryAdapterFactoryForTag(getAdapterKey(), isShouldRegisterAdapter());
 	}
 
-	ModelQuery createModelQuery(IStructuredModel model, URIResolver resolver) {
-		return new ModelQueryImpl(new SimpleAssociationProvider(new TagModelQueryCMProvider()));
+	protected ModelQuery createModelQuery(IStructuredModel model, URIResolver resolver) {
+		return new TagModelQuery(new SimpleAssociationProvider(new TagModelQueryCMProvider()));
 	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/TagModelQuery.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/TagModelQuery.java
new file mode 100644
index 0000000..73ef1cc
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/TagModelQuery.java
@@ -0,0 +1,155 @@
+/*******************************************************************************

+ * Copyright (c) 2009 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+

+package org.eclipse.jst.jsp.core.internal.modelquery;

+

+import java.util.List;

+

+import org.eclipse.core.resources.IProject;

+import org.eclipse.core.resources.ProjectScope;

+import org.eclipse.core.resources.ResourcesPlugin;

+import org.eclipse.core.runtime.IPath;

+import org.eclipse.core.runtime.Path;

+import org.eclipse.core.runtime.preferences.IEclipsePreferences;

+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;

+import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;

+import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;

+import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerUtility;

+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;

+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;

+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;

+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;

+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;

+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;

+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;

+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;

+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAssociationProvider;

+import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.ModelQueryImpl;

+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;

+import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;

+import org.eclipse.wst.xml.core.internal.ssemodelquery.MovableModelQuery;

+import org.w3c.dom.Element;

+import org.w3c.dom.Node;

+

+/**

+ * ModelQuery for JSP Tag files. Prioritizes the Tag content model and any

+ * loaded tag libraries in the model before falling back to the embedded model

+ * query, if one is found.

+ */

+public class TagModelQuery extends ModelQueryImpl implements ModelQuery, MovableModelQuery {

+	/**

+	 * The default mime-type for the embedded ModelQuery

+	 */

+	public static final String DEFAULT_MIMETYPE = "text/html";

+

+

+	/**

+	 * The prefix used with ProjectScope to find the (possibly user-set)

+	 * embedded mime-type on a .tag file.

+	 */

+	private static final String PREFERENCE_PREFIX = "embeddedMimeType/";

+

+	public static String createPreferenceKey(IPath fullPath) {

+		return PREFERENCE_PREFIX + fullPath.removeFirstSegments(1).toString();

+	}

+

+	private ModelQuery fEmbeddedModelQuery;

+

+	/**

+	 * @param modelQueryAssociationProvider

+	 */

+	public TagModelQuery(ModelQueryAssociationProvider modelQueryAssociationProvider) {

+		super(modelQueryAssociationProvider);

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.

+	 * ModelQueryImpl#getCMElementDeclaration(org.w3c.dom.Element)

+	 */

+	public CMElementDeclaration getCMElementDeclaration(Element element) {

+		CMElementDeclaration cmElementDeclaration = super.getCMElementDeclaration(element);

+		if (cmElementDeclaration == null) {

+			ModelQuery embeddedModelQuery = getEmbeddedModelQuery(element);

+			if (embeddedModelQuery != null) {

+				return embeddedModelQuery.getCMElementDeclaration(element);

+			}

+		}

+		return cmElementDeclaration;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.

+	 * ModelQueryImpl#getCorrespondingCMDocument(org.w3c.dom.Node)

+	 */

+	public CMDocument getCorrespondingCMDocument(Node node) {

+		CMDocument document = super.getCorrespondingCMDocument(node);

+		if (document == null) {

+			ModelQuery embeddedModelQuery = getEmbeddedModelQuery(node);

+			if (embeddedModelQuery != null) {

+				return embeddedModelQuery.getCorrespondingCMDocument(node);

+			}

+		}

+		return document;

+	}

+

+	private String getEmbeddedMimeType(Node node) {

+		String type = DEFAULT_MIMETYPE;

+		if (node instanceof IDOMNode) {

+			IStructuredModel model = ((IDOMNode) node).getModel();

+			String baseLocation = model.getBaseLocation();

+			if (!baseLocation.equals(IModelManager.UNMANAGED_MODEL)) {

+				IPath path = new Path(baseLocation);

+				if (path.segmentCount() > 1) {

+					IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));

+					if (project.isAccessible()) {

+						String key = createPreferenceKey(path);

+						IEclipsePreferences preferences = new ProjectScope(project).getNode(JSPCorePlugin.getDefault().getBundle().getSymbolicName());

+						type = preferences.get(key, DEFAULT_MIMETYPE);

+					}

+				}

+			}

+		}

+		return type;

+	}

+

+	private ModelQuery getEmbeddedModelQuery(Node node) {

+		if (fEmbeddedModelQuery == null) {

+			String embeddedMimeType = getEmbeddedMimeType(node);

+			if (embeddedMimeType != null) {

+				EmbeddedTypeHandler embeddedContentTypeHandler = ModelHandlerUtility.getEmbeddedContentTypeFor(embeddedMimeType);

+				if (embeddedContentTypeHandler != null) {

+					List adapterFactories = embeddedContentTypeHandler.getAdapterFactories();

+					for (int i = 0; i < adapterFactories.size(); i++) {

+						INodeAdapterFactory factory = (INodeAdapterFactory) adapterFactories.get(i);

+						if (factory.isFactoryForType(ModelQueryAdapter.class)) {

+							INodeAdapter adapter = factory.adapt((INodeNotifier) node.getOwnerDocument());

+							if (adapter instanceof ModelQueryAdapter) {

+								fEmbeddedModelQuery = ((ModelQueryAdapter) adapter).getModelQuery();

+							}

+						}

+					}

+				}

+			}

+		}

+		return fEmbeddedModelQuery;

+	}

+

+	/* (non-Javadoc)

+	 * @see org.eclipse.wst.xml.core.internal.ssemodelquery.MovableModelQuery#setIdResolver(org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver)

+	 */

+	public void setIdResolver(URIResolver newURIResolver) {

+		fEmbeddedModelQuery = null;

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/TagModelQueryCMProvider.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/TagModelQueryCMProvider.java
index a411467..8620e8a 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/TagModelQueryCMProvider.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/TagModelQueryCMProvider.java
@@ -62,7 +62,7 @@
 				if (tldmgr != null) {
 					List documents = tldmgr.getCMDocumentTrackers(node.getPrefix(), xmlNode.getStartOffset());
 					// there shouldn't be more than one cmdocument returned
-					if (documents != null && documents.size() > 0)
+					if (documents != null && !documents.isEmpty())
 						result = (CMDocument) documents.get(0);
 				}
 			}
@@ -70,9 +70,10 @@
 		catch (Exception e) {
 			e.printStackTrace();
 		}
-		if (result == null) {
-			result = tagdoc;
-		}
+// 204990 - JSP/Web Page Editors: tag files do not support content assist on html element attributes
+//		if (result == null) {
+//			result = tagdoc;
+//		}
 		return result;
 	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/TaglibModelQueryExtension.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/TaglibModelQueryExtension.java
new file mode 100644
index 0000000..4f9a9b3
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelquery/TaglibModelQueryExtension.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.core.internal.modelquery;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.w3c.dom.Element;
+
+/**
+ * An implementation of {@link ModelQueryExtension} for tag libraries in JSP documents
+ */
+public class TaglibModelQueryExtension extends ModelQueryExtension {
+	
+	/**
+	 * @see org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension#getAvailableElementContent(org.w3c.dom.Element, java.lang.String, int)
+	 */
+	public CMNode[] getAvailableElementContent(Element parentElement,
+			String namespace, int includeOptions) {
+		
+		CMNode[] nodes = EMPTY_CMNODE_ARRAY;
+		ArrayList nodeList = new ArrayList();
+		
+		//only returns anything if looking for child nodes
+		if(((includeOptions & ModelQuery.INCLUDE_CHILD_NODES) != 0) && parentElement instanceof IDOMElement) {
+			//get the trackers
+			IDOMElement elem = (IDOMElement)parentElement;
+			IStructuredDocument structDoc = elem.getModel().getStructuredDocument();
+			TLDCMDocumentManager manager = TaglibController.getTLDCMDocumentManager(structDoc);
+
+			if(manager != null) {
+				List trackers = manager.getCMDocumentTrackers(elem.getStartOffset());
+				
+				//for each tracker add each of its elements to the node list
+				for(int trackerIndex = 0; trackerIndex < trackers.size(); ++trackerIndex) {
+					CMNamedNodeMap elements = ((TaglibTracker)trackers.get(trackerIndex)).getElements();
+					for(int elementIndex = 0; elementIndex < elements.getLength(); ++elementIndex) {
+						nodeList.add(elements.item(elementIndex));
+					}
+				}
+				
+				nodes = (CMNode[])nodeList.toArray(new CMNode[nodeList.size()]);
+			}
+		}
+		
+		return nodes;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPSourceParser.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPSourceParser.java
index 280e3ff..44af4f7 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPSourceParser.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPSourceParser.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -360,6 +360,13 @@
 				if (currentNode.getLastRegion() != null && currentNode.getLastRegion().getType() == DOMRegionContext.UNDEFINED) {
 					currentNode.getLastRegion().adjustLength(region.getLength());
 					currentNode.adjustLength(region.getLength());
+
+					//if adding this region to a previous container then need to add this
+					//region to the container and update its start location
+					if(currentNode.getLastRegion() instanceof ITextRegionContainer) {
+						region.adjustStart(-currentNode.getLastRegion().getStart() - currentNode.getStart());
+						((ITextRegionContainer)currentNode.getLastRegion()).getRegions().add(region);
+					}
 				}
 				// previous wasn't undefined
 				else {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
index b424476..dfa69ac 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
@@ -1,7 +1,7 @@
-/* The following code was generated by JFlex 1.2.2 on 10/24/07 5:16 AM */
+/* The following code was generated by JFlex 1.2.2 on 6/29/10 1:04 PM */
 
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Frits Jalvingh - contributions for bug 150794
  *******************************************************************************/
 
 package org.eclipse.jst.jsp.core.internal.parser.internal;
@@ -35,8 +36,8 @@
 /**
  * This class is a scanner generated by 
  * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 10/24/07 5:16 AM from the specification file
- * <tt>file:/D:/eclipse.wtp/workspace/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex</tt>
+ * on 6/29/10 1:04 PM from the specification file
+ * <tt>file:/D:/dev/workspaces/wtp/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex</tt>
  */
 public class JSPTokenizer implements BlockTokenizer, DOMJSPRegionContexts {
 
@@ -44,26 +45,26 @@
   final public static int YYEOF = -1;
 
   /** lexical states */
-  final public static int ST_JSP_VBL_DQUOTES = 51;
-  final public static int ST_JSP_VBL_SQUOTES = 50;
-  final public static int ST_JSP_VBL_SQUOTES_END = 52;
+  final public static int ST_JSP_VBL_DQUOTES = 52;
+  final public static int ST_JSP_VBL_SQUOTES = 51;
+  final public static int ST_JSP_VBL_SQUOTES_END = 53;
   final public static int ST_XML_COMMENT_END = 4;
   final public static int ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE = 21;
-  final public static int ST_JSP_EL_SQUOTES_END = 45;
-  final public static int ST_JSP_EL_DQUOTES = 44;
-  final public static int ST_JSP_EL = 42;
+  final public static int ST_JSP_EL_SQUOTES_END = 46;
+  final public static int ST_JSP_EL_DQUOTES = 45;
+  final public static int ST_JSP_EL = 43;
   final public static int ST_BLOCK_TAG_SCAN = 36;
-  final public static int ST_JSP_EL_SQUOTES = 43;
+  final public static int ST_JSP_EL_SQUOTES = 44;
   final public static int ST_DHTML_ATTRIBUTE_VALUE = 14;
   final public static int ST_XML_PI_ATTRIBUTE_NAME = 8;
   final public static int ST_DHTML_TAG_CLOSE = 15;
-  final public static int ST_XML_ATTRIBUTE_VALUE_DQUOTED = 41;
+  final public static int ST_XML_ATTRIBUTE_VALUE_DQUOTED = 42;
   final public static int ST_DHTML_EQUALS = 13;
   final public static int ST_XML_PI_ATTRIBUTE_VALUE = 10;
   final public static int ST_XML_ATTRIBUTE_VALUE = 25;
-  final public static int ST_JSP_VBL = 49;
-  final public static int ST_JSP_SQUOTED_VBL = 55;
-  final public static int ST_XML_ATTRIBUTE_VALUE_SQUOTED = 40;
+  final public static int ST_JSP_VBL = 50;
+  final public static int ST_JSP_SQUOTED_VBL = 56;
+  final public static int ST_XML_ATTRIBUTE_VALUE_SQUOTED = 41;
   final public static int ST_XML_ATTRIBUTE_NAME = 23;
   final public static int ST_XML_EQUALS = 24;
   final public static int YYINITIAL = 0;
@@ -73,8 +74,8 @@
   final public static int ST_XML_ELEMENT_DECLARATION = 32;
   final public static int ST_XML_DECLARATION_CLOSE = 27;
   final public static int ST_JSP_DIRECTIVE_EQUALS = 20;
-  final public static int ST_JSP_VBL_DQUOTES_END = 53;
-  final public static int ST_JSP_DQUOTED_EL = 47;
+  final public static int ST_JSP_VBL_DQUOTES_END = 54;
+  final public static int ST_JSP_DQUOTED_EL = 48;
   final public static int ST_XML_DOCTYPE_DECLARATION = 28;
   final public static int ST_CDATA_END = 2;
   final public static int ST_PI_WS = 6;
@@ -82,13 +83,13 @@
   final public static int ST_JSP_DIRECTIVE_NAME_WHITESPACE = 18;
   final public static int ST_XML_ELEMENT_DECLARATION_CONTENT = 33;
   final public static int ST_XML_ATTLIST_DECLARATION = 34;
-  final public static int ST_JSP_EL_DQUOTES_END = 46;
-  final public static int ST_JSP_SQUOTED_EL = 48;
+  final public static int ST_JSP_EL_DQUOTES_END = 47;
+  final public static int ST_JSP_SQUOTED_EL = 49;
   final public static int ST_JSP_COMMENT_END = 39;
   final public static int ST_XML_PI_EQUALS = 9;
   final public static int ST_XML_ATTLIST_DECLARATION_CONTENT = 35;
   final public static int ST_XML_DOCTYPE_ID_PUBLIC = 30;
-  final public static int ST_JSP_DQUOTED_VBL = 54;
+  final public static int ST_JSP_DQUOTED_VBL = 55;
   final public static int ST_DHTML_ATTRIBUTE_NAME = 12;
   final public static int ST_ABORT_EMBEDDED = 37;
   final public static int ST_XML_DOCTYPE_EXTERNAL_ID = 29;
@@ -101,80 +102,81 @@
   final public static int ST_XML_TAG_NAME = 22;
   final public static int ST_XML_PI_TAG_CLOSE = 11;
   final public static int ST_XML_COMMENT = 3;
+  final public static int ST_JSP_ATTRIBUTE_VALUE = 40;
 
   /** 
    * Translates characters to character classes
    */
   final private static String yycmap_packed = 
-    "\11\0\1\5\1\26\2\0\1\17\22\0\1\17\1\25\1\12\1\65"+
-    "\1\15\1\22\1\13\1\14\1\24\1\24\1\24\1\24\1\24\1\7"+
-    "\1\6\1\3\12\20\1\11\1\72\1\1\1\51\1\2\1\4\1\21"+
-    "\1\40\1\73\1\36\1\37\1\55\1\70\1\62\1\62\1\63\1\62"+
-    "\1\62\1\33\1\31\1\64\1\52\1\54\1\62\1\67\1\66\1\41"+
-    "\1\71\2\62\1\27\1\53\1\62\1\35\1\104\1\23\1\0\1\10"+
-    "\1\0\1\57\1\103\1\74\1\60\1\43\1\70\1\75\1\106\1\46"+
-    "\1\100\1\62\1\34\1\32\1\50\1\47\1\101\1\62\1\44\1\45"+
-    "\1\56\1\102\1\42\1\62\1\30\1\61\1\62\1\16\1\0\1\105"+
-    "\71\0\1\77\10\0\27\76\1\0\37\76\1\0\72\76\2\0\13\76"+
-    "\2\0\10\76\1\0\65\76\1\0\104\76\11\0\44\76\3\0\2\76"+
-    "\4\0\36\76\70\0\131\76\22\0\7\76\16\0\2\77\56\0\106\77"+
-    "\32\0\2\77\44\0\1\76\1\77\3\76\1\0\1\76\1\0\24\76"+
-    "\1\0\54\76\1\0\7\76\3\0\1\76\1\0\1\76\1\0\1\76"+
-    "\1\0\1\76\1\0\22\76\15\0\14\76\1\0\102\76\1\0\14\76"+
-    "\1\0\44\76\1\0\4\77\11\0\65\76\2\0\2\76\2\0\2\76"+
-    "\3\0\34\76\2\0\10\76\2\0\2\76\67\0\46\76\2\0\1\76"+
-    "\7\0\46\76\12\0\21\77\1\0\27\77\1\0\3\77\1\0\1\77"+
-    "\1\0\2\77\1\0\1\77\13\0\33\76\5\0\3\76\56\0\32\76"+
-    "\5\0\1\77\12\76\10\77\15\0\12\77\6\0\1\77\107\76\2\0"+
-    "\5\76\1\0\17\76\1\0\4\76\1\0\1\76\17\77\2\76\2\77"+
-    "\1\0\4\77\2\0\12\77\u0207\0\3\77\1\0\65\76\2\0\1\77"+
-    "\1\76\20\77\3\0\4\77\3\0\12\76\2\77\2\0\12\77\21\0"+
-    "\3\77\1\0\10\76\2\0\2\76\2\0\26\76\1\0\7\76\1\0"+
-    "\1\76\3\0\4\76\2\0\1\77\1\0\7\77\2\0\2\77\2\0"+
-    "\3\77\11\0\1\77\4\0\2\76\1\0\3\76\2\77\2\0\12\77"+
-    "\2\76\20\0\1\77\2\0\6\76\4\0\2\76\2\0\26\76\1\0"+
-    "\7\76\1\0\2\76\1\0\2\76\1\0\2\76\2\0\1\77\1\0"+
-    "\5\77\4\0\2\77\2\0\3\77\13\0\4\76\1\0\1\76\7\0"+
-    "\12\77\2\77\3\76\14\0\3\77\1\0\7\76\1\0\1\76\1\0"+
-    "\3\76\1\0\26\76\1\0\7\76\1\0\2\76\1\0\5\76\2\0"+
-    "\1\77\1\76\10\77\1\0\3\77\1\0\3\77\22\0\1\76\5\0"+
-    "\12\77\21\0\3\77\1\0\10\76\2\0\2\76\2\0\26\76\1\0"+
-    "\7\76\1\0\2\76\2\0\4\76\2\0\1\77\1\76\6\77\3\0"+
-    "\2\77\2\0\3\77\10\0\2\77\4\0\2\76\1\0\3\76\4\0"+
-    "\12\77\22\0\2\77\1\0\6\76\3\0\3\76\1\0\4\76\3\0"+
-    "\2\76\1\0\1\76\1\0\2\76\3\0\2\76\3\0\3\76\3\0"+
-    "\10\76\1\0\3\76\4\0\5\77\3\0\3\77\1\0\4\77\11\0"+
-    "\1\77\17\0\11\77\21\0\3\77\1\0\10\76\1\0\3\76\1\0"+
-    "\27\76\1\0\12\76\1\0\5\76\4\0\7\77\1\0\3\77\1\0"+
-    "\4\77\7\0\2\77\11\0\2\76\4\0\12\77\22\0\2\77\1\0"+
-    "\10\76\1\0\3\76\1\0\27\76\1\0\12\76\1\0\5\76\4\0"+
-    "\7\77\1\0\3\77\1\0\4\77\7\0\2\77\7\0\1\76\1\0"+
-    "\2\76\4\0\12\77\22\0\2\77\1\0\10\76\1\0\3\76\1\0"+
-    "\27\76\1\0\20\76\4\0\6\77\2\0\3\77\1\0\4\77\11\0"+
-    "\1\77\10\0\2\76\4\0\12\77\221\0\56\76\1\0\1\76\1\77"+
-    "\2\76\7\77\5\0\6\76\1\77\10\77\1\0\12\77\47\0\2\76"+
-    "\1\0\1\76\2\0\2\76\1\0\1\76\2\0\1\76\6\0\4\76"+
-    "\1\0\7\76\1\0\3\76\1\0\1\76\1\0\1\76\2\0\2\76"+
-    "\1\0\2\76\1\0\1\76\1\77\2\76\6\77\1\0\2\77\1\76"+
-    "\2\0\5\76\1\0\1\77\1\0\6\77\2\0\12\77\76\0\2\77"+
-    "\6\0\12\77\13\0\1\77\1\0\1\77\1\0\1\77\4\0\2\77"+
-    "\10\76\1\0\41\76\7\0\24\77\1\0\6\77\4\0\6\77\1\0"+
-    "\1\77\1\0\25\77\3\0\7\77\1\0\1\77\346\0\46\76\12\0"+
-    "\47\76\11\0\1\76\1\0\2\76\1\0\3\76\1\0\1\76\1\0"+
-    "\2\76\1\0\5\76\51\0\1\76\1\0\1\76\1\0\1\76\13\0"+
-    "\1\76\1\0\1\76\1\0\1\76\3\0\2\76\3\0\1\76\5\0"+
-    "\3\76\1\0\1\76\1\0\1\76\1\0\1\76\1\0\1\76\3\0"+
-    "\2\76\3\0\2\76\1\0\1\76\50\0\1\76\11\0\1\76\2\0"+
-    "\1\76\2\0\2\76\7\0\2\76\1\0\1\76\1\0\7\76\50\0"+
-    "\1\76\4\0\1\76\10\0\1\76\u0c06\0\234\76\4\0\132\76\6\0"+
-    "\26\76\2\0\6\76\2\0\46\76\2\0\6\76\2\0\10\76\1\0"+
-    "\1\76\1\0\1\76\1\0\1\76\1\0\37\76\2\0\65\76\1\0"+
-    "\7\76\1\0\1\76\3\0\3\76\1\0\7\76\3\0\4\76\2\0"+
-    "\6\76\4\0\15\76\5\0\3\76\1\0\7\76\323\0\15\77\4\0"+
-    "\1\77\104\0\1\76\3\0\2\76\2\0\1\76\121\0\3\76\u0e82\0"+
-    "\1\77\1\0\1\76\31\0\11\76\6\77\1\0\5\77\13\0\124\76"+
-    "\4\0\2\77\2\0\2\77\2\0\132\76\1\0\3\77\6\0\50\76"+
-    "\u1cd3\0\u51a6\76\u0c5a\0\u2ba4\76\134\0\u0800\0\u1ffe\0\2\0";
+    "\11\0\1\5\1\27\2\0\1\20\22\0\1\20\1\26\1\12\1\66"+
+    "\1\15\1\23\1\13\1\14\1\25\1\25\1\25\1\25\1\25\1\7"+
+    "\1\6\1\3\12\21\1\11\1\73\1\1\1\52\1\2\1\4\1\22"+
+    "\1\41\1\74\1\37\1\40\1\56\1\71\1\63\1\63\1\64\1\63"+
+    "\1\63\1\34\1\32\1\65\1\53\1\55\1\63\1\70\1\67\1\42"+
+    "\1\72\2\63\1\30\1\54\1\63\1\36\1\17\1\24\1\0\1\10"+
+    "\1\0\1\60\1\104\1\75\1\61\1\44\1\71\1\76\1\106\1\47"+
+    "\1\101\1\63\1\35\1\33\1\51\1\50\1\102\1\63\1\45\1\46"+
+    "\1\57\1\103\1\43\1\63\1\31\1\62\1\63\1\16\1\0\1\105"+
+    "\71\0\1\100\10\0\27\77\1\0\37\77\1\0\72\77\2\0\13\77"+
+    "\2\0\10\77\1\0\65\77\1\0\104\77\11\0\44\77\3\0\2\77"+
+    "\4\0\36\77\70\0\131\77\22\0\7\77\16\0\2\100\56\0\106\100"+
+    "\32\0\2\100\44\0\1\77\1\100\3\77\1\0\1\77\1\0\24\77"+
+    "\1\0\54\77\1\0\7\77\3\0\1\77\1\0\1\77\1\0\1\77"+
+    "\1\0\1\77\1\0\22\77\15\0\14\77\1\0\102\77\1\0\14\77"+
+    "\1\0\44\77\1\0\4\100\11\0\65\77\2\0\2\77\2\0\2\77"+
+    "\3\0\34\77\2\0\10\77\2\0\2\77\67\0\46\77\2\0\1\77"+
+    "\7\0\46\77\12\0\21\100\1\0\27\100\1\0\3\100\1\0\1\100"+
+    "\1\0\2\100\1\0\1\100\13\0\33\77\5\0\3\77\56\0\32\77"+
+    "\5\0\1\100\12\77\10\100\15\0\12\100\6\0\1\100\107\77\2\0"+
+    "\5\77\1\0\17\77\1\0\4\77\1\0\1\77\17\100\2\77\2\100"+
+    "\1\0\4\100\2\0\12\100\u0207\0\3\100\1\0\65\77\2\0\1\100"+
+    "\1\77\20\100\3\0\4\100\3\0\12\77\2\100\2\0\12\100\21\0"+
+    "\3\100\1\0\10\77\2\0\2\77\2\0\26\77\1\0\7\77\1\0"+
+    "\1\77\3\0\4\77\2\0\1\100\1\0\7\100\2\0\2\100\2\0"+
+    "\3\100\11\0\1\100\4\0\2\77\1\0\3\77\2\100\2\0\12\100"+
+    "\2\77\20\0\1\100\2\0\6\77\4\0\2\77\2\0\26\77\1\0"+
+    "\7\77\1\0\2\77\1\0\2\77\1\0\2\77\2\0\1\100\1\0"+
+    "\5\100\4\0\2\100\2\0\3\100\13\0\4\77\1\0\1\77\7\0"+
+    "\12\100\2\100\3\77\14\0\3\100\1\0\7\77\1\0\1\77\1\0"+
+    "\3\77\1\0\26\77\1\0\7\77\1\0\2\77\1\0\5\77\2\0"+
+    "\1\100\1\77\10\100\1\0\3\100\1\0\3\100\22\0\1\77\5\0"+
+    "\12\100\21\0\3\100\1\0\10\77\2\0\2\77\2\0\26\77\1\0"+
+    "\7\77\1\0\2\77\2\0\4\77\2\0\1\100\1\77\6\100\3\0"+
+    "\2\100\2\0\3\100\10\0\2\100\4\0\2\77\1\0\3\77\4\0"+
+    "\12\100\22\0\2\100\1\0\6\77\3\0\3\77\1\0\4\77\3\0"+
+    "\2\77\1\0\1\77\1\0\2\77\3\0\2\77\3\0\3\77\3\0"+
+    "\10\77\1\0\3\77\4\0\5\100\3\0\3\100\1\0\4\100\11\0"+
+    "\1\100\17\0\11\100\21\0\3\100\1\0\10\77\1\0\3\77\1\0"+
+    "\27\77\1\0\12\77\1\0\5\77\4\0\7\100\1\0\3\100\1\0"+
+    "\4\100\7\0\2\100\11\0\2\77\4\0\12\100\22\0\2\100\1\0"+
+    "\10\77\1\0\3\77\1\0\27\77\1\0\12\77\1\0\5\77\4\0"+
+    "\7\100\1\0\3\100\1\0\4\100\7\0\2\100\7\0\1\77\1\0"+
+    "\2\77\4\0\12\100\22\0\2\100\1\0\10\77\1\0\3\77\1\0"+
+    "\27\77\1\0\20\77\4\0\6\100\2\0\3\100\1\0\4\100\11\0"+
+    "\1\100\10\0\2\77\4\0\12\100\221\0\56\77\1\0\1\77\1\100"+
+    "\2\77\7\100\5\0\6\77\1\100\10\100\1\0\12\100\47\0\2\77"+
+    "\1\0\1\77\2\0\2\77\1\0\1\77\2\0\1\77\6\0\4\77"+
+    "\1\0\7\77\1\0\3\77\1\0\1\77\1\0\1\77\2\0\2\77"+
+    "\1\0\2\77\1\0\1\77\1\100\2\77\6\100\1\0\2\100\1\77"+
+    "\2\0\5\77\1\0\1\100\1\0\6\100\2\0\12\100\76\0\2\100"+
+    "\6\0\12\100\13\0\1\100\1\0\1\100\1\0\1\100\4\0\2\100"+
+    "\10\77\1\0\41\77\7\0\24\100\1\0\6\100\4\0\6\100\1\0"+
+    "\1\100\1\0\25\100\3\0\7\100\1\0\1\100\346\0\46\77\12\0"+
+    "\47\77\11\0\1\77\1\0\2\77\1\0\3\77\1\0\1\77\1\0"+
+    "\2\77\1\0\5\77\51\0\1\77\1\0\1\77\1\0\1\77\13\0"+
+    "\1\77\1\0\1\77\1\0\1\77\3\0\2\77\3\0\1\77\5\0"+
+    "\3\77\1\0\1\77\1\0\1\77\1\0\1\77\1\0\1\77\3\0"+
+    "\2\77\3\0\2\77\1\0\1\77\50\0\1\77\11\0\1\77\2\0"+
+    "\1\77\2\0\2\77\7\0\2\77\1\0\1\77\1\0\7\77\50\0"+
+    "\1\77\4\0\1\77\10\0\1\77\u0c06\0\234\77\4\0\132\77\6\0"+
+    "\26\77\2\0\6\77\2\0\46\77\2\0\6\77\2\0\10\77\1\0"+
+    "\1\77\1\0\1\77\1\0\1\77\1\0\37\77\2\0\65\77\1\0"+
+    "\7\77\1\0\1\77\3\0\3\77\1\0\7\77\3\0\4\77\2\0"+
+    "\6\77\4\0\15\77\5\0\3\77\1\0\7\77\323\0\15\100\4\0"+
+    "\1\100\104\0\1\77\3\0\2\77\2\0\1\77\121\0\3\77\u0e82\0"+
+    "\1\100\1\0\1\77\31\0\11\77\6\100\1\0\5\100\13\0\124\77"+
+    "\4\0\2\100\2\0\2\100\2\0\132\77\1\0\3\100\6\0\50\77"+
+    "\u1cd3\0\u51a6\77\u0c5a\0\u2ba4\77\134\0\u0800\0\u1ffe\0\2\0";
 
   /** 
    * Translates characters to character classes
@@ -191,585 +193,662 @@
      2130,  2201,  2272,  2343,  2414,  2485,  2556,  2627,  2698,  2769, 
      2840,  2911,  2982,  3053,  3124,  3195,  3266,  3337,  3408,  3479, 
      3550,  3621,  3692,  3763,  3834,  3905,  3976,  4047,  4118,  4189, 
-     4260,  4331,  4402,  4473,  4402,  4473,  4544,  4402,  4402,  4473, 
-     4615,  4686,  4757,  4828,  4899,  4970,  5041,  5112,  4402,  4473, 
-     5183,  5254,  5325,  4402,  5396,  5396,  5467,  5538,  5609,  5183, 
-     4402,  5680,  5751,  4402,  5822,  5893,  5964,  6035,  4402,  4473, 
-     6106,  6177,  6248,  6319,  6390,  6461,  4402,  6532,  6532,  6603, 
-     6674,  6745,  6816,  6887,  4402,  6958,  7029,  7100,  7171,  7242, 
-     7313,  4402,  7384,  7455,  7526,  7597,  7668,  7739,  7810,  7881, 
-     4402,  7952,  8023,  8094,  8165,  8236,  8307,  8378,  8449,  8449, 
-     8520,  8591,  8662,  8733,  8733,  8804,  8875,  8946,  9017,  9017, 
-     9088,  9159,  9230,  9301,  4402,  9372,  9372,  9443,  9514,  9585, 
-     9656,  4402,  4402,  4473,  4402,  4473,  9727,  9798,  9869,  9940, 
-     4402, 10011, 10082, 10153, 10224,  4402, 10295, 10366, 10437, 10508, 
-     4402,  4402, 10579,  4402, 10650, 10721, 10650, 10792, 10863, 10792, 
-     4402,  4402, 10934, 11005, 11076,  4402, 11147, 11218, 11289, 11360, 
-    11431,  4402,  4402, 11502,  4402, 11573, 11644, 11573, 11715, 11786, 
-    11715,  4402,  4402, 11857, 11928, 11999,  4402, 12070, 12141, 12212, 
-     4402,  4402, 12283, 12354, 12425, 12496, 12567,  4402, 12638, 12709, 
-    12780, 12851, 12922, 12993, 13064, 13135,  4402, 13206, 13277, 13348, 
-     4402,  4402,  5396,  5538,  4402, 13419,  5609, 13490,  5680,  5822, 
-     5893, 13561,  5964,  4402, 13632, 13703,  6035, 13774,  4402, 12354, 
-     4402,  6532,  6603,  4402, 13845,  6674, 13916,  4402, 13987, 14058, 
-     7384, 14129,  7597,  4402, 14200,  7668, 14271, 14342, 14413, 14484, 
-    14555, 14626,  8165,  4402, 14697, 14768,  8449,  8520,  4402, 14839, 
-    14910, 14981, 15052, 15123,  8662,  8449,  8733,  8804,  4402,  8875, 
-     8946,  8733,  9017,  9088,  4402, 15194, 15265, 15336, 15407, 15478, 
-    15549, 15620,  9372,  9443,  4402, 15691, 15762, 15833, 15904, 15975, 
-    16046, 16117, 16188, 16259,  4402,  4402,  4402, 16330,  4402,  4402, 
-    16401, 16472, 16543, 16614, 10650,  4402, 16685, 16756, 10792,  4402, 
-    16827, 16898, 16969, 17040, 17111, 17182, 17253, 17324, 17395, 11360, 
-    11573,  4402, 17466, 17537, 11715,  4402, 17608, 17679, 17750, 17821, 
-    17892, 17963, 18034, 18105, 18176,  4402,  4402,  4402, 18247, 18318, 
-    18389, 18460, 18531,  4402, 18602, 18673,  4402,  4402,  4402,  4402, 
-     4402,  4828, 18744, 18815, 18886, 18957, 19028, 19099, 19170, 19099, 
-    19241, 19312, 19241, 19383, 19454, 19525, 19596, 19667, 19738, 19809, 
-    19809, 19880, 19951, 19951, 20022,  9230,  9230,  9230, 20093, 20164, 
-    20235, 20235, 20306,  9585,  9585,  9585, 20377, 20448, 16543, 20519, 
-    10437, 10437, 10437, 20590, 20661, 10650, 10650, 10650, 20732, 20803, 
-    10792, 10792, 10792, 20874, 20945, 10934, 10934, 10934, 17111, 21016, 
-    21087, 11147, 11147, 11147, 17324, 21158, 21229, 11360, 11360, 11360, 
-    21300, 11573, 11573, 11573, 21371, 21442, 11715, 11715, 11715, 21513, 
-    21584, 11857, 11857, 11857, 17892, 21655, 21726, 12070, 12070, 12070, 
-    18105, 21797,  4402,  4402, 21868, 21939,  4402, 22010, 22081, 22152, 
-    22223,  7384,  4402,  4402, 22294, 22365, 22436, 22507, 22578, 15052, 
-    15407,  9230, 22649, 15904,  9585, 22720,  4402, 10437, 10650, 22791, 
-    10792, 22862, 10934, 22933,  4402, 11147, 23004, 11360, 11573, 23075, 
-    11715, 23146, 11857, 23217,  4402, 12070, 23288, 23359, 23430, 23501, 
-    23572, 23643, 23714, 23785, 23856, 23927, 23998, 24069, 24140, 24211, 
-    24282, 24353, 24424, 24495, 24566, 24637, 24708, 24779, 24850,  4828, 
-    24921, 24992, 25063, 25134, 25205,  4402,  4402, 25276, 25347, 25418, 
-    25489, 17111, 17324, 25560, 25631, 17892, 18105, 25702, 25773, 25844, 
-    25915,  4402,  4402,  4402, 25986, 26057, 26128, 26199, 26270, 26341, 
-    26412, 26483,  7100, 26554, 26625, 26696, 26767, 26838, 26909, 26980, 
-     4402, 27051, 27122,  9230,  9585, 10650, 10792, 11573, 11715, 27193, 
-    27264, 27335, 27406, 27477, 27548, 27619, 27690,  4828, 27761, 27832, 
-    27903, 27974, 28045, 28116, 28187, 28258, 28329, 28400, 28471, 28542, 
-    28613, 28684, 28755, 28826, 28897, 28968, 29039, 29110, 29181, 29252, 
-    29323, 29394, 29465, 29536, 29607, 29678, 29749, 29820, 29891, 29962, 
-    30033, 30104, 30175, 30246,  4402, 30317, 30388, 30459, 30530,  7100, 
-    30601, 30672, 30743, 30814, 30885, 30956, 31027, 31098, 31169, 31240, 
-    31311, 31382, 31453, 31524
+     4260,  4331,  4402,  4473,  4544,  4615,  4544,  4615,  4686,  4544, 
+     4544,  4615,  4757,  4828,  4899,  4970,  5041,  5112,  5183,  5254, 
+     4544,  4615,  5325,  5396,  5467,  4544,  5538,  5538,  5609,  5680, 
+     5751,  5325,  4544,  5822,  5893,  4544,  5964,  6035,  6106,  6177, 
+     4544,  4615,  6248,  6319,  6390,  6461,  6532,  6603,  4544,  6674, 
+     6674,  6745,  6816,  6887,  6958,  7029,  4544,  7100,  7171,  7242, 
+     7313,  7384,  7455,  4544,  7526,  7597,  7668,  7739,  7810,  7881, 
+     7952,  8023,  4544,  8094,  8165,  8236,  8307,  8378,  8449,  8520, 
+     8591,  8591,  8662,  8733,  8804,  8875,  8875,  8946,  9017,  9088, 
+     9159,  9159,  9230,  9301,  9372,  9443,  4544,  9514,  9514,  9585, 
+     9656,  9727,  9798,  4544,  4544,  4615,  4544,  4615,  9869,  9940, 
+     7597, 10011, 10082, 10153, 10224, 10295, 10366, 10437, 10508,  4544, 
+    10579, 10650, 10721, 10792,  4544, 10863, 10934, 11005, 11076,  4544, 
+     4544, 11147,  4544, 11218, 11289,  4544, 11218, 11360, 11431,  4544, 
+    11360, 11502, 11573,  4544, 11644,  4544, 11715, 11786, 11857, 11928, 
+    11999,  4544,  4544, 12070,  4544, 12141, 12212,  4544, 12141, 12283, 
+    12354,  4544, 12283, 12425, 12496, 12567,  4544, 12638, 12709, 12780, 
+     4544,  4544, 12851, 12922, 12993, 13064, 13135, 13206, 13277, 13348, 
+    13419, 13490, 13561, 13632, 13703, 13774,  4544, 13845, 13916, 13987, 
+     4544,  4544,  5538,  5680,  4544, 14058, 14129,  5751, 14200, 14271, 
+     5822,  5964,  6035, 14342,  6106,  4544, 14413, 14484, 14555,  6177, 
+    14626, 14697,  4544, 12922,  4544,  6674,  6745,  4544, 14768, 14839, 
+     6816, 14910, 14981,  4544, 15052, 15123,  7526, 15194,  7739,  4544, 
+    15265, 15336,  7810, 15407, 15478, 15549, 15620, 15691, 15762, 15833, 
+     8307,  4544, 15904, 15975,  8591,  8662,  4544, 16046, 16117, 16188, 
+    16259, 16330, 16401, 16472,  8804,  8591,  8875,  8946,  4544,  9017, 
+     9088,  8875,  9159,  9230,  4544, 16543, 16614, 16685, 16756, 16827, 
+    16898, 16969, 17040, 17111,  9514,  9585,  4544, 17182, 17253, 17324, 
+    17395, 17466, 17537, 17608, 17679, 17750, 17821,  9940, 10082,  4544, 
+    17892, 17963, 10153, 18034, 18105, 18176, 18247,  4544, 18318,  4544, 
+     4544,  4544,  4544, 18389, 18460, 18531, 18602, 11218,  4544, 18673, 
+    18744, 11360,  4544, 18815, 18886, 18957, 19028, 19099, 19170, 19241, 
+    19312, 19383, 11928, 12141,  4544, 19454, 19525, 12283,  4544, 19596, 
+    19667, 19738, 19809, 19880, 19951, 20022, 20093, 20164,  4544,  4544, 
+     4544, 20235, 20306, 20377, 20448, 20519,  4544, 20590, 20661, 20732, 
+     4544,  4544,  4544,  4544, 20803,  4544,  4544,  4970, 20874, 20945, 
+    21016, 21087, 21158, 21229, 21300, 21371, 21442, 21513, 21584, 21655, 
+    21726, 21797, 21868, 21939, 22010, 21939, 22081, 22152, 22081, 22223, 
+    22294, 22365, 22436, 22507, 22578, 22649, 22720, 22720, 22791, 22862, 
+    22933, 23004, 23004, 23075, 23146,  9372,  9372,  9372, 23217, 23288, 
+    23359, 23430, 23430, 23501, 23572,  9727,  9727,  9727, 23643, 23714, 
+    10082, 23785, 10153, 23856, 23927, 23927, 23998, 23998, 18531, 24069, 
+    11005, 11005, 11005, 24140, 24211, 11218, 11218, 11218, 24282, 24353, 
+    11360, 11360, 11360, 24424, 24495, 11502, 11502, 11502, 19099, 24566, 
+    24637, 11715, 11715, 11715, 19312, 24708, 24779, 11928, 11928, 11928, 
+    24850, 12141, 12141, 12141, 24921, 24992, 12283, 12283, 12283, 25063, 
+    25134, 12425, 12425, 12425, 19880, 25205, 25276, 12638, 12638, 12638, 
+    20093, 25347,  4544,  4544, 25418, 25489,  4544, 25560, 25631, 25702, 
+    25773, 25844, 25915,  7526,  4544,  4544, 25986, 26057, 26128, 26199, 
+    26270, 16330, 16827,  9372, 26341, 17466,  9727, 26412,  4544,  9940, 
+    11005, 11218, 26483, 11360, 26554, 11502, 26625,  4544, 11715, 26696, 
+    11928, 12141, 26767, 12283, 26838, 12425, 26909,  4544, 12638, 26980, 
+    27051, 27122, 27193, 27264, 27335, 27406, 27477, 27548, 27619, 27690, 
+    27761, 27832, 27903, 27974, 28045, 28116, 28187, 28258, 28329, 28400, 
+    28471, 28542,  4970, 28613, 28684, 28755, 28826, 28897,  4544,  4544, 
+    28968, 29039, 29110, 29181, 19099, 19312, 29252, 29323, 19880, 20093, 
+    29394, 29465, 29536, 29607,  4544,  4544,  4544, 29678, 29749, 29820, 
+    29891, 29962, 30033, 30104, 30175,  7242, 30246, 30317, 30388, 30459, 
+    30530, 30601, 30672,  4544, 30743, 30814,  9372,  9727, 11218, 11360, 
+    12141, 12283, 30885, 30956, 31027, 31098, 31169, 31240, 31311, 31382, 
+     4970, 31453, 31524, 31595, 31666, 31737, 31808, 31879, 31950, 32021, 
+    32092, 32163, 32234, 32305, 32376, 32447, 32518, 32589, 32660, 32731, 
+    32802, 32873, 32944, 33015, 33086, 33157, 33228, 33299, 33370, 33441, 
+    33512, 33583, 33654, 33725, 33796, 33867, 33938,  4544, 34009, 34080, 
+    34151, 34222,  7242, 34293, 34364, 34435, 34506, 34577, 34648, 34719, 
+    34790, 34861, 34932, 35003, 35074, 35145, 35216
   };
 
   /** 
    * The packed transition table of the DFA
    */
   final private static String yy_packed = 
-    "\1\71\1\72\11\71\1\73\1\71\1\74\4\71\1\75"+
-    "\42\71\1\76\21\71\1\77\1\100\105\77\1\101\1\102"+
-    "\21\101\1\103\2\101\1\104\60\101\1\105\1\106\105\105"+
-    "\1\101\1\102\5\101\1\107\16\101\1\104\61\101\1\102"+
-    "\2\101\1\110\1\111\2\101\2\112\5\101\1\111\6\101"+
-    "\1\111\1\113\1\114\4\112\1\101\10\112\1\115\2\112"+
-    "\1\101\11\112\1\115\1\112\1\101\4\112\1\101\4\112"+
-    "\1\101\4\112\2\101\1\112\1\101\1\102\2\101\1\110"+
-    "\1\116\11\101\1\116\6\101\1\116\60\101\1\117\1\120"+
-    "\2\117\1\121\21\117\1\104\60\117\1\101\1\102\2\101"+
-    "\1\122\1\111\2\101\2\123\5\101\1\111\6\101\1\111"+
-    "\6\123\1\101\13\123\1\101\13\123\1\101\4\123\1\101"+
-    "\4\123\1\101\4\123\2\101\1\123\1\101\1\102\2\101"+
-    "\1\122\1\111\2\101\2\123\5\101\1\111\6\101\1\111"+
-    "\6\123\1\101\13\123\1\124\13\123\1\101\4\123\1\101"+
-    "\4\123\1\101\4\123\2\101\1\123\1\125\1\102\1\101"+
-    "\1\126\1\127\1\111\4\125\1\130\1\125\1\131\2\125"+
-    "\1\111\6\125\1\111\60\125\1\101\1\102\2\101\1\132"+
-    "\21\101\1\104\61\101\1\102\1\133\1\134\1\101\1\111"+
-    "\2\101\2\135\5\101\1\111\6\101\1\111\6\135\1\101"+
-    "\13\135\1\101\13\135\1\101\4\135\1\101\4\135\1\101"+
-    "\4\135\2\101\1\135\1\101\1\102\1\133\1\134\1\101"+
-    "\1\111\2\101\2\135\5\101\1\111\6\101\1\111\6\135"+
-    "\1\101\13\135\1\136\13\135\1\101\4\135\1\101\4\135"+
-    "\1\101\4\135\2\101\1\135\1\137\1\102\1\133\1\140"+
-    "\1\137\1\111\4\137\1\141\1\137\1\142\2\137\1\111"+
-    "\6\137\1\111\60\137\1\101\1\102\3\101\1\111\11\101"+
-    "\1\111\6\101\1\111\60\101\1\143\1\144\20\143\1\145"+
-    "\64\143\1\101\1\146\3\101\1\111\2\101\2\147\5\101"+
-    "\1\111\2\101\1\150\3\101\1\111\6\147\1\101\13\147"+
-    "\1\101\13\147\1\101\4\147\1\101\4\147\1\101\4\147"+
-    "\2\101\1\147\1\101\1\146\3\101\1\151\11\101\1\151"+
-    "\2\101\1\150\3\101\1\151\61\101\1\146\3\101\1\111"+
-    "\2\101\2\152\5\101\1\111\2\101\1\150\3\101\1\111"+
-    "\6\152\1\101\13\152\1\101\13\152\1\101\4\152\1\101"+
-    "\4\152\1\101\4\152\2\101\1\152\1\101\1\146\3\101"+
-    "\1\111\2\101\2\152\5\101\1\111\2\101\1\150\3\101"+
-    "\1\111\6\152\1\101\13\152\1\153\13\152\1\101\4\152"+
-    "\1\101\4\152\1\101\4\152\2\101\1\152\1\154\1\146"+
-    "\1\101\1\155\1\154\1\111\4\154\1\156\1\154\1\157"+
-    "\2\154\1\111\2\154\1\160\3\154\1\111\60\154\1\161"+
-    "\1\162\1\163\1\164\4\161\2\165\15\161\6\166\1\161"+
-    "\13\166\1\161\13\166\1\161\4\166\1\161\4\166\1\161"+
-    "\1\167\3\166\2\161\1\166\1\101\1\170\1\163\1\164"+
-    "\1\101\1\111\2\101\2\171\5\101\1\111\6\101\1\111"+
-    "\6\171\1\101\13\171\1\101\13\171\1\101\4\171\1\101"+
-    "\4\171\1\101\4\171\2\101\1\171\1\101\1\170\1\163"+
-    "\1\164\1\101\1\111\2\101\2\171\5\101\1\111\6\101"+
-    "\1\111\6\171\1\101\13\171\1\172\13\171\1\101\4\171"+
-    "\1\101\4\171\1\101\4\171\2\101\1\171\1\173\1\174"+
-    "\1\163\1\175\1\173\1\111\4\173\1\176\1\173\1\177"+
-    "\1\200\1\173\1\111\6\173\1\111\36\173\1\201\21\173"+
-    "\1\101\1\202\1\203\2\101\1\111\11\101\1\111\6\101"+
-    "\1\111\10\101\1\204\1\205\2\101\1\206\11\101\1\206"+
-    "\1\101\1\205\1\204\27\101\1\102\1\203\2\101\1\111"+
-    "\11\101\1\111\6\101\1\111\6\101\1\207\52\101\1\102"+
-    "\1\203\2\101\1\111\2\101\2\210\5\101\1\111\6\101"+
-    "\1\111\6\210\1\207\13\210\1\101\13\210\1\101\4\210"+
-    "\1\101\4\210\1\101\4\210\2\101\1\210\1\101\1\102"+
-    "\1\203\2\101\1\111\11\101\1\111\6\101\1\111\6\101"+
-    "\1\207\7\101\1\211\6\101\1\212\11\101\1\211\12\101"+
-    "\1\212\5\101\1\213\1\102\1\203\1\214\1\213\1\111"+
-    "\4\213\1\215\1\213\1\216\2\213\1\111\6\213\1\111"+
-    "\6\213\1\217\51\213\1\220\1\102\1\203\1\221\1\220"+
-    "\1\111\4\220\1\222\1\220\1\223\2\220\1\111\6\220"+
-    "\1\111\6\220\1\224\51\220\1\225\1\102\1\203\1\226"+
-    "\1\225\1\111\4\225\1\227\1\225\1\230\2\225\1\111"+
-    "\6\225\1\111\60\225\1\231\1\232\1\233\104\231\1\234"+
-    "\1\102\1\203\1\235\1\234\1\111\4\234\1\236\1\234"+
-    "\1\237\2\234\1\111\6\234\1\111\60\234\1\240\1\241"+
-    "\1\242\104\240\1\243\1\244\105\243\1\101\1\102\24\101"+
-    "\1\104\60\101\1\245\1\246\105\245\1\101\1\102\5\101"+
-    "\1\247\16\101\1\104\60\101\1\250\1\251\3\250\1\252"+
-    "\6\250\1\253\1\254\1\250\1\252\6\250\1\252\36\250"+
-    "\1\255\21\250\1\256\1\251\3\256\1\257\4\256\1\260"+
-    "\2\256\1\261\1\256\1\257\6\256\1\257\36\256\1\262"+
-    "\21\256\1\263\1\264\10\263\1\265\1\263\1\266\1\267"+
-    "\67\263\1\270\1\263\1\271\1\272\12\271\1\101\11\271"+
-    "\1\273\60\271\1\274\1\275\10\274\1\101\13\274\1\276"+
-    "\60\274\1\101\1\102\12\101\1\277\11\101\1\104\61\101"+
-    "\1\102\10\101\1\300\13\101\1\104\60\101\1\301\1\302"+
-    "\10\301\1\260\71\301\1\303\1\304\1\301\1\305\1\306"+
-    "\12\305\1\253\67\305\1\307\1\304\1\305\1\310\1\311"+
-    "\10\310\1\312\1\310\1\313\50\310\1\314\17\310\1\315"+
-    "\1\310\1\316\1\317\12\316\1\101\11\316\1\320\60\316"+
-    "\1\321\1\322\10\321\1\101\13\321\1\323\60\321\1\101"+
-    "\1\102\12\101\1\324\11\101\1\104\61\101\1\102\10\101"+
-    "\1\325\13\101\1\104\60\101\1\326\1\327\10\326\1\260"+
-    "\71\326\1\330\1\331\1\326\1\332\1\333\12\332\1\253"+
-    "\67\332\1\334\1\331\1\332\1\71\1\0\11\71\1\0"+
-    "\1\71\1\0\4\71\1\0\42\71\1\0\21\71\3\0"+
-    "\1\335\1\336\15\0\1\337\2\0\1\340\66\0\1\341"+
-    "\2\0\2\342\5\0\1\341\6\0\1\341\6\342\1\0"+
-    "\13\342\1\0\13\342\1\343\4\342\1\0\4\342\1\0"+
-    "\4\342\2\0\1\342\1\344\1\0\11\344\1\0\1\344"+
-    "\1\345\1\346\3\344\1\0\64\344\5\0\1\341\2\0"+
-    "\2\347\5\0\1\341\6\0\1\341\6\347\1\0\13\347"+
-    "\1\0\13\347\1\0\4\347\1\0\4\347\1\0\4\347"+
-    "\2\0\1\347\1\344\1\0\11\344\1\0\2\344\1\350"+
-    "\3\344\1\0\42\344\1\351\21\344\131\0\1\337\2\0"+
-    "\1\352\104\0\1\353\72\0\1\354\101\0\1\355\111\0"+
-    "\1\111\11\0\1\111\6\0\1\111\66\0\4\112\6\0"+
-    "\1\112\6\0\6\112\1\0\13\112\1\0\13\112\1\0"+
-    "\4\112\1\0\11\112\2\0\1\112\6\0\4\112\6\0"+
-    "\1\112\6\0\2\112\2\356\2\112\1\0\13\112\1\0"+
-    "\13\112\1\0\4\112\1\0\11\112\2\0\1\112\6\0"+
-    "\4\112\6\0\1\112\6\0\2\112\1\356\1\357\2\112"+
-    "\1\0\13\112\1\0\13\112\1\0\4\112\1\0\11\112"+
-    "\2\0\1\112\6\0\4\112\6\0\1\112\6\0\2\112"+
-    "\2\360\2\112\1\0\13\112\1\0\13\112\1\0\4\112"+
-    "\1\0\11\112\2\0\1\112\5\0\1\116\11\0\1\116"+
-    "\6\0\1\116\62\0\1\361\106\0\1\362\112\0\4\123"+
-    "\6\0\1\123\6\0\6\123\1\0\13\123\1\0\13\123"+
-    "\1\0\4\123\1\0\11\123\2\0\1\123\1\125\2\0"+
-    "\1\363\1\125\1\0\4\125\1\0\1\125\1\0\2\125"+
-    "\1\0\6\125\1\0\61\125\1\0\1\362\1\363\1\125"+
-    "\1\0\4\125\1\0\1\125\1\0\2\125\1\0\6\125"+
-    "\1\0\60\125\1\364\1\0\10\364\1\365\2\364\1\366"+
-    "\47\364\1\366\21\364\1\367\1\0\12\367\1\365\1\370"+
-    "\47\367\1\370\21\367\2\0\1\133\1\371\111\0\4\135"+
-    "\6\0\1\135\6\0\6\135\1\0\13\135\1\0\13\135"+
-    "\1\0\4\135\1\0\11\135\2\0\1\135\1\137\2\0"+
-    "\1\372\1\137\1\0\4\137\1\0\1\137\1\0\2\137"+
-    "\1\0\6\137\1\0\61\137\1\0\1\133\1\373\1\137"+
-    "\1\0\4\137\1\0\1\137\1\0\2\137\1\0\6\137"+
-    "\1\0\60\137\1\141\1\0\1\374\1\375\1\141\1\374"+
-    "\4\141\1\376\1\141\1\374\1\377\1\141\1\374\6\141"+
-    "\1\374\36\141\1\377\21\141\1\142\1\0\1\u0100\1\u0101"+
-    "\1\142\1\u0100\4\142\1\u0100\1\142\1\376\1\u0102\1\142"+
-    "\1\u0100\6\142\1\u0100\36\142\1\u0102\21\142\2\0\1\u0103"+
-    "\126\0\1\337\2\0\1\u0104\67\0\4\147\6\0\1\147"+
-    "\6\0\6\147\1\0\13\147\1\0\13\147\1\0\4\147"+
-    "\1\0\11\147\2\0\1\147\2\0\1\u0105\111\0\1\151"+
-    "\11\0\1\151\6\0\1\151\66\0\4\152\6\0\1\152"+
-    "\6\0\6\152\1\0\13\152\1\0\13\152\1\0\4\152"+
-    "\1\0\11\152\2\0\1\152\1\154\2\0\1\u0106\1\154"+
-    "\1\0\4\154\1\0\1\154\1\0\2\154\1\0\6\154"+
-    "\1\0\60\154\1\u0107\1\0\10\u0107\1\u0108\2\u0107\1\u0109"+
-    "\47\u0107\1\u0109\21\u0107\1\u010a\1\0\12\u010a\1\u0108\1\u010b"+
-    "\47\u010a\1\u010b\21\u010a\1\154\1\0\1\u0105\1\u0106\1\154"+
-    "\1\0\4\154\1\0\1\154\1\0\2\154\1\0\6\154"+
-    "\1\0\60\154\1\161\3\0\23\161\6\0\1\161\13\0"+
-    "\1\161\13\0\1\161\4\0\1\161\4\0\1\161\4\0"+
-    "\2\161\4\0\1\335\16\0\1\337\2\0\1\340\63\0"+
-    "\1\u010c\104\0\1\161\3\0\2\161\4\165\6\161\1\165"+
-    "\6\161\6\166\1\161\13\166\1\161\13\166\1\161\4\166"+
-    "\1\161\4\166\1\165\4\166\2\161\1\166\6\0\4\166"+
-    "\6\0\1\166\6\0\6\166\1\0\13\166\1\0\13\166"+
-    "\1\0\4\166\1\0\11\166\2\0\1\166\6\0\4\166"+
-    "\6\0\1\166\6\0\6\166\1\0\7\166\1\u010d\3\166"+
-    "\1\0\13\166\1\0\4\166\1\0\11\166\2\0\1\166"+
-    "\3\0\1\335\4\0\2\u010e\10\0\1\337\2\0\1\340"+
-    "\1\0\6\u010e\1\0\13\u010e\1\0\13\u010e\1\0\4\u010e"+
-    "\1\0\4\u010e\1\0\4\u010e\2\0\1\u010e\6\0\4\171"+
-    "\6\0\1\171\6\0\6\171\1\0\13\171\1\0\13\171"+
-    "\1\0\4\171\1\0\11\171\2\0\1\171\1\173\2\0"+
-    "\1\u010f\1\173\1\0\4\173\1\0\1\173\1\0\2\173"+
-    "\1\0\6\173\1\0\60\173\3\0\1\335\4\0\2\u0110"+
-    "\10\0\1\337\2\0\1\340\1\0\6\u0110\1\0\13\u0110"+
-    "\1\0\13\u0110\1\0\4\u0110\1\0\4\u0110\1\0\4\u0110"+
-    "\2\0\1\u0110\1\173\1\0\1\u010c\1\u010f\1\173\1\0"+
-    "\4\173\1\0\1\173\1\0\2\173\1\0\6\173\1\0"+
-    "\60\173\1\u0111\1\0\10\u0111\1\u0112\2\u0111\1\u0113\47\u0111"+
-    "\1\u0113\21\u0111\1\u0114\1\0\12\u0114\1\u0112\1\u0115\47\u0114"+
-    "\1\u0115\21\u0114\1\173\2\0\1\u010f\1\173\1\0\4\173"+
-    "\1\0\1\173\1\0\1\173\1\u0116\1\0\6\173\1\0"+
-    "\61\173\2\0\1\u010f\1\173\1\0\4\173\1\0\1\173"+
-    "\1\0\1\173\1\u0117\1\0\6\173\1\0\60\173\3\0"+
-    "\1\335\16\0\1\337\2\0\1\u0104\130\0\1\u0118\2\0"+
-    "\1\u0118\75\0\1\u0119\14\0\1\u0119\63\0\2\u011a\52\0"+
-    "\23\u011b\1\u011c\63\u011b\6\0\4\210\6\0\1\210\6\0"+
-    "\6\210\1\0\13\210\1\0\13\210\1\0\4\210\1\0"+
-    "\11\210\2\0\1\210\53\0\1\u011d\5\0\1\u011d\116\0"+
-    "\1\u011e\10\0\1\u011e\4\0\1\213\2\0\1\u011f\1\213"+
-    "\1\0\4\213\1\0\1\213\1\0\2\213\1\0\6\213"+
-    "\1\0\60\213\1\u0120\1\0\10\u0120\1\u0121\2\u0120\1\u0122"+
-    "\47\u0120\1\u0122\21\u0120\1\u0123\1\0\1\u0123\2\u0124\1\u0123"+
-    "\4\u0124\2\u0123\1\u0125\1\u0126\1\u0123\4\u0124\1\u0123\11\u0124"+
-    "\1\u0123\27\u0124\1\u0126\10\u0124\2\u0123\4\u0124\2\u0123\1\u0124"+
-    "\1\217\2\u011b\1\u0127\1\217\1\u011b\4\217\1\u011b\1\217"+
-    "\1\u011b\2\217\1\u011b\3\217\1\u0128\2\217\1\u011b\60\217"+
-    "\1\220\2\0\1\u0129\1\220\1\0\4\220\1\0\1\220"+
-    "\1\0\2\220\1\0\6\220\1\0\60\220\12\u012a\1\u012b"+
-    "\74\u012a\14\u012c\1\u012b\72\u012c\1\224\2\u011b\1\u012d\1\224"+
-    "\1\u011b\4\224\1\u011b\1\224\1\u011b\2\224\1\u011b\3\224"+
-    "\1\u012e\2\224\1\u011b\60\224\1\225\2\0\1\u012f\1\225"+
-    "\1\0\4\225\1\0\1\225\1\0\2\225\1\0\6\225"+
-    "\1\0\60\225\1\u0130\1\0\10\u0130\1\u0131\2\u0130\1\u0132"+
-    "\47\u0130\1\u0132\21\u0130\1\u0133\1\0\1\u0133\2\u0134\1\u0133"+
-    "\4\u0134\2\u0133\1\u0135\1\u0136\1\u0133\4\u0134\1\u0133\11\u0134"+
-    "\1\u0133\27\u0134\1\u0136\10\u0134\2\u0133\4\u0134\2\u0133\1\u0134"+
-    "\2\231\1\0\106\231\1\0\17\231\1\u0137\2\231\1\u0138"+
-    "\61\231\1\234\2\0\1\u0139\1\234\1\0\4\234\1\0"+
-    "\1\234\1\0\2\234\1\0\6\234\1\0\60\234\1\u013a"+
-    "\1\0\10\u013a\1\u013b\2\u013a\1\u013c\47\u013a\1\u013c\21\u013a"+
-    "\1\u013d\1\0\1\u013d\2\u013e\1\u013d\4\u013e\2\u013d\1\u013f"+
-    "\1\u0140\1\u013d\4\u013e\1\u013d\11\u013e\1\u013d\27\u013e\1\u0140"+
-    "\10\u013e\2\u013d\4\u013e\2\u013d\1\u013e\2\240\1\0\106\240"+
-    "\1\0\17\240\1\u0141\2\240\1\u0142\61\240\7\0\1\u0143"+
-    "\77\0\1\250\1\0\12\250\1\0\1\u0144\47\250\1\u0144"+
-    "\21\250\3\0\1\u0145\16\0\1\337\2\0\1\352\61\0"+
-    "\1\250\1\0\3\250\1\252\6\250\1\0\1\u0144\1\250"+
-    "\1\252\6\250\1\252\36\250\1\u0144\37\250\1\u0146\106\250"+
-    "\1\u0147\70\250\1\256\1\0\10\256\1\0\2\256\1\u0148"+
-    "\47\256\1\u0148\22\256\1\0\3\256\1\257\4\256\1\0"+
-    "\2\256\1\u0148\1\256\1\257\6\256\1\257\36\256\1\u0148"+
-    "\37\256\1\u0149\106\256\1\u014a\70\256\12\263\1\0\1\263"+
-    "\1\0\1\u014b\67\263\1\0\13\263\1\0\1\263\1\0"+
-    "\1\u014b\4\263\1\u014c\62\263\1\0\13\263\1\0\1\263"+
-    "\1\0\1\263\1\u014d\66\263\1\u014e\1\263\14\u014f\1\u0150"+
-    "\106\u014f\1\u0150\5\u014f\1\u0151\2\u014f\1\u0152\61\u014f\12\u0153"+
-    "\1\u0154\106\u0153\1\u0154\7\u0153\1\u0155\2\u0153\1\u0156\61\u0153"+
-    "\12\301\1\0\71\301\1\u0157\1\0\13\301\1\0\7\301"+
-    "\1\u0158\61\301\1\u0157\1\0\13\301\1\u0159\74\301\14\305"+
-    "\1\0\67\305\1\u015a\1\0\15\305\1\0\5\305\1\u015b"+
-    "\61\305\1\u015a\1\0\15\305\1\u015c\72\305\12\310\1\0"+
-    "\1\310\1\0\70\310\1\0\13\310\1\0\1\310\1\0"+
-    "\5\310\1\u015d\62\310\1\0\13\310\1\0\1\310\1\0"+
-    "\1\310\1\u015e\66\310\1\0\1\310\14\u015f\1\u0160\106\u015f"+
-    "\1\u0160\5\u015f\1\u0161\2\u015f\1\u0162\61\u015f\12\u0163\1\u0164"+
-    "\106\u0163\1\u0164\7\u0163\1\u0165\2\u0163\1\u0166\61\u0163\12\326"+
-    "\1\0\71\326\1\u0167\1\0\13\326\1\0\7\326\1\u0168"+
-    "\61\326\1\u0167\1\0\13\326\1\u0169\74\326\14\332\1\0"+
-    "\67\332\1\u016a\1\0\15\332\1\0\5\332\1\u016b\61\332"+
-    "\1\u016a\1\0\15\332\1\u016c\72\332\7\0\1\u016d\11\0"+
-    "\1\u016e\3\0\1\u016f\23\0\1\u0170\44\0\1\u0171\25\0"+
-    "\1\u0172\56\0\1\341\2\0\2\u0173\5\0\1\341\6\0"+
-    "\1\341\6\u0173\1\0\13\u0173\1\0\13\u0173\1\0\4\u0173"+
-    "\1\0\4\u0173\1\0\4\u0173\2\0\1\u0173\1\u0174\1\0"+
-    "\3\u0174\1\u0175\4\342\1\u0174\1\0\3\u0174\1\u0175\1\342"+
-    "\1\u0174\1\0\3\u0174\1\u0175\6\342\1\u0174\13\342\1\u0174"+
-    "\13\342\1\u0174\4\342\1\u0176\11\342\2\u0174\1\342\20\0"+
-    "\1\u0177\7\0\1\u0178\73\0\1\345\71\0\105\346\1\u0179"+
-    "\1\346\1\u0174\1\0\3\u0174\1\u0175\4\347\1\u0174\1\0"+
-    "\3\u0174\1\u0175\1\347\1\u0174\1\0\3\u0174\1\u0175\6\347"+
-    "\1\u0174\13\347\1\u0174\13\347\1\u0174\4\347\1\u017a\11\347"+
-    "\2\u0174\1\347\105\350\1\u017b\1\350\65\0\1\351\56\0"+
-    "\1\u0172\53\0\1\u017c\106\0\1\u017d\112\0\4\112\6\0"+
-    "\1\112\6\0\4\112\2\u017e\1\0\13\112\1\0\13\112"+
-    "\1\0\4\112\1\0\11\112\2\0\1\112\6\0\4\112"+
-    "\6\0\1\112\6\0\4\112\1\u017e\1\u017f\1\0\13\112"+
-    "\1\0\13\112\1\0\4\112\1\0\11\112\2\0\1\112"+
-    "\6\0\4\112\6\0\1\112\6\0\6\112\1\0\13\112"+
-    "\1\0\2\112\1\u0180\10\112\1\0\4\112\1\0\6\112"+
-    "\1\u0180\2\112\2\0\1\112\12\364\1\365\3\364\1\0"+
-    "\70\364\14\367\1\365\1\367\1\0\70\367\1\374\1\0"+
-    "\10\374\1\376\2\374\1\u0181\47\374\1\u0181\21\374\1\141"+
-    "\2\374\1\375\1\141\1\374\4\141\1\376\1\141\1\374"+
-    "\1\141\1\137\1\374\6\141\1\374\60\141\1\u0100\1\0"+
-    "\12\u0100\1\376\1\u0182\47\u0100\1\u0182\21\u0100\1\142\2\u0100"+
-    "\1\u0101\1\142\1\u0100\4\142\1\u0100\1\142\1\376\1\142"+
-    "\1\137\1\u0100\6\142\1\u0100\60\142\12\u0107\1\u0108\3\u0107"+
-    "\1\0\70\u0107\14\u010a\1\u0108\1\u010a\1\0\70\u010a\6\0"+
-    "\4\166\6\0\1\166\6\0\6\166\1\0\13\166\1\0"+
-    "\13\166\1\0\4\166\1\0\6\166\1\u0183\2\166\2\0"+
-    "\1\166\6\0\4\u010e\6\0\1\u010e\6\0\6\u010e\1\0"+
-    "\13\u010e\1\0\13\u010e\1\0\4\u010e\1\0\11\u010e\2\0"+
-    "\1\u010e\6\0\4\u0110\6\0\1\u0110\6\0\6\u0110\1\0"+
-    "\13\u0110\1\0\13\u0110\1\0\4\u0110\1\0\11\u0110\2\0"+
-    "\1\u0110\12\u0111\1\u0112\3\u0111\1\0\70\u0111\14\u0114\1\u0112"+
-    "\1\u0114\1\0\70\u0114\1\u0184\2\u0185\1\u0186\1\u0184\1\u0185"+
-    "\4\u0184\1\u0185\1\u0184\1\u0185\2\u0184\1\u0185\6\u0184\1\u0185"+
-    "\56\u0184\1\173\1\u0184\1\u0187\2\u0188\1\u0189\1\u0187\1\u0188"+
-    "\4\u0187\1\u0188\1\u0187\1\u0188\2\u0187\1\u0188\6\u0187\1\u0188"+
-    "\56\u0187\1\173\1\u0187\36\0\1\u018a\35\0\1\u018a\53\0"+
-    "\1\u018b\14\0\1\u018b\73\0\1\u018c\11\0\1\u018c\76\0"+
-    "\1\u018d\20\0\1\u018d\113\0\1\u018e\7\0\1\u018e\3\0"+
-    "\12\u0120\1\u0121\3\u0120\1\0\70\u0120\1\u0123\1\0\12\u0123"+
-    "\1\u0121\1\u018f\47\u0123\1\u018f\22\u0123\1\0\12\u0123\1\u0190"+
-    "\1\u018f\47\u0123\1\u018f\21\u0123\14\0\1\u0191\72\0\14\u0123"+
-    "\1\u0190\1\u0123\1\0\70\u0123\12\u0130\1\u0131\3\u0130\1\0"+
-    "\70\u0130\1\u0133\1\0\12\u0133\1\u0131\1\u0192\47\u0133\1\u0192"+
-    "\22\u0133\1\0\12\u0133\1\u0193\1\u0192\47\u0133\1\u0192\21\u0133"+
-    "\14\0\1\u0194\72\0\14\u0133\1\u0193\1\u0133\1\0\70\u0133"+
-    "\2\231\1\0\4\231\1\u0195\11\231\1\u0196\3\231\1\u0197"+
-    "\23\231\1\u0198\37\231\1\0\32\231\1\u0199\51\231\12\u013a"+
-    "\1\u013b\3\u013a\1\0\70\u013a\1\u013d\1\0\12\u013d\1\u013b"+
-    "\1\u019a\47\u013d\1\u019a\22\u013d\1\0\12\u013d\1\u019b\1\u019a"+
-    "\47\u013d\1\u019a\21\u013d\14\0\1\u019c\72\0\14\u013d\1\u019b"+
-    "\1\u013d\1\0\70\u013d\2\240\1\0\4\240\1\u019d\11\240"+
-    "\1\u019e\3\240\1\u019f\23\240\1\u01a0\37\240\1\0\32\240"+
-    "\1\u01a1\51\240\22\0\1\u01a2\64\0\16\250\1\0\70\250"+
-    "\16\256\1\0\70\256\12\263\1\0\1\263\1\0\1\263"+
-    "\1\u01a3\66\263\1\u014e\10\263\1\u01a4\2\263\1\0\1\263"+
-    "\1\0\1\u014b\3\263\1\u01a5\3\263\1\u01a6\23\263\1\u01a7"+
-    "\33\263\1\0\1\263\12\u01a3\1\0\1\u01a3\1\0\70\u01a3"+
-    "\1\0\1\u01a3\12\u014e\1\0\1\u014e\1\0\1\u01a8\67\u014e"+
-    "\1\0\1\u014e\7\u014f\1\u01a9\4\u014f\1\u0150\4\u014f\1\u01aa"+
-    "\3\u014f\1\u01ab\23\u014f\1\u01ac\51\u014f\1\u0150\20\u014f\1\u01ad"+
-    "\51\u014f\7\u0153\1\u01ae\2\u0153\1\u0154\6\u0153\1\u01af\3\u0153"+
-    "\1\u01b0\23\u0153\1\u01b1\47\u0153\1\u0154\22\u0153\1\u01b2\51\u0153"+
-    "\12\301\1\0\103\301\1\u01b3\2\301\1\0\6\301\1\u01b4"+
-    "\3\301\1\u01b5\23\301\1\u01b6\32\301\1\u0157\1\0\1\301"+
-    "\104\u01b7\1\u01b8\2\u01b7\14\305\1\0\101\305\1\u01b9\4\305"+
-    "\1\0\4\305\1\u01ba\3\305\1\u01bb\23\305\1\u01bc\32\305"+
-    "\1\u015a\1\0\1\305\104\u01bd\1\u01be\2\u01bd\7\310\1\u01bf"+
-    "\2\310\1\0\1\310\1\0\4\310\1\u01c0\3\310\1\u01c1"+
-    "\23\310\1\u01c2\33\310\1\0\1\310\7\u015f\1\u01c3\4\u015f"+
-    "\1\u0160\4\u015f\1\u01c4\3\u015f\1\u01c5\23\u015f\1\u01c6\51\u015f"+
-    "\1\u0160\20\u015f\1\u01c7\51\u015f\7\u0163\1\u01c8\2\u0163\1\u0164"+
-    "\6\u0163\1\u01c9\3\u0163\1\u01ca\23\u0163\1\u01cb\47\u0163\1\u0164"+
-    "\22\u0163\1\u01cc\51\u0163\12\326\1\0\103\326\1\u01cd\2\326"+
-    "\1\0\6\326\1\u01ce\3\326\1\u01cf\23\326\1\u01d0\32\326"+
-    "\1\u0167\1\0\1\326\104\u01d1\1\u01d2\2\u01d1\14\332\1\0"+
-    "\101\332\1\u01d3\4\332\1\0\4\332\1\u01d4\3\332\1\u01d5"+
-    "\23\332\1\u01d6\32\332\1\u016a\1\0\1\332\104\u01d7\1\u01d8"+
-    "\2\u01d7\7\0\1\u01d9\106\0\1\u01da\135\0\1\u01db\50\0"+
-    "\1\u0173\1\0\11\u0173\1\0\6\u0173\1\0\64\u0173\1\u0174"+
-    "\1\0\11\u0174\1\0\6\u0174\1\0\47\u0174\1\0\15\u0174"+
-    "\1\0\3\u0174\1\u0175\5\u0174\1\0\3\u0174\1\u0175\2\u0174"+
-    "\1\0\3\u0174\1\u0175\43\u0174\1\u01dc\14\u0174\20\0\1\u0177"+
-    "\51\0\1\u01dd\34\0\1\u01de\15\0\3\u01de\2\0\1\u01de"+
-    "\11\0\1\u01de\1\0\2\u01de\7\0\1\u01de\2\0\2\u01de"+
-    "\6\0\1\u01de\11\0\1\112\1\u01df\2\112\6\0\1\112"+
-    "\6\0\6\112\1\0\13\112\1\0\13\112\1\0\4\112"+
-    "\1\0\11\112\2\0\1\112\6\0\4\112\6\0\1\112"+
-    "\6\0\6\112\1\0\11\112\1\u01e0\1\112\1\0\1\u01e0"+
-    "\12\112\1\0\4\112\1\0\11\112\2\0\1\112\12\374"+
-    "\1\376\3\374\1\0\70\374\14\u0100\1\376\1\u0100\1\0"+
-    "\70\u0100\6\0\3\166\1\u01e1\6\0\1\166\6\0\6\166"+
-    "\1\0\13\166\1\0\13\166\1\0\4\166\1\0\11\166"+
-    "\2\0\1\166\1\u0184\2\u0185\1\u0186\1\u0184\1\u0185\4\u0184"+
-    "\1\u0185\1\u0184\1\u0185\2\u0184\1\u0185\6\u0184\1\u0185\56\u0184"+
-    "\1\u01e2\1\u0184\105\u0185\1\u01e3\1\u0185\1\u0187\2\u0188\1\u0189"+
-    "\1\u0187\1\u0188\4\u0187\1\u0188\1\u0187\1\u0188\2\u0187\1\u0188"+
-    "\6\u0187\1\u0188\56\u0187\1\u01e2\1\u0187\105\u0188\1\u01e4\1\u0188"+
-    "\41\0\1\u01e5\14\0\1\u01e5\63\0\2\u01e6\103\0\2\u01e7"+
-    "\115\0\1\u01e8\14\0\1\u01e8\63\0\2\u01e9\52\0\14\u0123"+
-    "\1\u0121\1\u0123\1\0\70\u0123\3\0\2\u01ea\1\0\4\u01ea"+
-    "\2\0\1\u0125\1\u01ea\1\0\4\u01ea\1\0\11\u01ea\1\0"+
-    "\40\u01ea\2\0\4\u01ea\2\0\1\u01ea\14\u0133\1\u0131\1\u0133"+
-    "\1\0\70\u0133\3\0\2\u01eb\1\0\4\u01eb\2\0\1\u0135"+
-    "\1\u01eb\1\0\4\u01eb\1\0\11\u01eb\1\0\40\u01eb\2\0"+
-    "\4\u01eb\2\0\1\u01eb\2\231\1\0\4\231\1\u01ec\101\231"+
-    "\1\0\33\231\1\u01ed\50\231\14\u013d\1\u013b\1\u013d\1\0"+
-    "\70\u013d\3\0\2\u01ee\1\0\4\u01ee\2\0\1\u013f\1\u01ee"+
-    "\1\0\4\u01ee\1\0\11\u01ee\1\0\40\u01ee\2\0\4\u01ee"+
-    "\2\0\1\u01ee\2\240\1\0\4\240\1\u01ef\101\240\1\0"+
-    "\33\240\1\u01f0\50\240\2\0\1\u01f1\104\0\7\263\1\u01f2"+
-    "\2\263\1\0\1\263\1\0\1\u014b\67\263\1\0\1\263"+
-    "\12\u014e\1\0\1\u014e\1\0\1\u014e\1\0\70\u014e\7\u014f"+
-    "\1\u01f3\4\u014f\1\u0150\106\u014f\1\u0150\21\u014f\1\u01f4\50\u014f"+
-    "\7\u0153\1\u01f5\2\u0153\1\u0154\106\u0153\1\u0154\23\u0153\1\u01f6"+
-    "\50\u0153\7\301\1\u01f7\2\301\1\0\71\301\1\u0157\1\0"+
-    "\1\301\12\u01f8\1\u01f9\72\u01f8\1\0\1\u01f8\7\305\1\u01fa"+
-    "\4\305\1\0\67\305\1\u015a\1\0\1\305\14\u01fb\1\u01f9"+
-    "\70\u01fb\1\0\1\u01fb\7\310\1\u01fc\2\310\1\0\1\310"+
-    "\1\0\70\310\1\0\1\310\7\u015f\1\u01fd\4\u015f\1\u0160"+
-    "\106\u015f\1\u0160\21\u015f\1\u01fe\50\u015f\7\u0163\1\u01ff\2\u0163"+
-    "\1\u0164\106\u0163\1\u0164\23\u0163\1\u0200\50\u0163\7\326\1\u0201"+
-    "\2\326\1\0\71\326\1\u0167\1\0\1\326\12\u0202\1\u0203"+
-    "\72\u0202\1\0\1\u0202\7\332\1\u0204\4\332\1\0\67\332"+
-    "\1\u016a\1\0\1\332\14\u0205\1\u0203\70\u0205\1\0\1\u0205"+
-    "\37\0\1\u0206\141\0\1\u01dc\34\0\1\u01de\15\0\3\u01de"+
-    "\2\0\1\u01de\11\0\1\u01de\1\0\2\u01de\7\0\1\u01de"+
-    "\1\0\1\u01dd\2\u01de\6\0\1\u01de\11\0\4\112\6\0"+
-    "\1\112\6\0\6\112\1\0\7\112\1\u0207\3\112\1\0"+
-    "\13\112\1\0\4\112\1\0\11\112\2\0\1\112\6\0"+
-    "\4\112\6\0\1\112\6\0\6\112\1\0\6\112\1\u0208"+
-    "\4\112\1\0\13\112\1\0\1\112\1\u0208\2\112\1\0"+
-    "\11\112\2\0\1\112\6\0\4\166\6\0\1\166\6\0"+
-    "\6\166\1\0\6\166\1\u0209\4\166\1\0\6\166\1\u020a"+
-    "\4\166\1\0\4\166\1\0\11\166\2\0\1\166\53\0"+
-    "\1\u020b\5\0\1\u020b\73\0\1\u020c\14\0\1\u020c\66\0"+
-    "\1\u020d\11\0\1\u020d\74\0\1\u020e\11\0\1\u020e\77\0"+
-    "\1\u020f\14\0\1\u020f\23\0\2\231\1\0\34\231\1\u0210"+
-    "\47\231\2\240\1\0\34\240\1\u0211\47\240\14\u014f\1\u0150"+
-    "\22\u014f\1\u0212\47\u014f\12\u0153\1\u0154\24\u0153\1\u0213\47\u0153"+
-    "\12\u01f8\1\u01b7\71\u01f8\1\u0214\1\u01b7\1\u01f8\14\u01fb\1\u01bd"+
-    "\67\u01fb\1\u0215\1\u01bd\1\u01fb\14\u015f\1\u0160\22\u015f\1\u0216"+
-    "\47\u015f\12\u0163\1\u0164\24\u0163\1\u0217\47\u0163\12\u0202\1\u01d1"+
-    "\71\u0202\1\u0218\1\u01d1\1\u0202\14\u0205\1\u01d7\67\u0205\1\u0219"+
-    "\1\u01d7\1\u0205\40\0\1\u021a\54\0\4\112\6\0\1\112"+
-    "\6\0\6\112\1\0\13\112\1\0\4\112\1\u021b\6\112"+
-    "\1\0\4\112\1\0\11\112\2\0\1\112\6\0\4\112"+
-    "\6\0\1\112\6\0\6\112\1\0\3\112\1\u021c\7\112"+
-    "\1\0\4\112\1\u021c\6\112\1\0\4\112\1\0\11\112"+
-    "\2\0\1\112\6\0\4\166\6\0\1\166\6\0\6\166"+
-    "\1\0\11\166\1\u021d\1\166\1\0\13\166\1\0\4\166"+
-    "\1\0\11\166\2\0\1\166\6\0\4\166\6\0\1\166"+
-    "\6\0\6\166\1\0\10\166\1\u021e\2\166\1\0\13\166"+
-    "\1\0\4\166\1\0\11\166\2\0\1\166\54\0\1\u021f"+
-    "\24\0\1\u021f\52\0\1\u0220\20\0\1\u0220\70\0\1\u0221"+
-    "\13\0\1\u0221\53\0\2\u0222\112\0\1\u0223\35\0\1\u0223"+
-    "\12\0\2\231\1\0\35\231\1\u0224\46\231\2\240\1\0"+
-    "\35\240\1\u0225\46\240\14\u014f\1\u0150\23\u014f\1\u0226\46\u014f"+
-    "\12\u0153\1\u0154\25\u0153\1\u0227\46\u0153\12\u01f8\1\u0228\71\u01f8"+
-    "\1\u0214\1\u01b7\1\u01f8\14\u01fb\1\u0229\67\u01fb\1\u0215\1\u01bd"+
-    "\1\u01fb\14\u015f\1\u0160\23\u015f\1\u022a\46\u015f\12\u0163\1\u0164"+
-    "\25\u0163\1\u022b\46\u0163\12\u0202\1\u022c\71\u0202\1\u0218\1\u01d1"+
-    "\1\u0202\14\u0205\1\u022d\67\u0205\1\u0219\1\u01d7\1\u0205\41\0"+
-    "\1\u022e\53\0\4\112\6\0\1\112\6\0\6\112\1\0"+
-    "\13\112\1\0\7\112\1\u022f\3\112\1\0\4\112\1\0"+
-    "\11\112\2\0\1\112\6\0\4\166\6\0\1\166\6\0"+
-    "\6\166\1\0\11\166\1\u0230\1\166\1\0\13\166\1\0"+
-    "\4\166\1\0\11\166\2\0\1\166\6\0\4\166\6\0"+
-    "\1\166\6\0\6\166\1\0\6\166\1\u0231\4\166\1\0"+
-    "\13\166\1\0\4\166\1\0\11\166\2\0\1\166\43\0"+
-    "\1\u0232\11\0\1\u0232\72\0\1\u0233\14\0\1\u0233\71\0"+
-    "\1\u0234\14\0\1\u0234\30\0\2\231\1\0\36\231\1\u0235"+
-    "\45\231\2\240\1\0\36\240\1\u0236\45\240\14\u014f\1\u0150"+
-    "\24\u014f\1\u0237\45\u014f\12\u0153\1\u0154\26\u0153\1\u0238\45\u0153"+
-    "\14\u015f\1\u0160\24\u015f\1\u0239\45\u015f\12\u0163\1\u0164\26\u0163"+
-    "\1\u023a\45\u0163\40\0\1\u023b\54\0\4\112\6\0\1\112"+
-    "\6\0\5\112\1\u023c\1\0\13\112\1\0\13\112\1\0"+
-    "\4\112\1\0\11\112\2\0\1\112\6\0\4\166\6\0"+
-    "\1\166\6\0\6\166\1\0\13\166\1\0\4\166\1\u023d"+
-    "\6\166\1\0\4\166\1\0\11\166\2\0\1\166\6\0"+
-    "\4\166\6\0\1\166\6\0\6\166\1\0\5\166\1\u023e"+
-    "\5\166\1\0\13\166\1\0\4\166\1\0\11\166\2\0"+
-    "\1\166\2\231\1\0\35\231\1\u023f\46\231\2\240\1\0"+
-    "\35\240\1\u0240\46\240\14\u014f\1\u0150\23\u014f\1\u0241\46\u014f"+
-    "\12\u0153\1\u0154\25\u0153\1\u0242\46\u0153\14\u015f\1\u0160\23\u015f"+
-    "\1\u0243\46\u015f\12\u0163\1\u0164\25\u0163\1\u0244\46\u0163\35\0"+
-    "\1\u0245\57\0\4\112\6\0\1\112\6\0\6\112\1\0"+
-    "\5\112\1\u0246\5\112\1\0\13\112\1\0\4\112\1\0"+
-    "\11\112\2\0\1\112\6\0\4\166\6\0\1\166\6\0"+
-    "\6\166\1\0\13\166\1\0\13\166\1\0\4\166\1\0"+
-    "\1\166\1\u0247\7\166\2\0\1\166\2\231\1\0\32\231"+
-    "\1\u0248\51\231\2\240\1\0\32\240\1\u0249\51\240\14\u014f"+
-    "\1\u0150\20\u014f\1\u024a\51\u014f\12\u0153\1\u0154\22\u0153\1\u024b"+
-    "\51\u0153\14\u015f\1\u0160\20\u015f\1\u024c\51\u015f\12\u0163\1\u0164"+
-    "\22\u0163\1\u024d\51\u0163\6\0\4\112\6\0\1\112\6\0"+
-    "\6\112\1\0\7\112\1\u024e\3\112\1\0\13\112\1\0"+
-    "\4\112\1\0\11\112\2\0\1\112\6\0\4\166\6\0"+
-    "\1\166\6\0\6\166\1\0\13\166\1\0\4\166\1\u024f"+
-    "\6\166\1\0\4\166\1\0\11\166\2\0\1\166\6\0"+
-    "\4\112\6\0\1\112\6\0\6\112\1\0\13\112\1\0"+
-    "\13\112\1\0\4\112\1\0\11\112\2\0\1\u0250\6\0"+
-    "\4\166\6\0\1\166\6\0\6\166\1\0\10\166\1\u0251"+
-    "\2\166\1\0\13\166\1\0\4\166\1\0\11\166\2\0"+
-    "\1\166\6\0\4\112\6\0\1\112\6\0\6\112\1\0"+
-    "\5\112\1\u0252\5\112\1\0\13\112\1\0\4\112\1\0"+
-    "\11\112\2\0\1\112\6\0\4\166\6\0\1\166\6\0"+
-    "\6\166\1\0\4\166\1\u0253\6\166\1\0\13\166\1\0"+
-    "\4\166\1\0\11\166\2\0\1\166\6\0\4\112\6\0"+
-    "\1\112\6\0\6\112\1\0\5\112\1\u0254\5\112\1\0"+
-    "\13\112\1\0\4\112\1\0\11\112\2\0\1\112\6\0"+
-    "\4\166\6\0\1\166\6\0\6\166\1\0\5\166\1\u0255"+
-    "\5\166\1\0\13\166\1\0\4\166\1\0\11\166\2\0"+
-    "\1\166\6\0\4\112\6\0\1\112\6\0\6\112\1\0"+
-    "\13\112\1\0\4\112\1\u0256\6\112\1\0\4\112\1\0"+
-    "\11\112\2\0\1\112\6\u0257\4\u0258\6\u0257\1\u0258\5\u0257"+
-    "\1\0\6\u0258\1\u0257\13\u0258\1\u0257\13\u0258\1\u0257\4\u0258"+
-    "\1\u0257\11\u0258\2\u0257\1\u0258\42\0\1\u0259\3\0\1\u025a"+
-    "\7\0\1\u025b\1\u025c\21\0\1\u025d\13\0\4\166\6\0"+
-    "\1\166\6\0\6\166\1\0\4\166\1\u025e\3\166\1\u025f"+
-    "\2\166\1\0\4\166\1\u0260\1\u0261\5\166\1\0\4\166"+
-    "\1\0\6\166\1\u0262\2\166\2\0\1\166\57\0\1\u0263"+
-    "\77\0\1\u0264\115\0\1\u0265\105\0\1\u0266\107\0\1\u0267"+
-    "\35\0\4\166\6\0\1\166\6\0\6\166\1\0\13\166"+
-    "\1\0\5\166\1\u0268\5\166\1\0\4\166\1\0\11\166"+
-    "\2\0\1\166\6\0\4\166\6\0\1\166\6\0\6\166"+
-    "\1\0\12\166\1\u0269\1\0\13\166\1\0\4\166\1\0"+
-    "\11\166\2\0\1\166\6\0\4\166\6\0\1\166\6\0"+
-    "\6\166\1\0\13\166\1\0\5\166\1\u026a\5\166\1\0"+
-    "\4\166\1\0\11\166\2\0\1\166\6\0\4\166\6\0"+
-    "\1\166\6\0\6\166\1\0\13\166\1\0\4\166\1\u026b"+
-    "\6\166\1\0\4\166\1\0\11\166\2\0\1\166\6\0"+
-    "\4\166\6\0\1\166\6\0\6\166\1\0\13\166\1\0"+
-    "\5\166\1\u026c\5\166\1\0\4\166\1\0\11\166\2\0"+
-    "\1\166\44\0\1\u026d\136\0\1\u026e\107\0\1\u026f\67\0"+
-    "\1\u0270\125\0\1\u0271\17\0\4\166\6\0\1\166\6\0"+
-    "\6\166\1\0\6\166\1\u0272\4\166\1\0\13\166\1\0"+
-    "\4\166\1\0\11\166\2\0\1\166\6\0\4\166\6\0"+
-    "\1\166\6\0\6\166\1\0\13\166\1\0\13\166\1\0"+
-    "\4\166\1\0\1\166\1\u0273\7\166\2\0\1\166\6\0"+
-    "\4\166\6\0\1\166\6\0\6\166\1\0\13\166\1\0"+
-    "\13\166\1\0\4\166\1\0\2\166\1\u0274\6\166\2\0"+
-    "\1\166\6\0\4\166\6\0\1\166\6\0\6\166\1\0"+
-    "\13\166\1\0\4\166\1\u0275\6\166\1\0\4\166\1\0"+
-    "\11\166\2\0\1\166\6\0\4\166\6\0\1\166\6\0"+
-    "\6\166\1\0\13\166\1\0\13\166\1\0\4\166\1\0"+
-    "\2\166\1\u0276\6\166\2\0\1\166\46\0\1\u0277\74\0"+
-    "\1\u0278\106\0\1\u0279\116\0\1\u027a\105\0\1\u027b\51\0"+
-    "\4\166\6\0\1\166\6\0\6\166\1\0\10\166\1\u027c"+
-    "\2\166\1\0\13\166\1\0\4\166\1\0\11\166\2\0"+
-    "\1\166\6\0\4\166\6\0\1\166\6\0\5\166\1\u027d"+
-    "\1\0\13\166\1\0\13\166\1\0\4\166\1\0\11\166"+
-    "\2\0\1\166\6\0\4\166\6\0\1\166\6\0\5\166"+
-    "\1\u027e\1\0\13\166\1\0\13\166\1\0\4\166\1\0"+
-    "\11\166\2\0\1\166\6\0\4\166\6\0\1\166\6\0"+
-    "\6\166\1\0\6\166\1\u027f\4\166\1\0\13\166\1\0"+
-    "\4\166\1\0\11\166\2\0\1\166\6\0\4\166\6\0"+
-    "\1\166\6\0\6\166\1\0\5\166\1\u0280\5\166\1\0"+
-    "\13\166\1\0\4\166\1\0\11\166\2\0\1\166\57\0"+
-    "\1\u0281\131\0\1\u0282\52\0\1\u0283\106\0\1\u0284\46\0"+
-    "\4\166\6\0\1\166\6\0\6\166\1\0\13\166\1\0"+
-    "\5\166\1\u0285\5\166\1\0\4\166\1\0\11\166\2\0"+
-    "\1\166\6\0\4\166\6\0\1\166\6\0\6\166\1\0"+
-    "\13\166\1\0\13\166\1\0\4\166\1\0\7\166\1\u0286"+
-    "\1\166\2\0\1\166\6\0\4\166\6\0\1\166\6\0"+
-    "\6\166\1\0\10\166\1\u0287\2\166\1\0\13\166\1\0"+
-    "\4\166\1\0\11\166\2\0\1\166\6\0\4\166\6\0"+
-    "\1\166\6\0\6\166\1\0\10\166\1\u0288\2\166\1\0"+
-    "\13\166\1\0\4\166\1\0\11\166\2\0\1\166\103\0"+
-    "\1\u0289\63\0\1\u0271\131\0\1\u027b\106\0\1\u028a\11\0"+
-    "\4\166\6\0\1\166\6\0\6\166\1\0\13\166\1\0"+
-    "\13\166\1\0\4\166\1\0\10\166\1\u028b\2\0\1\166"+
-    "\6\0\4\166\6\0\1\166\6\0\6\166\1\0\13\166"+
-    "\1\0\6\166\1\u0276\4\166\1\0\4\166\1\0\11\166"+
-    "\2\0\1\166\6\0\4\166\6\0\1\166\6\0\6\166"+
-    "\1\0\13\166\1\0\13\166\1\0\4\166\1\0\10\166"+
-    "\1\u0280\2\0\1\166\6\0\4\166\6\0\1\166\6\0"+
-    "\6\166\1\0\13\166\1\0\13\166\1\0\4\166\1\0"+
-    "\10\166\1\u028c\2\0\1\166\34\0\1\u0271\154\0\1\u028d"+
-    "\12\0\4\166\6\0\1\166\6\0\5\166\1\u0276\1\0"+
-    "\13\166\1\0\13\166\1\0\4\166\1\0\11\166\2\0"+
-    "\1\166\6\0\4\166\6\0\1\166\6\0\6\166\1\0"+
-    "\13\166\1\0\13\166\1\0\4\166\1\0\7\166\1\u028e"+
-    "\1\166\2\0\1\166\56\0\1\u0271\36\0\4\166\6\0"+
-    "\1\166\6\0\6\166\1\0\13\166\1\0\4\166\1\u0276"+
-    "\6\166\1\0\4\166\1\0\11\166\2\0\1\166";
+    "\1\72\1\73\11\72\1\74\1\72\1\75\1\72\1\76"+
+    "\3\72\1\77\42\72\1\100\20\72\1\101\1\102\105\101"+
+    "\1\103\1\104\22\103\1\105\2\103\1\106\57\103\1\107"+
+    "\1\110\105\107\1\103\1\104\5\103\1\111\17\103\1\106"+
+    "\60\103\1\104\2\103\1\112\1\113\2\103\2\114\6\103"+
+    "\1\113\6\103\1\113\1\115\1\116\4\114\1\103\10\114"+
+    "\1\117\2\114\1\103\11\114\1\117\1\114\1\103\4\114"+
+    "\1\103\4\114\1\103\4\114\1\103\1\114\1\103\1\104"+
+    "\2\103\1\112\1\120\12\103\1\120\6\103\1\120\57\103"+
+    "\1\121\1\122\2\121\1\123\22\121\1\106\57\121\1\103"+
+    "\1\104\2\103\1\124\1\113\2\103\2\125\6\103\1\113"+
+    "\6\103\1\113\6\125\1\103\13\125\1\103\13\125\1\103"+
+    "\4\125\1\103\4\125\1\103\4\125\1\103\1\125\1\103"+
+    "\1\104\2\103\1\124\1\113\2\103\2\125\6\103\1\113"+
+    "\6\103\1\113\6\125\1\103\13\125\1\126\13\125\1\103"+
+    "\4\125\1\103\4\125\1\103\4\125\1\103\1\125\1\127"+
+    "\1\104\1\103\1\130\1\131\1\113\4\127\1\132\1\127"+
+    "\1\133\3\127\1\113\6\127\1\113\57\127\1\103\1\104"+
+    "\2\103\1\134\22\103\1\106\60\103\1\104\1\135\1\136"+
+    "\1\103\1\113\2\103\2\137\6\103\1\113\6\103\1\113"+
+    "\6\137\1\103\13\137\1\103\13\137\1\103\4\137\1\103"+
+    "\4\137\1\103\4\137\1\103\1\137\1\103\1\104\1\135"+
+    "\1\136\1\103\1\113\2\103\2\137\6\103\1\113\6\103"+
+    "\1\113\6\137\1\103\13\137\1\140\13\137\1\103\4\137"+
+    "\1\103\4\137\1\103\4\137\1\103\1\137\1\141\1\104"+
+    "\1\135\1\142\1\141\1\113\4\141\1\143\1\141\1\144"+
+    "\3\141\1\113\6\141\1\113\57\141\1\103\1\104\3\103"+
+    "\1\113\12\103\1\113\6\103\1\113\57\103\1\145\1\146"+
+    "\21\145\1\147\63\145\1\103\1\150\3\103\1\113\2\103"+
+    "\2\151\6\103\1\113\2\103\1\152\3\103\1\113\6\151"+
+    "\1\103\13\151\1\103\13\151\1\103\4\151\1\103\4\151"+
+    "\1\103\4\151\1\103\1\151\1\103\1\150\3\103\1\153"+
+    "\12\103\1\153\2\103\1\152\3\103\1\153\60\103\1\150"+
+    "\3\103\1\113\2\103\2\154\6\103\1\113\2\103\1\152"+
+    "\3\103\1\113\6\154\1\103\13\154\1\103\13\154\1\103"+
+    "\4\154\1\103\4\154\1\103\4\154\1\103\1\154\1\103"+
+    "\1\150\3\103\1\113\2\103\2\154\6\103\1\113\2\103"+
+    "\1\152\3\103\1\113\6\154\1\103\13\154\1\155\13\154"+
+    "\1\103\4\154\1\103\4\154\1\103\4\154\1\103\1\154"+
+    "\1\156\1\150\1\103\1\157\1\156\1\113\4\156\1\160"+
+    "\1\156\1\161\3\156\1\113\2\156\1\162\3\156\1\113"+
+    "\57\156\1\163\1\164\1\165\1\166\4\163\2\167\16\163"+
+    "\6\170\1\163\13\170\1\163\13\170\1\163\4\170\1\163"+
+    "\4\170\1\163\1\171\3\170\1\163\1\170\1\103\1\172"+
+    "\1\165\1\166\1\103\1\113\2\103\2\173\6\103\1\113"+
+    "\6\103\1\113\6\173\1\103\13\173\1\103\13\173\1\103"+
+    "\4\173\1\103\4\173\1\103\4\173\1\103\1\173\1\103"+
+    "\1\172\1\165\1\166\1\103\1\113\2\103\2\173\6\103"+
+    "\1\113\6\103\1\113\6\173\1\103\13\173\1\174\13\173"+
+    "\1\103\4\173\1\103\4\173\1\103\4\173\1\103\1\173"+
+    "\1\175\1\176\1\165\1\177\1\175\1\113\4\175\1\200"+
+    "\1\175\1\201\1\202\2\175\1\113\6\175\1\113\36\175"+
+    "\1\203\20\175\1\103\1\204\1\205\2\103\1\113\12\103"+
+    "\1\113\6\103\1\113\10\103\1\206\1\207\2\103\1\210"+
+    "\11\103\1\210\1\103\1\207\1\206\26\103\1\104\1\205"+
+    "\2\103\1\113\12\103\1\113\6\103\1\113\6\103\1\211"+
+    "\51\103\1\104\1\205\2\103\1\113\2\103\2\212\6\103"+
+    "\1\113\6\103\1\113\6\212\1\211\13\212\1\103\13\212"+
+    "\1\103\4\212\1\103\4\212\1\103\4\212\1\103\1\212"+
+    "\1\103\1\104\1\205\2\103\1\113\12\103\1\113\6\103"+
+    "\1\113\6\103\1\211\7\103\1\213\6\103\1\214\11\103"+
+    "\1\213\12\103\1\214\4\103\1\215\1\104\1\205\1\216"+
+    "\1\215\1\113\4\215\1\217\1\215\1\220\3\215\1\113"+
+    "\6\215\1\113\6\215\1\221\50\215\1\222\1\104\1\205"+
+    "\1\223\1\222\1\113\4\222\1\224\1\222\1\225\3\222"+
+    "\1\113\6\222\1\113\6\222\1\226\50\222\1\227\1\104"+
+    "\1\205\1\230\1\227\1\113\4\227\1\231\1\227\1\232"+
+    "\3\227\1\113\6\227\1\113\57\227\1\233\1\234\1\235"+
+    "\104\233\1\236\1\104\1\205\1\237\1\236\1\113\4\236"+
+    "\1\240\1\236\1\241\3\236\1\113\6\236\1\113\57\236"+
+    "\1\242\1\243\1\244\104\242\1\245\1\246\105\245\1\103"+
+    "\1\104\25\103\1\106\57\103\1\247\1\250\105\247\1\103"+
+    "\1\104\5\103\1\251\17\103\1\106\57\103\1\252\1\253"+
+    "\1\165\1\254\1\252\1\113\4\252\1\255\1\252\1\256"+
+    "\1\257\2\252\1\113\6\252\1\113\36\252\1\260\20\252"+
+    "\1\261\1\262\3\261\1\263\6\261\1\264\1\265\2\261"+
+    "\1\263\6\261\1\263\36\261\1\266\20\261\1\267\1\262"+
+    "\3\267\1\270\4\267\1\271\2\267\1\272\2\267\1\270"+
+    "\6\267\1\270\36\267\1\273\20\267\1\274\1\275\10\274"+
+    "\1\276\1\274\1\277\1\300\67\274\1\301\1\274\1\302"+
+    "\1\303\12\302\1\304\12\302\1\305\57\302\1\306\1\307"+
+    "\10\306\1\310\14\306\1\311\57\306\1\103\1\104\12\103"+
+    "\1\304\12\103\1\106\60\103\1\104\10\103\1\310\14\103"+
+    "\1\106\57\103\1\312\1\313\10\312\1\314\4\312\1\315"+
+    "\65\312\1\316\1\312\1\317\1\320\12\317\1\264\2\317"+
+    "\1\321\65\317\1\316\1\317\1\322\1\323\10\322\1\324"+
+    "\1\322\1\325\51\322\1\326\16\322\1\327\1\322\1\330"+
+    "\1\331\12\330\1\332\12\330\1\333\57\330\1\334\1\335"+
+    "\10\334\1\336\14\334\1\337\57\334\1\103\1\104\12\103"+
+    "\1\332\12\103\1\106\60\103\1\104\10\103\1\336\14\103"+
+    "\1\106\57\103\1\340\1\341\10\340\1\314\4\340\1\342"+
+    "\65\340\1\343\1\340\1\344\1\345\12\344\1\264\2\344"+
+    "\1\346\65\344\1\343\1\344\1\72\1\0\11\72\1\0"+
+    "\1\72\1\0\5\72\1\0\42\72\1\0\20\72\3\0"+
+    "\1\347\1\350\16\0\1\351\2\0\1\352\65\0\1\353"+
+    "\2\0\2\354\6\0\1\353\6\0\1\353\6\354\1\0"+
+    "\13\354\1\0\13\354\1\355\4\354\1\0\4\354\1\0"+
+    "\4\354\1\0\1\354\1\72\1\0\11\72\1\0\1\72"+
+    "\1\356\1\357\4\72\1\0\64\72\1\0\11\72\1\0"+
+    "\1\72\1\360\5\72\1\0\42\72\1\360\20\72\5\0"+
+    "\1\353\2\0\2\361\6\0\1\353\6\0\1\353\6\361"+
+    "\1\0\13\361\1\0\13\361\1\0\4\361\1\0\4\361"+
+    "\1\0\4\361\1\0\1\361\1\72\1\0\11\72\1\0"+
+    "\2\72\1\362\4\72\1\0\42\72\1\363\20\72\132\0"+
+    "\1\351\2\0\1\364\104\0\1\365\71\0\1\366\101\0"+
+    "\1\367\111\0\1\113\12\0\1\113\6\0\1\113\65\0"+
+    "\4\114\7\0\1\114\6\0\6\114\1\0\13\114\1\0"+
+    "\13\114\1\0\4\114\1\0\11\114\1\0\1\114\6\0"+
+    "\4\114\7\0\1\114\6\0\2\114\2\370\2\114\1\0"+
+    "\13\114\1\0\13\114\1\0\4\114\1\0\11\114\1\0"+
+    "\1\114\6\0\4\114\7\0\1\114\6\0\2\114\1\370"+
+    "\1\371\2\114\1\0\13\114\1\0\13\114\1\0\4\114"+
+    "\1\0\11\114\1\0\1\114\6\0\4\114\7\0\1\114"+
+    "\6\0\2\114\2\372\2\114\1\0\13\114\1\0\13\114"+
+    "\1\0\4\114\1\0\11\114\1\0\1\114\5\0\1\120"+
+    "\12\0\1\120\6\0\1\120\61\0\1\373\106\0\1\374"+
+    "\112\0\4\125\7\0\1\125\6\0\6\125\1\0\13\125"+
+    "\1\0\13\125\1\0\4\125\1\0\11\125\1\0\1\125"+
+    "\1\127\2\0\1\375\1\127\1\0\4\127\1\0\1\127"+
+    "\1\0\3\127\1\0\6\127\1\0\60\127\1\0\1\374"+
+    "\1\375\1\127\1\0\4\127\1\0\1\127\1\0\3\127"+
+    "\1\0\6\127\1\0\57\127\1\376\1\0\10\376\1\377"+
+    "\2\376\1\u0100\1\376\1\u0101\46\376\1\u0100\20\376\1\u0102"+
+    "\1\0\12\u0102\1\377\1\u0103\1\u0102\1\u0104\46\u0102\1\u0103"+
+    "\20\u0102\2\0\1\135\1\u0105\111\0\4\137\7\0\1\137"+
+    "\6\0\6\137\1\0\13\137\1\0\13\137\1\0\4\137"+
+    "\1\0\11\137\1\0\1\137\1\141\2\0\1\u0106\1\141"+
+    "\1\0\4\141\1\0\1\141\1\0\3\141\1\0\6\141"+
+    "\1\0\60\141\1\0\1\135\1\u0107\1\141\1\0\4\141"+
+    "\1\0\1\141\1\0\3\141\1\0\6\141\1\0\57\141"+
+    "\1\143\1\0\1\u0108\1\u0109\1\143\1\u0108\4\143\1\u010a"+
+    "\1\143\1\u0108\1\u010b\1\143\1\u010c\1\u0108\6\143\1\u0108"+
+    "\36\143\1\u010b\20\143\1\144\1\0\1\u010d\1\u010e\1\144"+
+    "\1\u010d\4\144\1\u010d\1\144\1\u010a\1\u010f\1\144\1\u0110"+
+    "\1\u010d\6\144\1\u010d\36\144\1\u010f\20\144\2\0\1\u0111"+
+    "\127\0\1\351\2\0\1\u0112\66\0\4\151\7\0\1\151"+
+    "\6\0\6\151\1\0\13\151\1\0\13\151\1\0\4\151"+
+    "\1\0\11\151\1\0\1\151\2\0\1\u0113\111\0\1\153"+
+    "\12\0\1\153\6\0\1\153\65\0\4\154\7\0\1\154"+
+    "\6\0\6\154\1\0\13\154\1\0\13\154\1\0\4\154"+
+    "\1\0\11\154\1\0\1\154\1\156\2\0\1\u0114\1\156"+
+    "\1\0\4\156\1\0\1\156\1\0\3\156\1\0\6\156"+
+    "\1\0\57\156\1\u0115\1\0\10\u0115\1\u0116\2\u0115\1\u0117"+
+    "\1\u0115\1\u0118\46\u0115\1\u0117\20\u0115\1\u0119\1\0\12\u0119"+
+    "\1\u0116\1\u011a\1\u0119\1\u011b\46\u0119\1\u011a\20\u0119\1\156"+
+    "\1\0\1\u0113\1\u0114\1\156\1\0\4\156\1\0\1\156"+
+    "\1\0\3\156\1\0\6\156\1\0\57\156\1\163\3\0"+
+    "\24\163\6\0\1\163\13\0\1\163\13\0\1\163\4\0"+
+    "\1\163\4\0\1\163\4\0\1\163\4\0\1\347\17\0"+
+    "\1\351\2\0\1\352\62\0\1\u011c\104\0\1\163\3\0"+
+    "\2\163\4\167\7\163\1\167\6\163\6\170\1\163\13\170"+
+    "\1\163\13\170\1\163\4\170\1\163\4\170\1\167\4\170"+
+    "\1\163\1\170\6\0\4\170\7\0\1\170\6\0\6\170"+
+    "\1\0\13\170\1\0\13\170\1\0\4\170\1\0\11\170"+
+    "\1\0\1\170\6\0\4\170\7\0\1\170\6\0\6\170"+
+    "\1\0\7\170\1\u011d\3\170\1\0\13\170\1\0\4\170"+
+    "\1\0\11\170\1\0\1\170\3\0\1\347\4\0\2\u011e"+
+    "\11\0\1\351\2\0\1\352\1\0\6\u011e\1\0\13\u011e"+
+    "\1\0\13\u011e\1\0\4\u011e\1\0\4\u011e\1\0\4\u011e"+
+    "\1\0\1\u011e\6\0\4\173\7\0\1\173\6\0\6\173"+
+    "\1\0\13\173\1\0\13\173\1\0\4\173\1\0\11\173"+
+    "\1\0\1\173\1\175\2\0\1\u011f\1\175\1\0\4\175"+
+    "\1\0\1\175\1\0\3\175\1\0\6\175\1\0\57\175"+
+    "\3\0\1\347\4\0\2\u0120\11\0\1\351\2\0\1\352"+
+    "\1\0\6\u0120\1\0\13\u0120\1\0\13\u0120\1\0\4\u0120"+
+    "\1\0\4\u0120\1\0\4\u0120\1\0\1\u0120\1\175\1\0"+
+    "\1\u011c\1\u011f\1\175\1\0\4\175\1\0\1\175\1\0"+
+    "\3\175\1\0\6\175\1\0\57\175\1\u0121\1\0\10\u0121"+
+    "\1\u0122\2\u0121\1\u0123\1\u0121\1\u0124\46\u0121\1\u0123\20\u0121"+
+    "\1\u0125\1\0\12\u0125\1\u0122\1\u0126\1\u0125\1\u0127\46\u0125"+
+    "\1\u0126\20\u0125\1\175\2\0\1\u011f\1\175\1\0\4\175"+
+    "\1\0\1\175\1\0\1\175\1\u0128\1\175\1\0\6\175"+
+    "\1\0\60\175\2\0\1\u011f\1\175\1\0\4\175\1\0"+
+    "\1\175\1\0\1\175\1\u0129\1\175\1\0\6\175\1\0"+
+    "\57\175\3\0\1\347\17\0\1\351\2\0\1\u0112\130\0"+
+    "\1\u012a\2\0\1\u012a\75\0\1\u012b\14\0\1\u012b\63\0"+
+    "\2\u012c\51\0\24\u012d\1\u012e\62\u012d\6\0\4\212\7\0"+
+    "\1\212\6\0\6\212\1\0\13\212\1\0\13\212\1\0"+
+    "\4\212\1\0\11\212\1\0\1\212\54\0\1\u012f\5\0"+
+    "\1\u012f\116\0\1\u0130\10\0\1\u0130\3\0\1\215\2\0"+
+    "\1\u0131\1\215\1\0\4\215\1\0\1\215\1\0\3\215"+
+    "\1\0\6\215\1\0\57\215\1\u0132\1\0\10\u0132\1\u0133"+
+    "\2\u0132\1\u0134\1\u0132\1\u0135\46\u0132\1\u0134\20\u0132\1\u0136"+
+    "\1\0\1\u0136\2\u0137\1\u0136\4\u0137\2\u0136\1\u0138\1\u0139"+
+    "\1\u0136\1\u013a\4\u0137\1\u0136\11\u0137\1\u0136\27\u0137\1\u0139"+
+    "\10\u0137\2\u0136\4\u0137\1\u0136\1\u0137\1\221\2\u012d\1\u013b"+
+    "\1\221\1\u012d\4\221\1\u012d\1\221\1\u012d\3\221\1\u012d"+
+    "\3\221\1\u013c\2\221\1\u012d\57\221\1\222\2\0\1\u013d"+
+    "\1\222\1\0\4\222\1\0\1\222\1\0\3\222\1\0"+
+    "\6\222\1\0\57\222\12\u013e\1\u013f\74\u013e\14\u0140\1\u013f"+
+    "\72\u0140\1\226\2\u012d\1\u0141\1\226\1\u012d\4\226\1\u012d"+
+    "\1\226\1\u012d\3\226\1\u012d\3\226\1\u0142\2\226\1\u012d"+
+    "\57\226\1\227\2\0\1\u0143\1\227\1\0\4\227\1\0"+
+    "\1\227\1\0\3\227\1\0\6\227\1\0\57\227\1\u0144"+
+    "\1\0\10\u0144\1\u0145\2\u0144\1\u0146\1\u0144\1\u0147\46\u0144"+
+    "\1\u0146\20\u0144\1\u0148\1\0\1\u0148\2\u0149\1\u0148\4\u0149"+
+    "\2\u0148\1\u014a\1\u014b\1\u0148\1\u014c\4\u0149\1\u0148\11\u0149"+
+    "\1\u0148\27\u0149\1\u014b\10\u0149\2\u0148\4\u0149\1\u0148\1\u0149"+
+    "\2\233\1\0\106\233\1\0\20\233\1\u014d\2\233\1\u014e"+
+    "\60\233\1\236\2\0\1\u014f\1\236\1\0\4\236\1\0"+
+    "\1\236\1\0\3\236\1\0\6\236\1\0\57\236\1\u0150"+
+    "\1\0\10\u0150\1\u0151\2\u0150\1\u0152\1\u0150\1\u0153\46\u0150"+
+    "\1\u0152\20\u0150\1\u0154\1\0\1\u0154\2\u0155\1\u0154\4\u0155"+
+    "\2\u0154\1\u0156\1\u0157\1\u0154\1\u0158\4\u0155\1\u0154\11\u0155"+
+    "\1\u0154\27\u0155\1\u0157\10\u0155\2\u0154\4\u0155\1\u0154\1\u0155"+
+    "\2\242\1\0\106\242\1\0\20\242\1\u0159\2\242\1\u015a"+
+    "\60\242\7\0\1\u015b\77\0\1\252\2\0\1\u015c\1\252"+
+    "\1\0\4\252\1\0\1\252\1\0\3\252\1\0\6\252"+
+    "\1\0\60\252\1\0\1\u011c\1\u015c\1\252\1\0\4\252"+
+    "\1\0\1\252\1\0\3\252\1\0\6\252\1\0\57\252"+
+    "\1\u015d\1\0\10\u015d\1\u015e\2\u015d\1\u015f\1\u015d\1\u0160"+
+    "\46\u015d\1\u015f\20\u015d\1\u0161\1\0\12\u0161\1\u015e\1\u0162"+
+    "\1\u0161\1\u0163\46\u0161\1\u0162\20\u0161\1\252\2\0\1\u015c"+
+    "\1\252\1\0\4\252\1\0\1\252\1\0\1\252\1\u0164"+
+    "\1\252\1\0\6\252\1\0\60\252\2\0\1\u015c\1\252"+
+    "\1\0\4\252\1\0\1\252\1\0\1\252\1\u0165\1\252"+
+    "\1\0\6\252\1\0\57\252\1\261\1\0\12\261\2\0"+
+    "\50\261\1\0\20\261\3\0\1\u0166\17\0\1\351\2\0"+
+    "\1\364\60\0\1\261\1\0\3\261\1\263\6\261\2\0"+
+    "\2\261\1\263\6\261\1\263\36\261\1\0\20\261\5\0"+
+    "\1\u0167\10\0\1\u0168\1\0\1\u0167\6\0\1\u0167\64\0"+
+    "\1\u0167\10\0\1\u0169\1\0\1\u0167\6\0\1\u0167\57\0"+
+    "\1\267\1\0\10\267\1\0\2\267\1\0\50\267\1\0"+
+    "\21\267\1\0\3\267\1\270\4\267\1\0\2\267\1\0"+
+    "\2\267\1\270\6\267\1\270\36\267\1\0\20\267\5\0"+
+    "\1\u0167\10\0\1\u016a\1\0\1\u0167\6\0\1\u0167\64\0"+
+    "\1\u0167\10\0\1\u016b\1\0\1\u0167\6\0\1\u0167\57\0"+
+    "\12\274\1\0\1\274\1\0\1\u016c\67\274\1\0\13\274"+
+    "\1\0\1\274\1\0\1\u016c\5\274\1\u016d\61\274\1\0"+
+    "\13\274\1\0\1\274\1\0\1\274\1\u016e\66\274\1\u016f"+
+    "\1\274\14\u0170\1\u0171\106\u0170\1\u0171\6\u0170\1\u0172\2\u0170"+
+    "\1\u0173\60\u0170\12\u0174\1\u0175\106\u0174\1\u0175\10\u0174\1\u0176"+
+    "\2\u0174\1\u0177\60\u0174\12\312\1\0\4\312\1\u0178\65\312"+
+    "\1\0\13\312\1\0\4\312\1\u0178\3\312\1\u0179\61\312"+
+    "\1\0\13\312\1\u017a\74\312\14\317\1\0\2\317\1\u017b"+
+    "\65\317\1\0\15\317\1\0\2\317\1\u017b\3\317\1\u017c"+
+    "\61\317\1\0\15\317\1\u017d\72\317\12\322\1\0\1\322"+
+    "\1\0\70\322\1\0\13\322\1\0\1\322\1\0\6\322"+
+    "\1\u017e\61\322\1\0\13\322\1\0\1\322\1\0\1\322"+
+    "\1\u017f\66\322\1\0\1\322\14\u0180\1\u0181\106\u0180\1\u0181"+
+    "\6\u0180\1\u0182\2\u0180\1\u0183\60\u0180\12\u0184\1\u0185\106\u0184"+
+    "\1\u0185\10\u0184\1\u0186\2\u0184\1\u0187\60\u0184\12\340\1\0"+
+    "\4\340\1\u0188\65\340\1\0\13\340\1\0\4\340\1\u0188"+
+    "\3\340\1\u0189\61\340\1\0\13\340\1\u018a\74\340\14\344"+
+    "\1\0\2\344\1\u018b\65\344\1\0\15\344\1\0\2\344"+
+    "\1\u018b\3\344\1\u018c\61\344\1\0\15\344\1\u018d\72\344"+
+    "\7\0\1\u018e\12\0\1\u018f\3\0\1\u0190\23\0\1\u0191"+
+    "\43\0\1\u0192\26\0\1\u0193\55\0\1\353\2\0\2\u0194"+
+    "\6\0\1\353\6\0\1\353\6\u0194\1\0\13\u0194\1\0"+
+    "\13\u0194\1\0\4\u0194\1\0\4\u0194\1\0\4\u0194\1\0"+
+    "\1\u0194\1\u0195\1\0\3\u0195\1\u0196\4\354\1\u0195\1\0"+
+    "\4\u0195\1\u0196\1\354\1\u0195\1\0\3\u0195\1\u0196\6\354"+
+    "\1\u0195\13\354\1\u0195\13\354\1\u0195\4\354\1\u0197\11\354"+
+    "\1\u0195\1\354\21\0\1\u0198\7\0\1\u0199\55\0\1\72"+
+    "\1\0\11\72\1\0\1\72\1\u019a\5\72\1\0\42\72"+
+    "\1\0\20\72\105\357\1\u019b\1\357\16\0\1\u019c\70\0"+
+    "\1\u0195\1\0\3\u0195\1\u0196\4\361\1\u0195\1\0\4\u0195"+
+    "\1\u0196\1\361\1\u0195\1\0\3\u0195\1\u0196\6\361\1\u0195"+
+    "\13\361\1\u0195\13\361\1\u0195\4\361\1\u019d\11\361\1\u0195"+
+    "\1\361\105\362\1\u019e\1\362\1\72\1\0\11\72\1\0"+
+    "\1\72\1\0\5\72\1\0\42\72\1\u019f\20\72\36\0"+
+    "\1\u0193\52\0\1\u01a0\106\0\1\u01a1\112\0\4\114\7\0"+
+    "\1\114\6\0\4\114\2\u01a2\1\0\13\114\1\0\13\114"+
+    "\1\0\4\114\1\0\11\114\1\0\1\114\6\0\4\114"+
+    "\7\0\1\114\6\0\4\114\1\u01a2\1\u01a3\1\0\13\114"+
+    "\1\0\13\114\1\0\4\114\1\0\11\114\1\0\1\114"+
+    "\6\0\4\114\7\0\1\114\6\0\6\114\1\0\13\114"+
+    "\1\0\2\114\1\u01a4\10\114\1\0\4\114\1\0\6\114"+
+    "\1\u01a4\2\114\1\0\1\114\12\376\1\377\3\376\1\0"+
+    "\71\376\1\0\10\376\1\377\2\376\1\u01a5\1\376\1\u0101"+
+    "\46\376\1\u01a5\20\376\14\u0102\1\377\1\u0102\1\0\71\u0102"+
+    "\1\0\12\u0102\1\377\1\u01a6\1\u0102\1\u0104\46\u0102\1\u01a6"+
+    "\20\u0102\1\u0108\1\0\10\u0108\1\u010a\2\u0108\1\u01a7\1\u0108"+
+    "\1\u01a8\46\u0108\1\u01a7\20\u0108\1\143\2\u0108\1\u0109\1\143"+
+    "\1\u0108\4\143\1\u010a\1\143\1\u0108\1\143\1\141\1\143"+
+    "\1\u0108\6\143\1\u0108\60\143\1\0\1\u0108\1\u0109\1\143"+
+    "\1\u0108\4\143\1\u010a\1\143\1\u0108\1\u01a9\1\143\1\u010c"+
+    "\1\u0108\6\143\1\u0108\36\143\1\u01a9\20\143\1\u010d\1\0"+
+    "\12\u010d\1\u010a\1\u01aa\1\u010d\1\u01ab\46\u010d\1\u01aa\20\u010d"+
+    "\1\144\2\u010d\1\u010e\1\144\1\u010d\4\144\1\u010d\1\144"+
+    "\1\u010a\1\144\1\141\1\144\1\u010d\6\144\1\u010d\60\144"+
+    "\1\0\1\u010d\1\u010e\1\144\1\u010d\4\144\1\u010d\1\144"+
+    "\1\u010a\1\u01ac\1\144\1\u0110\1\u010d\6\144\1\u010d\36\144"+
+    "\1\u01ac\20\144\12\u0115\1\u0116\3\u0115\1\0\71\u0115\1\0"+
+    "\10\u0115\1\u0116\2\u0115\1\u01ad\1\u0115\1\u0118\46\u0115\1\u01ad"+
+    "\20\u0115\14\u0119\1\u0116\1\u0119\1\0\71\u0119\1\0\12\u0119"+
+    "\1\u0116\1\u01ae\1\u0119\1\u011b\46\u0119\1\u01ae\20\u0119\6\0"+
+    "\4\170\7\0\1\170\6\0\6\170\1\0\13\170\1\0"+
+    "\13\170\1\0\4\170\1\0\6\170\1\u01af\2\170\1\0"+
+    "\1\170\6\0\4\u011e\7\0\1\u011e\6\0\6\u011e\1\0"+
+    "\13\u011e\1\0\13\u011e\1\0\4\u011e\1\0\11\u011e\1\0"+
+    "\1\u011e\6\0\4\u0120\7\0\1\u0120\6\0\6\u0120\1\0"+
+    "\13\u0120\1\0\13\u0120\1\0\4\u0120\1\0\11\u0120\1\0"+
+    "\1\u0120\12\u0121\1\u0122\3\u0121\1\0\71\u0121\1\0\10\u0121"+
+    "\1\u0122\2\u0121\1\u01b0\1\u0121\1\u0124\46\u0121\1\u01b0\20\u0121"+
+    "\14\u0125\1\u0122\1\u0125\1\0\71\u0125\1\0\12\u0125\1\u0122"+
+    "\1\u01b1\1\u0125\1\u0127\46\u0125\1\u01b1\20\u0125\1\u01b2\2\u01b3"+
+    "\1\u01b4\1\u01b2\1\u01b3\4\u01b2\1\u01b3\1\u01b2\1\u01b3\3\u01b2"+
+    "\1\u01b3\6\u01b2\1\u01b3\55\u01b2\1\175\1\u01b2\1\u01b5\2\u01b6"+
+    "\1\u01b7\1\u01b5\1\u01b6\4\u01b5\1\u01b6\1\u01b5\1\u01b6\3\u01b5"+
+    "\1\u01b6\6\u01b5\1\u01b6\55\u01b5\1\175\1\u01b5\37\0\1\u01b8"+
+    "\35\0\1\u01b8\53\0\1\u01b9\14\0\1\u01b9\73\0\1\u01ba"+
+    "\11\0\1\u01ba\76\0\1\u01bb\20\0\1\u01bb\113\0\1\u01bc"+
+    "\7\0\1\u01bc\2\0\12\u0132\1\u0133\3\u0132\1\0\71\u0132"+
+    "\1\0\10\u0132\1\u0133\2\u0132\1\u01bd\1\u0132\1\u0135\46\u0132"+
+    "\1\u01bd\20\u0132\1\u0136\1\0\12\u0136\1\u0133\1\u01be\1\u0136"+
+    "\1\u013a\46\u0136\1\u01be\21\u0136\1\0\12\u0136\1\u01bf\1\u01be"+
+    "\1\u0136\1\u013a\46\u0136\1\u01be\20\u0136\14\0\1\u01c0\72\0"+
+    "\14\u0136\1\u01bf\1\u0136\1\0\71\u0136\1\0\12\u0136\1\u0133"+
+    "\1\u01c1\1\u0136\1\u013a\46\u0136\1\u01c1\20\u0136\12\u0144\1\u0145"+
+    "\3\u0144\1\0\71\u0144\1\0\10\u0144\1\u0145\2\u0144\1\u01c2"+
+    "\1\u0144\1\u0147\46\u0144\1\u01c2\20\u0144\1\u0148\1\0\12\u0148"+
+    "\1\u0145\1\u01c3\1\u0148\1\u014c\46\u0148\1\u01c3\21\u0148\1\0"+
+    "\12\u0148\1\u01c4\1\u01c3\1\u0148\1\u014c\46\u0148\1\u01c3\20\u0148"+
+    "\14\0\1\u01c5\72\0\14\u0148\1\u01c4\1\u0148\1\0\71\u0148"+
+    "\1\0\12\u0148\1\u0145\1\u01c6\1\u0148\1\u014c\46\u0148\1\u01c6"+
+    "\20\u0148\2\233\1\0\4\233\1\u01c7\12\233\1\u01c8\3\233"+
+    "\1\u01c9\23\233\1\u01ca\36\233\1\0\33\233\1\u01cb\50\233"+
+    "\12\u0150\1\u0151\3\u0150\1\0\71\u0150\1\0\10\u0150\1\u0151"+
+    "\2\u0150\1\u01cc\1\u0150\1\u0153\46\u0150\1\u01cc\20\u0150\1\u0154"+
+    "\1\0\12\u0154\1\u0151\1\u01cd\1\u0154\1\u0158\46\u0154\1\u01cd"+
+    "\21\u0154\1\0\12\u0154\1\u01ce\1\u01cd\1\u0154\1\u0158\46\u0154"+
+    "\1\u01cd\20\u0154\14\0\1\u01cf\72\0\14\u0154\1\u01ce\1\u0154"+
+    "\1\0\71\u0154\1\0\12\u0154\1\u0151\1\u01d0\1\u0154\1\u0158"+
+    "\46\u0154\1\u01d0\20\u0154\2\242\1\0\4\242\1\u01d1\12\242"+
+    "\1\u01d2\3\242\1\u01d3\23\242\1\u01d4\36\242\1\0\33\242"+
+    "\1\u01d5\50\242\23\0\1\u01d6\63\0\12\u015d\1\u015e\3\u015d"+
+    "\1\0\71\u015d\1\0\10\u015d\1\u01d7\2\u015d\1\u01d8\1\u015d"+
+    "\1\u0160\46\u015d\1\u01d8\20\u015d\14\u0161\1\u015e\1\u0161\1\0"+
+    "\71\u0161\1\0\12\u0161\1\u01d9\1\u01da\1\u0161\1\u0163\46\u0161"+
+    "\1\u01da\20\u0161\1\u01db\2\u01b3\1\u01dc\1\u01db\1\u01b3\4\u01db"+
+    "\1\u01b3\1\u01db\1\u01b3\3\u01db\1\u01b3\6\u01db\1\u01b3\55\u01db"+
+    "\1\252\1\u01db\1\u01dd\2\u01b6\1\u01de\1\u01dd\1\u01b6\4\u01dd"+
+    "\1\u01b6\1\u01dd\1\u01b6\3\u01dd\1\u01b6\6\u01dd\1\u01b6\55\u01dd"+
+    "\1\252\1\u01dd\5\0\1\u0167\12\0\1\u0167\6\0\1\u0167"+
+    "\57\0\12\274\1\0\1\274\1\0\1\274\1\u01df\66\274"+
+    "\1\u016f\10\274\1\u01e0\2\274\1\0\1\274\1\0\1\u016c"+
+    "\4\274\1\u01e1\3\274\1\u01e2\23\274\1\u01e3\32\274\1\0"+
+    "\1\274\12\u01df\1\0\1\u01df\1\0\70\u01df\1\0\1\u01df"+
+    "\12\u016f\1\0\1\u016f\1\0\1\u01e4\67\u016f\1\0\1\u016f"+
+    "\7\u0170\1\u01e5\4\u0170\1\u0171\5\u0170\1\u01e6\3\u0170\1\u01e7"+
+    "\23\u0170\1\u01e8\50\u0170\1\u0171\21\u0170\1\u01e9\50\u0170\7\u0174"+
+    "\1\u01ea\2\u0174\1\u0175\7\u0174\1\u01eb\3\u0174\1\u01ec\23\u0174"+
+    "\1\u01ed\46\u0174\1\u0175\23\u0174\1\u01ee\50\u0174\12\312\1\0"+
+    "\103\312\1\u01ef\2\312\1\0\4\312\1\u0178\2\312\1\u01f0"+
+    "\3\312\1\u01f1\23\312\1\u01f2\32\312\1\0\1\312\17\u01f3"+
+    "\1\u01f4\67\u01f3\14\317\1\0\101\317\1\u01f5\4\317\1\0"+
+    "\2\317\1\u017b\2\317\1\u01f6\3\317\1\u01f7\23\317\1\u01f8"+
+    "\32\317\1\0\1\317\17\u01f9\1\u01fa\67\u01f9\7\322\1\u01fb"+
+    "\2\322\1\0\1\322\1\0\5\322\1\u01fc\3\322\1\u01fd"+
+    "\23\322\1\u01fe\32\322\1\0\1\322\7\u0180\1\u01ff\4\u0180"+
+    "\1\u0181\5\u0180\1\u0200\3\u0180\1\u0201\23\u0180\1\u0202\50\u0180"+
+    "\1\u0181\21\u0180\1\u0203\50\u0180\7\u0184\1\u0204\2\u0184\1\u0185"+
+    "\7\u0184\1\u0205\3\u0184\1\u0206\23\u0184\1\u0207\46\u0184\1\u0185"+
+    "\23\u0184\1\u0208\50\u0184\12\340\1\0\103\340\1\u0209\2\340"+
+    "\1\0\4\340\1\u0188\2\340\1\u020a\3\340\1\u020b\23\340"+
+    "\1\u020c\32\340\1\0\1\340\17\u020d\1\u020e\67\u020d\14\344"+
+    "\1\0\101\344\1\u020f\4\344\1\0\2\344\1\u018b\2\344"+
+    "\1\u0210\3\344\1\u0211\23\344\1\u0212\32\344\1\0\1\344"+
+    "\17\u0213\1\u0214\67\u0213\7\0\1\u0215\106\0\1\u0216\136\0"+
+    "\1\u0217\47\0\1\u0194\1\0\11\u0194\1\0\7\u0194\1\0"+
+    "\63\u0194\1\u0195\1\0\11\u0195\1\0\7\u0195\1\0\47\u0195"+
+    "\1\0\14\u0195\1\0\3\u0195\1\u0196\5\u0195\1\0\4\u0195"+
+    "\1\u0196\2\u0195\1\0\3\u0195\1\u0196\43\u0195\1\u0218\13\u0195"+
+    "\21\0\1\u0198\51\0\1\u0219\34\0\1\u021a\15\0\3\u021a"+
+    "\2\0\1\u021a\11\0\1\u021a\1\0\2\u021a\7\0\1\u021a"+
+    "\2\0\2\u021a\6\0\1\u021a\17\0\1\u019a\157\0\1\u019f"+
+    "\26\0\1\114\1\u021b\2\114\7\0\1\114\6\0\6\114"+
+    "\1\0\13\114\1\0\13\114\1\0\4\114\1\0\11\114"+
+    "\1\0\1\114\6\0\4\114\7\0\1\114\6\0\6\114"+
+    "\1\0\11\114\1\u021c\1\114\1\0\1\u021c\12\114\1\0"+
+    "\4\114\1\0\11\114\1\0\1\114\12\376\1\377\74\376"+
+    "\14\u0102\1\377\72\u0102\12\u0108\1\u010a\3\u0108\1\0\71\u0108"+
+    "\1\0\10\u0108\1\u010a\2\u0108\1\u021d\1\u0108\1\u01a8\46\u0108"+
+    "\1\u021d\20\u0108\1\143\2\u0108\1\u0109\1\143\1\u0108\4\143"+
+    "\1\u010a\1\143\1\u0108\3\143\1\u0108\6\143\1\u0108\57\143"+
+    "\14\u010d\1\u010a\1\u010d\1\0\71\u010d\1\0\12\u010d\1\u010a"+
+    "\1\u021e\1\u010d\1\u01ab\46\u010d\1\u021e\20\u010d\1\144\2\u010d"+
+    "\1\u010e\1\144\1\u010d\4\144\1\u010d\1\144\1\u010a\3\144"+
+    "\1\u010d\6\144\1\u010d\57\144\12\u0115\1\u0116\74\u0115\14\u0119"+
+    "\1\u0116\72\u0119\6\0\3\170\1\u021f\7\0\1\170\6\0"+
+    "\6\170\1\0\13\170\1\0\13\170\1\0\4\170\1\0"+
+    "\11\170\1\0\1\170\12\u0121\1\u0122\74\u0121\14\u0125\1\u0122"+
+    "\72\u0125\1\u01b2\2\u01b3\1\u01b4\1\u01b2\1\u01b3\4\u01b2\1\u01b3"+
+    "\1\u01b2\1\u01b3\3\u01b2\1\u01b3\6\u01b2\1\u01b3\55\u01b2\1\u0220"+
+    "\1\u01b2\105\u01b3\1\u0221\1\u01b3\1\u01b5\2\u01b6\1\u01b7\1\u01b5"+
+    "\1\u01b6\4\u01b5\1\u01b6\1\u01b5\1\u01b6\3\u01b5\1\u01b6\6\u01b5"+
+    "\1\u01b6\55\u01b5\1\u0220\1\u01b5\105\u01b6\1\u0222\1\u01b6\42\0"+
+    "\1\u0223\14\0\1\u0223\63\0\2\u0224\103\0\2\u0225\115\0"+
+    "\1\u0226\14\0\1\u0226\63\0\2\u0227\51\0\12\u0132\1\u0133"+
+    "\74\u0132\14\u0136\1\u0133\1\u0136\1\0\70\u0136\3\0\2\u0228"+
+    "\1\0\4\u0228\2\0\1\u0138\1\u0228\2\0\4\u0228\1\0"+
+    "\11\u0228\1\0\40\u0228\2\0\4\u0228\1\0\1\u0228\14\u0136"+
+    "\1\u0133\72\u0136\12\u0144\1\u0145\74\u0144\14\u0148\1\u0145\1\u0148"+
+    "\1\0\70\u0148\3\0\2\u0229\1\0\4\u0229\2\0\1\u014a"+
+    "\1\u0229\2\0\4\u0229\1\0\11\u0229\1\0\40\u0229\2\0"+
+    "\4\u0229\1\0\1\u0229\14\u0148\1\u0145\72\u0148\2\233\1\0"+
+    "\4\233\1\u022a\101\233\1\0\34\233\1\u022b\47\233\12\u0150"+
+    "\1\u0151\74\u0150\14\u0154\1\u0151\1\u0154\1\0\70\u0154\3\0"+
+    "\2\u022c\1\0\4\u022c\2\0\1\u0156\1\u022c\2\0\4\u022c"+
+    "\1\0\11\u022c\1\0\40\u022c\2\0\4\u022c\1\0\1\u022c"+
+    "\14\u0154\1\u0151\72\u0154\2\242\1\0\4\242\1\u022d\101\242"+
+    "\1\0\34\242\1\u022e\47\242\2\0\1\u022f\104\0\12\u015d"+
+    "\1\u015e\74\u015d\14\u0161\1\u015e\72\u0161\1\u01db\2\u01b3\1\u01dc"+
+    "\1\u01db\1\u01b3\4\u01db\1\u01b3\1\u01db\1\u01b3\3\u01db\1\u01b3"+
+    "\6\u01db\1\u01b3\55\u01db\1\u0230\1\u01db\1\u01dd\2\u01b6\1\u01de"+
+    "\1\u01dd\1\u01b6\4\u01dd\1\u01b6\1\u01dd\1\u01b6\3\u01dd\1\u01b6"+
+    "\6\u01dd\1\u01b6\55\u01dd\1\u0230\1\u01dd\7\274\1\u0231\2\274"+
+    "\1\0\1\274\1\0\1\u016c\67\274\1\0\1\274\12\u016f"+
+    "\1\0\1\u016f\1\0\1\u016f\1\0\70\u016f\7\u0170\1\u0232"+
+    "\4\u0170\1\u0171\106\u0170\1\u0171\22\u0170\1\u0233\47\u0170\7\u0174"+
+    "\1\u0234\2\u0174\1\u0175\106\u0174\1\u0175\24\u0174\1\u0235\47\u0174"+
+    "\7\312\1\u0236\2\312\1\0\4\312\1\u0178\65\312\1\0"+
+    "\1\312\12\u0237\1\u0238\72\u0237\1\0\1\u0237\7\317\1\u0239"+
+    "\4\317\1\0\2\317\1\u017b\65\317\1\0\1\317\14\u023a"+
+    "\1\u0238\70\u023a\1\0\1\u023a\7\322\1\u023b\2\322\1\0"+
+    "\1\322\1\0\70\322\1\0\1\322\7\u0180\1\u023c\4\u0180"+
+    "\1\u0181\106\u0180\1\u0181\22\u0180\1\u023d\47\u0180\7\u0184\1\u023e"+
+    "\2\u0184\1\u0185\106\u0184\1\u0185\24\u0184\1\u023f\47\u0184\7\340"+
+    "\1\u0240\2\340\1\0\4\340\1\u0188\65\340\1\0\1\340"+
+    "\12\u0241\1\u0242\72\u0241\1\0\1\u0241\7\344\1\u0243\4\344"+
+    "\1\0\2\344\1\u018b\65\344\1\0\1\344\14\u0244\1\u0242"+
+    "\70\u0244\1\0\1\u0244\40\0\1\u0245\141\0\1\u0218\34\0"+
+    "\1\u021a\15\0\3\u021a\2\0\1\u021a\11\0\1\u021a\1\0"+
+    "\2\u021a\7\0\1\u021a\1\0\1\u0219\2\u021a\6\0\1\u021a"+
+    "\10\0\4\114\7\0\1\114\6\0\6\114\1\0\7\114"+
+    "\1\u0246\3\114\1\0\13\114\1\0\4\114\1\0\11\114"+
+    "\1\0\1\114\6\0\4\114\7\0\1\114\6\0\6\114"+
+    "\1\0\6\114\1\u0247\4\114\1\0\13\114\1\0\1\114"+
+    "\1\u0247\2\114\1\0\11\114\1\0\1\114\12\u0108\1\u010a"+
+    "\74\u0108\14\u010d\1\u010a\72\u010d\6\0\4\170\7\0\1\170"+
+    "\6\0\6\170\1\0\6\170\1\u0248\4\170\1\0\6\170"+
+    "\1\u0249\4\170\1\0\4\170\1\0\11\170\1\0\1\170"+
+    "\54\0\1\u024a\5\0\1\u024a\73\0\1\u024b\14\0\1\u024b"+
+    "\66\0\1\u024c\11\0\1\u024c\74\0\1\u024d\11\0\1\u024d"+
+    "\77\0\1\u024e\14\0\1\u024e\22\0\2\233\1\0\35\233"+
+    "\1\u024f\46\233\2\242\1\0\35\242\1\u0250\46\242\14\u0170"+
+    "\1\u0171\23\u0170\1\u0251\46\u0170\12\u0174\1\u0175\25\u0174\1\u0252"+
+    "\46\u0174\12\u0237\1\u01f3\4\u0237\1\u0253\65\u0237\1\u01f3\1\u0237"+
+    "\14\u023a\1\u01f9\2\u023a\1\u0254\65\u023a\1\u01f9\1\u023a\14\u0180"+
+    "\1\u0181\23\u0180\1\u0255\46\u0180\12\u0184\1\u0185\25\u0184\1\u0256"+
+    "\46\u0184\12\u0241\1\u020d\4\u0241\1\u0257\65\u0241\1\u020d\1\u0241"+
+    "\14\u0244\1\u0213\2\u0244\1\u0258\65\u0244\1\u0213\1\u0244\41\0"+
+    "\1\u0259\53\0\4\114\7\0\1\114\6\0\6\114\1\0"+
+    "\13\114\1\0\4\114\1\u025a\6\114\1\0\4\114\1\0"+
+    "\11\114\1\0\1\114\6\0\4\114\7\0\1\114\6\0"+
+    "\6\114\1\0\3\114\1\u025b\7\114\1\0\4\114\1\u025b"+
+    "\6\114\1\0\4\114\1\0\11\114\1\0\1\114\6\0"+
+    "\4\170\7\0\1\170\6\0\6\170\1\0\11\170\1\u025c"+
+    "\1\170\1\0\13\170\1\0\4\170\1\0\11\170\1\0"+
+    "\1\170\6\0\4\170\7\0\1\170\6\0\6\170\1\0"+
+    "\10\170\1\u025d\2\170\1\0\13\170\1\0\4\170\1\0"+
+    "\11\170\1\0\1\170\55\0\1\u025e\24\0\1\u025e\52\0"+
+    "\1\u025f\20\0\1\u025f\70\0\1\u0260\13\0\1\u0260\53\0"+
+    "\2\u0261\112\0\1\u0262\35\0\1\u0262\11\0\2\233\1\0"+
+    "\36\233\1\u0263\45\233\2\242\1\0\36\242\1\u0264\45\242"+
+    "\14\u0170\1\u0171\24\u0170\1\u0265\45\u0170\12\u0174\1\u0175\26\u0174"+
+    "\1\u0266\45\u0174\12\u0237\1\u0267\4\u0237\1\u0253\65\u0237\1\u01f3"+
+    "\1\u0237\14\u023a\1\u0268\2\u023a\1\u0254\65\u023a\1\u01f9\1\u023a"+
+    "\14\u0180\1\u0181\24\u0180\1\u0269\45\u0180\12\u0184\1\u0185\26\u0184"+
+    "\1\u026a\45\u0184\12\u0241\1\u026b\4\u0241\1\u0257\65\u0241\1\u020d"+
+    "\1\u0241\14\u0244\1\u026c\2\u0244\1\u0258\65\u0244\1\u0213\1\u0244"+
+    "\42\0\1\u026d\52\0\4\114\7\0\1\114\6\0\6\114"+
+    "\1\0\13\114\1\0\7\114\1\u026e\3\114\1\0\4\114"+
+    "\1\0\11\114\1\0\1\114\6\0\4\170\7\0\1\170"+
+    "\6\0\6\170\1\0\11\170\1\u026f\1\170\1\0\13\170"+
+    "\1\0\4\170\1\0\11\170\1\0\1\170\6\0\4\170"+
+    "\7\0\1\170\6\0\6\170\1\0\6\170\1\u0270\4\170"+
+    "\1\0\13\170\1\0\4\170\1\0\11\170\1\0\1\170"+
+    "\44\0\1\u0271\11\0\1\u0271\72\0\1\u0272\14\0\1\u0272"+
+    "\71\0\1\u0273\14\0\1\u0273\27\0\2\233\1\0\37\233"+
+    "\1\u0274\44\233\2\242\1\0\37\242\1\u0275\44\242\14\u0170"+
+    "\1\u0171\25\u0170\1\u0276\44\u0170\12\u0174\1\u0175\27\u0174\1\u0277"+
+    "\44\u0174\14\u0180\1\u0181\25\u0180\1\u0278\44\u0180\12\u0184\1\u0185"+
+    "\27\u0184\1\u0279\44\u0184\41\0\1\u027a\53\0\4\114\7\0"+
+    "\1\114\6\0\5\114\1\u027b\1\0\13\114\1\0\13\114"+
+    "\1\0\4\114\1\0\11\114\1\0\1\114\6\0\4\170"+
+    "\7\0\1\170\6\0\6\170\1\0\13\170\1\0\4\170"+
+    "\1\u027c\6\170\1\0\4\170\1\0\11\170\1\0\1\170"+
+    "\6\0\4\170\7\0\1\170\6\0\6\170\1\0\5\170"+
+    "\1\u027d\5\170\1\0\13\170\1\0\4\170\1\0\11\170"+
+    "\1\0\1\170\2\233\1\0\36\233\1\u027e\45\233\2\242"+
+    "\1\0\36\242\1\u027f\45\242\14\u0170\1\u0171\24\u0170\1\u0280"+
+    "\45\u0170\12\u0174\1\u0175\26\u0174\1\u0281\45\u0174\14\u0180\1\u0181"+
+    "\24\u0180\1\u0282\45\u0180\12\u0184\1\u0185\26\u0184\1\u0283\45\u0184"+
+    "\36\0\1\u0284\56\0\4\114\7\0\1\114\6\0\6\114"+
+    "\1\0\5\114\1\u0285\5\114\1\0\13\114\1\0\4\114"+
+    "\1\0\11\114\1\0\1\114\6\0\4\170\7\0\1\170"+
+    "\6\0\6\170\1\0\13\170\1\0\13\170\1\0\4\170"+
+    "\1\0\1\170\1\u0286\7\170\1\0\1\170\2\233\1\0"+
+    "\33\233\1\u0287\50\233\2\242\1\0\33\242\1\u0288\50\242"+
+    "\14\u0170\1\u0171\21\u0170\1\u0289\50\u0170\12\u0174\1\u0175\23\u0174"+
+    "\1\u028a\50\u0174\14\u0180\1\u0181\21\u0180\1\u028b\50\u0180\12\u0184"+
+    "\1\u0185\23\u0184\1\u028c\50\u0184\6\0\4\114\7\0\1\114"+
+    "\6\0\6\114\1\0\7\114\1\u028d\3\114\1\0\13\114"+
+    "\1\0\4\114\1\0\11\114\1\0\1\114\6\0\4\170"+
+    "\7\0\1\170\6\0\6\170\1\0\13\170\1\0\4\170"+
+    "\1\u028e\6\170\1\0\4\170\1\0\11\170\1\0\1\170"+
+    "\6\0\4\114\7\0\1\114\6\0\6\114\1\0\13\114"+
+    "\1\0\13\114\1\0\4\114\1\0\11\114\1\0\1\u028f"+
+    "\6\0\4\170\7\0\1\170\6\0\6\170\1\0\10\170"+
+    "\1\u0290\2\170\1\0\13\170\1\0\4\170\1\0\11\170"+
+    "\1\0\1\170\6\0\4\114\7\0\1\114\6\0\6\114"+
+    "\1\0\5\114\1\u0291\5\114\1\0\13\114\1\0\4\114"+
+    "\1\0\11\114\1\0\1\114\6\0\4\170\7\0\1\170"+
+    "\6\0\6\170\1\0\4\170\1\u0292\6\170\1\0\13\170"+
+    "\1\0\4\170\1\0\11\170\1\0\1\170\6\0\4\114"+
+    "\7\0\1\114\6\0\6\114\1\0\5\114\1\u0293\5\114"+
+    "\1\0\13\114\1\0\4\114\1\0\11\114\1\0\1\114"+
+    "\6\0\4\170\7\0\1\170\6\0\6\170\1\0\5\170"+
+    "\1\u0294\5\170\1\0\13\170\1\0\4\170\1\0\11\170"+
+    "\1\0\1\170\6\0\4\114\7\0\1\114\6\0\6\114"+
+    "\1\0\13\114\1\0\4\114\1\u0295\6\114\1\0\4\114"+
+    "\1\0\11\114\1\0\1\114\6\u0296\4\u0297\7\u0296\1\u0297"+
+    "\5\u0296\1\0\6\u0297\1\u0296\13\u0297\1\u0296\13\u0297\1\u0296"+
+    "\4\u0297\1\u0296\11\u0297\1\u0296\1\u0297\43\0\1\u0298\3\0"+
+    "\1\u0299\7\0\1\u029a\1\u029b\21\0\1\u029c\12\0\4\170"+
+    "\7\0\1\170\6\0\6\170\1\0\4\170\1\u029d\3\170"+
+    "\1\u029e\2\170\1\0\4\170\1\u029f\1\u02a0\5\170\1\0"+
+    "\4\170\1\0\6\170\1\u02a1\2\170\1\0\1\170\60\0"+
+    "\1\u02a2\77\0\1\u02a3\115\0\1\u02a4\105\0\1\u02a5\107\0"+
+    "\1\u02a6\34\0\4\170\7\0\1\170\6\0\6\170\1\0"+
+    "\13\170\1\0\5\170\1\u02a7\5\170\1\0\4\170\1\0"+
+    "\11\170\1\0\1\170\6\0\4\170\7\0\1\170\6\0"+
+    "\6\170\1\0\12\170\1\u02a8\1\0\13\170\1\0\4\170"+
+    "\1\0\11\170\1\0\1\170\6\0\4\170\7\0\1\170"+
+    "\6\0\6\170\1\0\13\170\1\0\5\170\1\u02a9\5\170"+
+    "\1\0\4\170\1\0\11\170\1\0\1\170\6\0\4\170"+
+    "\7\0\1\170\6\0\6\170\1\0\13\170\1\0\4\170"+
+    "\1\u02aa\6\170\1\0\4\170\1\0\11\170\1\0\1\170"+
+    "\6\0\4\170\7\0\1\170\6\0\6\170\1\0\13\170"+
+    "\1\0\5\170\1\u02ab\5\170\1\0\4\170\1\0\11\170"+
+    "\1\0\1\170\45\0\1\u02ac\136\0\1\u02ad\107\0\1\u02ae"+
+    "\67\0\1\u02af\125\0\1\u02b0\16\0\4\170\7\0\1\170"+
+    "\6\0\6\170\1\0\6\170\1\u02b1\4\170\1\0\13\170"+
+    "\1\0\4\170\1\0\11\170\1\0\1\170\6\0\4\170"+
+    "\7\0\1\170\6\0\6\170\1\0\13\170\1\0\13\170"+
+    "\1\0\4\170\1\0\1\170\1\u02b2\7\170\1\0\1\170"+
+    "\6\0\4\170\7\0\1\170\6\0\6\170\1\0\13\170"+
+    "\1\0\13\170\1\0\4\170\1\0\2\170\1\u02b3\6\170"+
+    "\1\0\1\170\6\0\4\170\7\0\1\170\6\0\6\170"+
+    "\1\0\13\170\1\0\4\170\1\u02b4\6\170\1\0\4\170"+
+    "\1\0\11\170\1\0\1\170\6\0\4\170\7\0\1\170"+
+    "\6\0\6\170\1\0\13\170\1\0\13\170\1\0\4\170"+
+    "\1\0\2\170\1\u02b5\6\170\1\0\1\170\47\0\1\u02b6"+
+    "\74\0\1\u02b7\106\0\1\u02b8\116\0\1\u02b9\105\0\1\u02ba"+
+    "\50\0\4\170\7\0\1\170\6\0\6\170\1\0\10\170"+
+    "\1\u02bb\2\170\1\0\13\170\1\0\4\170\1\0\11\170"+
+    "\1\0\1\170\6\0\4\170\7\0\1\170\6\0\5\170"+
+    "\1\u02bc\1\0\13\170\1\0\13\170\1\0\4\170\1\0"+
+    "\11\170\1\0\1\170\6\0\4\170\7\0\1\170\6\0"+
+    "\5\170\1\u02bd\1\0\13\170\1\0\13\170\1\0\4\170"+
+    "\1\0\11\170\1\0\1\170\6\0\4\170\7\0\1\170"+
+    "\6\0\6\170\1\0\6\170\1\u02be\4\170\1\0\13\170"+
+    "\1\0\4\170\1\0\11\170\1\0\1\170\6\0\4\170"+
+    "\7\0\1\170\6\0\6\170\1\0\5\170\1\u02bf\5\170"+
+    "\1\0\13\170\1\0\4\170\1\0\11\170\1\0\1\170"+
+    "\60\0\1\u02c0\131\0\1\u02c1\52\0\1\u02c2\106\0\1\u02c3"+
+    "\45\0\4\170\7\0\1\170\6\0\6\170\1\0\13\170"+
+    "\1\0\5\170\1\u02c4\5\170\1\0\4\170\1\0\11\170"+
+    "\1\0\1\170\6\0\4\170\7\0\1\170\6\0\6\170"+
+    "\1\0\13\170\1\0\13\170\1\0\4\170\1\0\7\170"+
+    "\1\u02c5\1\170\1\0\1\170\6\0\4\170\7\0\1\170"+
+    "\6\0\6\170\1\0\10\170\1\u02c6\2\170\1\0\13\170"+
+    "\1\0\4\170\1\0\11\170\1\0\1\170\6\0\4\170"+
+    "\7\0\1\170\6\0\6\170\1\0\10\170\1\u02c7\2\170"+
+    "\1\0\13\170\1\0\4\170\1\0\11\170\1\0\1\170"+
+    "\104\0\1\u02c8\63\0\1\u02b0\131\0\1\u02ba\106\0\1\u02c9"+
+    "\10\0\4\170\7\0\1\170\6\0\6\170\1\0\13\170"+
+    "\1\0\13\170\1\0\4\170\1\0\10\170\1\u02ca\1\0"+
+    "\1\170\6\0\4\170\7\0\1\170\6\0\6\170\1\0"+
+    "\13\170\1\0\6\170\1\u02b5\4\170\1\0\4\170\1\0"+
+    "\11\170\1\0\1\170\6\0\4\170\7\0\1\170\6\0"+
+    "\6\170\1\0\13\170\1\0\13\170\1\0\4\170\1\0"+
+    "\10\170\1\u02bf\1\0\1\170\6\0\4\170\7\0\1\170"+
+    "\6\0\6\170\1\0\13\170\1\0\13\170\1\0\4\170"+
+    "\1\0\10\170\1\u02cb\1\0\1\170\35\0\1\u02b0\154\0"+
+    "\1\u02cc\11\0\4\170\7\0\1\170\6\0\5\170\1\u02b5"+
+    "\1\0\13\170\1\0\13\170\1\0\4\170\1\0\11\170"+
+    "\1\0\1\170\6\0\4\170\7\0\1\170\6\0\6\170"+
+    "\1\0\13\170\1\0\13\170\1\0\4\170\1\0\7\170"+
+    "\1\u02cd\1\170\1\0\1\170\57\0\1\u02b0\35\0\4\170"+
+    "\7\0\1\170\6\0\6\170\1\0\13\170\1\0\4\170"+
+    "\1\u02b5\6\170\1\0\4\170\1\0\11\170\1\0\1\170";
 
   /** 
    * The transition table of the DFA
@@ -797,45 +876,49 @@
   private final static byte YY_ATTRIBUTE[] = {
      1,  0,  0,  0,  0,  1,  0,  0,  1,  1,  1,  0,  1,  1,  1,  1, 
      0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
-     1,  1,  1,  1,  0,  0,  0,  0,  1,  1,  1,  0,  0,  0,  0,  0, 
-     0,  1,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,  1,  1,  9,  1, 
-     9,  1,  1,  9,  9,  1,  1,  1,  1,  1,  1,  1,  1,  1,  9,  1, 
-     1,  1,  1,  9,  1,  1,  1,  1,  1,  1,  9,  1,  1,  9,  1,  1, 
-     1,  1,  9,  1,  1,  1,  1,  1,  1,  1,  9,  1,  1,  1,  1,  1, 
-     1,  1,  9,  1,  1,  1,  1,  1,  1,  9,  1,  1,  1,  1,  1,  1, 
-     1,  1,  9,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  9,  1,  1,  1,  1,  1, 
-     1,  9,  9,  1,  9,  1,  1,  1,  1,  1,  9,  1,  1,  1,  1,  9, 
-     1,  1,  1,  1,  9,  9,  1,  9,  3,  3,  3,  3,  3,  3,  9,  9, 
-     1,  1,  1,  9,  1,  1,  1,  1,  1,  9,  9,  1,  9,  3,  3,  3, 
-     3,  3,  3,  9,  9,  1,  1,  1,  9,  1,  1,  1,  9,  9,  1,  1, 
-     0,  1,  0,  9,  1,  2,  1,  2,  1,  0,  0,  0,  9,  1,  1,  1, 
-     9,  9,  0,  0,  9,  0,  0,  0,  0,  0,  0,  0,  0,  9,  1,  0, 
-     0,  1,  9,  0,  9,  0,  0,  9,  0,  0,  0,  9,  1,  1,  0,  1, 
-     0,  9,  0,  0,  0,  1,  1,  0,  0,  0,  0,  9,  0,  0,  0,  0, 
-     9,  0,  0,  0,  1,  0,  0,  1,  0,  0,  9,  0,  0,  1,  0,  0, 
-     9,  0,  0,  0,  1,  0,  1,  1,  0,  0,  9,  0,  0,  0,  1,  0, 
-     1,  1,  0,  0,  9,  9,  9,  0,  9,  9,  1,  1,  1,  1,  2, 13, 
-     3,  2,  2, 13,  3,  2,  0,  1,  1,  0,  1,  1,  1,  1,  2, 13, 
-     3,  2,  2, 13,  3,  2,  0,  1,  1,  0,  1,  1,  0,  9,  9,  9, 
-     0,  0,  1,  1,  1,  9,  0,  0, 13,  9, 13,  9,  9,  1,  1,  1, 
-     0,  0,  1,  3,  2,  2,  3,  2,  2,  0,  0,  0,  0,  0,  0,  1, 
-     0,  0,  1,  0,  1,  1,  1,  1,  1,  0,  1,  0,  1,  1,  1,  1, 
-     1,  0,  1,  1,  1,  1,  1,  0,  2,  3,  3,  3,  2,  2,  3,  3, 
-     3,  2,  1,  1,  1,  1,  0,  0,  1,  1,  1,  1,  0,  0,  1,  1, 
-     1,  1,  2,  3,  3,  3,  2,  2,  3,  3,  3,  2,  1,  1,  1,  1, 
-     0,  0,  1,  1,  1,  1,  0,  0,  9,  9,  0,  1,  9,  0,  1,  1, 
-     1,  5, 13, 13,  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  1,  1, 
-     9,  1,  3,  2,  3,  2,  1,  0,  9,  1,  0,  1,  3,  2,  3,  2, 
-     1,  0,  9,  1,  0,  0,  1,  1,  1,  1,  0,  0,  0,  0,  0,  1, 
-     1,  2,  2,  0,  0,  2,  2,  0,  0,  0,  1,  1,  1,  1,  0,  0, 
-     0,  9,  9,  1,  1,  2,  2,  1,  1,  2,  2,  1,  1,  0,  1,  1, 
-     1,  9,  9,  9,  1,  1,  2,  2,  2,  2,  0,  1,  1,  1,  1,  1, 
-     2,  2,  2,  2,  9,  1,  1,  1,  1,  3,  3,  3,  3,  1,  1,  1, 
-     1,  1,  1,  1,  1,  1,  0,  1,  0,  0,  0,  0,  0,  1,  1,  1, 
-     1,  1,  0,  0,  0,  0,  0,  1,  1,  1,  1,  1,  0,  0,  1,  0, 
-     0,  1,  1,  1,  1,  1,  0,  0,  0,  0,  9,  1,  1,  1,  1,  1, 
-     0,  0,  0,  0,  1,  1,  1,  1,  0,  0,  1,  1,  0,  1
+     1,  1,  1,  1,  0,  0,  0,  0,  1,  1,  1,  1,  0,  0,  0,  0, 
+     0,  0,  1,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,  1,  1,  1, 
+     9,  1,  9,  1,  1,  9,  9,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
+     9,  1,  1,  1,  1,  9,  1,  1,  1,  1,  1,  1,  9,  1,  1,  9, 
+     1,  1,  1,  1,  9,  1,  1,  1,  1,  1,  1,  1,  9,  1,  1,  1, 
+     1,  1,  1,  1,  9,  1,  1,  1,  1,  1,  1,  9,  1,  1,  1,  1, 
+     1,  1,  1,  1,  9,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
+     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  9,  1,  1,  1, 
+     1,  1,  1,  9,  9,  1,  9,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
+     1,  1,  1,  9,  1,  1,  1,  1,  9,  1,  1,  1,  1,  9,  9,  1, 
+     9,  3,  3,  9,  3,  3,  3,  9,  3,  1,  1,  9,  1,  9,  1,  1, 
+     1,  1,  1,  9,  9,  1,  9,  3,  3,  9,  3,  3,  3,  9,  3,  1, 
+     1,  1,  9,  1,  1,  1,  9,  9,  1,  1,  0,  1,  0,  1,  2,  0, 
+     1,  2,  1,  0,  0,  0,  9,  1,  1,  1,  9,  9,  0,  0,  9,  0, 
+     0,  0,  0,  0,  0,  0,  0,  0,  0,  9,  1,  1,  0,  0,  1,  1, 
+     9,  0,  9,  0,  0,  9,  0,  0,  0,  0,  0,  9,  1,  1,  0,  1, 
+     0,  9,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  9,  0,  0, 
+     0,  0,  9,  0,  0,  0,  0,  1,  0,  0,  0,  1,  0,  0,  9,  0, 
+     0,  1,  0,  0,  9,  0,  0,  0,  0,  1,  0,  0,  1,  1,  0,  0, 
+     9,  0,  0,  0,  0,  1,  0,  0,  1,  1,  0,  0,  0,  9,  0,  0, 
+     0,  0,  0,  1,  1,  9,  1,  9,  9,  9,  9,  1,  1,  1,  1,  2, 
+    13,  3,  2,  2, 13,  3,  2,  0,  1,  1,  0,  1,  1,  1,  1,  2, 
+    13,  3,  2,  2, 13,  3,  2,  0,  1,  1,  0,  1,  1,  0,  9,  9, 
+     9,  0,  0,  1,  1,  1,  9,  0,  0,  1, 13,  9,  9, 13,  1,  9, 
+     9,  1,  1,  1,  0,  0,  0,  0,  1,  0,  0,  1,  0,  0,  1,  0, 
+     0,  3,  2,  2,  3,  2,  2,  0,  0,  0,  0,  0,  0,  0,  1,  0, 
+     0,  0,  0,  1,  0,  0,  1,  1,  1,  1,  1,  0,  0,  1,  0,  0, 
+     1,  1,  1,  1,  1,  0,  1,  0,  1,  0,  3,  2,  3,  2,  1,  1, 
+     1,  1,  1,  0,  2,  3,  3,  3,  2,  2,  3,  3,  3,  2,  1,  1, 
+     1,  1,  0,  0,  1,  1,  1,  1,  0,  0,  1,  1,  1,  1,  2,  3, 
+     3,  3,  2,  2,  3,  3,  3,  2,  1,  1,  1,  1,  0,  0,  1,  1, 
+     1,  1,  0,  0,  9,  9,  0,  1,  9,  0,  1,  1,  0,  0,  1,  5, 
+    13, 13,  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  1,  1,  9,  5, 
+     1,  3,  2,  3,  2,  1,  0,  9,  1,  0,  1,  3,  2,  3,  2,  1, 
+     0,  9,  1,  0,  0,  1,  1,  1,  1,  0,  0,  0,  0,  0,  1,  1, 
+     2,  2,  0,  0,  2,  2,  0,  0,  0,  1,  1,  1,  1,  0,  0,  0, 
+     9,  9,  1,  1,  2,  2,  1,  1,  2,  2,  1,  1,  0,  1,  1,  1, 
+     9,  9,  9,  1,  1,  2,  2,  2,  2,  0,  1,  1,  1,  1,  1,  2, 
+     2,  2,  2,  9,  1,  1,  1,  1,  3,  3,  3,  3,  1,  1,  1,  1, 
+     1,  1,  1,  1,  1,  0,  1,  0,  0,  0,  0,  0,  1,  1,  1,  1, 
+     1,  0,  0,  0,  0,  0,  1,  1,  1,  1,  1,  0,  0,  1,  0,  0, 
+     1,  1,  1,  1,  1,  0,  0,  0,  0,  9,  1,  1,  1,  1,  1,  0, 
+     0,  0,  0,  1,  1,  1,  1,  0,  0,  1,  1,  0,  1
   };
 
   /** the input device */
@@ -898,7 +981,8 @@
 	private String fBufferedContext = null;
 	private int fBufferedStart = 1;
 	private int fBufferedLength = 0;
-	private ContextRegionContainer fBufferedEmbeddedContainer = null;
+	private ITextRegion fBufferedEmbeddedContainer = null;
+	private ITextRegion fProxyUnknownRegion = null;
 	private String f_context = null;
 
 	// state stack for handling embedded regions
@@ -908,9 +992,11 @@
 	// a "hint" as to what state to enter once an embedded region has
 	//   been completed
 	private int fEmbeddedPostState = YYINITIAL;
+	
 	// the container used to create embedded regions
 	private ContextRegionContainer fEmbeddedContainer = null;
 	private static final String PROXY_CONTEXT = "PROXY_CONTEXT";
+	private static final String PROXY_UNKNOWN_CONTEXT = "PROXY_UNKNOWN_CONTEXT";
 
 	private String context = null;
 	private int start = 0;
@@ -944,6 +1030,15 @@
 
 	private JSPParserRegionFactory fRegionFactory = new JSPParserRegionFactory();
 
+	// Is the embedded tag a JSP tag
+	private boolean fEmbeddedTag = false;
+	// Is the non-embedded tag a JSP tag
+	private boolean fContainerTag = false;
+	// Is the tokenizer in a non-embedded tag (between < and >)
+	private boolean fInTagContainer = false;
+	// Is the tokenizer in an embedded tag (between < and >)
+	private boolean fInTagEmbedded = false;
+
 	/**
 	 * user method 
 	 */
@@ -1268,215 +1363,221 @@
  */
 private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, String searchContext, int exitState, int immediateFallbackState) throws IOException {
 	boolean stillSearching = true;
-	// Disable further block (probably)
-	fIsBlockingEnabled = false;
-	int searchStringLength = searchString.length();
-	int n = 0;
-	char lastCheckChar;
-	int i;
-	boolean same = false;
-	// Check for JSP starts ("<%") if the tag is global like SCRIPT or STYLE
-	boolean checkJSPs = allowJSP && !fForbidJSP;
-	boolean checkedForJSPsOnce = !checkJSPs;
-	boolean checkedJSPsAtStartOnce = false;
-	
-	while (stillSearching) {
-		n = 0;
-		// Ensure that enough data from the input exists to compare against the search String.
-		n = yy_advance();
-		while(n != YYEOF && yy_currentPos < searchStringLength)
+	boolean wasBlockingEnabled = fIsBlockingEnabled;
+	try {
+		// Disable further block (probably)
+		fIsBlockingEnabled = false;
+		int searchStringLength = searchString.length();
+		int n = 0;
+		char lastCheckChar;
+		int i;
+		boolean same = false;
+		// Check for JSP starts ("<%") if the tag is global like SCRIPT or STYLE
+		boolean checkJSPs = allowJSP && !fForbidJSP;
+		boolean checkedForJSPsOnce = !checkJSPs;
+		boolean checkedJSPsAtStartOnce = false;
+		
+		while (stillSearching) {
+			n = 0;
+			// Ensure that enough data from the input exists to compare against the search String.
 			n = yy_advance();
-//		c = (char) n;
-		// If the input was too short or we've exhausted the input, stop immediately.
-		if (n == YYEOF && checkedForJSPsOnce) {
-			stillSearching = false;
-		}
-		else {
-			/**
-			 * Look for starting JSPs "<%"
-			 */
-			checkedForJSPsOnce = true;
-			// 1) yy_currentPos - searchStringLength : There's at least searchStringLength of input available; once that's read, check for JSPs
-			// ---
-			// Look for a JSP beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.
-			// Ensure that we've not encountered a complete block (<%%>) that was *shorter* than the closeTagString and
-			// thus found twice at current-targetLength [since the first scan would have come out this far anyway].
-			if(checkJSPs && yy_currentPos > searchStringLength && yy_currentPos - searchStringLength != fLastInternalBlockStart && 
-				yy_buffer[yy_currentPos - searchStringLength] == '<' && yy_buffer[yy_currentPos - searchStringLength + 1] == '%') {
-				fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;
-				yy_currentPos = yy_markedPos + 1;
-				int resumeState = yystate();
-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
-				if(yy_markedPos == yy_startRead) {
-					String jspContext = primGetNextToken();
-					yybegin(resumeState);
-					return jspContext;
-				}
-				return searchContext;
-			}
-			// 2) yy_currentPos - jspstarter.length : There's not searchStringLength of input available; check for a JSP 2 spots back in what we could read
-			// ---
-			// Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section
-			// since it relies upon *having* closeTagStringLength amount of input to work as designed.  Must be sure we don't
-			// spill over the end of the buffer while checking.
-			else if(checkJSPs && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&
-					yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {
-				fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;
-				yy_currentPos = yy_markedPos + 1;
-				int resumeState = yystate();
-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
-				if(yy_markedPos == yy_startRead) {
-					String jspContext = primGetNextToken();
-					yybegin(resumeState);
-					return jspContext;
-				}
-				return searchContext;
-			}
-			// 3) yy_currentPos..(yy_currentPos+jspStartlength-1) : Check at the start of the block one time
-			// ---
-			// Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section
-			// since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.
-			else if(checkJSPs && !checkedJSPsAtStartOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&
-					yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {
-				checkedJSPsAtStartOnce = true;
-				fLastInternalBlockStart = yy_markedPos = yy_startRead;
-				yy_currentPos = yy_markedPos + 1;
-				int resumeState = yystate();
-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
-				if(yy_markedPos == yy_startRead) {
-					String jspContext = primGetNextToken();
-					yybegin(resumeState);
-					return jspContext;
-				}
-				return searchContext;
-			}
-
-
-			/**
-			 * Look for starting CDATA "<![CDATA["
-			 */
-			// 1) yy_currentPos - searchStringLength: There's at least searchStringLength of input available; once that's read, check for CDATA
-			// ---
-			// Look for a CDATA beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.
-			// Ensure that we've not encountered a complete block (<[!CDATA[]]>) that was *shorter* than the closeTagString and
-			// thus found twice at current-targetLength [since the first scan would have come out this far anyway].
-/*			if(checkCDATA && yy_currentPos > searchStringLength && yy_currentPos + searchStringLength < yy_buffer.length && yy_currentPos - searchStringLength != fLastInternalBlockStart && 
-				charsMatch(cdataStarter, yy_buffer, 0, yy_currentPos - searchStringLength)) {
-				fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;
-				yy_currentPos = yy_markedPos + 1;
-				int resumeState = yystate();
-				// go to a state where CDATA can be found
-				if (fEmbeddedContainer == null) {
-					fEmbeddedContainer = new ContextRegionContainer();
-					fEmbeddedContainer.setType(searchContext);
-					fEmbeddedContainer.setStart(yychar);
-				}
-				ITextRegion newToken = fRegionFactory.createToken(searchContext, yychar, yylength(), yylength());
-				fEmbeddedContainer.getRegions().add(newToken);
-				fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
-				fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
-				yybegin(YYINITIAL);
-				String context = primGetNextToken();
-				if(context.equals(XMLRegionContexts.XML_CDATA_OPEN)) {
-					assembleEmbeddedContainer(XMLRegionContexts.XML_CDATA_OPEN, XMLRegionContexts.XML_CDATA_CLOSE);
-				}
-				yybegin(resumeState);
-				return searchContext;
-			}
-*//*
-			// 2) yy_currentPos - cdataStarter.length: There's not searchStringLength of input available; check for a CDATA right here spots back in what we could read
-			// ---
-			// Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section
-			// since it relies upon *having* closeTagStringLength amount of input to work as designed.  Must be sure we don't
-			// spill over the end of the buffer while checking.
-			else if(checkCDATA && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&
-					yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {
-				fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;
-				yy_currentPos = yy_markedPos + 1;
-				int resumeState = yystate();
-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
-				if(yy_markedPos == yy_startRead) {
-					String jspContext = primGetNextToken();
-					yybegin(resumeState);
-					return jspContext;
-				}
-				return searchContext;
-			}
-			// 3) yy_currentPos : Check at the start of the block one time
-			// ---
-			// Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section
-			// since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.
-			else if(checkCDATA && !checkedForCDATAOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&
-					yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {
-				checkedForCDATAOnce = true;
-				fLastInternalBlockStart = yy_markedPos = yy_startRead;
-				yy_currentPos = yy_markedPos + 1;
-				int resumeState = yystate();
-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
-				if(yy_markedPos == yy_startRead) {
-					String jspContext = primGetNextToken();
-					yybegin(resumeState);
-					return jspContext;
-				}
-				return searchContext;
-			}
-*/
-			// Check the characters in the target versus the last targetLength characters read from the buffer
-			// and see if it matches
-			if (n == YYEOF) {
+			while(n != YYEOF && yy_currentPos < searchStringLength)
+				n = yy_advance();
+	//		c = (char) n;
+			// If the input was too short or we've exhausted the input, stop immediately.
+			if (n == YYEOF && checkedForJSPsOnce) {
 				stillSearching = false;
 			}
 			else {
-				same = true;
-				// safety check for array accesses
-				if(yy_currentPos >= searchStringLength && yy_currentPos <= yy_buffer.length) {
-					for(i = 0; i < searchStringLength; i++) {
-						if(same && fIsCaseSensitiveBlocking)
-							same = yy_buffer[i + yy_currentPos - searchStringLength] == searchString.charAt(i);
-						else if(same && !fIsCaseSensitiveBlocking)
-							same = Character.toLowerCase(yy_buffer[i + yy_currentPos - searchStringLength]) == Character.toLowerCase(searchString.charAt(i));
+				/**
+				 * Look for starting JSPs "<%"
+				 */
+				checkedForJSPsOnce = true;
+				// 1) yy_currentPos - searchStringLength : There's at least searchStringLength of input available; once that's read, check for JSPs
+				// ---
+				// Look for a JSP beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.
+				// Ensure that we've not encountered a complete block (<%%>) that was *shorter* than the closeTagString and
+				// thus found twice at current-targetLength [since the first scan would have come out this far anyway].
+				if(checkJSPs && yy_currentPos > searchStringLength && yy_currentPos - searchStringLength != fLastInternalBlockStart && 
+					yy_buffer[yy_currentPos - searchStringLength] == '<' && yy_buffer[yy_currentPos - searchStringLength + 1] == '%') {
+					fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;
+					yy_currentPos = yy_markedPos + 1;
+					int resumeState = yystate();
+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
+					if(yy_markedPos == yy_startRead) {
+						String jspContext = primGetNextToken();
+						yybegin(resumeState);
+						return jspContext;
+					}
+					return searchContext;
+				}
+				// 2) yy_currentPos - jspstarter.length : There's not searchStringLength of input available; check for a JSP 2 spots back in what we could read
+				// ---
+				// Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section
+				// since it relies upon *having* closeTagStringLength amount of input to work as designed.  Must be sure we don't
+				// spill over the end of the buffer while checking.
+				else if(checkJSPs && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&
+						yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {
+					fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;
+					yy_currentPos = yy_markedPos + 1;
+					int resumeState = yystate();
+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
+					if(yy_markedPos == yy_startRead) {
+						String jspContext = primGetNextToken();
+						yybegin(resumeState);
+						return jspContext;
+					}
+					return searchContext;
+				}
+				// 3) yy_currentPos..(yy_currentPos+jspStartlength-1) : Check at the start of the block one time
+				// ---
+				// Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section
+				// since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.
+				else if(checkJSPs && !checkedJSPsAtStartOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&
+						yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {
+					checkedJSPsAtStartOnce = true;
+					fLastInternalBlockStart = yy_markedPos = yy_startRead;
+					yy_currentPos = yy_markedPos + 1;
+					int resumeState = yystate();
+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
+					if(yy_markedPos == yy_startRead) {
+						String jspContext = primGetNextToken();
+						yybegin(resumeState);
+						return jspContext;
+					}
+					return searchContext;
+				}
+	
+	
+				/**
+				 * Look for starting CDATA "<![CDATA["
+				 */
+				// 1) yy_currentPos - searchStringLength: There's at least searchStringLength of input available; once that's read, check for CDATA
+				// ---
+				// Look for a CDATA beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.
+				// Ensure that we've not encountered a complete block (<[!CDATA[]]>) that was *shorter* than the closeTagString and
+				// thus found twice at current-targetLength [since the first scan would have come out this far anyway].
+	/*			if(checkCDATA && yy_currentPos > searchStringLength && yy_currentPos + searchStringLength < yy_buffer.length && yy_currentPos - searchStringLength != fLastInternalBlockStart && 
+					charsMatch(cdataStarter, yy_buffer, 0, yy_currentPos - searchStringLength)) {
+					fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;
+					yy_currentPos = yy_markedPos + 1;
+					int resumeState = yystate();
+					// go to a state where CDATA can be found
+					if (fEmbeddedContainer == null) {
+						fEmbeddedContainer = new ContextRegionContainer();
+						fEmbeddedContainer.setType(searchContext);
+						fEmbeddedContainer.setStart(yychar);
+					}
+					ITextRegion newToken = fRegionFactory.createToken(searchContext, yychar, yylength(), yylength());
+					fEmbeddedContainer.getRegions().add(newToken);
+					fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
+					fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
+					yybegin(YYINITIAL);
+					String context = primGetNextToken();
+					if(context.equals(XMLRegionContexts.XML_CDATA_OPEN)) {
+						assembleEmbeddedContainer(XMLRegionContexts.XML_CDATA_OPEN, XMLRegionContexts.XML_CDATA_CLOSE);
+					}
+					yybegin(resumeState);
+					return searchContext;
+				}
+	*//*
+				// 2) yy_currentPos - cdataStarter.length: There's not searchStringLength of input available; check for a CDATA right here spots back in what we could read
+				// ---
+				// Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section
+				// since it relies upon *having* closeTagStringLength amount of input to work as designed.  Must be sure we don't
+				// spill over the end of the buffer while checking.
+				else if(checkCDATA && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&
+						yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {
+					fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;
+					yy_currentPos = yy_markedPos + 1;
+					int resumeState = yystate();
+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
+					if(yy_markedPos == yy_startRead) {
+						String jspContext = primGetNextToken();
+						yybegin(resumeState);
+						return jspContext;
+					}
+					return searchContext;
+				}
+				// 3) yy_currentPos : Check at the start of the block one time
+				// ---
+				// Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section
+				// since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.
+				else if(checkCDATA && !checkedForCDATAOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&
+						yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {
+					checkedForCDATAOnce = true;
+					fLastInternalBlockStart = yy_markedPos = yy_startRead;
+					yy_currentPos = yy_markedPos + 1;
+					int resumeState = yystate();
+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
+					if(yy_markedPos == yy_startRead) {
+						String jspContext = primGetNextToken();
+						yybegin(resumeState);
+						return jspContext;
+					}
+					return searchContext;
+				}
+	*/
+				// Check the characters in the target versus the last targetLength characters read from the buffer
+				// and see if it matches
+				if (n == YYEOF) {
+					stillSearching = false;
+				}
+				else {
+					same = true;
+					// safety check for array accesses
+					if(yy_currentPos >= searchStringLength && yy_currentPos <= yy_buffer.length) {
+						for(i = 0; i < searchStringLength && same; i++) {
+							if(fIsCaseSensitiveBlocking)
+								same = yy_buffer[i + yy_currentPos - searchStringLength] == searchString.charAt(i);
+							else
+								same = Character.toLowerCase(yy_buffer[i + yy_currentPos - searchStringLength]) == Character.toLowerCase(searchString.charAt(i));
+						}
+					}
+					// safety check failed; no match is possible right now
+					else {
+						same = false;
 					}
 				}
-				// safety check failed; no match is possible right now
+				if (same && requireTailSeparator && yy_currentPos < yy_buffer.length) {
+					// Additional check for close tags to ensure that targetString="</script" doesn't match
+					// "</scriptS"
+					lastCheckChar = yy_buffer[yy_currentPos];
+					// Succeed on "</script>" and "</script "
+					if(lastCheckChar == '>' || Character.isWhitespace(lastCheckChar))
+						stillSearching = false;
+				}
 				else {
-					same = false;
+					stillSearching = !same || (yy_currentPos < yy_startRead + searchStringLength);
 				}
 			}
-			if (same && requireTailSeparator && yy_currentPos < yy_buffer.length) {
-				// Additional check for close tags to ensure that targetString="</script" doesn't match
-				// "</scriptS"
-				lastCheckChar = yy_buffer[yy_currentPos];
-				// Succeed on "</script>" and "</script "
-				if(lastCheckChar == '>' || Character.isWhitespace(lastCheckChar))
-					stillSearching = false;
-			}
-			else {
-				stillSearching = !same || (yy_currentPos < yy_startRead + searchStringLength);
+		}
+		if (n != YYEOF || same) {
+			// We've stopped short of the end or definitely found a match
+			yy_markedPos = yy_currentPos - searchStringLength;
+			yy_currentPos = yy_markedPos + 1;
+			// If the searchString occurs at the very beginning of what would have
+			// been a Block, resume scanning normally immediately
+			if (yy_markedPos == yy_startRead) {
+				yybegin(immediateFallbackState);
+				return primGetNextToken();
 			}
 		}
-	}
-	if (n != YYEOF || same) {
-		// We've stopped short of the end or definitely found a match
-		yy_markedPos = yy_currentPos - searchStringLength;
-		yy_currentPos = yy_markedPos + 1;
-		// If the searchString occurs at the very beginning of what would have
+		else {
+			// We ran through the rest of the input
+			yy_markedPos = yy_currentPos;
+			yy_currentPos++;
+		}
+		yybegin(exitState);
+		// If the ending occurs at the very beginning of what would have
 		// been a Block, resume scanning normally immediately
-		if (yy_markedPos == yy_startRead) {
-			yybegin(immediateFallbackState);
+		if(yy_markedPos == yy_startRead)
 			return primGetNextToken();
-		}
+		return searchContext;
 	}
-	else {
-		// We ran through the rest of the input
-		yy_markedPos = yy_currentPos;
-		yy_currentPos++;
+	finally {
+		fIsBlockingEnabled = wasBlockingEnabled;
 	}
-	yybegin(exitState);
-	// If the ending occurs at the very beginning of what would have
-	// been a Block, resume scanning normally immediately
-	if(yy_markedPos == yy_startRead)
-		return primGetNextToken();
-	return searchContext;
 }
 /**
  * user method 
@@ -1548,6 +1649,8 @@
 			fIsBlockingEnabled = true;
 		} else if (f_context == XML_END_TAG_OPEN) {
 			fIsBlockingEnabled = false;
+		} else if (f_context == PROXY_UNKNOWN_CONTEXT) {
+			fBufferedEmbeddedContainer = fProxyUnknownRegion;
 		}
 		fBufferedContext = f_context;
 		fBufferedStart = yychar;
@@ -1711,6 +1814,11 @@
 		//  context as usual.
 		return doScan("--%>", false, false, true, JSP_COMMENT_TEXT, ST_JSP_COMMENT_END, ST_JSP_COMMENT_END);
 	}
+	
+	/* user method */
+	private boolean isJspTag() {
+		return (fContainerTag && fEmbeddedContainer != null) || (fContainerTag && fInTagContainer) || (fEmbeddedTag && fInTagEmbedded);
+	}
 
 
   /**
@@ -1740,10 +1848,10 @@
    * @return         the unpacked transition table
    */
   private static int [] yy_unpack(String packed) {
-    int [] trans = new int[31595];
+    int [] trans = new int[35287];
     int i = 0;  /* index in packed string  */
     int j = 0;  /* index in unpacked array */
-    while (i < 8206) {
+    while (i < 9344) {
       int count = packed.charAt(i++);
       int value = packed.charAt(i++);
       value--;
@@ -2075,10 +2183,48 @@
 
       switch (yy_action) {    
 
-        case 622: 
-        case 627: 
-        case 634: 
-        case 639: 
+        case 124: 
+        case 129: 
+        case 130: 
+        case 289: 
+        case 295: 
+        case 296: 
+        case 433: 
+        case 436: 
+        case 543: 
+          {  /* only allow for non-JSP tags for this does not obey JSP quoting rules */
+	if(Debug.debugTokenizer)
+		dump("attr value");//$NON-NLS-1$
+	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
+	fEmbeddedPostState = ST_XML_EQUALS;
+        yybegin(ST_XML_ATTRIBUTE_NAME);
+        return XML_TAG_ATTRIBUTE_VALUE;
+ }
+        case 718: break;
+        case 169: 
+        case 174: 
+        case 175: 
+        case 349: 
+        case 355: 
+        case 356: 
+        case 470: 
+        case 472: 
+        case 474: 
+        case 476: 
+        case 559: 
+          {  /* JSP attribute values have escape semantics */
+	if(Debug.debugTokenizer)
+		dump("jsp attr value");//$NON-NLS-1$
+	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
+	fEmbeddedPostState = ST_XML_EQUALS;
+	yybegin(ST_XML_ATTRIBUTE_NAME);
+	return XML_TAG_ATTRIBUTE_VALUE;
+ }
+        case 719: break;
+        case 685: 
+        case 690: 
+        case 697: 
+        case 702: 
           { 
 	if(Debug.debugTokenizer)
 		dump("jsp directive tag name");//$NON-NLS-1$
@@ -2087,8 +2233,8 @@
         yybegin(ST_XML_ATTRIBUTE_NAME);
         return JSP_DIRECTIVE_NAME;
  }
-        case 655: break;
-        case 597: 
+        case 720: break;
+        case 660: 
           { 
 	if(Debug.debugTokenizer)
 		dump("XSL processing instruction target");//$NON-NLS-1$
@@ -2096,14 +2242,14 @@
         yybegin(ST_XML_PI_ATTRIBUTE_NAME);
         return XML_TAG_NAME;
  }
-        case 656: break;
-        case 580: 
-        case 583: 
-        case 584: 
-        case 585: 
-        case 586: 
-        case 587: 
-        case 588: 
+        case 721: break;
+        case 643: 
+        case 646: 
+        case 647: 
+        case 648: 
+        case 649: 
+        case 650: 
+        case 651: 
           { 
 	if(Debug.debugTokenizer)
 		dump("\nCDATA start");//$NON-NLS-1$
@@ -2111,8 +2257,8 @@
 	yybegin(ST_CDATA_TEXT);
 	return XML_CDATA_OPEN;
  }
-        case 657: break;
-        case 572: 
+        case 722: break;
+        case 635: 
           { 
 	if(Debug.debugTokenizer)
 		dump("jsp:root tag name");//$NON-NLS-1$
@@ -2121,32 +2267,32 @@
         yybegin(ST_XML_ATTRIBUTE_NAME);
         return JSP_ROOT_TAG_NAME;
  }
-        case 658: break;
-        case 563: 
+        case 723: break;
+        case 626: 
           { 
 	if(Debug.debugTokenizer)
 		dump("element");//$NON-NLS-1$
 	yybegin(ST_XML_ELEMENT_DECLARATION);
 	return XML_ELEMENT_DECLARATION;
  }
-        case 659: break;
-        case 562: 
+        case 724: break;
+        case 625: 
           { 
 	if(Debug.debugTokenizer)
 		dump("attlist");//$NON-NLS-1$
 	yybegin(ST_XML_ATTLIST_DECLARATION);
 	return XML_ATTLIST_DECLARATION;
  }
-        case 660: break;
-        case 561: 
+        case 725: break;
+        case 624: 
           { 
 	if(Debug.debugTokenizer)
 		dump("doctype");//$NON-NLS-1$
 	yybegin(ST_XML_DOCTYPE_DECLARATION);
 	return XML_DOCTYPE_DECLARATION;
  }
-        case 661: break;
-        case 546: 
+        case 726: break;
+        case 609: 
           { 
 	if(Debug.debugTokenizer)
 		dump("doctype external id");//$NON-NLS-1$
@@ -2154,8 +2300,8 @@
 	yybegin(ST_XML_DOCTYPE_ID_PUBLIC);
 	return XML_DOCTYPE_EXTERNAL_ID_PUBLIC;
  }
-        case 662: break;
-        case 545: 
+        case 727: break;
+        case 608: 
           { 
 	if(Debug.debugTokenizer)
 		dump("doctype external id");//$NON-NLS-1$
@@ -2163,8 +2309,8 @@
 	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
 	return XML_DOCTYPE_EXTERNAL_ID_SYSTEM;
  }
-        case 663: break;
-        case 539: 
+        case 728: break;
+        case 602: 
           { 
 	if(Debug.debugTokenizer)
 		dump("DHTML processing instruction target");//$NON-NLS-1$
@@ -2173,33 +2319,33 @@
         yybegin(ST_DHTML_ATTRIBUTE_NAME);
         return XML_TAG_NAME;
  }
-        case 664: break;
-        case 514: 
-        case 555: 
-        case 556: 
+        case 729: break;
+        case 577: 
+        case 618: 
+        case 619: 
           { 
 	return JSP_VBL_QUOTED_CONTENT;
  }
-        case 665: break;
-        case 504: 
-        case 551: 
-        case 552: 
+        case 730: break;
+        case 567: 
+        case 614: 
+        case 615: 
           { 
 	return JSP_EL_QUOTED_CONTENT;
  }
-        case 666: break;
-        case 496: 
+        case 731: break;
+        case 558: 
           { 
 	if(Debug.debugTokenizer)
 		dump("\nJSP comment close");//$NON-NLS-1$
 	yybegin(YYINITIAL);
 	return JSP_COMMENT_CLOSE;
  }
-        case 667: break;
-        case 483: 
+        case 732: break;
+        case 545: 
           { 
 	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
+		System.out.println("begin embedded region: " + fEmbeddedHint+", el-unquoted");//$NON-NLS-1$
 	}
 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
 	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
@@ -2217,11 +2363,11 @@
 	fEmbeddedPostState = ST_XML_EQUALS;
 	return PROXY_CONTEXT;
  }
-        case 668: break;
-        case 482: 
+        case 733: break;
+        case 544: 
           { 
 	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
+		System.out.println("begin embedded region: " + fEmbeddedHint+", el-unquoted");//$NON-NLS-1$
 	}
 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
 	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
@@ -2239,15 +2385,15 @@
 	fEmbeddedPostState = ST_XML_EQUALS;
 	return PROXY_CONTEXT;
  }
-        case 669: break;
-        case 476: 
+        case 734: break;
+        case 536: 
           { 
 	if(Debug.debugTokenizer)
 		dump("\nCharRef");//$NON-NLS-1$
 	return XML_CHAR_REFERENCE;
  }
-        case 670: break;
-        case 473: 
+        case 735: break;
+        case 533: 
           { 
 	if(Debug.debugTokenizer)
 		dump("\ncomment start");//$NON-NLS-1$
@@ -2256,20 +2402,20 @@
 	yybegin(ST_XML_COMMENT);
 	return XML_COMMENT_OPEN;
  }
-        case 671: break;
-        case 472: 
-        case 491: 
-        case 494: 
-        case 497: 
-        case 498: 
-        case 500: 
-        case 502: 
-        case 505: 
-        case 507: 
-        case 508: 
-        case 510: 
-        case 512: 
-        case 515: 
+        case 736: break;
+        case 532: 
+        case 553: 
+        case 556: 
+        case 560: 
+        case 561: 
+        case 563: 
+        case 565: 
+        case 568: 
+        case 570: 
+        case 571: 
+        case 573: 
+        case 575: 
+        case 578: 
           { 
 	/* JSP comment begun (anywhere)
 	 * A consequence of the start anywhere possibility is that the
@@ -2311,7 +2457,7 @@
 	}
 	else {
 		if (Debug.debugTokenizer) {
-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspCommentStart");//$NON-NLS-1$
 		}
 		if(Debug.debugTokenizer)
 			dump("JSP comment start");//$NON-NLS-1$
@@ -2348,12 +2494,16 @@
 			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
 			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
 		}
+		else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {
+			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
+			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
+		}
 		return PROXY_CONTEXT;
 	}
  }
-        case 672: break;
-        case 381: 
-        case 382: 
+        case 737: break;
+        case 417: 
+        case 418: 
           { 
 	if(Debug.debugTokenizer)
 		dump("XML processing instruction target");//$NON-NLS-1$
@@ -2362,8 +2512,8 @@
         yybegin(ST_XML_PI_ATTRIBUTE_NAME);
         return XML_TAG_NAME;
  }
-        case 673: break;
-        case 380: 
+        case 738: break;
+        case 416: 
           { 
 	if(Debug.debugTokenizer)
 		dump("comment end");//$NON-NLS-1$
@@ -2371,16 +2521,16 @@
 	yybegin(YYINITIAL);
 	return XML_COMMENT_CLOSE;
  }
-        case 674: break;
-        case 379: 
+        case 739: break;
+        case 415: 
           { 
 	if(Debug.debugTokenizer)
 		dump("CDATA end");//$NON-NLS-1$
 	yybegin(fStateStack.pop());
 	return XML_CDATA_CLOSE;
  }
-        case 675: break;
-        case 378: 
+        case 740: break;
+        case 413: 
           { 
 	yybegin(ST_JSP_VBL);
 	if(yylength() > 2)
@@ -2393,15 +2543,15 @@
 	yybegin(YYINITIAL);
 	return PROXY_CONTEXT;
  }
-        case 676: break;
-        case 377: 
+        case 741: break;
+        case 412: 
           { 
 	if(Debug.debugTokenizer)
 		dump("\nPEReference");//$NON-NLS-1$
 	return XML_PE_REFERENCE;
  }
-        case 677: break;
-        case 376: 
+        case 742: break;
+        case 410: 
           { 
 	yybegin(ST_JSP_EL);
 	if(yylength() > 2)
@@ -2414,27 +2564,27 @@
 	yybegin(YYINITIAL);
 	return PROXY_CONTEXT;
  }
-        case 678: break;
-        case 373: 
+        case 743: break;
+        case 406: 
           { 
 	if(Debug.debugTokenizer)
 		dump("\nEntityRef");//$NON-NLS-1$
 	return XML_ENTITY_REFERENCE;
  }
-        case 679: break;
-        case 367: 
-        case 407: 
-        case 415: 
-        case 422: 
-        case 427: 
-        case 432: 
-        case 437: 
-        case 443: 
-        case 449: 
-        case 453: 
-        case 458: 
-        case 463: 
-        case 469: 
+        case 744: break;
+        case 400: 
+        case 457: 
+        case 467: 
+        case 482: 
+        case 487: 
+        case 492: 
+        case 497: 
+        case 503: 
+        case 509: 
+        case 513: 
+        case 518: 
+        case 523: 
+        case 529: 
           { 
 	/* JSP expression begun (anywhere)
 	 * A consequence of the start anywhere possibility is that the
@@ -2470,7 +2620,7 @@
 	}
 	else {
 		if (Debug.debugTokenizer) {
-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspExpressionStart");//$NON-NLS-1$
 		}
 		if(Debug.debugTokenizer)
 			dump("JSP expression start");//$NON-NLS-1$
@@ -2501,23 +2651,28 @@
 			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
 			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
 		}
+		else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {
+			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
+			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
+		}
+		
 		return PROXY_CONTEXT;
 	}
  }
-        case 680: break;
-        case 366: 
-        case 406: 
-        case 414: 
-        case 421: 
-        case 426: 
-        case 431: 
-        case 436: 
-        case 442: 
-        case 448: 
-        case 452: 
-        case 457: 
-        case 462: 
-        case 468: 
+        case 745: break;
+        case 399: 
+        case 456: 
+        case 466: 
+        case 481: 
+        case 486: 
+        case 491: 
+        case 496: 
+        case 502: 
+        case 508: 
+        case 512: 
+        case 517: 
+        case 522: 
+        case 528: 
           { 
 	/* JSP declaration begun (anywhere)
 	 * A consequence of the start anywhere possibility is that the
@@ -2553,7 +2708,7 @@
 	}
 	else {
 		if (Debug.debugTokenizer) {
-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspDeclarationStart");//$NON-NLS-1$
 		}
 		if(Debug.debugTokenizer)
 			dump("JSP declaration start");//$NON-NLS-1$
@@ -2584,23 +2739,27 @@
 			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
 			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
 		}
+		else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {
+			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
+			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
+		}
 		return PROXY_CONTEXT;
 	}
  }
-        case 681: break;
-        case 365: 
-        case 405: 
-        case 413: 
-        case 420: 
-        case 425: 
-        case 430: 
-        case 435: 
-        case 441: 
-        case 447: 
-        case 451: 
-        case 456: 
-        case 461: 
-        case 467: 
+        case 746: break;
+        case 398: 
+        case 455: 
+        case 465: 
+        case 480: 
+        case 485: 
+        case 490: 
+        case 495: 
+        case 501: 
+        case 507: 
+        case 511: 
+        case 516: 
+        case 521: 
+        case 527: 
           { 
 	/* JSP directive begun (anywhere)
 	 * A consequence of the start anywhere possibility is that the
@@ -2636,7 +2795,7 @@
 	}
 	else {
 		if (Debug.debugTokenizer) {
-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspDirectiveStart");//$NON-NLS-1$
 		}
 		if(Debug.debugTokenizer)
 			dump("JSP declaration start");//$NON-NLS-1$
@@ -2670,60 +2829,60 @@
 		return PROXY_CONTEXT;
 	}
  }
-        case 682: break;
-        case 355: 
+        case 747: break;
+        case 388: 
           { 
 	yybegin(ST_JSP_VBL_DQUOTES_END);
 	return JSP_VBL_QUOTED_CONTENT;
  }
-        case 683: break;
-        case 351: 
+        case 748: break;
+        case 384: 
           { 
 	yybegin(ST_JSP_VBL_SQUOTES_END);
 	return JSP_VBL_QUOTED_CONTENT;
  }
-        case 684: break;
-        case 349: 
+        case 749: break;
+        case 382: 
           { 
 	fELlevel++;
 	if(fELlevel == 1) {
 		return JSP_VBL_OPEN;
 	}
  }
-        case 685: break;
-        case 339: 
+        case 750: break;
+        case 372: 
           { 
 	yybegin(ST_JSP_EL_DQUOTES_END);
 	return JSP_EL_QUOTED_CONTENT;
  }
-        case 686: break;
-        case 335: 
+        case 751: break;
+        case 368: 
           { 
 	yybegin(ST_JSP_EL_SQUOTES_END);
 	return JSP_EL_QUOTED_CONTENT;
  }
-        case 687: break;
-        case 333: 
+        case 752: break;
+        case 366: 
           { 
 	//System.out.println(JSP_EL_CONTENT+ ":[" + yytext() + "]");
 	return JSP_EL_CONTENT;
  }
-        case 688: break;
-        case 332: 
+        case 753: break;
+        case 365: 
           { 
 	fELlevel++;
 	if(fELlevel == 1) {
 		return JSP_EL_OPEN;
 	}
  }
-        case 689: break;
-        case 329: 
+        case 754: break;
+        case 362: 
           { 
 	int enterState = yystate();
 	yybegin(ST_JSP_DQUOTED_VBL);
-	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE});
+	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE, JSP_TAG_ATTRIBUTE_VALUE_DQUOTE});
 	// abort early when an unescaped double quote is found in the VBL
-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE)) {
+	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_DQUOTE)) {
 		yybegin(ST_ABORT_EMBEDDED);
 		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
 	}
@@ -2732,14 +2891,14 @@
 	}
 	return PROXY_CONTEXT;
  }
-        case 690: break;
-        case 328: 
+        case 755: break;
+        case 361: 
           { 
 	int enterState = yystate();
 	yybegin(ST_JSP_DQUOTED_EL);
-	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE});
+	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE, JSP_TAG_ATTRIBUTE_VALUE_DQUOTE});
 	// abort early when an unescaped double quote is found in the EL
-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE)) {
+	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_DQUOTE)) {
 		yybegin(ST_ABORT_EMBEDDED);
 		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
 	}
@@ -2748,14 +2907,14 @@
 	}
 	return PROXY_CONTEXT;
  }
-        case 691: break;
-        case 326: 
+        case 756: break;
+        case 360: 
           { 
 	int enterState = yystate();
 	yybegin(ST_JSP_SQUOTED_VBL);
-	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE});
+	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE, JSP_TAG_ATTRIBUTE_VALUE_SQUOTE});
 	// abort early when an unescaped single quote is found in the VBL
-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
+	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
 		yybegin(ST_ABORT_EMBEDDED);
 		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
 	}
@@ -2764,14 +2923,14 @@
 	}
 	return PROXY_CONTEXT;
  }
-        case 692: break;
-        case 325: 
+        case 757: break;
+        case 359: 
           { 
 	int enterState = yystate();
 	yybegin(ST_JSP_SQUOTED_EL);
-	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE});
+	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE, JSP_TAG_ATTRIBUTE_VALUE_SQUOTE});
 	// abort early when an unescaped single quote is found in the EL
-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
+	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
 		yybegin(ST_ABORT_EMBEDDED);
 		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
 	}
@@ -2780,11 +2939,11 @@
 	}
 	return PROXY_CONTEXT;
  }
-        case 693: break;
-        case 324: 
+        case 758: break;
+        case 357: 
           { 
 	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
+		System.out.println("begin embedded region: " + fEmbeddedHint+", genericEndTagOpen");//$NON-NLS-1$
 	}
 	int incomingState = yystate();
 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
@@ -2797,15 +2956,15 @@
         yybegin(incomingState);
 	return PROXY_CONTEXT;
  }
-        case 694: break;
-        case 283: 
-        case 295: 
+        case 759: break;
         case 301: 
+        case 315: 
+        case 321: 
           { 
 	return XML_DOCTYPE_INTERNAL_SUBSET;
  }
-        case 695: break;
-        case 271: 
+        case 760: break;
+        case 287: 
           { 
 	String tagName = yytext().substring(1);
 	// pushback to just after the opening bracket
@@ -2814,7 +2973,7 @@
 	 * If this tag can not be nested or we're already searching for an
 	 * attribute name, equals, or value, return immediately.
 	 */
-	if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE))) {
+	if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE || fStateStack.peek() == ST_JSP_ATTRIBUTE_VALUE))) {
 		yybegin(ST_XML_TAG_NAME);
 		return XML_TAG_OPEN;
 	}
@@ -2830,8 +2989,8 @@
 	yybegin(ST_XML_ATTRIBUTE_NAME);
 	return PROXY_CONTEXT;
  }
-        case 696: break;
-        case 269: 
+        case 761: break;
+        case 285: 
           { 
 	String tagName = yytext().substring(1);
 	// pushback to just after the opening bracket
@@ -2840,7 +2999,7 @@
 	 * If this tag can not be nested or we're already searching for an
 	 * attribute name, equals, or value, return immediately.
 	 */
-	if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE))) {
+	if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE || fStateStack.peek() == ST_JSP_ATTRIBUTE_VALUE))) {
 		yybegin(ST_XML_TAG_NAME);
 		return XML_TAG_OPEN;
 	}
@@ -2856,20 +3015,53 @@
 	yybegin(ST_XML_EQUALS);
 	return PROXY_CONTEXT;
  }
-        case 697: break;
-        case 267: 
+        case 762: break;
+        case 283: 
           { 
         yybegin(YYINITIAL);
 	fEmbeddedHint = UNDEFINED;
 	if(Debug.debugTokenizer)
 		dump("empty tag close");//$NON-NLS-1$
-        return XML_EMPTY_TAG_CLOSE;
+
+	if (fEmbeddedContainer != null)
+		fInTagEmbedded = false;
+	else
+		fInTagContainer = false;
+
+	return XML_EMPTY_TAG_CLOSE;
  }
-        case 698: break;
-        case 125: 
+        case 763: break;
+        case 274: 
           { 
+	if(Debug.debugTokenizer)
+		dump("JSP end");//$NON-NLS-1$
 	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
+		if(fStateStack.peek()!=YYINITIAL)
+			System.out.println("end embedded region");//$NON-NLS-1$
+	}
+	yybegin(fStateStack.pop());
+	return JSP_DIRECTIVE_CLOSE;
+ }
+        case 764: break;
+        case 272: 
+          { 
+	if(Debug.debugTokenizer)
+		dump("JSP end");//$NON-NLS-1$
+	if (Debug.debugTokenizer) {
+		if(fStateStack.peek()!=YYINITIAL)
+			System.out.println("end embedded region");//$NON-NLS-1$
+	}
+	yybegin(fStateStack.pop());
+	return JSP_CLOSE;
+ }
+        case 765: break;
+        case 127: 
+        case 172: 
+          { 
+	String type = yy_lexical_state == ST_XML_ATTRIBUTE_VALUE ? XML_TAG_ATTRIBUTE_VALUE_DQUOTE : JSP_TAG_ATTRIBUTE_VALUE_DQUOTE;
+
+	if (Debug.debugTokenizer) {
+		System.out.println("begin embedded region: " + fEmbeddedHint+", "+type);//$NON-NLS-1$
 	}
 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
 	fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
@@ -2877,18 +3069,22 @@
 	fStateStack.push(yystate());
 	if(Debug.debugTokenizer)
 		dump("JSP attribute value start - complex double quoted");//$NON-NLS-1$
-	assembleEmbeddedContainer(XML_TAG_ATTRIBUTE_VALUE_DQUOTE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE);
+	assembleEmbeddedContainer(type, type);
 	fStateStack.pop();
 	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
 	fEmbeddedPostState = ST_XML_EQUALS;
 	yybegin(ST_XML_ATTRIBUTE_NAME);
+	if (fEmbeddedContainer.getLastRegion().getType() == UNDEFINED) {
+		fProxyUnknownRegion = fRegionFactory.createToken(XML_TAG_ATTRIBUTE_VALUE, fEmbeddedContainer.getStart(), fEmbeddedContainer.getTextLength(), fEmbeddedContainer.getLength());
+		return PROXY_UNKNOWN_CONTEXT;
+	}
 	return PROXY_CONTEXT;
  }
-        case 699: break;
-        case 123: 
+        case 766: break;
+        case 125: 
           { 
 	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
+		System.out.println("begin embedded region: " + fEmbeddedHint+", unquoted genericTagOpen");//$NON-NLS-1$
 	}
 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
 	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
@@ -2903,36 +3099,18 @@
 	fEmbeddedPostState = ST_XML_EQUALS;
 	return PROXY_CONTEXT;
  }
-        case 700: break;
-        case 122: 
-        case 127: 
-        case 128: 
-        case 273: 
-        case 277: 
-        case 278: 
-        case 387: 
-        case 390: 
-        case 481: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attr value");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 701: break;
-        case 121: 
+        case 767: break;
+        case 123: 
           { 
 	if(Debug.debugTokenizer)
 		dump("equals");//$NON-NLS-1$
 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
 	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-        yybegin(ST_XML_ATTRIBUTE_VALUE);
+        yybegin(isJspTag() ? ST_JSP_ATTRIBUTE_VALUE : ST_XML_ATTRIBUTE_VALUE);
         return XML_TAG_ATTRIBUTE_EQUALS;
  }
-        case 702: break;
-        case 120: 
+        case 768: break;
+        case 122: 
           { 
 	if(Debug.debugTokenizer)
 		dump("attr name");//$NON-NLS-1$
@@ -2941,61 +3119,71 @@
         yybegin(ST_XML_EQUALS);
         return XML_TAG_ATTRIBUTE_NAME;
  }
-        case 703: break;
-        case 116: 
-        case 117: 
+        case 769: break;
         case 118: 
-        case 268: 
-        case 386: 
-        case 480: 
-        case 520: 
-        case 521: 
-        case 540: 
-        case 541: 
-        case 559: 
-        case 560: 
-        case 573: 
-        case 582: 
-        case 590: 
-        case 592: 
-        case 594: 
-        case 596: 
-        case 599: 
-        case 605: 
-        case 606: 
-        case 607: 
-        case 608: 
-        case 609: 
-        case 615: 
-        case 616: 
-        case 617: 
-        case 618: 
-        case 619: 
-        case 625: 
-        case 626: 
-        case 628: 
-        case 629: 
-        case 635: 
+        case 119: 
+        case 120: 
+        case 284: 
+        case 430: 
+        case 542: 
+        case 583: 
+        case 584: 
+        case 603: 
+        case 604: 
+        case 622: 
+        case 623: 
         case 636: 
-        case 637: 
-        case 638: 
-        case 644: 
         case 645: 
-        case 646: 
-        case 647: 
-        case 650: 
-        case 651: 
         case 653: 
+        case 655: 
+        case 657: 
+        case 659: 
+        case 662: 
+        case 668: 
+        case 669: 
+        case 670: 
+        case 671: 
+        case 672: 
+        case 678: 
+        case 679: 
+        case 680: 
+        case 681: 
+        case 682: 
+        case 688: 
+        case 689: 
+        case 691: 
+        case 692: 
+        case 698: 
+        case 699: 
+        case 700: 
+        case 701: 
+        case 707: 
+        case 708: 
+        case 709: 
+        case 710: 
+        case 713: 
+        case 714: 
+        case 716: 
           { 
 	if(Debug.debugTokenizer)
 		dump("tag name");//$NON-NLS-1$
+    String tagname = yytext();
+    boolean jspTag = tagname.indexOf(':') != -1;
+	if (fEmbeddedContainer != null) {
+    	fEmbeddedTag = jspTag;
+		fInTagEmbedded = true;
+    }
+	else {
+		fContainerTag = jspTag;
+		fInTagContainer = true;
+	}
 	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
 	fEmbeddedPostState = ST_XML_EQUALS;
         yybegin(ST_XML_ATTRIBUTE_NAME);
         return XML_TAG_NAME;
  }
-        case 704: break;
-        case 114: 
+        case 770: break;
+        case 116: 
           { 
 	if(Debug.debugTokenizer)
 		dump("tag close");//$NON-NLS-1$
@@ -3007,58 +3195,68 @@
 	}
 	else
         	yybegin(YYINITIAL);
-        return XML_TAG_CLOSE;
+
+	if (fEmbeddedContainer != null)
+		fInTagEmbedded = false;
+	else
+		fInTagContainer = false;
+
+	return XML_TAG_CLOSE;
  }
-        case 705: break;
-        case 107: 
-        case 111: 
-        case 263: 
+        case 771: break;
+        case 109: 
+        case 113: 
+        case 277: 
           { 
 	if(Debug.debugTokenizer)
 		dump("attr value");//$NON-NLS-1$
         yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_NAME);
         return XML_TAG_ATTRIBUTE_VALUE;
  }
-        case 706: break;
-        case 106: 
+        case 772: break;
+        case 108: 
           { 
 	if(Debug.debugTokenizer)
 		dump("equals");//$NON-NLS-1$
         yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE);
         return XML_TAG_ATTRIBUTE_EQUALS;
  }
-        case 707: break;
-        case 105: 
+        case 773: break;
+        case 107: 
           { 
 	if(Debug.debugTokenizer)
 		dump("attr name");//$NON-NLS-1$
         yybegin(ST_JSP_DIRECTIVE_EQUALS);
         return XML_TAG_ATTRIBUTE_NAME;
  }
-        case 708: break;
-        case 102: 
+        case 774: break;
+        case 104: 
           { 
 	if(Debug.debugTokenizer)
 		dump("JSP directive name");//$NON-NLS-1$
 	yybegin(ST_JSP_DIRECTIVE_NAME_WHITESPACE);
 	return JSP_DIRECTIVE_NAME;
  }
-        case 709: break;
-        case 98: 
-        case 99: 
+        case 775: break;
         case 100: 
+        case 101: 
+        case 102: 
           { 
 	if(Debug.debugTokenizer)
 		dump("JSP code content");//$NON-NLS-1$
 	return doScan("%>", false, false, false, JSP_CONTENT, ST_JSP_CONTENT, ST_JSP_CONTENT);
  }
-        case 710: break;
-        case 94: 
+        case 776: break;
         case 96: 
-        case 97: 
-        case 253: 
-        case 254: 
-        case 257: 
+        case 98: 
+        case 99: 
+        case 265: 
+        case 266: 
+        case 267: 
+        case 270: 
+        case 271: 
+        case 424: 
+        case 427: 
           { 
 	if(Debug.debugTokenizer)
 		dump("DHTML processing instruction attribute value");//$NON-NLS-1$
@@ -3067,8 +3265,8 @@
         yybegin(ST_DHTML_ATTRIBUTE_NAME);
         return XML_TAG_ATTRIBUTE_VALUE;
  }
-        case 711: break;
-        case 93: 
+        case 777: break;
+        case 95: 
           { 
 	if(Debug.debugTokenizer)
 		dump("DHTML processing instruction '='");//$NON-NLS-1$
@@ -3077,16 +3275,16 @@
         yybegin(ST_DHTML_ATTRIBUTE_VALUE);
         return XML_TAG_ATTRIBUTE_EQUALS;
  }
-        case 712: break;
-        case 92: 
+        case 778: break;
+        case 94: 
           { 
 	if(Debug.debugTokenizer)
 		dump("DHTML processing instruction attribute name");//$NON-NLS-1$
         yybegin(ST_DHTML_EQUALS);
         return XML_TAG_ATTRIBUTE_NAME;
  }
-        case 713: break;
-        case 90: 
+        case 779: break;
+        case 92: 
           { 
 	if(Debug.debugTokenizer)
 		dump("DHTML processing instruction end");//$NON-NLS-1$
@@ -3094,10 +3292,10 @@
         yybegin(YYINITIAL);
         return XML_PI_CLOSE;
  }
-        case 714: break;
-        case 84: 
+        case 780: break;
         case 86: 
-        case 244: 
+        case 88: 
+        case 254: 
           { 
 	if(Debug.debugTokenizer)
 		dump("XML processing instruction attribute value");//$NON-NLS-1$
@@ -3106,8 +3304,8 @@
         yybegin(ST_XML_PI_ATTRIBUTE_NAME);
         return XML_TAG_ATTRIBUTE_VALUE;
  }
-        case 715: break;
-        case 83: 
+        case 781: break;
+        case 85: 
           { 
 	if(Debug.debugTokenizer)
 		dump("XML processing instruction '='");//$NON-NLS-1$
@@ -3116,100 +3314,100 @@
         yybegin(ST_XML_PI_ATTRIBUTE_VALUE);
         return XML_TAG_ATTRIBUTE_EQUALS;
  }
-        case 716: break;
-        case 49: 
-        case 199: 
-        case 200: 
-        case 203: 
+        case 782: break;
+        case 50: 
+        case 209: 
+        case 210: 
         case 213: 
-        case 214: 
-        case 217: 
-        case 218: 
-        case 360: 
-        case 363: 
-        case 446: 
-        case 460: 
-        case 466: 
+        case 223: 
+        case 224: 
+        case 227: 
+        case 228: 
+        case 393: 
+        case 396: 
+        case 506: 
+        case 520: 
+        case 526: 
           { 
 	return JSP_VBL_CONTENT;
  }
-        case 717: break;
-        case 42: 
-        case 178: 
-        case 179: 
-        case 182: 
-        case 192: 
-        case 193: 
-        case 196: 
-        case 197: 
-        case 330: 
-        case 344: 
-        case 347: 
-        case 418: 
-        case 419: 
-        case 434: 
-        case 440: 
+        case 783: break;
+        case 43: 
+        case 187: 
+        case 188: 
+        case 191: 
+        case 201: 
+        case 202: 
+        case 206: 
+        case 207: 
+        case 363: 
+        case 377: 
+        case 380: 
+        case 478: 
+        case 479: 
+        case 494: 
+        case 500: 
           { 
 	return JSP_EL_CONTENT;
  }
-        case 718: break;
+        case 784: break;
         case 35: 
-        case 159: 
-        case 160: 
-        case 321: 
-        case 412: 
-        case 416: 
-        case 495: 
-        case 528: 
-        case 548: 
-        case 565: 
-        case 575: 
+        case 161: 
+        case 162: 
+        case 345: 
+        case 464: 
+        case 468: 
+        case 557: 
+        case 591: 
+        case 611: 
+        case 628: 
+        case 638: 
           { 
 	if(Debug.debugTokenizer)
 		dump("attlist contentspec");//$NON-NLS-1$
 	return XML_ATTLIST_DECL_CONTENT;
  }
-        case 719: break;
+        case 785: break;
         case 33: 
-        case 152: 
-        case 153: 
-        case 311: 
-        case 404: 
-        case 408: 
-        case 492: 
-        case 527: 
-        case 547: 
-        case 564: 
-        case 574: 
+        case 154: 
+        case 155: 
+        case 333: 
+        case 454: 
+        case 458: 
+        case 554: 
+        case 590: 
+        case 610: 
+        case 627: 
+        case 637: 
           { 
 	if(Debug.debugTokenizer)
 		dump("elementdecl contentspec");//$NON-NLS-1$
 	return XML_ELEMENT_DECL_CONTENT;
  }
-        case 720: break;
+        case 786: break;
         case 22: 
-        case 112: 
+        case 114: 
           { 
 	if(Debug.debugTokenizer)
 		dump("inappropriate tag name");//$NON-NLS-1$
 	if(!fStateStack.empty() && (fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_SQUOTED||fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_DQUOTED)) {
 		yybegin(ST_ABORT_EMBEDDED);
-		yypushback(yylength()-1);
-		return XML_TAG_ATTRIBUTE_VALUE;
+		//yypushback(yylength()-1);
+		return UNDEFINED;
 	}
 	yybegin(YYINITIAL);
         return XML_CONTENT;
  }
-        case 721: break;
+        case 787: break;
         case 18: 
-        case 104: 
+        case 106: 
           { 
 	if(Debug.debugTokenizer)
 		dump("white space");//$NON-NLS-1$
 	yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_NAME);
 	return WHITE_SPACE;
  }
-        case 722: break;
+        case 788: break;
         case 5: 
         case 8: 
         case 9: 
@@ -3235,39 +3433,43 @@
         case 34: 
         case 40: 
         case 41: 
-        case 72: 
-        case 169: 
-        case 174: 
+        case 42: 
+        case 74: 
+        case 178: 
+        case 183: 
           { 
 	if(Debug.debugTokenizer)
 		dump("white space");//$NON-NLS-1$
         return WHITE_SPACE;
  }
-        case 723: break;
+        case 789: break;
         case 0: 
-        case 56: 
-        case 59: 
+        case 57: 
+        case 60: 
         case 61: 
-        case 225: 
-        case 227: 
-        case 228: 
-        case 230: 
-        case 232: 
-        case 370: 
-        case 371: 
-        case 372: 
-        case 475: 
+        case 63: 
+        case 235: 
+        case 237: 
+        case 240: 
+        case 242: 
+        case 403: 
+        case 404: 
+        case 405: 
+        case 409: 
+        case 411: 
+        case 414: 
+        case 535: 
           { 
 	if(Debug.debugTokenizer)
 		dump("\nXML content");//$NON-NLS-1$
 	return XML_CONTENT;
  }
-        case 724: break;
-        case 57: 
-        case 101: 
-        case 113: 
-        case 119: 
-        case 129: 
+        case 790: break;
+        case 58: 
+        case 103: 
+        case 115: 
+        case 121: 
+        case 131: 
           { 
 	if(Debug.debugTokenizer)
 		dump("\nstart tag open");//$NON-NLS-1$
@@ -3276,71 +3478,69 @@
         yybegin(ST_XML_TAG_NAME);
         return XML_TAG_OPEN;
  }
-        case 725: break;
-        case 58: 
-        case 60: 
-        case 64: 
-        case 65: 
+        case 791: break;
+        case 59: 
+        case 62: 
         case 66: 
-        case 70: 
-        case 71: 
-        case 81: 
-        case 85: 
+        case 67: 
+        case 68: 
+        case 72: 
+        case 73: 
+        case 83: 
         case 87: 
-        case 88: 
         case 89: 
+        case 90: 
         case 91: 
-        case 95: 
-        case 103: 
-        case 108: 
-        case 109: 
+        case 93: 
+        case 97: 
+        case 105: 
         case 110: 
-        case 115: 
-        case 124: 
-        case 131: 
-        case 132: 
+        case 111: 
+        case 112: 
+        case 117: 
+        case 126: 
         case 133: 
         case 134: 
+        case 135: 
         case 136: 
-        case 137: 
+        case 138: 
         case 139: 
-        case 140: 
         case 141: 
-        case 144: 
-        case 145: 
+        case 142: 
+        case 143: 
         case 146: 
-        case 149: 
-        case 150: 
+        case 147: 
+        case 148: 
         case 151: 
-        case 156: 
-        case 157: 
+        case 152: 
+        case 153: 
         case 158: 
-        case 166: 
+        case 159: 
+        case 160: 
+        case 168: 
+        case 170: 
         case 171: 
-        case 172: 
-        case 176: 
-        case 177: 
-        case 184: 
-        case 185: 
-        case 187: 
-        case 188: 
+        case 193: 
         case 194: 
+        case 197: 
         case 198: 
-        case 205: 
-        case 206: 
+        case 204: 
         case 208: 
-        case 209: 
         case 215: 
+        case 216: 
         case 219: 
+        case 220: 
+        case 225: 
+        case 229: 
           { 
 	if (Debug.debugTokenizer)
 		System.out.println("!!!unexpected!!!: \"" + yytext() + "\":" + //$NON-NLS-2$//$NON-NLS-1$
 			yychar + "-" + (yychar + yylength()));//$NON-NLS-1$
 	return UNDEFINED;
  }
-        case 726: break;
-        case 62: 
-        case 63: 
+        case 792: break;
+        case 64: 
+        case 65: 
           { 
 	if(Debug.debugTokenizer)
 		dump("CDATA text");//$NON-NLS-1$
@@ -3351,46 +3551,46 @@
 		yybegin(ST_CDATA_END);
 	return returnedContext;
  }
-        case 727: break;
-        case 67: 
-        case 186: 
-        case 189: 
-        case 207: 
-        case 210: 
+        case 793: break;
+        case 69: 
+        case 196: 
+        case 200: 
+        case 218: 
+        case 222: 
           { 
 	if(Debug.debugTokenizer)
 		dump("LINE FEED");//$NON-NLS-1$
 	return WHITE_SPACE;
  }
-        case 728: break;
-        case 68: 
-        case 69: 
+        case 794: break;
+        case 70: 
+        case 71: 
           { 
 	if(Debug.debugTokenizer)
 		dump("comment content");//$NON-NLS-1$
 	return scanXMLCommentText();
  }
-        case 729: break;
-        case 73: 
-        case 74: 
+        case 795: break;
         case 75: 
         case 76: 
-        case 237: 
-        case 238: 
-        case 239: 
-        case 383: 
-        case 478: 
-        case 479: 
-        case 518: 
-        case 519: 
+        case 77: 
+        case 78: 
+        case 247: 
+        case 248: 
+        case 249: 
+        case 419: 
         case 538: 
-        case 558: 
-        case 571: 
+        case 539: 
         case 581: 
-        case 589: 
-        case 591: 
-        case 593: 
-        case 595: 
+        case 582: 
+        case 601: 
+        case 621: 
+        case 634: 
+        case 644: 
+        case 652: 
+        case 654: 
+        case 656: 
+        case 658: 
           { 
 	if(Debug.debugTokenizer)
 		dump("processing instruction target");//$NON-NLS-1$
@@ -3398,33 +3598,35 @@
         yybegin(ST_PI_WS);
         return XML_TAG_NAME;
  }
-        case 730: break;
-        case 77: 
+        case 796: break;
+        case 79: 
           { 
         yybegin(ST_PI_CONTENT);
         return WHITE_SPACE;
  }
-        case 731: break;
-        case 78: 
-        case 79: 
+        case 797: break;
         case 80: 
+        case 81: 
+        case 82: 
           { 
 		// block scan until close is found
 	return doScan("?>", false, false, false, XML_PI_CONTENT, ST_XML_PI_TAG_CLOSE, ST_XML_PI_TAG_CLOSE);
  }
-        case 732: break;
-        case 82: 
+        case 798: break;
+        case 84: 
           { 
 	if(Debug.debugTokenizer)
 		dump("XML processing instruction attribute name");//$NON-NLS-1$
         yybegin(ST_XML_PI_EQUALS);
         return XML_TAG_ATTRIBUTE_NAME;
  }
-        case 733: break;
-        case 126: 
+        case 799: break;
+        case 128: 
+        case 173: 
           { 
+	String type = yy_lexical_state == ST_XML_ATTRIBUTE_VALUE ? XML_TAG_ATTRIBUTE_VALUE_SQUOTE : JSP_TAG_ATTRIBUTE_VALUE_SQUOTE;
 	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
+		System.out.println("begin embedded region: " + fEmbeddedHint+", "+type);//$NON-NLS-1$
 	}
 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
 	fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
@@ -3432,15 +3634,19 @@
 	fStateStack.push(yystate());
 	if(Debug.debugTokenizer)
 		dump("JSP attribute value start - complex single quoted");//$NON-NLS-1$
-	assembleEmbeddedContainer(XML_TAG_ATTRIBUTE_VALUE_SQUOTE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE);
+	assembleEmbeddedContainer(type, type);
 	fStateStack.pop();
 	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
 	fEmbeddedPostState = ST_XML_EQUALS;
         yybegin(ST_XML_ATTRIBUTE_NAME);
+    if (fEmbeddedContainer.getLastRegion().getType() == UNDEFINED) {
+		fProxyUnknownRegion = fRegionFactory.createToken(XML_TAG_ATTRIBUTE_VALUE, fEmbeddedContainer.getStart(), fEmbeddedContainer.getTextLength(), fEmbeddedContainer.getLength());
+		return PROXY_UNKNOWN_CONTEXT;
+	}
 	return PROXY_CONTEXT;
  }
-        case 734: break;
-        case 130: 
+        case 800: break;
+        case 132: 
           { 
 	if(Debug.debugTokenizer)
 		dump("declaration end");//$NON-NLS-1$
@@ -3451,20 +3657,20 @@
 	yybegin(fStateStack.pop());
 	return XML_DECLARATION_CLOSE;
  }
-        case 735: break;
-        case 135: 
+        case 801: break;
+        case 137: 
           { 
 	if(Debug.debugTokenizer)
 		dump("doctype type");//$NON-NLS-1$
 	yybegin(ST_XML_DOCTYPE_EXTERNAL_ID);
 	return XML_DOCTYPE_NAME;
  }
-        case 736: break;
-        case 138: 
-        case 142: 
-        case 288: 
-        case 292: 
-        case 399: 
+        case 802: break;
+        case 140: 
+        case 144: 
+        case 306: 
+        case 311: 
+        case 446: 
           { 
 	if(Debug.debugTokenizer)
 		dump("doctype public reference");//$NON-NLS-1$
@@ -3473,10 +3679,10 @@
 	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
 	return XML_DOCTYPE_EXTERNAL_ID_PUBREF;
  }
-        case 737: break;
-        case 143: 
-        case 147: 
-        case 298: 
+        case 803: break;
+        case 145: 
+        case 149: 
+        case 318: 
           { 
 	if(Debug.debugTokenizer)
 		dump("doctype system reference");//$NON-NLS-1$
@@ -3485,11 +3691,11 @@
 	yybegin(ST_XML_DECLARATION_CLOSE);
 	return XML_DOCTYPE_EXTERNAL_ID_SYSREF;
  }
-        case 738: break;
-        case 148: 
-        case 304: 
-        case 308: 
-        case 402: 
+        case 804: break;
+        case 150: 
+        case 324: 
+        case 329: 
+        case 451: 
           { 
 	if(Debug.debugTokenizer)
 		dump("elementdecl name");//$NON-NLS-1$
@@ -3498,8 +3704,8 @@
 	yybegin(ST_XML_ELEMENT_DECLARATION_CONTENT);
 	return XML_ELEMENT_DECL_NAME;
  }
-        case 739: break;
-        case 154: 
+        case 805: break;
+        case 156: 
           { 
 	if(Debug.debugTokenizer)
 		dump("elementdecl close");//$NON-NLS-1$
@@ -3510,11 +3716,11 @@
 	yybegin(fStateStack.pop());
 	return XML_DECLARATION_CLOSE;
  }
-        case 740: break;
-        case 155: 
-        case 314: 
-        case 318: 
-        case 410: 
+        case 806: break;
+        case 157: 
+        case 336: 
+        case 341: 
+        case 461: 
           { 
 	if(Debug.debugTokenizer)
 		dump("attlist name");//$NON-NLS-1$
@@ -3523,8 +3729,8 @@
 	yybegin(ST_XML_ATTLIST_DECLARATION_CONTENT);
 	return XML_ATTLIST_DECL_NAME;
  }
-        case 741: break;
-        case 161: 
+        case 807: break;
+        case 163: 
           { 
 	if(Debug.debugTokenizer)
 		dump("attlist close");//$NON-NLS-1$
@@ -3535,25 +3741,30 @@
 	yybegin(fStateStack.pop());
 	return XML_DECLARATION_CLOSE;
  }
-        case 742: break;
-        case 164: 
-        case 165: 
+        case 808: break;
+        case 166: 
+        case 167: 
           { 
 	if(Debug.debugTokenizer)
 		dump("\nJSP comment text");//$NON-NLS-1$
 	return scanJSPCommentText();
  }
-        case 743: break;
-        case 167: 
-        case 173: 
+        case 809: break;
+        case 176: 
+        case 180: 
+        case 181: 
+        case 182: 
+        case 185: 
+        case 186: 
+        case 358: 
           { 
 	return XML_TAG_ATTRIBUTE_VALUE;
  }
-        case 744: break;
-        case 168: 
+        case 810: break;
+        case 177: 
           { 
 	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
+		System.out.println("begin embedded region: " + fEmbeddedHint+", genericTagOpen");//$NON-NLS-1$
 	}
 	int incomingState = yystate();
 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
@@ -3566,30 +3777,30 @@
         yybegin(incomingState);
 	return PROXY_CONTEXT;
  }
-        case 745: break;
-        case 170: 
+        case 811: break;
+        case 179: 
           { 
-	return XML_TAG_ATTRIBUTE_VALUE_SQUOTE;
+	return isJspTag() ? JSP_TAG_ATTRIBUTE_VALUE_SQUOTE : XML_TAG_ATTRIBUTE_VALUE_SQUOTE;
  }
-        case 746: break;
-        case 175: 
+        case 812: break;
+        case 184: 
           { 
-	return XML_TAG_ATTRIBUTE_VALUE_DQUOTE;
+	return isJspTag()? JSP_TAG_ATTRIBUTE_VALUE_DQUOTE : XML_TAG_ATTRIBUTE_VALUE_DQUOTE;
  }
-        case 747: break;
-        case 180: 
+        case 813: break;
+        case 189: 
           { 
 	yybegin(ST_JSP_EL_DQUOTES);
 	return JSP_EL_DQUOTE;
  }
-        case 748: break;
-        case 181: 
+        case 814: break;
+        case 190: 
           { 
 	yybegin(ST_JSP_EL_SQUOTES);
 	return JSP_EL_SQUOTE;
  }
-        case 749: break;
-        case 183: 
+        case 815: break;
+        case 192: 
           { 
 	fELlevel--;
 	if(fELlevel == 0) {
@@ -3598,37 +3809,42 @@
 	}
 	return JSP_EL_CONTENT;
  }
-        case 750: break;
-        case 190: 
+        case 816: break;
+        case 195: 
           { 
 	yybegin(ST_JSP_EL);
 	return JSP_EL_SQUOTE;
  }
-        case 751: break;
-        case 191: 
+        case 817: break;
+        case 199: 
           { 
 	yybegin(ST_JSP_EL);
 	return JSP_EL_DQUOTE;
  }
-        case 752: break;
-        case 195: 
+        case 818: break;
+        case 203: 
+          { 
+	return isJspTag() ? JSP_TAG_ATTRIBUTE_VALUE_DQUOTE: XML_TAG_ATTRIBUTE_VALUE_DQUOTE;
+ }
+        case 819: break;
+        case 205: 
           { 
 	return JSP_EL_CLOSE;
  }
-        case 753: break;
-        case 201: 
+        case 820: break;
+        case 211: 
           { 
 	yybegin(ST_JSP_VBL_DQUOTES);
 	return JSP_VBL_DQUOTE;
  }
-        case 754: break;
-        case 202: 
+        case 821: break;
+        case 212: 
           { 
 	yybegin(ST_JSP_VBL_SQUOTES);
 	return JSP_VBL_SQUOTE;
  }
-        case 755: break;
-        case 204: 
+        case 822: break;
+        case 214: 
           { 
 	fELlevel--;
 	if(fELlevel == 0) {
@@ -3637,25 +3853,25 @@
 	}
 	return JSP_VBL_CONTENT;
  }
-        case 756: break;
-        case 211: 
+        case 823: break;
+        case 217: 
           { 
 	yybegin(ST_JSP_VBL);
 	return JSP_VBL_SQUOTE;
  }
-        case 757: break;
-        case 212: 
+        case 824: break;
+        case 221: 
           { 
 	yybegin(ST_JSP_VBL);
 	return JSP_VBL_DQUOTE;
  }
-        case 758: break;
-        case 216: 
+        case 825: break;
+        case 226: 
           { 
 	return JSP_VBL_CLOSE;
  }
-        case 759: break;
-        case 220: 
+        case 826: break;
+        case 230: 
           { 
 	if(Debug.debugTokenizer)
 		dump("\nend tag open");//$NON-NLS-1$
@@ -3664,28 +3880,28 @@
         yybegin(ST_XML_TAG_NAME);
         return XML_END_TAG_OPEN;
  }
-        case 760: break;
-        case 221: 
+        case 827: break;
+        case 231: 
           { 
 	if(Debug.debugTokenizer)
 		dump("\nprocessing instruction start");//$NON-NLS-1$
 	yybegin(ST_PI);
         return XML_PI_OPEN;
  }
-        case 761: break;
-        case 222: 
-        case 310: 
-        case 320: 
-        case 331: 
-        case 336: 
-        case 340: 
-        case 343: 
-        case 346: 
-        case 348: 
-        case 352: 
-        case 356: 
-        case 359: 
-        case 362: 
+        case 828: break;
+        case 232: 
+        case 332: 
+        case 344: 
+        case 364: 
+        case 369: 
+        case 373: 
+        case 376: 
+        case 379: 
+        case 381: 
+        case 385: 
+        case 389: 
+        case 392: 
+        case 395: 
           { 
 	/* JSP scriptlet begun (anywhere)
 	 * A consequence of the start anywhere possibility is that the
@@ -3721,7 +3937,7 @@
 	}
 	else {
 		if (Debug.debugTokenizer) {
-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspScriptletStart");//$NON-NLS-1$
 		}
 		if(Debug.debugTokenizer)
 			dump("JSP scriptlet start");//$NON-NLS-1$
@@ -3752,11 +3968,16 @@
 			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
 			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
 		}
+        else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {
+            fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
+            fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
+        }
+		
 		return PROXY_CONTEXT;
 	}
  }
-        case 762: break;
-        case 223: 
+        case 829: break;
+        case 233: 
           { 
 	fStateStack.push(yystate());
 	if(Debug.debugTokenizer)
@@ -3764,8 +3985,8 @@
         yybegin(ST_XML_DECLARATION);
 	return XML_DECLARATION_OPEN;
  }
-        case 763: break;
-        case 236: 
+        case 830: break;
+        case 246: 
           { 
 	if(Debug.debugTokenizer)
 		dump("processing instruction end");//$NON-NLS-1$
@@ -3773,16 +3994,16 @@
         yybegin(YYINITIAL);
         return XML_PI_CLOSE;
  }
-        case 764: break;
-        case 240: 
+        case 831: break;
+        case 250: 
           { 
 		// ended with nothing inside
 		fEmbeddedHint = UNDEFINED;
         yybegin(YYINITIAL);
         return XML_PI_CLOSE;
  }
-        case 765: break;
-        case 241: 
+        case 832: break;
+        case 251: 
           { 
 	if(Debug.debugTokenizer)
 		dump("XML processing instruction end");//$NON-NLS-1$
@@ -3790,37 +4011,13 @@
         yybegin(YYINITIAL);
         return XML_PI_CLOSE;
  }
-        case 766: break;
-        case 258: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("JSP end");//$NON-NLS-1$
-	if (Debug.debugTokenizer) {
-		if(fStateStack.peek()!=YYINITIAL)
-			System.out.println("end embedded region");//$NON-NLS-1$
-	}
-	yybegin(fStateStack.pop());
-	return JSP_CLOSE;
- }
-        case 767: break;
-        case 260: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("JSP end");//$NON-NLS-1$
-	if (Debug.debugTokenizer) {
-		if(fStateStack.peek()!=YYINITIAL)
-			System.out.println("end embedded region");//$NON-NLS-1$
-	}
-	yybegin(fStateStack.pop());
-	return JSP_DIRECTIVE_CLOSE;
- }
-        case 768: break;
-        case 162: 
-        case 163: 
+        case 833: break;
+        case 164: 
+        case 165: 
           { 
 		return doBlockTagScan();
 	 }
-        case 769: break;
+        case 834: break;
         default: 
           if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
             yy_atEOF = true;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceInitializer.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceInitializer.java
index 09edd42..508773b 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceInitializer.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -64,6 +64,7 @@
 		node.putInt(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE, ValidationMessage.ERROR);
 		node.putInt(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE, ValidationMessage.WARNING);
 		node.putInt(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG, ValidationMessage.WARNING);
+		node.putInt(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE, ValidationMessage.WARNING);
 
 		node.putInt(JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE, ValidationMessage.ERROR);
 		node.putInt(JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND, ValidationMessage.WARNING);
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceNames.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceNames.java
index 651dbe8..1f8f2b0 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceNames.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -69,6 +69,7 @@
 
 	public static final String VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE = "validation.actions-missing-required-attribute";
 	public static final String VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE = "validation.actions-unknown-attribute";
+	public static final String VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE = "validation.actions-unexpected-rtexprvalue";
 	public static final String VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG = "validation.actions-non-empty-inline-tag";
 	
 	public static final String VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE = "validation.translation-tei-message";
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/provisional/JSP21Namespace.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/provisional/JSP21Namespace.java
new file mode 100644
index 0000000..bbb5d9d
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/provisional/JSP21Namespace.java
@@ -0,0 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.core.internal.provisional;
+
+public interface JSP21Namespace extends org.eclipse.wst.html.core.internal.contentmodel.JSP21Namespace {
+}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/regions/DOMJSPRegionContexts.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/regions/DOMJSPRegionContexts.java
index 2e3c581..3387e1f 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/regions/DOMJSPRegionContexts.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/regions/DOMJSPRegionContexts.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     Frits Jalvingh - contributions for bug 150794
  *     
  *******************************************************************************/
 package org.eclipse.jst.jsp.core.internal.regions;
@@ -50,7 +51,13 @@
 	public static final String JSP_VBL_OPEN = "JSP_VBL_OPEN"; //$NON-NLS-1$
 	public static final String JSP_VBL_QUOTED_CONTENT = "JSP_VBL_QUOTED_CONTENT"; //$NON-NLS-1$
 	public static final String JSP_VBL_SQUOTE = "JSP_VBL_SQUOTE"; //$NON-NLS-1$
-	public static final String XML_TAG_ATTRIBUTE_VALUE_DQUOTE = "XML_TAG_ATTRIBUTE_VALUE_DQUOTE"; //$NON-NLS-1$
 
+	/** Non-taglib XML tag, needing single escape unquoting for embedded expressions */
+	public static final String XML_TAG_ATTRIBUTE_VALUE_DQUOTE = "XML_TAG_ATTRIBUTE_VALUE_DQUOTE"; //$NON-NLS-1$
 	public static final String XML_TAG_ATTRIBUTE_VALUE_SQUOTE = "XML_TAG_ATTRIBUTE_VALUE_SQUOTE"; //$NON-NLS-1$
+
+	/** Taglib tag attribute with double quote, needing 'double escaping' */
+	public static final String JSP_TAG_ATTRIBUTE_VALUE_DQUOTE = "JSP_TAG_ATTRIBUTE_VALUE_DQUOTE"; //$NON-NLS-1$
+	/** Taglib tag attribute with single quote, needing 'double escaping' */
+	public static final String JSP_TAG_ATTRIBUTE_VALUE_SQUOTE = "JSP_TAG_ATTRIBUTE_VALUE_SQUOTE"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/BuildPathClassLoader.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/BuildPathClassLoader.java
new file mode 100644
index 0000000..7b5443f
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/BuildPathClassLoader.java
@@ -0,0 +1,234 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.core.internal.taglib;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jst.jsp.core.internal.Logger;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+
+/**
+ * Custom ClassLoader backed by a Java Project.
+ */
+public class BuildPathClassLoader extends ClassLoader {
+	private static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/taglibclassloader")).booleanValue(); //$NON-NLS-1$
+	private IJavaProject fProject;
+
+	public BuildPathClassLoader(ClassLoader parent, IJavaProject project) {
+		super(parent);
+		fProject = project;
+	}
+
+	/**
+	 * Closes the given file with "extreme prejudice".
+	 * 
+	 * @param file the zip file to be closed
+	 */
+	public void closeJarFile(ZipFile file) {
+		if (file == null)
+			return;
+		try {
+			file.close();
+		}
+		catch (IOException ioe) {
+			// no cleanup can be done
+			Logger.logException("JarUtilities: Could not close file " + file.getName(), ioe); //$NON-NLS-1$
+		}
+	}
+
+	/*
+	 * This may pose a runtime performance problem as it opens the containing
+	 * .jar file for each class, but this is countered by no longer leaving
+	 * file handles open nor having to directly interact the build path at
+	 * all. If it is a problem, the TaglibHelper should control some
+	 * "batching" whereby we leave the JarFiles open until directed to close
+	 * them at the end of TaglibHelper.addTEIVariables(...).
+	 * 
+	 * @see java.lang.ClassLoader#findClass(java.lang.String)
+	 */
+	protected Class findClass(String className) throws ClassNotFoundException {
+		if (DEBUG)
+			System.out.println("finding: [" + className + "]"); //$NON-NLS-1$ //$NON-NLS-2$
+		try {
+			IType type = fProject.findType(className);
+			int offset = -1;
+			if (type == null && (offset = className.indexOf('$')) != -1) {
+				// Internal classes from source files must be referenced by . instead of $
+				String cls = className.substring(0, offset) + className.substring(offset).replace('$', '.');
+				type = fProject.findType(cls);
+			}
+			if (type != null) {
+				IPath path = null;
+				IResource resource = type.getResource();
+
+				if (resource != null)
+					path = resource.getLocation();
+				if (path == null)
+					path = type.getPath();
+
+				// needs to be compiled before we can load it
+				if ("class".equalsIgnoreCase(path.getFileExtension())) {
+					IFile file = null;
+
+					if (resource != null && resource.getType() == IResource.FILE)
+						file = (IFile) resource;
+					else
+						file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+
+					if (file != null && file.isAccessible()) {
+						byte[] bytes = loadBytes(file);
+						return defineClass(className, bytes, 0, bytes.length);
+					}
+				}
+				// Look up the class file based on the output location of the java project
+				else if ("java".equalsIgnoreCase(path.getFileExtension()) && resource != null) { //$NON-NLS-1$
+					if (resource.getProject() != null) {
+						IJavaProject jProject = JavaCore.create(resource.getProject());
+						String outputClass = StringUtils.replace(type.getFullyQualifiedName(), ".", "/").concat(".class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+						IPath classPath = jProject.getOutputLocation().append(outputClass);
+						IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(classPath);
+						if (file != null && file.isAccessible()) {
+							byte[] bytes = loadBytes(file);
+							return defineClass(className, bytes, 0, bytes.length);
+						}
+					}
+				}
+				else if ("jar".equalsIgnoreCase(path.getFileExtension())) {
+					String expectedFileName = StringUtils.replace(className, ".", "/").concat(".class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+					byte[] bytes = getCachedInputStream(path.toOSString(), expectedFileName);
+					return defineClass(className, bytes, 0, bytes.length);
+				}
+			}
+		}
+		catch (JavaModelException e) {
+			Logger.logException(e);
+		}
+		return super.findClass(className);
+	}
+
+	/**
+	 * Get the entry from the jarfile
+	 * @param jarFilename the string path of the jarfile
+	 * @param entryName the fully-qualified entry
+	 * @return the bytes for the entry within the jarfile or a byte array of size 0
+	 */
+	private byte[] getCachedInputStream(String jarFilename, String entryName) {
+		ByteArrayOutputStream buffer = null;
+
+		File testFile = new File(jarFilename);
+		if (!testFile.exists())
+			return null;
+
+		ZipFile jarfile = null;
+		try {
+			jarfile = new ZipFile(jarFilename);
+			
+			if (jarfile != null) {
+				ZipEntry zentry = jarfile.getEntry(entryName);
+				if (zentry != null) {
+					InputStream entryInputStream = null;
+					try {
+						entryInputStream = jarfile.getInputStream(zentry);
+					}
+					catch (IOException ioExc) {
+						Logger.logException("JarUtilities: " + jarFilename, ioExc); //$NON-NLS-1$
+					}
+
+					if (entryInputStream != null) {
+						int c;
+						if (zentry.getSize() > 0) {
+							buffer = new ByteArrayOutputStream((int) zentry.getSize());
+						}
+						else {
+							buffer = new ByteArrayOutputStream();
+						}
+						// array dim restriction?
+						byte bytes[] = new byte[2048];
+						try {
+							while ((c = entryInputStream.read(bytes)) >= 0) {
+								buffer.write(bytes, 0, c);
+							}
+						}
+						catch (IOException ioe) {
+							// no cleanup can be done
+						}
+						finally {
+							try {
+								entryInputStream.close();
+							}
+							catch (IOException e) {
+							}
+						}
+					}
+				}
+			}
+		}
+		catch (IOException ioExc) {
+			Logger.logException("JarUtilities: " + jarFilename, ioExc); //$NON-NLS-1$
+		}
+		finally {
+			closeJarFile(jarfile);
+		}
+
+		if (buffer != null) {
+			return buffer.toByteArray();
+		}
+		return new byte[0];
+	}
+
+	/**
+	 * @param file
+	 * @return
+	 */
+	private byte[] loadBytes(IFile file) {
+		ByteArrayOutputStream out = new ByteArrayOutputStream();
+		InputStream in = null;
+		try {
+			in = file.getContents();
+			byte[] buffer = new byte[4096];
+			int read = 0;
+			while ((read = in.read(buffer)) != -1) {
+				out.write(buffer, 0, read);
+			}
+		}
+		catch (CoreException e) {
+			Logger.logException(e);
+		}
+		catch (IOException e) {
+			Logger.logException(e);
+		}
+		finally {
+			try {
+				if (in != null)
+					in.close();
+			}
+			catch (IOException e) {
+			}
+		}
+		return out.toByteArray();
+	}
+
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/CustomTag.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/CustomTag.java
new file mode 100644
index 0000000..0186713
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/CustomTag.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.core.internal.taglib;
+
+/**
+ * Contains information about a custom tag including the tag name (with prefix),
+ * the class that defines the functionality of the tag, TEI class, any scripting variables associated with the
+ * TEI class, and if the class is an iteration tag
+ *
+ */
+public class CustomTag {
+
+	private final String fTagName;
+	private final String fClassName;
+	private final String fTeiClassName;
+	private final boolean fIsIterationTag;
+	private final TaglibVariable[] fVariables;
+
+	public CustomTag(String tagName, String className, String teiClassName, TaglibVariable[] tagVariables, boolean isIterationTag) {
+		fTagName = tagName;
+		fClassName = className;
+		fTeiClassName = teiClassName;
+		fVariables = tagVariables;
+		fIsIterationTag = isIterationTag;
+	}
+
+	/**
+	 * Returns the name of the tag with its prefix
+	 * @return the tag name including prefix
+	 */
+	public String getTagName() {
+		return fTagName;
+	}
+
+	/**
+	 * Returns the name of the implementation class for the tag
+	 * @return the name of the implementation class for the tag
+	 */
+	public String getTagClassName() {
+		return fClassName;
+	}
+
+	/**
+	 * Returns the name of the TagExtraInfo class for the tag
+	 * @return the name of the TagExtraInfo class for the tag
+	 */
+	public String getTeiClassName() {
+		return fTeiClassName;
+	}
+
+	/**
+	 * Returns an array of scripting variables associated with the TagExtraInfo class
+	 * @return an array of scripting variables associated with the TagExtraInfo class
+	 */
+	public TaglibVariable[] getTagVariables() {
+		return fVariables;
+	}
+
+	/**
+	 * Identifies if the tag implements the IterationTag interface
+	 * @return true if the tag implements the IterationTag interface; false otherwise
+	 */
+	public boolean isIterationTag() {
+		return fIsIterationTag;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibClassLoader.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibClassLoader.java
index b8706cd..0dc3948 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibClassLoader.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibClassLoader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,363 +11,81 @@
 package org.eclipse.jst.jsp.core.internal.taglib;
 
 
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
 
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jst.jsp.core.internal.Logger;
 
-
-
 /**
  * Custom classloader which allows you to add source directories (folders
  * containing .class files) and jars to the classpath.
- * 
- * @author pavery
  */
-public class TaglibClassLoader extends ClassLoader {
-
+public class TaglibClassLoader extends URLClassLoader {
 	// for debugging
-	private static final boolean DEBUG;
-	static {
-		String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/taglibclassloader"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-	}
+	private static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/taglibclassloader")).booleanValue(); //$NON-NLS-1$
 
-	private List jarsList = new ArrayList();
-	private List dirsList = new ArrayList();
-	private List usedJars = new ArrayList();
-	private List usedDirs = new ArrayList();
-
-	private Map failedClasses = new HashMap(); // CL: added to optimize
-													// failed loading
-
-	// private List loadedClassFilenames = new ArrayList();
+	private static final String FILE = "file:/";
+	private static final String RESOURCE = "platform:/resource/";
 
 	public TaglibClassLoader(ClassLoader parentLoader) {
-		super(parentLoader);
-	}
-
-	/**
-	 * Adds a new jar to classpath.
-	 * 
-	 * @param filename -
-	 *            full path to the jar file
-	 */
-	public void addJar(String filename) {
-		if (DEBUG)
-			System.out.println("trying to add: [" + filename + "] to classpath"); //$NON-NLS-1$ //$NON-NLS-2$
-		// don't add the same entry twice, or search times will get even worse
-		if (!jarsList.contains(filename)) {
-			jarsList.add(filename);
-			failedClasses = new HashMap();
-			if (DEBUG)
-				System.out.println(" + [" + filename + "] added to classpath"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-
-	/**
-	 * Removes a jar from the classpath.
-	 * 
-	 * @param filename -
-	 *            full path to the jar file
-	 */
-	public void removeJar(String filename) {
-		jarsList.remove(filename);
-		failedClasses = new HashMap();
-		if (DEBUG)
-			System.out.println("removed: [" + filename + "] from classpath"); //$NON-NLS-1$ //$NON-NLS-2$
+		super(new URL[0], parentLoader);
 	}
 
 	public void addDirectory(String dirPath) {
-		if (!dirsList.contains(dirPath)) {
-			dirsList.add(dirPath);
-			failedClasses = new HashMap();
-			if (DEBUG)
-				System.out.println("added: [" + dirPath + "] to classpath"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
+		addJavaFile(dirPath + "/"); //$NON-NLS-1$
 	}
 
-	/**
-	 * Removes a directory from the classpath.
-	 * 
-	 * @param dirPath -
-	 *            full path of the directory
-	 */
-	public void removeDirectory(String dirPath) {
-		dirsList.remove(dirPath);
-		failedClasses = new HashMap();
-		if (DEBUG)
-			System.out.println("removed: [" + dirPath + "] from classpath"); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	/**
-	 * Returns the list of JARs on this loader's classpath that contain
-	 * classes that have been loaded.
-	 * 
-	 * @return List - the list of JARs
-	 */
-	public List getJarsInUse() {
-		return usedJars;
-	}
-
-	/**
-	 * Returns a list of directories on this loader's classpath that contain
-	 * classes that have been loaded.
-	 * 
-	 * @return List - the list of directories (fully-qualified filename
-	 *         Strings)
-	 */
-	public List getDirectoriesInUse() {
-		return usedDirs;
-	}
-	
-	Map getFailures() {
-		return failedClasses;
-	}
-
-	/**
-	 * Returns a list of filenames for loose classes that have been loaded out
-	 * of directories.
-	 * 
-	 * @return List - the list of class filenames
-	 */
-	// public List getClassFilenamesFromDirectories() {
-	// return loadedClassFilenames;
-	// }
-	/**
-	 * Searches for the given class name on the defined classpath -
-	 * directories are checked before JARs.
-	 * 
-	 * @param className -
-	 *            the name of the class to find
-	 * @return Class - the loaded class
-	 * @throws ClassNotFoundException
-	 */
-	protected synchronized Class findClass(String className) throws ClassNotFoundException {
-		Class oldClass = findLoadedClass(className);
-		if (oldClass != null) {
-			if (DEBUG)
-				System.out.println(">> TaglibClassLoader " + this + " returning existing class: " + className); //$NON-NLS-1$ //$NON-NLS-2$
-			return oldClass;
-		}
-		if (failedClasses.containsKey(className)) {
-			if (DEBUG)
-				System.out.println(">> TaglibClassLoader " + this + " known missing class: " + className); //$NON-NLS-1$ //$NON-NLS-2$
-			throw new ClassNotFoundException();
-		}
-
-		if (DEBUG)
-			System.out.println(">> TaglibClassLoader " + this + " finding class: " + className); //$NON-NLS-1$ //$NON-NLS-2$
-
-		Class newClass = null;
-		JarFile jarfile = null;
-		JarEntry entry = null;
-
-		// get the correct name of the actual .class file to search for
-		String fileName = calculateClassFilename(className);
-		InputStream stream = null;
+	public void addFile(IPath filePath) {
 		try {
-			// first try searching the classpath directories
-			Iterator dirs = dirsList.iterator();
-			File f;
-			String dirName;
-			String fileToFind = ""; //$NON-NLS-1$
-			while (dirs.hasNext()) {
-				dirName = (String) dirs.next();
-				fileToFind = dirName + "/" + fileName; //$NON-NLS-1$
-
-				f = new File(fileToFind);
-				if (f.exists()) {
-					stream = new FileInputStream(f);
-					usedDirs.add(dirName);
-					// loadedClassFilenames.add(fileToFind);
-					if (DEBUG)
-						System.out.println(">> added file from dir: " + dirName + "/" + fileName); //$NON-NLS-1$ //$NON-NLS-2$
-					break;
-
-				}
-			}
-
-			if (stream != null) {
-				// found a class from a directory
-				ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
-				byte[] buffer = new byte[2048];
-				while (stream.available() > 0) {
-					int amountRead = stream.read(buffer);
-					if(amountRead > 0) {
-						byteStream.write(buffer, 0, amountRead);
-					}
-				}
-
-				byte[] byteArray = byteStream.toByteArray();
-				try {
-					if (DEBUG)
-						System.out.println(">> defining newClass:" + className); //$NON-NLS-1$
-					newClass = defineClass(className, byteArray, 0, byteArray.length);
-					resolveClass(newClass);
-				}
-				catch (Throwable t) {
-					Logger.logException("Error loading TEI class " + className, t);
-
-					// j9 can give ClassCircularityError
-					// parent should already have the class then
-					// try parent loader
-					try {
-						Class c = getParent().loadClass(className);
-						if (DEBUG)
-							System.out.println(">> loaded: " + className + " with: " + getParent()); //$NON-NLS-1$ //$NON-NLS-2$
-						return c;
-					}
-					catch (ClassNotFoundException cnf) {
-						if (DEBUG)
-							cnf.printStackTrace();
-					}
-				}
-				stream.close();
-			}
-
-			if (stream == null) {
-				// still haven't found the class, so now try searching the
-				// jars
-				// search each of the jars until we find an entry matching the
-				// classname
-				Iterator jars = jarsList.iterator();
-				String jarName;
-				while (jars.hasNext()) {
-					jarName = (String) jars.next();
-
-					// make sure the file exists or "new JarFile()" will throw
-					// an exception
-					f = new File(jarName);
-					if (!f.exists()) {
-						continue;
-					}
-					try {
-						jarfile = new JarFile(jarName);
-					}
-					catch (IOException e) {
-						if (DEBUG)
-							Logger.logException("bad jar file", e); //$NON-NLS-1$
-					}
-					if (jarfile == null) {
-						continue;
-					}
-
-					entry = jarfile.getJarEntry(fileName);
-
-					if (DEBUG)
-						System.out.println("looking for filename: " + fileName + " in: " + jarfile.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-					if (entry != null) {
-						if (DEBUG)
-							System.out.println("found the entry: " + entry + " for filename: " + fileName); //$NON-NLS-1$ //$NON-NLS-2$
-						// found the class
-						if (!usedJars.contains(jarName)) {
-							// add the jar to the list of in-use jars
-							usedJars.add(jarName);
-						}
-						break;
-					}
-					jarfile.close();
-				}
-
-				if (entry != null) {
-					// we've found an entry for the desired class
-					stream = jarfile.getInputStream(entry);
-					ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
-					long byteLength = entry.getSize();
-					long totalBytesRead = 0;
-					int bytesRead;
-					byte[] byteBuffer = new byte[10000];
-					while (totalBytesRead < byteLength) {
-						bytesRead = stream.read(byteBuffer);
-						if (bytesRead == -1) {
-							break;
-						}
-						totalBytesRead = totalBytesRead + bytesRead;
-						byteStream.write(byteBuffer, 0, bytesRead);
-					}
-
-					byte[] byteArray = byteStream.toByteArray();
-					try {
-						if (DEBUG)
-							System.out.println(">> defining newClass:" + className); //$NON-NLS-1$
-						// define the class from the byte array
-						newClass = defineClass(className, byteArray, 0, byteArray.length);
-						resolveClass(newClass);
-					}
-					catch (Throwable t) {
-						Logger.logException("Error loading TEI class " + className, t);
-						// j9 can give ClassCircularityError
-						// parent should already have the class then
-
-						// try parent
-						try {
-							Class c = getParent().loadClass(className);
-							if (DEBUG)
-								System.out.println(">> loaded: " + className + " with: " + getParent()); //$NON-NLS-1$ //$NON-NLS-2$
-							return c;
-						}
-						catch (ClassNotFoundException cnf) {
-							if (DEBUG)
-								cnf.printStackTrace();
-							failedClasses.put(className, cnf);
-						}
-					}
-					stream.close();
-					jarfile.close();
-				}
-			}
-		}
-		catch (Throwable t) {
-			failedClasses.put(className, t);
-			return null;
-		}
-		finally {
-			try {
-				if (stream != null) {
-					stream.close();
-				}
-				if (jarfile != null) {
-					jarfile.close();
-				}
-			}
-			catch (IOException ioe) {
-				// ioe.printStackTrace();
-				// just trying to close down anyway - ignore
-			}
-		}
-
-		if (newClass != null) {
+			URL url = new URL(RESOURCE + filePath.toString()); //$NON-NLS-1$
+			super.addURL(url);
 			if (DEBUG)
-				System.out.println(">> loaded: " + newClass + " with: " + this); //$NON-NLS-1$ //$NON-NLS-2$
-			return newClass;
+				System.out.println("added: [" + url + "] to classpath"); //$NON-NLS-1$ //$NON-NLS-2$
 		}
-
-//		failedClasses.add(className);
-		throw new ClassNotFoundException();
+		catch (MalformedURLException e) {
+			Logger.logException(filePath.toString(), e);
+		}
 	}
 
-	/**
-	 * Replaces '.' in the classname with '/' and appends '.class' if needed.
-	 * 
-	 * @return String - the properly-formed class name
-	 */
-	private String calculateClassFilename(String name) {
-		StringBuffer buffer = new StringBuffer(name.replace('.', '/'));
-		if (!name.endsWith(".class")) { //$NON-NLS-1$
-			buffer.append(".class"); //$NON-NLS-1$
+	public void addFolder(IPath folderPath) {
+		try {
+			URL url = new URL(RESOURCE + folderPath.toString() + "/"); //$NON-NLS-1$
+			super.addURL(url);
+			if (DEBUG)
+				System.out.println("added: [" + url + "] to classpath"); //$NON-NLS-1$ //$NON-NLS-2$
 		}
-		return buffer.toString();
+		catch (MalformedURLException e) {
+			Logger.logException(folderPath.toString(), e);
+		}
+	}
+
+	public void addJar(String filename) {
+		addJavaFile(filename);
+	}
+
+	void addJavaFile(String filename) {
+		try {
+			URL url = new URL(FILE + filename);
+			super.addURL(url);
+			if (DEBUG)
+				System.out.println("added: [" + url + "] to classpath"); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+		catch (MalformedURLException e) {
+			Logger.logException(filename, e);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see java.net.URLClassLoader#findClass(java.lang.String)
+	 */
+	protected Class findClass(String className) throws ClassNotFoundException {
+		if (DEBUG)
+			System.out.println("finding: [" + className + "]"); //$NON-NLS-1$ //$NON-NLS-2$
+		return super.findClass(className);
 	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelper.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelper.java
index fe85bf7..8fa95d7 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelper.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,9 +11,8 @@
 package org.eclipse.jst.jsp.core.internal.taglib;
 
 
-import java.io.File;
 import java.util.ArrayList;
-import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
@@ -30,20 +29,14 @@
 import javax.servlet.jsp.tagext.ValidationMessage;
 import javax.servlet.jsp.tagext.VariableInfo;
 
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.IType;
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.Signature;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
 import org.eclipse.jst.jsp.core.internal.Logger;
@@ -60,6 +53,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.internal.util.AbstractMemoryListener;
 import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
@@ -68,16 +62,18 @@
 import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
 import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.osgi.service.event.Event;
 
 import com.ibm.icu.text.MessageFormat;
 
 /**
  * This class helps find TaglibVariables in a JSP file.
- * 
- * @author pavery
  */
 public class TaglibHelper {
 
+	private static final String ITERATION_QUALIFIER = "javax.servlet.jsp.tagext"; //$NON-NLS-1$
+	private static final String ITERATION_NAME = "IterationTag"; //$NON-NLS-1$
+	
 	// for debugging
 	private static final boolean DEBUG;
 	static {
@@ -86,21 +82,211 @@
 	}
 
 	private IProject fProject = null;
-	private TaglibClassLoader fLoader = null;
+	private ClassLoader fLoader = null;
 
-	private Set fProjectEntries = null;
-	private Map fTranslationProblems = null;
-	private Set fContainerEntries = null;
 	private IJavaProject fJavaProject;
+	
+	/**
+	 * A cache of class names that the class loader could not find.
+	 * Because the TaglibHelper is destroyed and recreated whenever
+	 * the classpath changes this cache will not become stale
+	 */
+	private Set fNotFoundClasses = null;
+
+	private Map fClassMap = null;
+
+	/**
+	 * Used to keep the {@link #fNotFoundClasses} cache clean when memory is low
+	 */
+	private MemoryListener fMemoryListener;
 
 	public TaglibHelper(IProject project) {
+		super();
 		setProject(project);
-		fProjectEntries = new HashSet();
-		fContainerEntries = new HashSet();
-		fTranslationProblems = new HashMap();
+		fMemoryListener = new MemoryListener();
+		fMemoryListener.connect();
+		fNotFoundClasses = new HashSet();
+		fClassMap = Collections.synchronizedMap(new HashMap());
 	}
 
 	/**
+	 * Checks that <code>type</code> implements an IterationTag
+	 * 
+	 * @param type
+	 * @return true if <code>type</code> implements IterationTag
+	 * @throws JavaModelException
+	 * @throws ClassNotFoundException thrown when the <code>type</code> is null
+	 */
+	private boolean isIterationTag(IType type) throws JavaModelException, ClassNotFoundException {
+		if (type == null) {
+			throw new ClassNotFoundException();
+		}
+		synchronized (fClassMap) {
+			if (fClassMap.containsKey(type.getFullyQualifiedName()))
+				return ((Boolean) fClassMap.get(type.getFullyQualifiedName())).booleanValue();
+		}
+
+		String signature;
+		String qualifier;
+		String name;
+		String[] interfaces = type.getSuperInterfaceTypeSignatures();
+		boolean isIteration = false;
+		// Check any super interfaces for the iteration tag
+		for (int i = 0; i < interfaces.length; i++) {
+			// For source files, the interface may need to be resolved
+			String erasureSig = Signature.getTypeErasure(interfaces[i]);
+			qualifier = Signature.getSignatureQualifier(erasureSig);
+			name = Signature.getSignatureSimpleName(erasureSig);
+			// Interface type is unresolved
+			if (erasureSig.charAt(0) == Signature.C_UNRESOLVED) {
+				String[][] types = type.resolveType(getQualifiedType(qualifier, name));
+				// Type was resolved
+				if (types != null && types.length > 0) {
+					isIteration = handleInterface(type, types[0][0], types[0][1]);
+				}
+			}
+			else {
+				isIteration = handleInterface(type, qualifier, name);
+			}
+			if (isIteration)
+				return true;
+		}
+
+		signature = type.getSuperclassTypeSignature();
+		if (signature != null) {
+			String erasureSig = Signature.getTypeErasure(signature);
+			qualifier = Signature.getSignatureQualifier(erasureSig);
+			name = Signature.getSignatureSimpleName(erasureSig);
+			// superclass was unresolved
+			if (erasureSig.charAt(0) == Signature.C_UNRESOLVED) {
+				String[][] types = type.resolveType(getQualifiedType(qualifier, name));
+				// Type was resolved
+				if (types != null && types.length > 0) {
+					isIteration = isIterationTag(fJavaProject.findType(types[0][0], types[0][1]));
+				}
+			}
+			else {
+				isIteration = isIterationTag(fJavaProject.findType(qualifier, name));
+			}
+		}
+		fClassMap.put(type.getFullyQualifiedName(), Boolean.valueOf(isIteration));
+		return isIteration;
+	}
+
+	private boolean handleInterface(IType type, String qualifier, String name) throws JavaModelException, ClassNotFoundException {
+		boolean isIteration = false;
+		// Qualified interface is an iteration tag
+		if (ITERATION_QUALIFIER.equals(qualifier) && ITERATION_NAME.equals(name))
+			isIteration = true;
+		// Check ancestors of this interface
+		else
+			isIteration = isIterationTag(fJavaProject.findType(qualifier, name));
+
+		fClassMap.put(type.getFullyQualifiedName(), Boolean.valueOf(isIteration));
+		return isIteration;
+	}
+
+	private String getQualifiedType(String qualifier, String name) {
+		StringBuffer qual = new StringBuffer(qualifier);
+		if (qual.length() > 0)
+			qual.append('.');
+		qual.append(name);
+		return qual.toString();
+	}
+
+	private boolean isIterationTag(TLDElementDeclaration elementDecl, IStructuredDocument document, ITextRegionCollection customTag, List problems) {
+		String className = elementDecl.getTagclass();
+		if (className == null || className.length() == 0 || fProject == null || fNotFoundClasses.contains(className))
+			return false;
+
+		try {
+			synchronized (fClassMap) {
+				if (fClassMap.containsKey(className))
+					return ((Boolean) fClassMap.get(className)).booleanValue();
+			}
+			return isIterationTag(fJavaProject.findType(className));
+		} catch (ClassNotFoundException e) {
+			//the class could not be found so add it to the cache
+			fNotFoundClasses.add(className);
+
+			Object createdProblem = createJSPProblem(document, customTag, IJSPProblem.TagClassNotFound, JSPCoreMessages.TaglibHelper_3, className, true);
+			if (createdProblem != null)
+				problems.add(createdProblem);
+			if (DEBUG)
+				Logger.logException(className, e);
+		} catch (JavaModelException e) {
+			if (DEBUG)
+				Logger.logException(className, e);
+		} catch (Exception e) {
+			// this is 3rd party code, need to catch all errors
+			if (DEBUG)
+				Logger.logException(className, e);
+		} catch (Error e) {
+			// this is 3rd party code, need to catch all errors
+			if (DEBUG)
+				Logger.logException(className, e);
+		}
+
+		return false;
+	}
+
+	public CustomTag getCustomTag(String tagToAdd, IStructuredDocument structuredDoc, ITextRegionCollection customTag, List problems) {
+		List results = new ArrayList();
+		boolean isIterationTag = false;
+		String tagClass = null;
+		String teiClass = null;
+		if (problems == null)
+			problems = new ArrayList();
+		ModelQuery mq = getModelQuery(structuredDoc);
+		if (mq != null) {
+			TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(structuredDoc);
+
+			if (mgr != null) {
+
+				List trackers = mgr.getCMDocumentTrackers(-1);
+				Iterator taglibs = trackers.iterator();
+	
+				CMDocument doc = null;
+				CMNamedNodeMap elements = null;
+				while (taglibs.hasNext()) {
+					doc = (CMDocument) taglibs.next();
+					CMNode node = null;
+					if ((elements = doc.getElements()) != null && (node = elements.getNamedItem(tagToAdd)) != null && node.getNodeType() == CMNode.ELEMENT_DECLARATION) {
+	
+						if (node instanceof CMNodeWrapper) {
+							node = ((CMNodeWrapper) node).getOriginNode();
+						}
+						TLDElementDeclaration tldElementDecl = (TLDElementDeclaration) node;
+
+						tagClass = tldElementDecl.getTagclass();
+						teiClass = tldElementDecl.getTeiclass();
+						isIterationTag = isIterationTag(tldElementDecl, structuredDoc, customTag, problems);
+						/*
+						 * Although clearly not the right place to add validation
+						 * design-wise, this is the first time we have the
+						 * necessary information to validate the tag class.
+						 */
+						validateTagClass(structuredDoc, customTag, tldElementDecl, problems);
+	
+						// 1.2+ taglib style
+						addVariables(results, node, customTag);
+	
+						// for 1.1 need more info from taglib tracker
+						if (doc instanceof TaglibTracker) {
+							String uri = ((TaglibTracker) doc).getURI();
+							String prefix = ((TaglibTracker) doc).getPrefix();
+							// only for 1.1 taglibs
+							addTEIVariables(structuredDoc, customTag, results, tldElementDecl, prefix, uri, problems);
+						}
+						break;
+					}
+				}
+			}
+		}
+
+		return new CustomTag(tagToAdd, tagClass, teiClass, (TaglibVariable[]) results.toArray(new TaglibVariable[results.size()]), isIterationTag);
+	}
+	/**
 	 * @param tagToAdd
 	 *            is the name of the tag whose variables we want
 	 * @param structuredDoc
@@ -108,11 +294,13 @@
 	 * @param customTag
 	 *            is the IStructuredDocumentRegion opening tag for the custom
 	 *            tag
+	 * @param problems problems that are generated while creating variables are added to this collection
 	 */
-	public TaglibVariable[] getTaglibVariables(String tagToAdd, IStructuredDocument structuredDoc, ITextRegionCollection customTag) {
+	public TaglibVariable[] getTaglibVariables(String tagToAdd, IStructuredDocument structuredDoc, ITextRegionCollection customTag, List problems) {
 
 		List results = new ArrayList();
-		List problems = new ArrayList();
+		if (problems == null)
+			problems = new ArrayList();
 		ModelQuery mq = getModelQuery(structuredDoc);
 		if (mq != null) {
 			TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(structuredDoc);
@@ -165,11 +353,6 @@
 			}
 		}
 
-		IPath location = TaglibController.getLocation(structuredDoc);
-		if (location != null) {
-			fTranslationProblems.put(location, problems);
-		}
-
 		return (TaglibVariable[]) results.toArray(new TaglibVariable[results.size()]);
 	}
 
@@ -181,7 +364,6 @@
 	 * @param node
 	 */
 	private void addVariables(List results, CMNode node, ITextRegionCollection customTag) {
-
 		List list = ((TLDElementDeclaration) node).getVariables();
 		Iterator it = list.iterator();
 		while (it.hasNext()) {
@@ -214,7 +396,7 @@
 			}
 			if (varName != null) {
 				String varClass = "java.lang.String"; // the default
-														// class...//$NON-NLS-1$
+				// class...//$NON-NLS-1$
 				if (var.getVariableClass() != null) {
 					varClass = var.getVariableClass();
 				}
@@ -240,10 +422,10 @@
 	 */
 	private void addTEIVariables(IStructuredDocument document, ITextRegionCollection customTag, List results, TLDElementDeclaration decl, String prefix, String uri, List problems) {
 		String teiClassname = decl.getTeiclass();
-		if (teiClassname == null || teiClassname.length() == 0 || fJavaProject == null)
+		if (teiClassname == null || teiClassname.length() == 0 || fJavaProject == null || fNotFoundClasses.contains(teiClassname))
 			return;
 
-		TaglibClassLoader loader = getClassloader();
+		ClassLoader loader = getClassloader();
 
 		Class teiClass = null;
 		try {
@@ -295,6 +477,9 @@
 			}
 		}
 		catch (ClassNotFoundException e) {
+			//the class could not be found so add it to the cache
+			fNotFoundClasses.add(teiClassname);
+
 			Object createdProblem = createJSPProblem(document, customTag, IJSPProblem.TEIClassNotFound, JSPCoreMessages.TaglibHelper_0, teiClassname, true);
 			if (createdProblem != null) {
 				problems.add(createdProblem);
@@ -332,6 +517,10 @@
 		}
 		catch (Error e) {
 			// this is 3rd party code, need to catch all errors
+			Object createdProblem = createJSPProblem(document, customTag, IJSPProblem.TEIClassNotInstantiated, JSPCoreMessages.TaglibHelper_1, teiClassname, true);
+			if (createdProblem != null) {
+				problems.add(createdProblem);
+			}
 			if (DEBUG)
 				logException(teiClassname, e);
 		}
@@ -450,7 +639,7 @@
 
 		final int end;
 		if (customTag.getNumberOfRegions() > 3) {
-			end = customTag.getTextEndOffset(customTag.getRegions().get(customTag.getNumberOfRegions() - 2));
+			end = customTag.getTextEndOffset(customTag.getRegions().get(customTag.getNumberOfRegions() - 2)) - 1;
 		}
 		else if (customTag.getNumberOfRegions() > 1) {
 			end = customTag.getTextEndOffset(customTag.getRegions().get(1)) - 1;
@@ -610,220 +799,14 @@
 		return tagDataTable;
 	}
 
-	private TaglibClassLoader getClassloader() {
+	private ClassLoader getClassloader() {
 		if (fLoader == null) {
-			fLoader = new TaglibClassLoader(this.getClass().getClassLoader());
-			fProjectEntries.clear();
-			fContainerEntries.clear();
-			addClasspathEntriesForProject(getProject(), fLoader);
+			fLoader = new BuildPathClassLoader(this.getClass().getClassLoader(), fJavaProject);
 		}
 		return fLoader;
 	}
 
 	/**
-	 * @param loader
-	 */
-	private void addClasspathEntriesForProject(IProject p, TaglibClassLoader loader) {
-
-		// avoid infinite recursion and closed project
-		if (!p.isAccessible() || fProjectEntries.contains(p.getFullPath().toString()))
-			return;
-		fProjectEntries.add(p.getFullPath().toString());
-
-		// add things on classpath that we are interested in
-		try {
-			if (p.hasNature(JavaCore.NATURE_ID)) {
-
-				IJavaProject project = JavaCore.create(p);
-
-				try {
-					IClasspathEntry[] entries = project.getRawClasspath();
-					addDefaultDirEntry(loader, project);
-					addClasspathEntries(loader, project, entries);
-				}
-				catch (JavaModelException e) {
-					Logger.logException(e);
-				}
-			}
-		}
-		catch (CoreException e) {
-			Logger.logException(e);
-		}
-	}
-
-	private void addClasspathEntries(TaglibClassLoader loader, IJavaProject project, IClasspathEntry[] entries) throws JavaModelException {
-		IClasspathEntry entry;
-		for (int i = 0; i < entries.length; i++) {
-
-			entry = entries[i];
-			if (DEBUG)
-				System.out.println("current entry is: " + entry); //$NON-NLS-1$
-
-			switch (entry.getEntryKind()) {
-				case IClasspathEntry.CPE_SOURCE :
-					addSourceEntry(loader, entry);
-					break;
-				case IClasspathEntry.CPE_LIBRARY :
-					addLibraryEntry(loader, entry.getPath());
-					break;
-				case IClasspathEntry.CPE_PROJECT :
-					addProjectEntry(loader, entry);
-					break;
-				case IClasspathEntry.CPE_VARIABLE :
-					addVariableEntry(loader, entry);
-					break;
-				case IClasspathEntry.CPE_CONTAINER :
-					addContainerEntry(loader, project, entry);
-					break;
-			}
-		}
-	}
-
-	/**
-	 * @param loader
-	 * @param entry
-	 */
-	private void addVariableEntry(TaglibClassLoader loader, IClasspathEntry entry) {
-		if (DEBUG)
-			System.out.println(" -> adding variable entry: [" + entry + "]"); //$NON-NLS-1$ //$NON-NLS-2$
-
-		// variable should either be a project or a library entry
-
-		// BUG 169431
-		String variableName = entry.getPath().toString();
-		IPath variablePath = JavaCore.getResolvedVariablePath(entry.getPath());
-		variablePath = JavaCore.getClasspathVariable(variableName);
-
-		// RATLC01076854
-		// variable paths may not exist
-		// in that case null will be returned
-		if (variablePath != null) {
-			if (variablePath.segments().length == 1) {
-				IProject varProj = ResourcesPlugin.getWorkspace().getRoot().getProject(variablePath.toString());
-				if (varProj != null && varProj.exists()) {
-					addClasspathEntriesForProject(varProj, loader);
-					return;
-				}
-			}
-			addLibraryEntry(loader, variablePath);
-		}
-	}
-
-	/**
-	 * @param loader
-	 * @param project
-	 * @param entry
-	 * @throws JavaModelException
-	 */
-	private void addContainerEntry(TaglibClassLoader loader, IJavaProject project, IClasspathEntry entry) throws JavaModelException {
-
-		IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), project);
-		if (container != null) {
-			// avoid infinite recursion
-			if (!fContainerEntries.contains(container.getPath().toString())) {
-				fContainerEntries.add(container.getPath().toString());
-
-				IClasspathEntry[] cpes = container.getClasspathEntries();
-				// recursive call here
-				addClasspathEntries(loader, project, cpes);
-			}
-		}
-	}
-
-	/**
-	 * @param loader
-	 * @param entry
-	 */
-	private void addProjectEntry(TaglibClassLoader loader, IClasspathEntry entry) {
-
-		if (DEBUG)
-			System.out.println(" -> project entry: [" + entry + "]"); //$NON-NLS-1$ //$NON-NLS-2$
-
-		IPath path = entry.getPath();
-		IProject referenceProject = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));
-		if (referenceProject != null && referenceProject.isAccessible()) {
-			addClasspathEntriesForProject(referenceProject, loader);
-		}
-	}
-
-	/**
-	 * @param loader
-	 * @param project
-	 * @param projectLocation
-	 * @throws JavaModelException
-	 */
-	private void addDefaultDirEntry(TaglibClassLoader loader, IJavaProject project) throws JavaModelException {
-		// add default bin directory for the project
-		IPath outputPath = project.getOutputLocation();
-		String outputLocation = null;
-		if (!outputPath.toFile().exists()) {
-			if (outputPath.segmentCount() > 1) {
-				IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(outputPath);
-				if (folder.getLocation() != null) {
-					outputLocation = folder.getLocation().toString();
-				}
-			}
-			else {
-				IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(outputPath.segment(0));
-				if (iproject.getLocation() != null) {
-					outputLocation = iproject.getLocation().toString();
-				}
-			}
-		}
-		else {
-			outputLocation = outputPath.toString();
-		}
-		loader.addDirectory(outputLocation);
-	}
-
-	/**
-	 * @param loader
-	 * @param entry
-	 */
-	private void addLibraryEntry(TaglibClassLoader loader, IPath libPath) {
-		String jarPathString = libPath.toString();
-		File file = new File(libPath.toOSString());
-
-		// if not absolute path, it's workspace relative
-		if (!file.exists() && libPath.segmentCount() > 1) {
-			IFile jarFile = ResourcesPlugin.getWorkspace().getRoot().getFile(libPath);
-			if (jarFile.isAccessible() && jarFile.getLocation() != null) {
-				jarPathString = jarFile.getLocation().toString();
-			}
-		}
-
-		if (jarPathString != null) {
-			if (jarPathString.endsWith(".jar")) { //$NON-NLS-1$ 
-				loader.addJar(jarPathString);
-			}
-			else if (file.isDirectory()) {
-				/*
-				 * unlikely, the UI prevents adding folder variables to the
-				 * classpath - it's actually a folder containing binaries
-				 */
-				loader.addDirectory(jarPathString);
-			}
-		}
-	}
-
-	/**
-	 * @param loader
-	 * @param entry
-	 */
-	private void addSourceEntry(TaglibClassLoader loader, IClasspathEntry entry) {
-		// add bin directory for specific entry if it has
-		// one
-		IPath outputLocation = entry.getOutputLocation();
-		if (outputLocation != null && outputLocation.segmentCount() > 1) {
-			IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(outputLocation);
-			if (folder != null && folder.isAccessible()) {
-				outputLocation = folder.getLocation();
-				loader.addDirectory(outputLocation.toString());
-			}
-		}
-	}
-
-	/**
 	 * @return Returns the fModelQuery.
 	 */
 	public ModelQuery getModelQuery(IDocument doc) {
@@ -861,25 +844,17 @@
 		}
 	}
 
-	/**
-	 * @param path
-	 * @return
-	 */
-	public Collection getProblems(IPath path) {
-		return (Collection) fTranslationProblems.remove(path);
-	}
-
 	private void validateTagClass(IStructuredDocument document, ITextRegionCollection customTag, TLDElementDeclaration decl, List problems) {
 		// skip if from a tag file
-		if (TLDElementDeclaration.SOURCE_TAG_FILE.equals(decl.getProperty(TLDElementDeclaration.TAG_SOURCE))) {
+		if (TLDElementDeclaration.SOURCE_TAG_FILE.equals(decl.getProperty(TLDElementDeclaration.TAG_SOURCE)) || fJavaProject == null) {
 			return;
 		}
 
 		String tagClassname = decl.getTagclass();
-		IType tagClass = null;
-		if (tagClassname != null && tagClassname.length() > 0 && fJavaProject != null) {
+		Object tagClass = null;
+		if (tagClassname != null && tagClassname.length() > 0 && fJavaProject.exists()) {
 			try {
-				tagClass = fJavaProject.findType(tagClassname, new NullProgressMonitor());
+				tagClass = fJavaProject.findType(tagClassname);
 			}
 			catch (JavaModelException e) {
 				Logger.logException(e);
@@ -892,4 +867,63 @@
 			}
 		}
 	}
+
+	/**
+	 * 
+	 */
+	public void dispose() {
+		fLoader = null;
+		fJavaProject = null;
+		fProject = null;
+		fNotFoundClasses = null;
+		fClassMap = null;
+		fMemoryListener.disconnect();
+		fMemoryListener = null;
+	}
+
+	public void invalidateClass(String className) {
+		fClassMap.remove(className);
+	}
+
+	/**
+	 * <p>A {@link AbstractMemoryListener} that clears the {@link #fNotFoundClasses} cache
+	 * whenever specific memory events are received.</p>
+	 * 
+	 * <p>Events:
+	 * <ul>
+	 * <li>{@link AbstractMemoryListener#SEV_NORMAL}</li>
+	 * <li>{@link AbstractMemoryListener#SEV_SERIOUS}</li>
+	 * <li>{@link AbstractMemoryListener#SEV_CRITICAL}</li>
+	 * </ul>
+	 * </p>
+	 */
+	private class MemoryListener extends AbstractMemoryListener {
+		/**
+		 * <p>Constructor causes this listener to listen for specific memory events.</p>
+		 * <p>Events:
+		 * <ul>
+		 * <li>{@link AbstractMemoryListener#SEV_NORMAL}</li>
+		 * <li>{@link AbstractMemoryListener#SEV_SERIOUS}</li>
+		 * <li>{@link AbstractMemoryListener#SEV_CRITICAL}</li>
+		 * </ul>
+		 * </p>
+		 */
+		MemoryListener() {
+			super(new String[] { SEV_NORMAL, SEV_SERIOUS, SEV_CRITICAL });
+		}
+
+		/**
+		 * On any memory event we handle clear out the project descriptions
+		 * 
+		 * @see org.eclipse.jst.jsp.core.internal.util.AbstractMemoryListener#handleMemoryEvent(org.osgi.service.event.Event)
+		 */
+		protected void handleMemoryEvent(Event event) {
+			/* if running low on memory then this cache can be cleared
+			 * and rebuilt at the expense of processing time
+			 */
+			fNotFoundClasses.clear();
+			fClassMap.clear();
+		}
+
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelperCache.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelperCache.java
index acf1e30..8c5eadf 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelperCache.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelperCache.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -129,9 +129,10 @@
         }
         if(fHelpers.size() > MAX_SIZE) {
             // one too many, remove last
-            Object removed = fHelpers.remove(fHelpers.size()-1);
+        	Entry removed = (Entry) fHelpers.remove(fHelpers.size()-1);
+        	removed.getHelper().dispose();
             if(DEBUG) {
-            	Logger.log(Logger.INFO, "(-) TaglibHelperCache removed: " + removed); //$NON-NLS-1$
+            	Logger.log(Logger.INFO, "(-) TaglibHelperCache removed: " + removed.getProjectName()); //$NON-NLS-1$
                 printCacheContents();
             }
         }
@@ -144,6 +145,7 @@
         while(it.hasNext()) {
             entry = (Entry)it.next();
             if(entry.getProjectName().equals(projectName)) {
+            	entry.getHelper().dispose();
                 fHelpers.remove(entry);
                 if(DEBUG) { 
                     Logger.log(Logger.INFO, "(-) TaglibHelperCache removed: " + entry); //$NON-NLS-1$
@@ -153,7 +155,22 @@
             }
         }
     }
-    
+
+    public final synchronized void invalidate(String projectName, String className) {
+    	Entry entry = null;
+        Iterator it = fHelpers.iterator();
+        while(it.hasNext()) {
+            entry = (Entry)it.next();
+            if(entry.getProjectName().equals(projectName)) {
+            	entry.getHelper().invalidateClass(className);
+                if(DEBUG) { 
+                    Logger.log(Logger.INFO, "(-) TaglibHelperCache invalidated: " + className); //$NON-NLS-1$
+                    printCacheContents();
+                }
+                break;
+            }
+        }
+    }
     private void printCacheContents() {
         StringBuffer debugString = new StringBuffer();
         debugString.append("\n-----------------------------------------------------------"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelperManager.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelperManager.java
index 8409581..c0b26e0 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelperManager.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelperManager.java
@@ -19,6 +19,7 @@
 import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IJavaElementDelta;
 import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
 
 /**
  * Manages creation and caching (ordered MRU) of TaglibHelpers.
@@ -59,20 +60,35 @@
      * Update classpath for appropriate loader.
      * @see org.eclipse.jdt.core.IElementChangedListener#elementChanged(org.eclipse.jdt.core.ElementChangedEvent)
      */
-    public void elementChanged(ElementChangedEvent event) {
+	public void elementChanged(ElementChangedEvent event) {
+		// handle classpath changes
+		IJavaElementDelta delta = event.getDelta();
+		if (delta.getElement().getElementType() == IJavaElement.JAVA_MODEL) {
+			IJavaElementDelta[] changed = delta.getChangedChildren();
+			for (int i = 0; i < changed.length; i++) {
+				if ((changed[i].getFlags() & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0 || (changed[i].getFlags() & IJavaElementDelta.F_REORDER) != 0 || (changed[i].getFlags() & IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED) != 0 || (changed[i].getFlags() & IJavaElementDelta.F_PRIMARY_RESOURCE) != 0) {
+					IJavaElement proj = changed[i].getElement();
+					handleClasspathChange(changed, i, proj);
+				}
+			}
+		}
+		else if (delta.getElement().getElementType() == IJavaElement.COMPILATION_UNIT) {
+			IJavaElementDelta[] changed = delta.getChangedChildren();
+			for (int i = 0; i < changed.length; i++) {
+				if ((changed[i].getFlags() & IJavaElementDelta.F_SUPER_TYPES) != 0) {
+					IJavaElement element = changed[i].getElement();
+					handleSuperTypeChange(element);
+				}
+			}
+		}
+	}
 
-        // handle classpath changes
-        IJavaElementDelta delta = event.getDelta();
-        if(delta.getElement().getElementType() == IJavaElement.JAVA_MODEL) {
-            IJavaElementDelta[] changed = delta.getChangedChildren();
-            for (int i = 0; i < changed.length; i++) {
-                if ((changed[i].getFlags() & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0 || (changed[i].getFlags() & IJavaElementDelta.F_REORDER) != 0 || (changed[i].getFlags() & IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED) != 0) {
-                    IJavaElement proj = changed[i].getElement();
-                    handleClasspathChange(changed, i, proj);
-                }
-            }
-        }
-    }
+	private void handleSuperTypeChange(IJavaElement element) {
+		IJavaProject project = element.getJavaProject();
+		if (element instanceof IType) {
+			fCache.invalidate(project.getProject().getName(), ((IType) element).getFullyQualifiedName());
+		}
+	}
     
     /**
      * @param changed
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibVariable.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibVariable.java
index d73bbbc..ab91ce9 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibVariable.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibVariable.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -115,18 +115,18 @@
 		 */
 		if (includeDoc && getDescription() != null) {
 			if (style == M_PRIVATE) {
-				declaration = "/** " + ENDL + StringUtils.replace(getDescription(), "*/", "*\\/") + ENDL + " */ " + ENDL + "private " + getVarClass() + " " + getVarName() + " = null;" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$  //$NON-NLS-5$
+				declaration = "/** " + ENDL + StringUtils.replace(getDescription(), "*/", "*\\/") + ENDL + " */ " + ENDL + "private " + getVarClass() + " " + getVarName() + " = (" + getVarClass() + ") pageContext.getAttribute(\"" + getVarName() + "\");" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
 			}
 			else {
-				declaration = "/** " + ENDL + StringUtils.replace(getDescription(), "*/", "*\\/") + ENDL + " */ " + ENDL + getVarClass() + " " + getVarName() + " = null;" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$  //$NON-NLS-5$
+				declaration = "/** " + ENDL + StringUtils.replace(getDescription(), "*/", "*\\/") + ENDL + " */ " + ENDL + getVarClass() + " " + getVarName() + " = (" + getVarClass() + ") pageContext.getAttribute(\"" + getVarName() + "\");" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
 			}
 		}
 		else {
 			if (style == M_PRIVATE) {
-				declaration = "private " + getVarClass() + " " + getVarName() + " = null;" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+				declaration = "private " + getVarClass() + " " + getVarName() + " = (" + getVarClass() + ") pageContext.getAttribute(\"" + getVarName() + "\");" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
 			}
 			else {
-				declaration = getVarClass() + " " + getVarName() + " = null;" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$
+				declaration = getVarClass() + " " + getVarName() + " = (" + getVarClass() + ") pageContext.getAttribute(\"" + getVarName() + "\");" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 			}
 		}
 		return declaration;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java
index 5974322..a89150e 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -33,6 +33,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.internal.text.rules.IStructuredTypedRegion;
 import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
@@ -243,6 +244,8 @@
 			result = IJSPPartitions.JSP_DEFAULT_EL;
 		else if (region_type == DOMJSPRegionContexts.JSP_VBL_OPEN || region_type == DOMJSPRegionContexts.JSP_VBL_CONTENT || region_type == DOMJSPRegionContexts.JSP_VBL_CLOSE || region_type == DOMJSPRegionContexts.JSP_VBL_DQUOTE || region_type == DOMJSPRegionContexts.JSP_VBL_SQUOTE || region_type == DOMJSPRegionContexts.JSP_VBL_QUOTED_CONTENT)
 			result = IJSPPartitions.JSP_DEFAULT_EL2;
+		else if (region_type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE || region_type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE)
+			result = IJSPPartitions.JSP_DEFAULT;
 		else if (region_type == DOMRegionContext.XML_CDATA_TEXT) {
 			// BUG131463: possibly between <jsp:scriptlet>, <jsp:expression>,
 			// <jsp:declaration>
@@ -261,6 +264,15 @@
 			else
 				result = getDefaultPartitionType();
 		}
+//		else if (region_type == DOMRegionContext.BLOCK_TEXT) {
+			// possibly between <jsp:scriptlet>, <jsp:expression>,
+			// <jsp:declaration>
+//			IStructuredDocumentRegion sdRegion = this.fStructuredDocument.getRegionAtCharacterOffset(offset);
+//			if (isJspJavaActionName(getParentName(sdRegion)))
+//				result = getPartitionTypeForDocumentLanguage();
+//			else
+//				result = getDefaultPartitionType();
+//		}
 		else {
 			result = getEmbeddedPartitioner().getPartitionType(region, offset);
 		}
@@ -332,10 +344,9 @@
 				setInternalPartition(offset, containedChildRegion.getLength(), IJSPPartitions.JSP_DIRECTIVE);
 				return true;
 			}
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=113346
-			if (fEnableJSPActionPartitions && isAction(sdRegion, offset) && !(containedChildRegion instanceof ITextRegionContainer)) {
-				// if (fEnableJSPActionPartitions && isAction(sdRegion,
-				// offset)) {
+			
+			//if is a JSP custom tag but not a JSP_EL region
+			if (fEnableJSPActionPartitions && !isELRegion(containedChildRegion) && isAction(sdRegion, offset) && !(containedChildRegion instanceof ITextRegionContainer) ) {
 				setInternalPartition(offset, containedChildRegion.getLength(), IJSPPartitions.JSP_DIRECTIVE);
 				return true;
 			}
@@ -392,7 +403,8 @@
 		// but hopefully this will be less garbage than before (especially for
 		// HTML, XML,
 		// naturally!)
-		internalReusedTempInstance = getEmbeddedPartitioner().createPartition(offset, length, type);
+		IStructuredTypedRegion region = getEmbeddedPartitioner().createPartition(offset, length, type);
+		super.setInternalPartition(region.getOffset(), region.getLength(), region.getType());
 
 	}
 
@@ -405,5 +417,27 @@
 	public void setLanguage(String language) {
 		this.fLanguage = language;
 	}
+	
+	/**
+	 * @param region decide if this region is an EL region
+	 * @return <code>true</code> if the given <code>region</code> is a EL region,
+	 * <code>false</code> otherwise.
+	 */
+	private boolean isELRegion(ITextRegion region) {
+		String type = region.getType();
+		return
+			type == DOMJSPRegionContexts.JSP_EL_CLOSE ||
+			type == DOMJSPRegionContexts.JSP_EL_CONTENT ||
+			type == DOMJSPRegionContexts.JSP_EL_DQUOTE ||
+			type == DOMJSPRegionContexts.JSP_EL_OPEN ||
+			type == DOMJSPRegionContexts.JSP_EL_QUOTED_CONTENT ||
+			type == DOMJSPRegionContexts.JSP_EL_SQUOTE ||
+			type == DOMJSPRegionContexts.JSP_VBL_CLOSE ||
+			type == DOMJSPRegionContexts.JSP_VBL_CONTENT ||
+			type == DOMJSPRegionContexts.JSP_VBL_DQUOTE ||
+			type == DOMJSPRegionContexts.JSP_VBL_OPEN ||
+			type == DOMJSPRegionContexts.JSP_VBL_QUOTED_CONTENT ||
+			type == DOMJSPRegionContexts.JSP_VBL_SQUOTE;
+	}
 
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/DocumentProvider.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/DocumentProvider.java
index 3607088..2c9c28c 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/DocumentProvider.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/DocumentProvider.java
@@ -18,8 +18,6 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
-import java.lang.ref.Reference;
-import java.lang.ref.SoftReference;
 import java.net.URL;
 import java.net.URLConnection;
 
@@ -141,20 +139,13 @@
 		return document;
 	}
 
-	ThreadLocal fDocumentBuilder = new ThreadLocal();
+	DocumentBuilder fDocumentBuilder = null;
 	
 	private DocumentBuilder getDocumentBuilder() {
-		DocumentBuilder db = null;
-
-		Reference builderReference = (Reference) fDocumentBuilder.get();
-		if (builderReference != null) {
-			db = (DocumentBuilder) builderReference.get();
+		if (fDocumentBuilder == null) {
+			fDocumentBuilder = CommonXML.getDocumentBuilder(isValidating());
 		}
-		if (db == null) {
-			db = CommonXML.getDocumentBuilder(isValidating());
-			fDocumentBuilder.set(new SoftReference(db));
-		}
-		return db;
+		return fDocumentBuilder;
 	}
 
 	private DOMImplementation getDomImplementation() {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupport.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupport.java
index 775d9b1..33b8c64 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupport.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupport.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -36,6 +36,8 @@
 	private static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$
 	private static final IPath WEB_INF_PATH = new Path(WEB_INF);
 
+	static final float DEFAULT_SERVLET_VERSION = 3f;
+
 	/**
 	 * @param project
 	 * @return the computed IPath to the "root" of the web contents, either from facet knowledge or hueristics, or null if one can not be determined
@@ -69,7 +71,7 @@
 	 */
 	public static float getDynamicWebProjectVersion(IProject project) {
 		// In the absence of any facet information, assume the highest level
-		float version = 2.5f;
+		float version = DEFAULT_SERVLET_VERSION;
 		try {
 			version = FacetModuleCoreSupportDelegate.getDynamicWebProjectVersion(project);
 		}
@@ -99,6 +101,12 @@
 		return path;
 	}
 
+	/**
+	 * @param path -
+	 *            the full path to a resource within the workspace
+	 * @return - the runtime path of the resource if one exists, null
+	 *         otherwise
+	 */
 	public static IPath getRuntimePath(IPath path) {
 		IPath result = null;
 		try {
@@ -224,6 +232,4 @@
 
 		return basePath.uptoSegment(1);
 	}
-
-
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupportDelegate.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupportDelegate.java
index 2b7e288..c751360 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupportDelegate.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupportDelegate.java
@@ -43,7 +43,6 @@
 	 * @see org.eclipse.wst.common.componentcore.internal.util.IModuleConstants.JST_WEB_MODULE
 	 */
 	private final static String JST_WEB_MODULE = "jst.web"; //$NON-NLS-1$
-
 	/**
 	 * @param project
 	 * @return -1 if the project does not have the JST Web facet, the version
@@ -52,10 +51,10 @@
 	 */
 	static float getDynamicWebProjectVersion(IProject project) {
 		if (project == null)
-			return 2.5f;
+			return FacetModuleCoreSupport.DEFAULT_SERVLET_VERSION;
 
 		// In the absence of any facet information, assume the highest level
-		float version = 2.5f;
+		float version = FacetModuleCoreSupport.DEFAULT_SERVLET_VERSION;
 		try {
 			IFacetedProject faceted = ProjectFacetsManager.create(project);
 			if (faceted != null && ProjectFacetsManager.isProjectFacetDefined(JST_WEB_MODULE)) {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FileContentCache.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FileContentCache.java
index e6243ad..5a2de58 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FileContentCache.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FileContentCache.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -34,6 +34,7 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.QualifiedName;
 import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.jface.text.IDocument;
 import org.eclipse.jst.jsp.core.internal.Logger;
 import org.eclipse.wst.sse.core.internal.util.Debug;
 
@@ -90,7 +91,7 @@
 					// will try to cleanup in finally
 				}
 				catch (CoreException e) {
-					Logger.logException(e);
+					// out of sync
 				}
 				finally {
 					if (contents != null) {
@@ -126,9 +127,12 @@
 				IFile f = getFile(filePath);
 				if (f != null && f.isAccessible()) {
 					String charset = detectCharset(f);
+					if (charset == null) {
+						charset = ResourcesPlugin.getEncoding();
+					}
 					is = f.getContents();
 					Reader reader = new InputStreamReader(is, charset);
-					char[] readBuffer = new char[2048];
+					char[] readBuffer = new char[8092];
 					int n = reader.read(readBuffer);
 					while (n > 0) {
 						s.append(readBuffer, 0, n);
@@ -136,10 +140,12 @@
 					}
 				}
 			}
+			catch (CoreException e) {
+				// out of sync
+			}
 			catch (Exception e) {
 				if (Debug.debugStructuredDocument) {
 					Logger.logException(e);
-					e.printStackTrace();
 				}
 			}
 			finally {
@@ -194,11 +200,13 @@
 	}
 
 	private void cleanup() {
-		Iterator iterator = fContentMap.entrySet().iterator();
-		while (iterator.hasNext()) {
-			Map.Entry entry = (Map.Entry) iterator.next();
-			if (entry.getValue() != null && ((Reference) entry.getValue()).get() == null) {
-				iterator.remove();
+		synchronized (fContentMap) {
+			Iterator iterator = fContentMap.entrySet().iterator();
+			while (iterator.hasNext()) {
+				Map.Entry entry = (Map.Entry) iterator.next();
+				if (entry.getValue() != null && ((Reference) entry.getValue()).get() == null) {
+					iterator.remove();
+				}
 			}
 		}
 	}
@@ -206,6 +214,16 @@
 	public String getContents(IPath filePath) {
 		if (DEBUG)
 			System.out.println("getContents:" + filePath);
+		
+		// use an text file buffer if one is already open
+		ITextFileBuffer existingBuffer = FileBuffers.getTextFileBufferManager().getTextFileBuffer(filePath, LocationKind.IFILE);
+		if (existingBuffer != null) {
+			IDocument document = existingBuffer.getDocument();
+			if (document != null) {
+				return document.get();
+			}
+		}
+		
 		CacheEntry entry = null;
 		Object o = fContentMap.get(filePath);
 		if (o instanceof Reference) {
@@ -215,7 +233,9 @@
 			if (DEBUG && entry != null && entry.isStale())
 				System.out.println("stale contents:" + filePath);
 			entry = new CacheEntry(filePath);
-			fContentMap.put(filePath, new SoftReference(entry));
+			synchronized (fContentMap) {
+				fContentMap.put(filePath, new SoftReference(entry));
+			}
 		}
 		cleanup();
 		return entry.contents;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/FragmentValidationTools.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/FragmentValidationTools.java
new file mode 100644
index 0000000..83a95ab
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/FragmentValidationTools.java
@@ -0,0 +1,57 @@
+/*******************************************************************************

+ * Copyright (c) 2008 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+

+package org.eclipse.jst.jsp.core.internal.validation;

+

+import org.eclipse.core.resources.IProject;

+import org.eclipse.core.resources.IResource;

+import org.eclipse.core.resources.ProjectScope;

+import org.eclipse.core.runtime.preferences.IEclipsePreferences;

+import org.eclipse.core.runtime.preferences.InstanceScope;

+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;

+import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;

+

+

+/**

+ * Utility class for reading fragment validation preferences/properties.

+ * JSPFContentProperties does not respect the project override preference.

+ * 

+ */

+class FragmentValidationTools {

+	/**

+	 * @param resource

+	 * @return whether to perform validation on a fragment, returning the

+	 *         project-specific preference only of project-specific values are

+	 *         enabled

+	 */

+	static boolean shouldValidateFragment(IResource resource) {

+		String qualifier = JSPCorePlugin.getDefault().getBundle().getSymbolicName();

+

+		IProject project = null;

+		if (resource.getType() == IResource.PROJECT) {

+			project = (IProject) resource;

+		}

+		else {

+			project = resource.getProject();

+		}

+		if (project != null) {

+			IEclipsePreferences node = new ProjectScope(project).getNode(qualifier);

+			// first, check whether project specific settings are to be used

+			boolean useProjectSettings = node.getBoolean(JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS, false);

+			if (useProjectSettings) {

+				// only if so, return that value

+				return node.getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true);

+			}

+			// if not, return the workspace value

+		}

+		return new InstanceScope().getNode(qualifier).getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true);

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPActionValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPActionValidator.java
index 51f0c3d..ad213e1 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPActionValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPActionValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.preferences.DefaultScope;
 import org.eclipse.core.runtime.preferences.IPreferencesService;
@@ -29,6 +30,12 @@
 import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDAttributeDeclaration;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache.PropertyGroup;
+import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapter;
+import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapterImpl;
 import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.osgi.util.NLS;
@@ -51,8 +58,10 @@
 import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
 import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.w3c.dom.Attr;
@@ -76,8 +85,10 @@
 	private int fSeverityMissingRequiredAttribute = IMessage.HIGH_SEVERITY;
 	private int fSeverityNonEmptyInlineTag = IMessage.NORMAL_SEVERITY;
 	private int fSeverityUnknownAttribute = IMessage.NORMAL_SEVERITY;
+	private int fSeverityUnexpectedRuntimeExpression = IMessage.NORMAL_SEVERITY;
 
 	private HashSet fTaglibPrefixes = new HashSet();
+	private boolean fIsELIgnored = false;
 
 	public JSPActionValidator() {
 		this.fMessageOriginator = this;
@@ -102,6 +113,48 @@
 		}
 	}
 
+	/**
+	 * Checks an attribute for runtime expressions
+	 * @param a The attribute to check for runtime expressions
+	 * @return true if the attribute contains a runtime expression, false otherwise
+	 */
+	private boolean checkRuntimeValue(IDOMAttr a) {
+		ITextRegion value = a.getValueRegion();
+		if (value instanceof ITextRegionContainer) {
+			Iterator it = ((ITextRegionContainer) value).getRegions().iterator();
+			while (it.hasNext()) {
+				String type = ((ITextRegion) it.next()).getType();
+				if (type == DOMJSPRegionContexts.JSP_EL_OPEN)
+					return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Determines if EL should be ignored. Checks
+	 * <ol>
+	 *  <li>JSP version</li>
+	 * 	<li>Page directive isELIgnored</li>
+	 *  <li>Deployment descriptor's el-ignored</li>
+	 * </ol>
+	 * @return true if EL should be ignored, false otherwise. If the JSP version is < 2.0, EL is ignored by default
+	 */
+	private boolean isElIgnored(IPath path, IStructuredModel model) {
+		if (DeploymentDescriptorPropertyCache.getInstance().getJSPVersion(path) < 2.0f)
+			return true;
+		String directiveIsELIgnored = ((PageDirectiveAdapterImpl)(((IDOMModel) model).getDocument().getAdapterFor(PageDirectiveAdapter.class))).getElIgnored();
+		// isELIgnored directive found
+		if (directiveIsELIgnored != null)
+			return Boolean.valueOf(directiveIsELIgnored).booleanValue();
+		// Check the deployment descriptor for el-ignored
+		PropertyGroup[] groups = DeploymentDescriptorPropertyCache.getInstance().getPropertyGroups(path);
+		if (groups.length > 0)
+			return groups[0].isELignored();
+		// JSP version >= 2.0 defaults to evaluating EL
+		return false;
+	}
+
 	private void checkRequiredAttributes(IDOMElement element, CMNamedNodeMap attrMap, IReporter reporter, IFile file, IStructuredDocument document, IStructuredDocumentRegion documentRegion) {
 		Iterator it = attrMap.iterator();
 		CMAttributeDeclaration attr = null;
@@ -147,7 +200,7 @@
 				 * Get the name attribute of jsp:attribute and compare its
 				 * value to the required attribute name
 				 */
-				if (neededAttrName.equals(childElement.getAttribute("name"))) {//$NON-NLS-1$
+				if (childElement.hasAttribute("name") && neededAttrName.equals(childElement.getAttribute("name"))) {//$NON-NLS-1$ //$NON-NLS-2$
 					return true;
 				}
 			}
@@ -155,33 +208,65 @@
 		return false;
 	}
 
-	private boolean checkUnknownAttributes(IDOMElement element, CMNamedNodeMap cmAttrs, IReporter reporter, IFile file, IStructuredDocument document, IStructuredDocumentRegion documentRegion) {
+	private boolean checkUnknownAttributes(IDOMElement element, CMElementDeclaration elementDecl, CMNamedNodeMap cmAttrs, IReporter reporter, IFile file, IStructuredDocument document, IStructuredDocumentRegion documentRegion) {
 		boolean foundjspattribute = false;
+		boolean dynamicAttributesAllowed = false;
+		CMElementDeclaration decl = elementDecl;
+		if (decl instanceof CMNodeWrapper)
+			decl = (CMElementDeclaration) ((CMNodeWrapper) decl).getOriginNode();
+		if (decl instanceof TLDElementDeclaration) {
+			String dynamicAttributes = ((TLDElementDeclaration) decl).getDynamicAttributes();
+			dynamicAttributesAllowed = dynamicAttributes != null ? Boolean.valueOf(dynamicAttributes).booleanValue() : false;
+		}
 
 		NamedNodeMap attrs = element.getAttributes();
 		for (int i = 0; i < attrs.getLength(); i++) {
 			Attr a = (Attr) attrs.item(i);
 			CMAttributeDeclaration adec = (CMAttributeDeclaration) cmAttrs.getNamedItem(a.getName());
 			if (adec == null) {
-				// No attr declaration was found. That is, the attr name is
-				// undefined.
-				// but not regard it as undefined name if it includes JSP
+				/*
+				 * No attr declaration was found. That is, the attr name is
+				 * undefined. Disregard it includes JSP structure or this
+				 * element supports dynamic attributes
+				 */
 				if (!hasJSPRegion(((IDOMNode) a).getNameRegion()) && fSeverityUnknownAttribute != ValidationMessage.IGNORE) {
-					String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_6, a.getName());
-					LocalizedMessage message = new LocalizedMessage(fSeverityUnknownAttribute, msgText, file);
-					int start = ((IDOMAttr) a).getNameRegionStartOffset();
-					int length = ((IDOMAttr) a).getNameRegionEndOffset() - start;
-					int lineNo = document.getLineOfOffset(start);
-					message.setLineNo(lineNo);
-					message.setOffset(start);
-					message.setLength(length);
+					if (!dynamicAttributesAllowed) {
+						String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_6, a.getName());
+						LocalizedMessage message = new LocalizedMessage(fSeverityUnknownAttribute, msgText, file);
+						int start = ((IDOMAttr) a).getNameRegionStartOffset();
+						int length = ((IDOMAttr) a).getNameRegionEndOffset() - start;
+						int lineNo = document.getLineOfOffset(start);
+						message.setLineNo(lineNo);
+						message.setOffset(start);
+						message.setLength(length);
 
-					reporter.addMessage(fMessageOriginator, message);
+						reporter.addMessage(fMessageOriginator, message);
+					}
 				}
 				else {
 					foundjspattribute = true;
 				}
 			}
+			else {
+				if (fSeverityUnexpectedRuntimeExpression != ValidationMessage.IGNORE && adec instanceof TLDAttributeDeclaration) {
+					// The attribute cannot have a runtime evaluation of an expression
+					if (!Boolean.valueOf(((TLDAttributeDeclaration) adec).getRtexprvalue()).booleanValue()) {
+						IDOMAttr attr = (IDOMAttr) a;
+						if(checkRuntimeValue(attr) && !fIsELIgnored) {
+							String msg = NLS.bind(JSPCoreMessages.JSPActionValidator_1, a.getName());
+							LocalizedMessage message = new LocalizedMessage(fSeverityUnexpectedRuntimeExpression, msg, file);
+							ITextRegion region = attr.getValueRegion();
+							int start = attr.getValueRegionStartOffset();
+							int length = region != null ? region.getTextLength() : 0;
+							int lineNo = document.getLineOfOffset(start);
+							message.setLineNo(lineNo);
+							message.setOffset(start);
+							message.setLength(length);
+							reporter.addMessage(fMessageOriginator, message);
+						}
+					}
+				}
+			}
 		}
 		return foundjspattribute;
 	}
@@ -283,6 +368,7 @@
 		fSeverityMissingRequiredAttribute = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE);
 		fSeverityNonEmptyInlineTag = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG);
 		fSeverityUnknownAttribute = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE);
+		fSeverityUnexpectedRuntimeExpression = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE);
 	}
 
 	void performValidation(IFile f, IReporter reporter, IStructuredModel model) {
@@ -295,6 +381,7 @@
 		loadPreferences(f);
 		IStructuredDocument sDoc = model.getStructuredDocument();
 
+		fIsELIgnored = isElIgnored(f.getFullPath(), model);
 		// iterate all document regions
 		IStructuredDocumentRegion region = sDoc.getRegionAtCharacterOffset(validateRegion.getOffset());
 		while (region != null && !reporter.isCancelled() && (region.getStartOffset() <= (validateRegion.getOffset() + validateRegion.getLength()))) {
@@ -328,9 +415,9 @@
 			if (query != null) {
 				CMElementDeclaration cmElement = query.getCMElementDeclaration(element);
 				if (cmElement != null) {
-					CMNamedNodeMap cmAttributes = cmElement.getAttributes();
+					CMNamedNodeMap cmAttributes = null;
 
-					CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(cmAttributes);
+					CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl();
 					List nodes = query.getAvailableContent(element, cmElement, ModelQuery.INCLUDE_ATTRIBUTES);
 					for (int k = 0; k < nodes.size(); k++) {
 						CMNode cmnode = (CMNode) nodes.get(k);
@@ -340,7 +427,7 @@
 					}
 					cmAttributes = allAttributes;
 
-					boolean foundjspattribute = checkUnknownAttributes(element, cmAttributes, reporter, file, model.getStructuredDocument(), documentRegion);
+					boolean foundjspattribute = checkUnknownAttributes(element, cmElement, cmAttributes, reporter, file, model.getStructuredDocument(), documentRegion);
 					// required attributes could be hidden in jsp regions in
 					// tags, so if jsp regions were detected, do not check for
 					// missing required attributes
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPBatchValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPBatchValidator.java
index d4dde9f..42c287b 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPBatchValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPBatchValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,8 @@
 import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
 
 import org.eclipse.core.resources.IFile;
@@ -29,6 +31,7 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
@@ -43,7 +46,8 @@
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
 import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache.PropertyGroup;
 import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.wst.sse.core.StructuredModelManager;
@@ -109,6 +113,11 @@
 	private static final String PLUGIN_ID_JSP_CORE = "org.eclipse.jst.jsp.core"; //$NON-NLS-1$
 
 	/**
+	 * List of IResources that the currently validating file depends upon
+	 */
+	private Collection fDependsOn;
+
+	/**
 	 * Gets current validation project configuration based on current project
 	 * (which is based on current document)
 	 * 
@@ -168,6 +177,11 @@
 
 	private JSPActionValidator fJSPActionValidator = new JSPActionValidator(this);
 
+	void addDependsOn(IResource resource) {
+		if(resource != null) {
+			fDependsOn.add(resource);
+		}
+	}
 
 	public void cleanup(IReporter reporter) {
 		fJSPDirectiveValidator.cleanup(reporter);
@@ -243,7 +257,7 @@
 		// quick check to see if this is possibly a jsp fragment
 		if (getJSPFContentType().isAssociatedWith(file.getName())) {
 			// get preference for validate jsp fragments
-			boolean shouldValidateFragments = Boolean.valueOf(JSPFContentProperties.getProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, file, true)).booleanValue();
+			boolean shouldValidateFragments = FragmentValidationTools.shouldValidateFragment(file);
 			/*
 			 * if jsp fragments should not be validated, check if file is
 			 * really jsp fragment
@@ -472,11 +486,41 @@
 	public ValidationResult validate(final IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
 		if (resource.getType() != IResource.FILE)
 			return null;
-		ValidationResult result = new ValidationResult();
+		final ValidationResult result = new ValidationResult();
 		final IReporter reporter = result.getReporter(monitor);
+		
+		if(result.getDependsOn() != null) {
+			fDependsOn = new HashSet(Arrays.asList(result.getDependsOn()));
+		}
+		else {
+			fDependsOn = new HashSet();
+		}
+		
+		// add web.xml as a dependency
+		addDependsOn(DeploymentDescriptorPropertyCache.getInstance().getWebXML(resource.getFullPath()));
+
+		// List relevant JSP 2.0 preludes/codas as dependencies
+		IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+		PropertyGroup[] propertyGroups = DeploymentDescriptorPropertyCache.getInstance().getPropertyGroups(resource.getFullPath());
+		for (int j = 0; j < propertyGroups.length; j++) {
+			IPath[] preludes = propertyGroups[j].getIncludePrelude();
+			for (int i = 0; i < preludes.length; i++) {
+				addDependsOn(workspaceRoot.getFile(preludes[i]));
+			}
+			IPath[] codas = propertyGroups[j].getIncludeCoda();
+			for (int i = 0; i < codas.length; i++) {
+				addDependsOn(workspaceRoot.getFile(codas[i]));
+			}
+		}
+		
 		IWorkspaceRunnable validationRunnable = new IWorkspaceRunnable() {
 			public void run(IProgressMonitor monitor) throws CoreException {
-				validateFile((IFile) resource, reporter);
+				if (fragmentCheck((IFile) resource)) {
+					validateFile((IFile) resource, reporter);
+				}
+				IResource[] resources = (IResource[]) fDependsOn.toArray(new IResource[fDependsOn.size()]);
+				result.setDependsOn(resources);
+				fDependsOn.clear();
 			}
 		};
 		Job currentJob = Job.getJobManager().currentJob();
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPContentValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPContentValidator.java
index fd9a126..2c13d19 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPContentValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPContentValidator.java
@@ -11,26 +11,91 @@
 package org.eclipse.jst.jsp.core.internal.validation;
 
 import java.io.IOException;
+import java.io.InputStream;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.jst.jsp.core.internal.Logger;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
 import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeConstants;
 import org.eclipse.wst.html.core.internal.validate.HTMLValidationAdapterFactory;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
+import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
 import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;
+import org.w3c.dom.Element;
 
 /**
  * This validator validates the contents of the content type of the JSP, like
  * the HTML regions in a JSP with content type="text/html"
  */
 public class JSPContentValidator extends JSPValidator {
+	private static final String HTTP_JAVA_SUN_COM_JSP_PAGE = "http://java.sun.com/JSP/Page"; //$NON-NLS-1$
+	private static final String XMLNS = "xmlns"; //$NON-NLS-1$
+	private static final String XMLNS_JSP = "xmlns:jsp"; //$NON-NLS-1$
+	private IContentType fJSPFContentType = null;
+
+
+	/**
+	 * Checks if file is a jsp fragment or not. If so, check if the fragment
+	 * should be validated or not.
+	 * 
+	 * @param file
+	 *            Assumes shouldValidate was already called on file so it
+	 *            should not be null and does exist
+	 * @return false if file is a fragment and it should not be validated,
+	 *         true otherwise
+	 */
+	private boolean fragmentCheck(IFile file) {
+		boolean shouldValidate = true;
+		// quick check to see if this is possibly a jsp fragment
+		if (getJSPFContentType().isAssociatedWith(file.getName())) {
+			// get preference for validate jsp fragments
+			boolean shouldValidateFragments = FragmentValidationTools.shouldValidateFragment(file);
+			/*
+			 * if jsp fragments should not be validated, check if file is
+			 * really jsp fragment
+			 */
+			if (!shouldValidateFragments) {
+				boolean isFragment = isFragment(file);
+				shouldValidate = !isFragment;
+			}
+		}
+		return shouldValidate;
+	}
+
+	/**
+	 * Returns JSP fragment content type
+	 * 
+	 * @return jspf content type
+	 */
+	private IContentType getJSPFContentType() {
+		if (fJSPFContentType == null) {
+			fJSPFContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT);
+		}
+		return fJSPFContentType;
+	}
+
+	/*
+	 * Copied from HTMLValidator
+	 */
+	private HTMLValidationReporter getReporter(IReporter reporter, IFile file, IDOMModel model) {
+		return new HTMLValidationReporter(this, reporter, file, model);
+	}
+
 	/*
 	 * Copied from HTMLValidator
 	 */
@@ -41,13 +106,81 @@
 		return adapter.hasFeature(HTMLDocumentTypeConstants.HTML);
 	}
 
-	/*
-	 * Copied from HTMLValidator
+	/**
+	 * Determines if file is jsp fragment or not (does a deep, indepth check,
+	 * looking into contents of file)
+	 * 
+	 * @param file
+	 *            assumes file is not null and exists
+	 * @return true if file is jsp fragment, false otherwise
 	 */
-	private HTMLValidationReporter getReporter(IReporter reporter, IFile file, IDOMModel model) {
-		return new HTMLValidationReporter(this, reporter, file, model);
+	private boolean isFragment(IFile file) {
+		boolean isFragment = false;
+		InputStream is = null;
+		try {
+			IContentDescription contentDescription = file.getContentDescription();
+			// it can be null
+			if (contentDescription == null) {
+				is = file.getContents();
+				contentDescription = Platform.getContentTypeManager().getDescriptionFor(is, file.getName(), new QualifiedName[]{IContentDescription.CHARSET});
+			}
+			if (contentDescription != null) {
+				String fileCtId = contentDescription.getContentType().getId();
+				isFragment = (fileCtId != null && ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT.equals(fileCtId));
+			}
+		}
+		catch (IOException e) {
+			// ignore, assume it's invalid JSP
+		}
+		catch (CoreException e) {
+			// ignore, assume it's invalid JSP
+		}
+		finally {
+			/*
+			 * must close input stream in case others need it
+			 * (IFile.getContents() requirement as well)
+			 */
+			if (is != null)
+				try {
+					is.close();
+				}
+				catch (Exception e) {
+					// not sure how to recover at this point
+				}
+		}
+		return isFragment;
 	}
 
+	private boolean isXMLJSP(IDOMDocument document) {
+		Element root = document.getDocumentElement();
+		return root != null && (root.hasAttribute(XMLNS_JSP) || HTTP_JAVA_SUN_COM_JSP_PAGE.equals(root.getAttribute(XMLNS)));
+	}
+
+	private void validate(IFile file, int kind, ValidationState state, IProgressMonitor monitor, IDOMModel model, IReporter reporter) {
+		IDOMDocument document = model.getDocument();
+		if (document == null)
+			return; // error
+
+		boolean isXMLJSP = isXMLJSP(document);
+		boolean hasHTMLFeature = hasHTMLFeature(document);
+
+		if (hasHTMLFeature && !isXMLJSP) {
+			INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
+			ValidationAdapter adapter = (ValidationAdapter) factory.adapt(document);
+			if (adapter != null) {
+				HTMLValidationReporter rep = getReporter(reporter, file, model);
+				rep.clear();
+				adapter.setReporter(rep);
+				adapter.validate(document);
+			}
+		}
+		if (!hasHTMLFeature && isXMLJSP) {
+			Validator xmlValidator = new Validator();
+			xmlValidator.validate(file, kind, state, monitor);
+		}
+	}
+
+
 	/*
 	 * Mostly copied from HTMLValidator
 	 */
@@ -60,7 +193,9 @@
 
 		// This validator currently only handles validating HTML content in
 		// JSP
-		if (hasHTMLFeature(document)) {
+		boolean hasXMLFeature = isXMLJSP(document);
+		boolean hasHTMLFeature = hasHTMLFeature(document);
+		if (hasHTMLFeature && !hasXMLFeature) {
 			INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
 			ValidationAdapter adapter = (ValidationAdapter) factory.adapt(document);
 			if (adapter == null)
@@ -73,13 +208,46 @@
 		}
 	}
 
+	public ValidationResult validate(final IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
+		if (resource.getType() != IResource.FILE)
+			return null;
+
+		ValidationResult result = new ValidationResult();
+		final IReporter reporter = result.getReporter(monitor);
+
+		if (fragmentCheck((IFile) resource)) {
+			IStructuredModel model = null;
+			try {
+				model = StructuredModelManager.getModelManager().getModelForRead((IFile) resource);
+				if (!reporter.isCancelled() && model instanceof IDOMModel) {
+					reporter.removeAllMessages(this, resource);
+					validate((IFile) resource, kind, state, monitor, (IDOMModel) model, reporter);
+				}
+			}
+			catch (IOException e) {
+				Logger.logException(e);
+			}
+			catch (CoreException e) {
+				Logger.logException(e);
+			}
+			finally {
+				if (model != null)
+					model.releaseFromRead();
+			}
+		}
+
+		return result;
+	}
+
 	protected void validateFile(IFile f, IReporter reporter) {
 		IStructuredModel model = null;
 		try {
-			model = StructuredModelManager.getModelManager().getModelForRead(f);
-			if (!reporter.isCancelled() && model instanceof IDOMModel) {
-				reporter.removeAllMessages(this, f);
-				validate(reporter, f, (IDOMModel) model);
+			if (fragmentCheck(f)) {
+				model = StructuredModelManager.getModelManager().getModelForRead(f);
+				if (!reporter.isCancelled() && model instanceof IDOMModel) {
+					reporter.removeAllMessages(this, f);
+					validate(reporter, f, (IDOMModel) model);
+				}
 			}
 		}
 		catch (IOException e) {
@@ -93,4 +261,5 @@
 				model.releaseFromRead();
 		}
 	}
+
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPDirectiveValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPDirectiveValidator.java
index 687e966..2be0563 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPDirectiveValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPDirectiveValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,9 +19,14 @@
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
 import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.preferences.DefaultScope;
 import org.eclipse.core.runtime.preferences.IEclipsePreferences;
@@ -35,11 +40,16 @@
 import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
 import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
 import org.eclipse.jst.jsp.core.internal.Logger;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
 import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport;
+import org.eclipse.jst.jsp.core.taglib.IJarRecord;
+import org.eclipse.jst.jsp.core.taglib.ITLDRecord;
+import org.eclipse.jst.jsp.core.taglib.ITagDirRecord;
 import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
+import org.eclipse.jst.jsp.core.taglib.IURLRecord;
 import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.wst.html.core.internal.contentmodel.JSP20Namespace;
@@ -49,6 +59,8 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.text.IRegionComparible;
 import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
 import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
@@ -105,6 +117,18 @@
 		this.fMessageOriginator = validator;
 	}
 
+	/**
+	 * Record that the currently validating resource depends on the given
+	 * file. Only possible during batch (not source) validation.
+	 * 
+	 * @param file
+	 */
+	private void addDependsOn(IResource file) {
+		if (fMessageOriginator instanceof JSPBatchValidator) {
+			((JSPBatchValidator) fMessageOriginator).addDependsOn(file);
+		}
+	}
+
 	public void cleanup(IReporter reporter) {
 		super.cleanup(reporter);
 		fTaglibPrefixesInUse.clear();
@@ -201,6 +225,10 @@
 		fPrefixValueRegionToDocumentRegionMap.clear();
 		fTaglibPrefixesInUse.clear();
 
+		IRegionComparible comparer = null;
+		if (sDoc instanceof IRegionComparible)
+			comparer = (IRegionComparible) sDoc;
+		
 		// iterate all document regions
 		IStructuredDocumentRegion region = sDoc.getFirstStructuredDocumentRegion();
 		while (region != null && !reporter.isCancelled()) {
@@ -208,6 +236,14 @@
 			if (region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
 				processDirective(reporter, f, sDoc, region);
 			}
+			// requires tag name, attribute, equals, and value
+			else if (comparer != null && region.getNumberOfRegions() > 4) {
+				ITextRegion nameRegion = region.getRegions().get(1);
+				if (comparer.regionMatches(region.getStartOffset(nameRegion), nameRegion.getTextLength(), "jsp:include")) {
+					processIncludeDirective(reporter, f, sDoc, region);
+				}
+
+			}
 			region = region.getNext();
 		}
 
@@ -227,7 +263,7 @@
 		if (directiveName.equals("taglib")) { //$NON-NLS-1$
 			processTaglibDirective(reporter, file, sDoc, documentRegion);
 		}
-		else if (directiveName.equals("include")) { //$NON-NLS-1$
+		else if (directiveName.equals("include")||directiveName.equals("jsp:include")) { //$NON-NLS-1$ //$NON-NLS-2$
 			processIncludeDirective(reporter, file, sDoc, documentRegion);
 		}
 		else if (directiveName.equals("page")) { //$NON-NLS-1$
@@ -237,7 +273,10 @@
 
 	private void processIncludeDirective(IReporter reporter, IFile file, IStructuredDocument sDoc, IStructuredDocumentRegion documentRegion) {
 		ITextRegion fileValueRegion = getAttributeValueRegion(documentRegion, JSP11Namespace.ATTR_NAME_FILE);
-		if (fileValueRegion != null) {
+		if (fileValueRegion == null)
+			fileValueRegion = getAttributeValueRegion(documentRegion, JSP11Namespace.ATTR_NAME_PAGE);
+		// There is a file and it isn't a nested region which could contain a JSP expression
+		if (fileValueRegion != null && !hasNestedRegion(fileValueRegion)) {
 			// file specified
 			String fileValue = documentRegion.getText(fileValueRegion);
 			fileValue = StringUtils.stripQuotes(fileValue);
@@ -249,40 +288,43 @@
 				int start = documentRegion.getStartOffset(fileValueRegion);
 				int length = fileValueRegion.getTextLength();
 				int lineNo = sDoc.getLineOfOffset(start);
-				message.setLineNo(lineNo);
+				message.setLineNo(lineNo + 1);
 				message.setOffset(start);
 				message.setLength(length);
 
 				reporter.addMessage(fMessageOriginator, message);
 			}
-			else if (fSeverityIncludeFileMissing != ValidationMessage.IGNORE) {
+			else if (DeploymentDescriptorPropertyCache.getInstance().getURLMapping(file.getFullPath(), fileValue) == null) {
 				IPath testPath = FacetModuleCoreSupport.resolve(file.getFullPath(), fileValue);
 				if (testPath.segmentCount() > 1) {
 					IFile testFile = file.getWorkspace().getRoot().getFile(testPath);
+					addDependsOn(testFile);
 					if (!testFile.isAccessible()) {
-						// File not found
-						String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_4, new String[]{fileValue, testPath.toString()});
-						LocalizedMessage message = new LocalizedMessage(fSeverityIncludeFileMissing, msgText, file);
-						int start = documentRegion.getStartOffset(fileValueRegion);
-						int length = fileValueRegion.getTextLength();
-						int lineNo = sDoc.getLineOfOffset(start);
-						message.setLineNo(lineNo);
-						message.setOffset(start);
-						message.setLength(length);
+						if (fSeverityIncludeFileMissing != ValidationMessage.IGNORE) {
+							// File not found
+							String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_4, new String[]{fileValue, testPath.toString()});
+							LocalizedMessage message = new LocalizedMessage(fSeverityIncludeFileMissing, msgText, file);
+							int start = documentRegion.getStartOffset(fileValueRegion);
+							int length = fileValueRegion.getTextLength();
+							int lineNo = sDoc.getLineOfOffset(start);
+							message.setLineNo(lineNo + 1);
+							message.setOffset(start);
+							message.setLength(length);
 
-						reporter.addMessage(fMessageOriginator, message);
+							reporter.addMessage(fMessageOriginator, message);
+						}
 					}
 				}
 			}
 		}
-		else if (fSeverityIncludeFileNotSpecified != ValidationMessage.IGNORE) {
+		else if (fileValueRegion == null && fSeverityIncludeFileNotSpecified != ValidationMessage.IGNORE) {
 			// file is not specified at all
 			String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_3, JSP11Namespace.ATTR_NAME_FILE);
 			LocalizedMessage message = new LocalizedMessage(fSeverityIncludeFileNotSpecified, msgText, file);
 			int start = documentRegion.getStartOffset();
 			int length = documentRegion.getTextLength();
 			int lineNo = sDoc.getLineOfOffset(start);
-			message.setLineNo(lineNo);
+			message.setLineNo(lineNo + 1);
 			message.setOffset(start);
 			message.setLength(length);
 
@@ -314,13 +356,13 @@
 			}
 
 			if (superClass == null && fSeveritySuperClassNotFound != ValidationMessage.IGNORE) {
-				// file value is specified but empty
+				// superclass not found
 				String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_8, superclassName);
 				LocalizedMessage message = new LocalizedMessage(fSeveritySuperClassNotFound, msgText, file);
 				int start = documentRegion.getStartOffset(superclassValueRegion);
 				int length = superclassValueRegion.getTextLength();
 				int lineNo = doc.getLineOfOffset(start);
-				message.setLineNo(lineNo);
+				message.setLineNo(lineNo + 1);
 				message.setOffset(start);
 				message.setLength(length);
 
@@ -340,19 +382,98 @@
 			if (file != null) {
 				uri = StringUtils.stripQuotes(uri);
 				if (uri.length() > 0) {
-					ITaglibRecord tld = TaglibIndex.resolve(file.getFullPath().toString(), uri, false);
-					if (tld == null && fSeverityTaglibUnresolvableURI != ValidationMessage.IGNORE) {
+					ITaglibRecord reference = TaglibIndex.resolve(file.getFullPath().toString(), uri, false);
+					if (reference != null) {
+						switch (reference.getRecordType()) {
+							case (ITaglibRecord.TLD) : {
+								ITLDRecord record = (ITLDRecord) reference;
+								IResource tldfile = ResourcesPlugin.getWorkspace().getRoot().getFile(record.getPath());
+								addDependsOn(tldfile);
+							}
+								break;
+							case (ITaglibRecord.JAR) : {
+								IJarRecord record = (IJarRecord) reference;
+								IFile[] foundFilesForLocation = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(record.getLocation());
+								for (int i = 0; i < foundFilesForLocation.length; i++) {
+									addDependsOn(foundFilesForLocation[i]);
+								}
+							}
+								break;
+							case (ITaglibRecord.TAGDIR) : {
+								ITagDirRecord record = (ITagDirRecord) reference;
+								IPath path = record.getPath();
+								IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(path, false);
+
+								try {
+									found.accept(new IResourceVisitor() {
+										public boolean visit(IResource resource) throws CoreException {
+											if (resource.getType() == IResource.FILE) {
+												addDependsOn(resource);
+											}
+											return true;
+										}
+									});
+								}
+								catch (CoreException e) {
+									Logger.logException(e);
+								}
+							}
+								break;
+							case (ITaglibRecord.URL) : {
+								IURLRecord record = (IURLRecord) reference;
+								String baseLocation = record.getBaseLocation();
+								if (baseLocation != null && baseLocation.indexOf("://") < 0) {
+									IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(baseLocation, false);
+									if (found != null) {
+										try {
+											found.accept(new IResourceVisitor() {
+												public boolean visit(IResource resource) throws CoreException {
+													if (resource.getType() == IResource.FILE) {
+														addDependsOn(resource);
+													}
+													return true;
+												}
+											});
+										}
+										catch (CoreException e) {
+											Logger.logException(e);
+										}
+									}
+									else {
+										IFile externalJar = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(baseLocation));
+										if (externalJar != null) {
+											addDependsOn(externalJar);
+										}
+									}
+								}
+							}
+								break;
+						}
+					}
+					if (reference == null && fSeverityTaglibUnresolvableURI != ValidationMessage.IGNORE) {
 						// URI specified but does not resolve
-						String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_1, uri);
+						String msgText = null;
+						// provide better messages for typical "http:*" URIs
+						if (uri.startsWith("http:") && DeploymentDescriptorPropertyCache.getInstance().getJSPVersion(file.getFullPath()) < 1.2) { //$NON-NLS-1$
+							if (FacetModuleCoreSupport.isDynamicWebProject(file.getProject())) {
+								msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_9, uri);
+							}
+							else {
+								msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_10, uri);
+							}
+						}
+						else {
+							msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_1, uri);
+						}
 						LocalizedMessage message = new LocalizedMessage(fSeverityTaglibUnresolvableURI, msgText, file);
 						int start = documentRegion.getStartOffset(uriValueRegion);
 						int length = uriValueRegion.getTextLength();
 						int lineNo = sDoc.getLineOfOffset(start);
-						message.setLineNo(lineNo);
+						message.setLineNo(lineNo + 1);
 						message.setOffset(start);
 						message.setLength(length);
 
-						message.setAttribute("PROBLEM_ID", new Integer(611));
+						message.setAttribute("PROBLEM_ID", new Integer(611)); //$NON-NLS-1$
 
 						reporter.addMessage(fMessageOriginator, message);
 					}
@@ -364,7 +485,7 @@
 					int start = documentRegion.getStartOffset(uriValueRegion);
 					int length = uriValueRegion.getTextLength();
 					int lineNo = sDoc.getLineOfOffset(start);
-					message.setLineNo(lineNo);
+					message.setLineNo(lineNo + 1);
 					message.setOffset(start);
 					message.setLength(length);
 
@@ -385,7 +506,7 @@
 					int start = documentRegion.getStartOffset(tagdirValueRegion);
 					int length = tagdirValueRegion.getTextLength();
 					int lineNo = sDoc.getLineOfOffset(start);
-					message.setLineNo(lineNo);
+					message.setLineNo(lineNo + 1);
 					message.setOffset(start);
 					message.setLength(length);
 
@@ -393,12 +514,12 @@
 				}
 				else if (TaglibIndex.resolve(file.getFullPath().toString(), tagdir, false) == null && fSeverityTagdirUnresolvableURI != ValidationMessage.IGNORE) {
 					// URI specified but does not resolve
-					String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_1, tagdir);
+					String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_11, tagdir);
 					LocalizedMessage message = new LocalizedMessage(fSeverityTaglibUnresolvableURI, msgText, file);
 					int start = documentRegion.getStartOffset(tagdirValueRegion);
 					int length = tagdirValueRegion.getTextLength();
 					int lineNo = sDoc.getLineOfOffset(start);
-					message.setLineNo(lineNo);
+					message.setLineNo(lineNo + 1);
 					message.setOffset(start);
 					message.setLength(length);
 
@@ -413,7 +534,7 @@
 			int start = documentRegion.getStartOffset();
 			int length = documentRegion.getTextLength();
 			int lineNo = sDoc.getLineOfOffset(start);
-			message.setLineNo(lineNo);
+			message.setLineNo(lineNo + 1);
 			message.setOffset(start);
 			message.setLength(length);
 
@@ -436,7 +557,7 @@
 				int start = documentRegion.getStartOffset(prefixValueRegion);
 				int length = prefixValueRegion.getTextLength();
 				int lineNo = sDoc.getLineOfOffset(start);
-				message.setLineNo(lineNo);
+				message.setLineNo(lineNo + 1);
 				message.setOffset(start);
 				message.setLength(length);
 
@@ -449,7 +570,7 @@
 				int start = documentRegion.getStartOffset(prefixValueRegion);
 				int length = prefixValueRegion.getTextLength();
 				int lineNo = sDoc.getLineOfOffset(start);
-				message.setLineNo(lineNo);
+				message.setLineNo(lineNo + 1);
 				message.setOffset(start);
 				message.setLength(length);
 
@@ -463,7 +584,7 @@
 			int start = documentRegion.getStartOffset();
 			int length = documentRegion.getTextLength();
 			int lineNo = sDoc.getLineOfOffset(start);
-			message.setLineNo(lineNo);
+			message.setLineNo(lineNo + 1);
 			message.setOffset(start);
 			message.setLength(length);
 
@@ -507,24 +628,26 @@
 					}
 				}
 
-				String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_2, prefixes[prefixNumber]); //$NON-NLS-2$ //$NON-NLS-1$
+				if (severity != ValidationMessage.IGNORE) {
+					String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_2, prefixes[prefixNumber]); //$NON-NLS-2$ //$NON-NLS-1$
 
-				// Report an error in all directives using this prefix
-				for (int regionNumber = 0; regionNumber < valueRegions.size(); regionNumber++) {
+					// Report an error in all directives using this prefix
+					for (int regionNumber = 0; regionNumber < valueRegions.size(); regionNumber++) {
 
-					ITextRegion valueRegion = (ITextRegion) valueRegions.get(regionNumber);
-					IStructuredDocumentRegion documentRegion = (IStructuredDocumentRegion) fPrefixValueRegionToDocumentRegionMap.get(valueRegion);
-					LocalizedMessage message = (file == null ? new LocalizedMessage(severity, msgText) : new LocalizedMessage(severity, msgText, file));
+						ITextRegion valueRegion = (ITextRegion) valueRegions.get(regionNumber);
+						IStructuredDocumentRegion documentRegion = (IStructuredDocumentRegion) fPrefixValueRegionToDocumentRegionMap.get(valueRegion);
+						LocalizedMessage message = (file == null ? new LocalizedMessage(severity, msgText) : new LocalizedMessage(severity, msgText, file));
 
-					// if there's a message, there was an error found
-					int start = documentRegion.getStartOffset(valueRegion);
-					int length = valueRegion.getTextLength();
-					int lineNo = document.getLineOfOffset(start);
-					message.setLineNo(lineNo);
-					message.setOffset(start);
-					message.setLength(length);
+						// if there's a message, there was an error found
+						int start = documentRegion.getStartOffset(valueRegion);
+						int length = valueRegion.getTextLength();
+						int lineNo = document.getLineOfOffset(start);
+						message.setLineNo(lineNo + 1);
+						message.setOffset(start);
+						message.setLength(length);
 
-					reporter.addMessage(fMessageOriginator, message);
+						reporter.addMessage(fMessageOriginator, message);
+					}
 				}
 			}
 		}
@@ -553,6 +676,14 @@
 		fPreferencesService = null;
 		fScopes = null;
 	}
+	
+	/**
+	 * True if container has nested regions, meaning container is probably too
+	 * complicated (like JSP expressions or EL) to validate with this validator.
+	 */
+	private boolean hasNestedRegion(ITextRegion container) {
+		return (container instanceof ITextRegionContainer && ((ITextRegionContainer) container).getRegions() != null);
+	}
 
 	/**
 	 * batch validation call
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPELValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPELValidator.java
index 8fb17de..cf84532 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPELValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPELValidator.java
@@ -46,7 +46,8 @@
 public class JSPELValidator extends JSPValidator {
 	private static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspvalidator")).booleanValue(); //$NON-NLS-1$		
 	private static final String PREFERENCE_NODE_QUALIFIER = JSPCorePlugin.getDefault().getBundle().getSymbolicName();
-
+	private static final int MAX_REGIONS = 1000;
+	
 	private IValidator fMessageOriginator;
 
 	public JSPELValidator() {
@@ -137,12 +138,55 @@
 				Iterator childRegions = parentRegion.getRegions().iterator();
 				while (childRegions.hasNext() && !reporter.isCancelled()) {
 					ITextRegion childRegion = (ITextRegion) childRegions.next();
-					if (childRegion.getType() == DOMJSPRegionContexts.JSP_EL_CONTENT)
-						validateXMLNode(parentRegion, childRegion, reporter, file);
+					/* [136795] Validate everything in the EL container, not just JSP_EL_CONTENT */
+					if (childRegion.getType() == DOMJSPRegionContexts.JSP_EL_OPEN)
+						validateELContent(parentRegion, childRegion, childRegions, reporter, file);
 				}
 			}
 		}
 	}
+	
+	protected void validateELContent(ITextRegionCollection container, ITextRegion elOpenRegion, Iterator elRegions, IReporter reporter, IFile file) {
+		int contentStart = elOpenRegion.getEnd();
+		int contentDocStart = container.getEndOffset(elOpenRegion);
+		int contentLength = container.getLength();
+		int regionCount = 0;
+		ITextRegion elRegion = null;
+		/* Find the EL closing region, otherwise the last region will be used to calculate the EL content text */
+		while (elRegions != null && elRegions.hasNext() && (regionCount++ < MAX_REGIONS)) {
+			elRegion = (ITextRegion) elRegions.next();
+			if (elRegion.getType() == DOMJSPRegionContexts.JSP_EL_CLOSE)
+				break;
+		}
+		
+		String elText = container.getFullText().substring(contentStart, (elRegion != null) ? elRegion.getStart() : (contentLength - 1));
+		JSPELParser elParser = JSPELParser.createParser(elText);
+		try {
+			elParser.Expression();
+		}
+		catch (ParseException e) {
+			int sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_EL_SYNTAX);
+			if (sev != ValidationMessage.IGNORE) {
+				Token curTok = e.currentToken;
+				int problemStartOffset = contentDocStart + curTok.beginColumn;
+				Message message = new LocalizedMessage(sev, JSPCoreMessages.JSPEL_Syntax);
+				message.setOffset(problemStartOffset);
+				message.setLength(curTok.endColumn - curTok.beginColumn + 1);
+				message.setTargetObject(file);
+				reporter.addMessage(fMessageOriginator, message);
+			}
+		}
+		catch (TokenMgrError te) {
+			int sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_EL_LEXER);
+			if (sev != ValidationMessage.IGNORE) {
+				Message message = new LocalizedMessage(IMessage.NORMAL_SEVERITY, JSPCoreMessages.JSPEL_Token);
+				message.setOffset(contentDocStart);
+				message.setLength(contentLength);
+				message.setTargetObject(file);
+				reporter.addMessage(fMessageOriginator, message);
+			}
+		}
+	}
 
 	protected void validateXMLNode(ITextRegionCollection container, ITextRegion region, IReporter reporter, IFile file) {
 		String elText = container.getText(region);
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPJavaValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPJavaValidator.java
index b01860f..d8ffbff 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPJavaValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPJavaValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,8 @@
 import java.util.List;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.ProjectScope;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.Platform;
@@ -51,9 +53,13 @@
 	private static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspvalidator")).booleanValue(); //$NON-NLS-1$
 	private IValidator fMessageOriginator;
 
-	private IPreferencesService fPreferencesService = null;
+	private IPreferencesService fPreferencesService = Platform.getPreferencesService();
 	private static final String PREFERENCE_NODE_QUALIFIER = JSPCorePlugin.getDefault().getBundle().getSymbolicName();
 	private IScopeContext[] fScopes = null;
+	
+	private static final boolean UPDATE_JAVA_TASKS = true;
+	private static final String JAVA_TASK_MARKER_TYPE = "org.eclipse.jdt.core.task"; //$NON-NLS-1$
+	private static final String[] DEPEND_ONs = new String[]{".classpath", ".project", ".settings/org.eclipse.jdt.core.prefs", ".settings/org.eclipse.jst.jsp.core.prefs", ".settings/org.eclipse.wst.common.project.facet.core.xml", ".settings/org.eclipse.wst.common.component"};
 
 	public JSPJavaValidator() {
 		this.fMessageOriginator = this;
@@ -159,33 +165,42 @@
 			sourceEnd = translation.getJspOffset(problem.getSourceEnd());
 			switch (problem.getID()) {
 				case IProblem.LocalVariableIsNeverUsed : {
-					sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED);
+					sev = getSourceSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED, sourceStart, sourceEnd);
 				}
 					break;
 				case IProblem.NullLocalVariableReference : {
-					sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE);
+					sev = getSourceSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE, sourceStart, sourceEnd);
 				}
 					break;
 				case IProblem.ArgumentIsNeverUsed : {
-					sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED);
+					sev = getSourceSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED, sourceStart, sourceEnd);
 				}
 					break;
 				case IProblem.PotentialNullLocalVariableReference : {
-					sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE);
+					sev = getSourceSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE, sourceStart, sourceEnd);
 				}
 					break;
 				case IProblem.UnusedImport : {
-					sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_UNUSED_IMPORT);
+					sev = getSourceSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_UNUSED_IMPORT, sourceStart, sourceEnd);
 				}
 					break;
+				case IProblem.UnusedPrivateField:
+				case IProblem.MissingSerialVersion : {
+					// JSP files don't get serialized...right?
+					sev = ValidationMessage.IGNORE;
+				}
+				break;
 
 				default : {
 					if (problem.isError()) {
 						sev = IMessage.HIGH_SEVERITY;
 					}
-					else {
+					else if (problem.isWarning()) {
 						sev = IMessage.NORMAL_SEVERITY;
 					}
+					else {
+						sev = IMessage.LOW_SEVERITY;
+					}
 				}
 					if (sev == ValidationMessage.IGNORE) {
 						return null;
@@ -244,6 +259,17 @@
 		return m;
 	}
 
+	/**
+	 * Provides the severity for the given message key only when it's within the source range of the JSP (i.e., not boilerplate code).
+	 * @param key the key to get the severity of
+	 * @param start start within the JSP source
+	 * @param end end wtihin the JSP source
+	 * @return The message severity for the key if it is part of the JSP's source. IGNORE if it's boilerplate code.
+	 */
+	private int getSourceSeverity(String key, int start, int end) {
+		return (start >= 0 && end >= 0 ) ? getMessageSeverity(key) : ValidationMessage.IGNORE;
+	}
+
 	int getMessageSeverity(String key) {
 		int sev = fPreferencesService.getInt(PREFERENCE_NODE_QUALIFIER, key, IMessage.NORMAL_SEVERITY, fScopes);
 		switch (sev) {
@@ -262,7 +288,6 @@
 	private void loadPreferences(IFile file) {
 		fScopes = new IScopeContext[]{new InstanceScope(), new DefaultScope()};
 
-		fPreferencesService = Platform.getPreferencesService();
 		if (file != null && file.isAccessible()) {
 			ProjectScope projectScope = new ProjectScope(file.getProject());
 			if (projectScope.getNode(PREFERENCE_NODE_QUALIFIER).getBoolean(JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS, false)) {
@@ -272,6 +297,9 @@
 	}
 
 	void performValidation(IFile f, IReporter reporter, IStructuredModel model) {
+		for (int i = 0; i < DEPEND_ONs.length; i++) {
+			addDependsOn(f.getProject().getFile(DEPEND_ONs[i]));	
+		}
 		if (model instanceof IDOMModel) {
 			IDOMModel domModel = (IDOMModel) model;
 			ModelHandlerForJSP.ensureTranslationAdapterFactory(domModel);
@@ -283,16 +311,65 @@
 			if (!reporter.isCancelled()) {
 				loadPreferences(f);
 
+				// only update task markers if the model is the same as what's on disk
+				boolean updateJavaTasks = UPDATE_JAVA_TASKS && !domModel.isDirty() && f != null && f.isAccessible();
+				if (updateJavaTasks) {
+					// remove old Java task markers
+					try {
+						IMarker[] foundMarkers = f.findMarkers(JAVA_TASK_MARKER_TYPE, true, IResource.DEPTH_ONE);
+						for (int i = 0; i < foundMarkers.length; i++) {
+							foundMarkers[i].delete();
+						}
+					}
+					catch (CoreException e) {
+						Logger.logException(e);
+					}
+				}
+
 				translation.setProblemCollectingActive(true);
 				translation.reconcileCompilationUnit();
 				List problems = translation.getProblems();
 				// add new messages
 				for (int i = 0; i < problems.size() && !reporter.isCancelled(); i++) {
 					IProblem problem = (IProblem) problems.get(i);
-					if (problem.getID() != IProblem.Task) {
-						IMessage m = createMessageFromProblem(problem, f, translation, domModel.getStructuredDocument());
-						if (m != null)
+					IMessage m = createMessageFromProblem(problem, f, translation, domModel.getStructuredDocument());
+					if (m != null) {
+						if (problem.getID() == IProblem.Task) {
+							if (updateJavaTasks) {
+								// add new Java task marker
+								try {
+									IMarker task = f.createMarker(JAVA_TASK_MARKER_TYPE);
+									task.setAttribute(IMarker.LINE_NUMBER, new Integer(m.getLineNumber()));
+									task.setAttribute(IMarker.CHAR_START, new Integer(m.getOffset()));
+									task.setAttribute(IMarker.CHAR_END, new Integer(m.getOffset() + m.getLength()));
+									task.setAttribute(IMarker.MESSAGE, m.getText());
+									task.setAttribute(IMarker.USER_EDITABLE, Boolean.FALSE);
+
+									switch (m.getSeverity()) {
+										case IMessage.HIGH_SEVERITY: {
+											task.setAttribute(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_HIGH));
+											task.setAttribute(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR));
+										}
+											break;
+										case IMessage.LOW_SEVERITY : {
+											task.setAttribute(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_LOW));
+											task.setAttribute(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_INFO));
+										}
+											break;
+										default : {
+											task.setAttribute(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_NORMAL));
+											task.setAttribute(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_WARNING));
+										}
+									}
+								}
+								catch (CoreException e) {
+									Logger.logException(e);
+								}
+							}
+						}
+						else {
 							reporter.addMessage(fMessageOriginator, m);
+						}
 					}
 				}
 			}
@@ -301,7 +378,6 @@
 	}
 
 	private void unloadPreferences() {
-		fPreferencesService = null;
 		fScopes = null;
 	}
 
@@ -321,6 +397,9 @@
 			// get jsp model, get tranlsation
 			model = StructuredModelManager.getModelManager().getModelForRead(f);
 			if (!reporter.isCancelled() && model != null) {
+				for (int i = 0; i < DEPEND_ONs.length; i++) {
+					addDependsOn(f.getProject().getFile(DEPEND_ONs[i]));	
+				}
 				// get jsp model, get translation
 				if (model instanceof IDOMModel) {
 					reporter.removeAllMessages(fMessageOriginator, f);
@@ -339,4 +418,17 @@
 				model.releaseFromRead();
 		}
 	}
+
+	/**
+	 * Record that the currently validating resource depends on the given
+	 * file. Only possible during batch (not source) validation.
+	 * 
+	 * @param file
+	 */
+	private void addDependsOn(IFile file) {
+		if (fMessageOriginator instanceof JSPBatchValidator) {
+			((JSPBatchValidator) fMessageOriginator).addDependsOn(file);
+		}
+	}
+
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java
index 1ecbf45..a6b20c1 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java
@@ -37,8 +37,8 @@
 import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties;
 import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.validation.AbstractValidator;
 import org.eclipse.wst.validation.ValidationResult;
@@ -252,16 +252,16 @@
 
 	/**
 	 * 
-	 * @param sdr
+	 * @param collection
 	 * @return the jsp directive name
 	 */
-	protected String getDirectiveName(IStructuredDocumentRegion sdr) {
+	protected String getDirectiveName(ITextRegionCollection collection) {
 		String name = ""; //$NON-NLS-1$
-		ITextRegionList subRegions = sdr.getRegions();
+		ITextRegionList subRegions = collection.getRegions();
 		for (int j = 0; j < subRegions.size(); j++) {
 			ITextRegion subRegion = subRegions.get(j);
 			if (subRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
-				name = sdr.getText(subRegion);
+				name = collection.getText(subRegion);
 				break;
 			}
 		}
@@ -275,7 +275,7 @@
 	 * @return the ITextRegion for the attribute value of the given attribute
 	 *         name, case sensitive, null if no matching attribute is found
 	 */
-	protected ITextRegion getAttributeValueRegion(IStructuredDocumentRegion sdr, String attrName) {
+	protected ITextRegion getAttributeValueRegion(ITextRegionCollection sdr, String attrName) {
 		ITextRegion valueRegion = null;
 		ITextRegionList subRegions = sdr.getRegions();
 		for (int i = 0; i < subRegions.size(); i++) {
@@ -294,7 +294,7 @@
 		return valueRegion;
 	}
 
-	protected String getAttributeValue(IStructuredDocumentRegion sdr, String attrName) {
+	protected String getAttributeValue(ITextRegionCollection sdr, String attrName) {
 		ITextRegion r = getAttributeValueRegion(sdr, attrName);
 		if (r != null)
 			return sdr.getText(r).trim();
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/TLDValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/TLDValidator.java
new file mode 100644
index 0000000..ae70a60
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/TLDValidator.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jst.jsp.core.internal.validation;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IPreferencesService;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jst.jsp.core.internal.Assert;
+import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
+import org.eclipse.jst.jsp.core.internal.Logger;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP11TLDNames;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP12TLDNames;
+import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
+import org.eclipse.wst.validation.AbstractValidator;
+import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
+import org.eclipse.wst.validation.ValidatorMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * A miniature validator for .tld files. Checks for valid class names.
+ */
+public class TLDValidator extends AbstractValidator {
+	private static final String MARKER_TYPE = "org.eclipse.jst.jsp.core.validationMarker"; //$NON-NLS-1$
+	private static final String PREFERENCE_NODE_QUALIFIER = JSPCorePlugin.getDefault().getBundle().getSymbolicName();
+
+	private IPreferencesService fPreferencesService = Platform.getPreferencesService();
+
+	private static final String[] classElementNames = new String[]{JSP11TLDNames.TAGCLASS, JSP12TLDNames.TAG_CLASS, JSP11TLDNames.TEICLASS, JSP12TLDNames.TEI_CLASS, JSP12TLDNames.VALIDATOR_CLASS, JSP12TLDNames.VARIABLE_CLASS, JSP12TLDNames.LISTENER_CLASS};
+	private static final String[] missingClassMessages = new String[]{JSPCoreMessages.TaglibHelper_3, JSPCoreMessages.TaglibHelper_3, JSPCoreMessages.TaglibHelper_0, JSPCoreMessages.TaglibHelper_0, JSPCoreMessages.TLDValidator_MissingValidator, JSPCoreMessages.TLDValidator_MissingVariable, JSPCoreMessages.TLDValidator_MissingListener};
+	private static final String[] missingClassSeverityPreferenceKeys = new String[]{JSPCorePreferenceNames.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND};
+
+	public TLDValidator() {
+		super();
+
+		Assert.isTrue(classElementNames.length == missingClassMessages.length, "mismanaged arrays"); //$NON-NLS-1$
+		Assert.isTrue(classElementNames.length == missingClassSeverityPreferenceKeys.length, "mismanaged arrays"); //$NON-NLS-1$
+		Assert.isTrue(missingClassMessages.length == missingClassSeverityPreferenceKeys.length, "mismanaged arrays"); //$NON-NLS-1$
+	}
+
+	private Map checkClass(IJavaProject javaProject, Node classSpecifier, IScopeContext[] preferenceScopes, String preferenceKey, String errorMessage) {
+		String className = getTextContents(classSpecifier);
+		if (className != null && className.length() > 2) {
+			IType type = null;
+			try {
+				type = javaProject.findType(className);
+			}
+			catch (JavaModelException e) {
+				return null;
+			}
+
+			if (type == null || !type.exists()) {
+				Object severity = getMessageSeverity(preferenceScopes, preferenceKey);
+				if (severity == null)
+					return null;
+
+				IDOMNode classElement = (IDOMNode) classSpecifier;
+				Map markerValues = new HashMap();
+				markerValues.put(IMarker.SEVERITY, severity);
+				int start = classElement.getStartOffset();
+				if (classElement.getStartStructuredDocumentRegion() != null && classElement.getEndStructuredDocumentRegion() != null)
+					start = classElement.getStartStructuredDocumentRegion().getEndOffset();
+				markerValues.put(IMarker.CHAR_START, new Integer(start));
+				int end = classElement.getEndOffset();
+				if (classElement.getStartStructuredDocumentRegion() != null && classElement.getEndStructuredDocumentRegion() != null)
+					end = classElement.getEndStructuredDocumentRegion().getStartOffset();
+				markerValues.put(IMarker.CHAR_END, new Integer(end));
+				int line = classElement.getStructuredDocument().getLineOfOffset(start);
+				markerValues.put(IMarker.LINE_NUMBER, new Integer(line + 1));
+				markerValues.put(IMarker.MESSAGE, NLS.bind(errorMessage, (errorMessage.indexOf("{1}") >= 0) ? new String[]{getTagName(classSpecifier), className} : new String[]{className})); //$NON-NLS-1$
+				return markerValues;
+			}
+		}
+		return null;
+	}
+
+	private Map[] detectProblems(IJavaProject javaProject, IFile tld, IScopeContext[] preferenceScopes) throws CoreException {
+		List problems = new ArrayList();
+
+		IStructuredModel m = null;
+		try {
+			m = StructuredModelManager.getModelManager().getModelForRead(tld);
+			if (m != null && m instanceof IDOMModel) {
+				IDOMDocument document = ((IDOMModel) m).getDocument();
+
+				for (int i = 0; i < classElementNames.length; i++) {
+					NodeList classes = document.getElementsByTagName(classElementNames[i]);
+					for (int j = 0; j < classes.getLength(); j++) {
+						Map problem = checkClass(javaProject, classes.item(j), preferenceScopes, missingClassSeverityPreferenceKeys[i], missingClassMessages[i]);
+						if (problem != null)
+							problems.add(problem);
+					}
+				}
+
+			}
+		}
+		catch (IOException e) {
+			Logger.logException(e);
+		}
+		finally {
+			if (m != null)
+				m.releaseFromRead();
+		}
+
+		return (Map[]) problems.toArray(new Map[problems.size()]);
+	}
+
+	Integer getMessageSeverity(IScopeContext[] preferenceScopes, String key) {
+		int sev = fPreferencesService.getInt(PREFERENCE_NODE_QUALIFIER, key, IMessage.NORMAL_SEVERITY, preferenceScopes);
+		switch (sev) {
+			case ValidationMessage.ERROR :
+				return new Integer(IMarker.SEVERITY_ERROR);
+			case ValidationMessage.WARNING :
+				return new Integer(IMarker.SEVERITY_WARNING);
+			case ValidationMessage.INFORMATION :
+				return new Integer(IMarker.SEVERITY_INFO);
+			case ValidationMessage.IGNORE :
+				return null;
+		}
+		return new Integer(IMarker.SEVERITY_WARNING);
+	}
+
+	private String getTagName(Node classSpecifier) {
+		Node tagElement = classSpecifier.getParentNode();
+		Node child = tagElement.getFirstChild();
+		while (child != null) {
+			if (child.getNodeType() == Node.ELEMENT_NODE) {
+				String name = child.getNodeName();
+				if (JSP11TLDNames.NAME.equals(name))
+					return getTextContents(child);
+			}
+			child = child.getNextSibling();
+		}
+		return "";
+	}
+
+	private String getTextContents(Node parent) {
+		NodeList children = parent.getChildNodes();
+		if (children.getLength() == 1) {
+			return children.item(0).getNodeValue().trim();
+		}
+		StringBuffer s = new StringBuffer();
+		Node child = parent.getFirstChild();
+		while (child != null) {
+			s.append(child.getNodeValue().trim());
+			child = child.getNextSibling();
+		}
+		return s.toString().trim();
+	}
+
+	public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
+		if (resource.getType() != IResource.FILE)
+			return null;
+		ValidationResult result = new ValidationResult();
+
+		IFile tld = (IFile) resource;
+		if (tld.isAccessible()) {
+			try {
+				final IJavaProject javaProject = JavaCore.create(tld.getProject());
+				if (javaProject.exists()) {
+					IScopeContext[] scopes = new IScopeContext[]{new InstanceScope(), new DefaultScope()};
+					ProjectScope projectScope = new ProjectScope(tld.getProject());
+					if (projectScope.getNode(PREFERENCE_NODE_QUALIFIER).getBoolean(JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS, false)) {
+						scopes = new IScopeContext[]{projectScope, new InstanceScope(), new DefaultScope()};
+					}
+					Map[] problems = detectProblems(javaProject, tld, scopes);
+					for (int i = 0; i < problems.length; i++) {
+						ValidatorMessage message = ValidatorMessage.create(problems[i].get(IMarker.MESSAGE).toString(), resource);
+						message.setType(MARKER_TYPE);
+						message.setAttributes(problems[i]);
+						result.add(message);
+					}
+				}
+			}
+			catch (Exception e) {
+				Logger.logException(e);
+			}
+		}
+
+		return result;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/ELProblem.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/ELProblem.java
index cb548c0..ef95d18 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/ELProblem.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/ELProblem.java
@@ -13,22 +13,78 @@
 package org.eclipse.jst.jsp.core.jspel;
 
 import org.eclipse.jface.text.Position;
+import org.eclipse.jst.jsp.core.internal.java.IJSPProblem;
 
-public class ELProblem {
+/**
+ * All ELProblems are currently assumed to be errors.
+ */
+public class ELProblem implements IJSPProblem {
 	private Position fPos;
 	private String fMessage;
-	
+	private int fId = IJSPProblem.ELProblem;
+
+	/**
+	 * @param pos should be relative to the JSP document the error is to be reported on
+	 * @param message
+	 */
 	public ELProblem(Position pos, String message)	{
 		fPos = pos;
 		fMessage = message;
 	}
+
+	public ELProblem(Position pos, String message, int id)	{
+		fPos = pos;
+		fMessage = message;
+		fId = id;
+	}
 	
 	public String getMessage() {
 		return fMessage;
 	}
 	
-
 	public Position getPosition() {
 		return fPos;
 	}
+
+	public String[] getArguments() {
+		return null;
+	}
+
+	public int getID() {
+		return fId;
+	}
+	
+	public int getEID() {
+		return fId;
+	}
+
+	public char[] getOriginatingFileName() {
+		return null;
+	}
+
+	public int getSourceEnd() {
+		return fPos.getOffset() + fPos.getLength();
+	}
+
+	public int getSourceLineNumber() {
+		return 0;
+	}
+
+	public int getSourceStart() {
+		return fPos.getOffset();
+	}
+
+	public boolean isError() {
+		return true;
+	}
+
+	public boolean isWarning() {
+		return false;
+	}
+
+	public void setSourceEnd(int sourceEnd) {}
+
+	public void setSourceLineNumber(int lineNumber) {}
+
+	public void setSourceStart(int sourceStart) {}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexDelta.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexDelta.java
index 14b3bb8..c1a611b 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexDelta.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexDelta.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,7 +16,7 @@
 /**
  * Describes changes to the known records within the TaglibIndex.
  * <p>
- * This interface is not intended to be implemented by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
  * </p>
  * 
  * @since 1.2
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexListener.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexListener.java
index b81027e..e4e404c 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexListener.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexListener.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,11 +13,6 @@
 
 /**
  * A listener for changes in the index's records.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * 
- * @since 1.2
  */
 public interface ITaglibIndexListener {
 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibRecordEvent.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibRecordEvent.java
index c1d17ca..b316511 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibRecordEvent.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibRecordEvent.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@
  * Describes changes to the known records within the TaglibIndex.
  * 
  * <p>
- * This interface is not intended to be implemented by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
  * </p>
  */
 public interface ITaglibRecordEvent {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
index 306829a..a7f8939 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -25,7 +25,6 @@
 import java.io.Writer;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.net.URLConnection;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Enumeration;
@@ -40,6 +39,7 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipException;
 import java.util.zip.ZipFile;
+import java.util.zip.ZipInputStream;
 
 import org.eclipse.core.filebuffers.FileBuffers;
 import org.eclipse.core.resources.IContainer;
@@ -55,8 +55,11 @@
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.ILock;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jdt.core.IClasspathContainer;
@@ -92,7 +95,73 @@
 import com.ibm.icu.text.Collator;
 import com.ibm.icu.util.StringTokenizer;
 
+/**
+ * Contains the tag library information for a single project.
+ * 
+ *  * <p>
+ * This class is neither intended to be instantiated nor accessed by clients.
+ * </p>
+ *
+ */
 class ProjectDescription {
+	class BuildPathJob extends Job {
+		public BuildPathJob() {
+			super("Updating Tag Library Index");
+			setSystem(true);
+			setUser(false);
+		}
+
+		protected IStatus run(IProgressMonitor monitor) {
+			try {
+				LOCK.acquire();
+
+				PackageFragmentRootDelta[] removes = (PackageFragmentRootDelta[]) fPackageFragmentRootsRemoved.values().toArray(new PackageFragmentRootDelta[fPackageFragmentRootsRemoved.size()]);
+				for (int i = 0; i < removes.length; i++) {
+					handleElementChanged(removes[i].elementPath, removes[i].deltaKind, removes[i].isExported);
+				}
+				fPackageFragmentRootsRemoved.clear();
+				if (monitor.isCanceled())
+					return Status.OK_STATUS;
+				
+				PackageFragmentRootDelta[] changes = (PackageFragmentRootDelta[]) fPackageFragmentRootsChanged.values().toArray(new PackageFragmentRootDelta[fPackageFragmentRootsChanged.size()]);
+				for (int i = 0; i < changes.length; i++) {
+					handleElementChanged(changes[i].elementPath, changes[i].deltaKind, changes[i].isExported);
+				}
+				fPackageFragmentRootsChanged.clear();
+				if (monitor.isCanceled())
+					return Status.OK_STATUS;
+				
+				PackageFragmentRootDelta[] adds = (PackageFragmentRootDelta[]) fPackageFragmentRootsAdded.values().toArray(new PackageFragmentRootDelta[fPackageFragmentRootsAdded.size()]);
+				for (int i = 0; i < adds.length; i++) {
+					handleElementChanged(adds[i].elementPath, adds[i].deltaKind, adds[i].isExported);
+				}
+				fPackageFragmentRootsAdded.clear();
+			}
+			finally {
+				LOCK.release();
+			}
+			TaglibIndex.getInstance().fireCurrentDelta(BuildPathJob.this);
+			return Status.OK_STATUS;
+		}
+	}
+	
+	class PackageFragmentRootDelta {
+		PackageFragmentRootDelta(IPath path, int kind, boolean exported) {
+			super();
+			elementPath = path;
+			deltaKind = kind;
+			isExported = exported;
+		}
+
+		/*
+			IJavaElementDelta.F_ADDED_TO_CLASSPATH
+			IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED
+			IJavaElementDelta.F_REMOVED_FROM_CLASSPATH
+		*/ 
+		int deltaKind;
+		IPath elementPath;
+		boolean isExported;
+	}
 
 	class DeltaVisitor implements IResourceDeltaVisitor {
 		public boolean visit(IResourceDelta delta) throws CoreException {
@@ -327,7 +396,7 @@
 		}
 
 		public String toString() {
-			return "TaglibInfo|" + shortName + "|" + tlibVersion + "|" + smallIcon + "|" + largeIcon + "|" + jspVersion + "|" + uri + "|" + description; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+			return "TaglibInfo|" + uri + "|" + shortName + "|" + tlibVersion + "|" + smallIcon + "|" + largeIcon + "|" + jspVersion + "|" + description; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
 		}
 	}
 
@@ -515,7 +584,7 @@
 	private static final String BUILDPATH_DIRTY = "BUILDPATH_DIRTY"; //$NON-NLS-1$
 	private static final String BUILDPATH_ENTRIES = "BUILDPATH_ENTRIES"; //$NON-NLS-1$
 	private static final String BUILDPATH_PROJECT = "BUILDPATH_PROJECT"; //$NON-NLS-1$
-	private static final String SAVE_FORMAT_VERSION = "Tag Library Index 1.0.3"; //$NON-NLS-1$
+	private static final String SAVE_FORMAT_VERSION = "Tag Library Index 1.1.0"; //$NON-NLS-1$
 	private static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$
 	private static final IPath WEB_INF_PATH = new Path(WEB_INF);
 	private static final String WEB_XML = "web.xml"; //$NON-NLS-1$
@@ -572,12 +641,17 @@
 
 	IResourceDeltaVisitor fVisitor;
 	Hashtable fWebXMLReferences;
+	
+	private Map fPackageFragmentRootsAdded = new HashMap();
+	private Map fPackageFragmentRootsChanged = new HashMap();
+	private Map fPackageFragmentRootsRemoved = new HashMap();
 
 	ILock LOCK = Job.getJobManager().newLock();
 
 	private long time0;
 	
 	private TaglibSorter fTaglibSorter = new TaglibSorter();
+	private BuildPathJob fBuildPathJob = new BuildPathJob();
 
 	ProjectDescription(IProject project, String saveStateFile) {
 		super();
@@ -660,7 +734,7 @@
 					Iterator implicitRecords = rootReferences[j].values().iterator();
 					while (implicitRecords.hasNext()) {
 						ITaglibRecord record = (ITaglibRecord) implicitRecords.next();
-						if (record.getRecordType() == ITaglibRecord.TLD && ((ITLDRecord) record).getURI() != null) {
+						if (record.getRecordType() == ITaglibRecord.TLD && ((ITLDRecord) record).getURI() != null && ((ITLDRecord) record).getURI().length() > 0) {
 							references.put(((ITLDRecord) record).getURI(), record);
 						}
 					}
@@ -723,6 +797,7 @@
 			}
 			catch (MalformedURLException e) {
 				// not worth reporting
+				Logger.log(Logger.ERROR_DEBUG, null, e);
 			}
 			if (fileLocation != null) {
 				JarRecord jarRecord = createJARRecord(fileLocation);
@@ -746,6 +821,7 @@
 								contents.close();
 							}
 							catch (IOException e) {
+								Logger.log(Logger.ERROR_DEBUG, null, e);
 							}
 						}
 					}
@@ -761,42 +837,18 @@
 		// The rest are URLs into a plug-in...somewhere
 		else {
 			URL url = null;
-			ByteArrayInputStream cachedContents = null;
 			InputStream tldStream = null;
 			try {
 				url = new URL(urlString);
-				URLConnection connection = url.openConnection();
-				connection.setDefaultUseCaches(false);
-				tldStream = connection.getInputStream();
+				tldStream = JarUtilities.getInputStream(url);
 			}
 			catch (Exception e1) {
 				Logger.logException("Exception reading TLD contributed to the XML Catalog", e1);
 			}
 
 			if (tldStream != null) {
-				int c;
-				ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-				// array dim restriction?
-				byte bytes[] = new byte[2048];
-				try {
-					while ((c = tldStream.read(bytes)) >= 0) {
-						buffer.write(bytes, 0, c);
-					}
-					cachedContents = new ByteArrayInputStream(buffer.toByteArray());
-				}
-				catch (IOException ioe) {
-					// no cleanup can be done
-				}
-				finally {
-					try {
-						tldStream.close();
-					}
-					catch (IOException e) {
-					}
-				}
-
 				URLRecord urlRecord = null;
-				TaglibInfo info = extractInfo(urlString, cachedContents);
+				TaglibInfo info = extractInfo(urlString, tldStream);
 				if (info != null) {
 					/*
 					 * the record's reported URI should match the catalog
@@ -809,9 +861,10 @@
 					urlRecord.url = url; //$NON-NLS-1$ //$NON-NLS-2$
 				}
 				try {
-					cachedContents.close();
+					tldStream.close();
 				}
 				catch (IOException e) {
+					Logger.log(Logger.ERROR_DEBUG, null, e);
 				}
 				record = urlRecord;
 			}
@@ -839,7 +892,7 @@
 		JarRecord record = new JarRecord();
 		record.info = new TaglibInfo();
 		record.location = new Path(fileLocation);
-		record.urlRecords = new ArrayList(0);
+		record.urlRecords = new ArrayList();
 		return record;
 	}
 
@@ -904,7 +957,7 @@
 		InputStream contents = null;
 		try {
 			if (tld.isAccessible()) {
-				contents = ((IFile) tld).getContents(true);
+				contents = ((IFile) tld).getContents();
 				String basePath = tld.getFullPath().toString();
 				TaglibInfo info = extractInfo(basePath, contents);
 				if (info != null) {
@@ -913,7 +966,7 @@
 			}
 		}
 		catch (CoreException e) {
-			Logger.logException(e);
+			// out of sync
 		}
 		finally {
 			try {
@@ -923,40 +976,63 @@
 			}
 			catch (IOException e) {
 				// ignore
+				Logger.log(Logger.ERROR_DEBUG, null, e);
 			}
 		}
 		return record;
 	}
 
 	private void ensureUpTodate() {
-		try {
-			LOCK.acquire();
-
-			if (!fBuildPathIsDirty) {
+		IClasspathEntry[] entries = null;
+			try {
+				/*
+				 * If the Java nature isn't present (or something else is
+				 * wrong), don't check the build path.
+				 */
+				IJavaProject jproject = JavaCore.create(fProject);
+				if (jproject != null && jproject.exists()) {
+					entries = jproject.getResolvedClasspath(true);
+				}
+			}
+			catch (JavaModelException e) {
+				Logger.logException(e);
+			}
+		if (entries != null) {
+			try {
+				LOCK.acquire();
 				/*
 				 * Double-check that the number of build path entries has not
 				 * changed. This should cover most cases such as when a
 				 * library is added into or removed from a container.
 				 */
-				try {
-					IJavaProject jproject = JavaCore.create(fProject);
-					if (jproject != null && jproject.exists()) {
-						IClasspathEntry[] entries = jproject.getResolvedClasspath(true);
-						fBuildPathIsDirty = (fBuildPathEntryCount != entries.length);
+				fBuildPathIsDirty = fBuildPathIsDirty || (fBuildPathEntryCount != entries.length);
+
+				if (fBuildPathIsDirty) {
+					indexClasspath(entries);
+					fBuildPathIsDirty = false;
+				}
+				else {
+					PackageFragmentRootDelta[] removes = (PackageFragmentRootDelta[]) fPackageFragmentRootsRemoved.values().toArray(new PackageFragmentRootDelta[fPackageFragmentRootsRemoved.size()]);
+					for (int i = 0; i < removes.length; i++) {
+						handleElementChanged(removes[i].elementPath, removes[i].deltaKind, removes[i].isExported);
 					}
-				}
-				catch (JavaModelException e) {
-					Logger.logException(e);
+					PackageFragmentRootDelta[] changes = (PackageFragmentRootDelta[]) fPackageFragmentRootsChanged.values().toArray(new PackageFragmentRootDelta[fPackageFragmentRootsChanged.size()]);
+					for (int i = 0; i < changes.length; i++) {
+						handleElementChanged(changes[i].elementPath, changes[i].deltaKind, changes[i].isExported);
+					}
+					PackageFragmentRootDelta[] adds = (PackageFragmentRootDelta[]) fPackageFragmentRootsAdded.values().toArray(new PackageFragmentRootDelta[fPackageFragmentRootsAdded.size()]);
+					for (int i = 0; i < adds.length; i++) {
+						handleElementChanged(adds[i].elementPath, adds[i].deltaKind, adds[i].isExported);
+					}
+					fPackageFragmentRootsRemoved.clear();
+					fPackageFragmentRootsChanged.clear();
+					fPackageFragmentRootsAdded.clear();
 				}
 			}
-			if (fBuildPathIsDirty) {
-				indexClasspath();
-				fBuildPathIsDirty = false;
+			finally {
+				LOCK.release();
 			}
 		}
-		finally {
-			LOCK.release();
-		}
 	}
 
 	private TaglibInfo extractInfo(String basePath, InputStream tldContents) {
@@ -1013,7 +1089,7 @@
 			LOCK.acquire();
 
 			Collection implicitReferences = new HashSet(getImplicitReferences(path.toString()).values());
-			records = new ArrayList(fTLDReferences.size() + fTagDirReferences.size() + fJARReferences.size() + fWebXMLReferences.size());
+			records = new HashSet(fTLDReferences.size() + fTagDirReferences.size() + fJARReferences.size() + fWebXMLReferences.size());
 			records.addAll(fTLDReferences.values());
 			if (jspVersion >= 1.1) {
 				records.addAll(_getJSP11AndWebXMLJarReferences(fJARReferences.values()));
@@ -1027,10 +1103,19 @@
 				projectsProcessed.add(fProject);
 				addBuildPathReferences(buildPathReferences, projectsProcessed, false);
 				records.addAll(buildPathReferences.values());
+				
+				if(path.segmentCount() > 1) {
+					records.addAll(new HashSet(getImplicitReferences(fProject.getFullPath().toString()).values()));
+				}
 			}
 			if (jspVersion >= 2.0) {
 				records.addAll(fTagDirReferences.values());
 			}
+			
+			IPath localWebXML = new Path(getLocalRoot(path.toString())).append("/WEB-INF/web.xml"); //$NON-NLS-1$ 
+			WebXMLRecord webxmlRecord = (WebXMLRecord) fWebXMLReferences.get(localWebXML.toString());
+			if(webxmlRecord != null)
+				records.addAll(webxmlRecord.getTLDRecords());
 
 			records.addAll(getCatalogRecords());
 		}
@@ -1074,12 +1159,14 @@
 					}
 					catch (IOException ioe) {
 						// no cleanup can be done
+						Logger.log(Logger.ERROR_DEBUG, null, ioe);
 					}
 					finally {
 						try {
 							entryInputStream.close();
 						}
 						catch (IOException e) {
+							Logger.log(Logger.ERROR_DEBUG, null, e);
 						}
 					}
 				}
@@ -1242,6 +1329,16 @@
 		return fVisitor;
 	}
 
+	void handleElementChanged(IPath libraryPath, int deltaKind, boolean exported) {
+		IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(libraryPath);
+		String libraryLocation = null;
+		if (file.isAccessible() && file.getLocation() != null)
+			libraryLocation = file.getLocation().toString();
+		else
+			libraryLocation = libraryPath.toString();
+		updateClasspathLibrary(libraryLocation, deltaKind, exported);
+	}
+	
 	void handleElementChanged(IJavaElementDelta delta) {
 		if (fBuildPathIsDirty) {
 			return;
@@ -1249,6 +1346,12 @@
 
 		// Logger.log(Logger.INFO_DEBUG, "IJavaElementDelta: " + delta);
 		IJavaElement element = delta.getElement();
+		if (element.getElementType() == IJavaElement.JAVA_PROJECT) {
+			IJavaElementDelta[] affectedChildren = delta.getAffectedChildren();
+			for (int i = 0; i < affectedChildren.length; i++) {
+				handleElementChanged(affectedChildren[i]);
+			}
+		}
 		if (element.getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT && ((IPackageFragmentRoot) element).isArchive()) {
 			time0 = System.currentTimeMillis();
 			if (element.getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT && ((IPackageFragmentRoot) element).isExternal()) {
@@ -1256,7 +1359,16 @@
 			String libLocation = null;
 			int taglibRecordEventKind = -1;
 			if ((delta.getFlags() & IJavaElementDelta.F_ADDED_TO_CLASSPATH) > 0 || (delta.getFlags() & IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) > 0 || (delta.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) > 0) {
-				taglibRecordEventKind = ITaglibIndexDelta.ADDED;
+				taglibRecordEventKind = ITaglibIndexDelta.CHANGED;
+				if ((delta.getFlags() & IJavaElementDelta.F_ADDED_TO_CLASSPATH) > 0) {
+					taglibRecordEventKind = ITaglibIndexDelta.ADDED;
+				}
+				else if ((delta.getFlags() & IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) > 0) {
+					taglibRecordEventKind = ITaglibIndexDelta.CHANGED;
+				}
+				else if ((delta.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) > 0) {
+					taglibRecordEventKind = ITaglibIndexDelta.REMOVED;
+				}
 				IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(element.getPath());
 				if (file.isAccessible() && file.getLocation() != null)
 					libLocation = file.getLocation().toString();
@@ -1278,7 +1390,7 @@
 					}
 				}
 				catch (JavaModelException e) {
-					Logger.logException("Problem handling build path entry for " + element.getPath(), e); //$NON-NLS-1$
+					// IPackageFragmentRoot not part of the build path
 				}
 				if ((delta.getFlags() & IJavaElementDelta.F_ADDED_TO_CLASSPATH) > 0) {
 					fBuildPathEntryCount++;
@@ -1312,6 +1424,9 @@
 			Logger.log(Logger.INFO, "indexed " + fProject.getName() + " contents in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 	}
 
+	/**
+	 * @deprecated
+	 */
 	void indexClasspath() {
 		if (_debugIndexTime)
 			time0 = System.currentTimeMillis();
@@ -1337,6 +1452,22 @@
 			Logger.log(Logger.INFO, "indexed " + fProject.getName() + " classpath in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 	}
 
+	void indexClasspath(IClasspathEntry[] entries) {
+		if (_debugIndexTime)
+			time0 = System.currentTimeMillis();
+		fClasspathProjects.clear();
+		fClasspathReferences.clear();
+		fClasspathJars.clear();
+
+		fBuildPathEntryCount = entries.length;
+		for (int i = 0; i < entries.length; i++) {
+			indexClasspath(entries[i]);
+		}
+
+		if (_debugIndexTime)
+			Logger.log(Logger.INFO, "indexed " + fProject.getName() + " classpath in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+	}
+
 	/**
 	 * @param entry
 	 */
@@ -1366,9 +1497,21 @@
 						 * table that will e returned to
 						 * getAvailableTaglibRecords().
 						 */
-						IFile libFile = ResourcesPlugin.getWorkspace().getRoot().getFile(libPath);
-						if (libFile != null && libFile.exists()) {
-							updateClasspathLibrary(libFile.getLocation().toString(), ITaglibIndexDelta.ADDED, entry.isExported());
+						IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(libPath);
+						if (resource != null && resource.isAccessible()) {
+							if (resource.getType() == IResource.FILE) {
+								if (resource.getLocation() != null) {
+									updateClasspathLibrary(resource.getLocation().toString(), ITaglibIndexDelta.ADDED, entry.isExported());
+								}
+							}
+							else if (resource.getType() == IResource.FOLDER) {
+								try {
+									resource.accept(new Indexer(), 0);
+								}
+								catch (CoreException e) {
+									Logger.logException(e);
+								}
+							}
 						}
 					}
 				}
@@ -1385,7 +1528,19 @@
 				}
 			}
 				break;
-			case IClasspathEntry.CPE_SOURCE :
+			case IClasspathEntry.CPE_SOURCE : {
+				IPath path = entry.getPath();
+				try {
+					IResource sourceFolder = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
+					// could be a bad .classpath file
+					if(sourceFolder != null) {
+						sourceFolder.accept(new Indexer(), 0);
+					}
+				}
+				catch (CoreException e) {
+					Logger.logException(e);
+				}
+			}
 				break;
 			case IClasspathEntry.CPE_VARIABLE : {
 				IPath libPath = JavaCore.getResolvedVariablePath(entry.getPath());
@@ -1422,7 +1577,7 @@
 	 */
 
 	/**
-	 * @param javaProject
+	 * @deprecated
 	 */
 	private void indexClasspath(IJavaProject javaProject) {
 		if (javaProject == null)
@@ -1442,6 +1597,61 @@
 			}
 		}
 	}
+	
+	void queueElementChanged(IJavaElementDelta delta) {
+		try {
+			LOCK.acquire();
+			IJavaElement element = delta.getElement();
+			if (element.getElementType() == IJavaElement.JAVA_PROJECT) {
+				IJavaElementDelta[] affectedChildren = delta.getAffectedChildren();
+				for (int i = 0; i < affectedChildren.length; i++) {
+					queueElementChanged(affectedChildren[i]);
+				}
+			}
+			if (element.getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT && ((IPackageFragmentRoot) element).isArchive()) {
+				IPath path = element.getPath();
+				boolean fragmentisExported = true;
+				try {
+					IClasspathEntry rawClasspathEntry = ((IPackageFragmentRoot) element).getRawClasspathEntry();
+					/*
+					 * null may also be returned for deletions depending on
+					 * resource/build path notification order. If it's null,
+					 * it's been deleted and whether it's exported won't
+					 * really matter
+					 */
+					if (rawClasspathEntry != null) {
+						fragmentisExported = rawClasspathEntry.isExported();
+					}
+				}
+				catch (JavaModelException e) {
+					// IPackageFragmentRoot not part of the build path
+				}
+				String key = path.toString();
+				if ((delta.getFlags() & IJavaElementDelta.F_ADDED_TO_CLASSPATH) > 0) {
+					fPackageFragmentRootsAdded.put(key, new PackageFragmentRootDelta(path, ITaglibIndexDelta.ADDED, fragmentisExported));
+					fPackageFragmentRootsChanged.remove(key);
+					fPackageFragmentRootsRemoved.remove(key);
+					fBuildPathEntryCount++;
+				}
+				else if ((delta.getFlags() & IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) > 0) {
+					fPackageFragmentRootsChanged.put(key, new PackageFragmentRootDelta(path, ITaglibIndexDelta.CHANGED, fragmentisExported));
+				}
+				else if ((delta.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) > 0) {
+					fPackageFragmentRootsAdded.remove(key);
+					fPackageFragmentRootsChanged.remove(key);
+					fPackageFragmentRootsRemoved.put(key, new PackageFragmentRootDelta(path, ITaglibIndexDelta.REMOVED, fragmentisExported));
+					fBuildPathEntryCount--;
+				}
+			}
+		}
+		finally {
+			LOCK.release();
+		}
+
+		fBuildPathJob.cancel();
+		fBuildPathJob.schedule(2000);
+	}
+
 
 	private String readTextofChild(Node node, String childName) {
 		NodeList children = node.getChildNodes();
@@ -1514,6 +1724,15 @@
 			}
 		}
 	}
+	
+	private boolean requestedRefresh() {
+		boolean requested = false;
+		String[] commandLineArgs = Platform.getCommandLineArgs();
+		for (int i = 0; i < commandLineArgs.length; i++) {
+			requested = requested || "-refresh".equals(commandLineArgs[i]); //$NON-NLS-1$ 
+		}
+		return requested;
+	}
 
 	/**
 	 * @param basePath
@@ -1550,26 +1769,42 @@
 
 			LOCK.acquire();
 
+			String localRoot = getLocalRoot(basePath);
 			/**
 			 * Workaround for problem in URIHelper; uris starting with '/' are
 			 * returned as-is.
 			 */
 			if (path == null) {
 				if (reference.startsWith("/")) { //$NON-NLS-1$
-					path = getLocalRoot(basePath) + reference;
+					path = localRoot + reference;
 				}
 				else {
-					path = URIHelper.normalize(reference, basePath, getLocalRoot(basePath));
+					path = URIHelper.normalize(reference, basePath, localRoot);
 				}
 			}
 
-			// order dictated by JSP spec 2.0 section 7.2.3
-			record = (ITaglibRecord) fJARReferences.get(path);
-
-			// only if 1.1 TLD was found
-			if (jspVersion < 1.1 || (record instanceof JarRecord && !((JarRecord) record).has11TLD)) {
-				record = null;
+			IPath localWebXML = new Path(localRoot).append("/WEB-INF/web.xml"); //$NON-NLS-1$ 
+			WebXMLRecord webxmlRecord = (WebXMLRecord) fWebXMLReferences.get(localWebXML.toString());
+			if (webxmlRecord != null) {
+				for (int i = 0; i < webxmlRecord.tldRecords.size(); i++) {
+					ITaglibRecord record2 = (ITaglibRecord) webxmlRecord.tldRecords.get(i);
+					ITaglibDescriptor descriptor = record2.getDescriptor();
+					if (reference.equals(descriptor.getURI())) {
+						record = record2;
+					}
+				}
 			}
+
+			if (record == null) {
+				// order dictated by JSP spec 2.0 section 7.2.3
+				record = (ITaglibRecord) fJARReferences.get(path);
+
+				// only if 1.1 TLD was found
+				if (jspVersion < 1.1 || (record instanceof JarRecord && !((JarRecord) record).has11TLD)) {
+					record = null;
+				}
+			}
+			
 			if (record == null) {
 				record = (ITaglibRecord) fTLDReferences.get(path);
 			}
@@ -1597,7 +1832,7 @@
 				addBuildPathReferences(buildPathReferences, projectsProcessed, false);
 				record = (ITaglibRecord) buildPathReferences.get(reference);
 			}
-
+			
 			// Check the XML Catalog
 			if (record == null) {
 				ICatalog catalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
@@ -1623,12 +1858,12 @@
 					}
 				}
 			}
-
+			
 			/*
 			 * If no records were found and no local-root applies, check ALL
 			 * of the web.xml files as a fallback
 			 */
-			if (record == null && fProject.getFullPath().toString().equals(getLocalRoot(basePath))) {
+			if (record == null && fProject.getFullPath().toString().equals(localRoot)) {
 				WebXMLRecord[] webxmls = (WebXMLRecord[]) fWebXMLReferences.values().toArray(new WebXMLRecord[0]);
 				for (int i = 0; i < webxmls.length; i++) {
 					if (record != null)
@@ -1641,6 +1876,18 @@
 					}
 				}
 			}
+			/*
+			 * If no records were found, check the implicit references on the project itself as a fallback
+			 */
+			if (record == null && jspVersion >= 1.2) {
+				Object[] records = (Object[]) getImplicitReferences(fProject.getFullPath().toString()).get(reference);
+				if (records != null && records.length > 0) {
+					if (records.length > 1)
+						records = fTaglibSorter.sort(records);
+					record =  (ITaglibRecord) records[records.length - 1];
+				}
+			}
+
 		}
 		finally {
 			LOCK.release();
@@ -1662,7 +1909,7 @@
 			// ================ test reload time ========================
 			boolean restored = false;
 			File savedState = new File(fSaveStateFilename);
-			if (savedState.exists()) {
+			if (savedState.exists() && !requestedRefresh()) {
 				Reader reader = null;
 				try {
 					time0 = System.currentTimeMillis();
@@ -1741,6 +1988,7 @@
 													contents.close();
 												}
 												catch (IOException e) {
+													Logger.log(Logger.ERROR_DEBUG, null, e);
 												}
 											}
 										}
@@ -1748,8 +1996,7 @@
 										fClasspathJars.put(libraryLocation, libraryRecord);
 									}
 									else if ("URL".equalsIgnoreCase(tokenType) && libraryRecord != null) { //$NON-NLS-1$
-										// relies on a previously declared JAR
-										// record
+										// relies on a previously declared JAR record
 										boolean exported = Boolean.valueOf(toker.nextToken()).booleanValue();
 										// make the rest the URL
 										String urlString = toker.nextToken();
@@ -1759,53 +2006,27 @@
 										urlString = urlString.trim();
 										// Append a URLrecord
 										URLRecord urlRecord = new URLRecord();
-										urlRecord.url = new URL(urlString); //$NON-NLS-1$ //$NON-NLS-2$
+										urlRecord.url = new URL(urlString);
 										urlRecord.isExported = exported;
 										urlRecord.baseLocation = libraryRecord.location.toString();
-										libraryRecord.urlRecords.add(urlRecord);
 
-										ByteArrayInputStream cachedContents = null;
-										InputStream tldStream = null;
-										try {
-											URLConnection connection = urlRecord.url.openConnection();
-											connection.setDefaultUseCaches(false);
-											tldStream = connection.getInputStream();
-										}
-										catch (IOException e1) {
-											Logger.logException(e1);
-										}
-
-										int c;
-										ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
-										// array dim restriction?
-										byte bytes[] = new byte[2048];
-										try {
-											while ((c = tldStream.read(bytes)) >= 0) {
-												byteArrayOutput.write(bytes, 0, c);
+										InputStream tldStream = JarUtilities.getInputStream(urlRecord.url);
+										if(tldStream != null) {
+											libraryRecord.urlRecords.add(urlRecord);
+											TaglibInfo info = extractInfo(urlRecord.url.toString(), tldStream);
+											if (info != null) {
+												urlRecord.info = info;
 											}
-											cachedContents = new ByteArrayInputStream(byteArrayOutput.toByteArray());
-										}
-										catch (IOException ioe) {
-											// no cleanup can be done
-										}
-										finally {
 											try {
 												tldStream.close();
 											}
 											catch (IOException e) {
+												Logger.log(Logger.ERROR_DEBUG, null, e);
+											}
+											if (urlRecord.getURI() != null && urlRecord.getURI().length() > 0) {
+												fClasspathReferences.put(urlRecord.getURI(), urlRecord);
 											}
 										}
-
-										TaglibInfo info = extractInfo(urlRecord.url.toString(), cachedContents);
-										if (info != null) {
-											urlRecord.info = info;
-										}
-										try {
-											cachedContents.close();
-										}
-										catch (IOException e) {
-										}
-										fClasspathReferences.put(urlRecord.getURI(), urlRecord);
 									}
 									else if (BUILDPATH_PROJECT.equalsIgnoreCase(tokenType)) {
 										String projectName = toker.nextToken();
@@ -1832,7 +2053,7 @@
 							restored = true;
 						}
 						else {
-							Logger.log(Logger.INFO, "Tag Library Index: different cache format found, was \"" + lineText + "\", supports \"" + SAVE_FORMAT_VERSION + "\", reindexing build path"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+							Logger.log(Logger.INFO_DEBUG, "Tag Library Index: different cache format found, was \"" + lineText + "\", supports \"" + SAVE_FORMAT_VERSION + "\", reindexing build path"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 						}
 					}
 					if (_debugIndexTime)
@@ -1849,6 +2070,7 @@
 							reader.close();
 						}
 						catch (IOException e) {
+							Logger.log(Logger.ERROR_DEBUG, null, e);
 						}
 					}
 				}
@@ -1874,7 +2096,7 @@
 
 		/**
 		 * <pre>
-		 *                     		 1.0.1
+		 *                     		 1.1.0
 		 *                     		 Save classpath information (| is field delimiter)
 		 *                     		 Jars are saved as &quot;JAR:&quot;+ has11TLD + jar path 
 		 *                     		 URLRecords as &quot;URL:&quot;+URL
@@ -1920,6 +2142,7 @@
 			}
 		}
 		catch (IOException e) {
+			Logger.log(Logger.ERROR_DEBUG, null, e);
 		}
 		finally {
 			try {
@@ -1928,6 +2151,7 @@
 				}
 			}
 			catch (Exception e) {
+				Logger.log(Logger.ERROR_DEBUG, null, e);
 			}
 		}
 
@@ -1956,6 +2180,7 @@
 			}
 		}
 		if (deltaKind == ITaglibIndexDelta.ADDED || deltaKind == ITaglibIndexDelta.CHANGED) {
+			// XXX: runs on folders as well?!
 			libraryRecord = createJARRecord(libraryLocation);
 			libraryRecord.isExported = isExported;
 			fClasspathJars.put(libraryLocation, libraryRecord);
@@ -1983,8 +2208,14 @@
 										urlRecord.isExported = isExported;
 										urlRecord.url = new URL("jar:file:" + libraryLocation + "!/" + z.getName()); //$NON-NLS-1$ //$NON-NLS-2$
 										libraryRecord.urlRecords.add(urlRecord);
-										TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, urlRecord, deltaKind));
+										int urlDeltaKind = ITaglibIndexDelta.ADDED;
+										if (fClasspathReferences.containsKey(urlRecord.getURI())) {
+											// TODO: not minimized enough
+											urlDeltaKind = ITaglibIndexDelta.CHANGED;
+										}
 										fClasspathReferences.put(urlRecord.getURI(), urlRecord);
+										TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, urlRecord, urlDeltaKind));
+										fClasspathReferences.put(info.uri, urlRecord);
 										if (_debugIndexCreation)
 											Logger.log(Logger.INFO, "created record for " + urlRecord.getURI() + "@" + urlRecord.getURL()); //$NON-NLS-1$ //$NON-NLS-2$
 									}
@@ -1997,6 +2228,7 @@
 									contents.close();
 								}
 								catch (IOException e) {
+									Logger.log(Logger.ERROR_DEBUG, null, e);
 								}
 							}
 						}
@@ -2027,51 +2259,60 @@
 			jarLocationString = jar.getLocation().toString();
 		else
 			jarLocationString = jar.getLocationURI().toString();
-		String[] entries = JarUtilities.getEntryNames(jar);
 		JarRecord jarRecord = createJARRecord(jar);
 		fJARReferences.put(jar.getFullPath().toString(), jarRecord);
-		for (int i = 0; i < entries.length; i++) {
-			if (entries[i].endsWith(".tld")) { //$NON-NLS-1$
-				if (entries[i].equals(JarUtilities.JSP11_TAGLIB)) {
-					jarRecord.has11TLD = true;
-				}
-				InputStream contents = JarUtilities.getInputStream(jar, entries[i]);
-				if (contents != null) {
-					TaglibInfo info = extractInfo(jarLocationString, contents);
-
-					if (info != null && info.uri != null && info.uri.length() > 0) {
-						URLRecord record = new URLRecord();
-						record.info = info;
-						record.baseLocation = jarLocationString;
-						try {
-							record.url = new URL("jar:file:" + jarLocationString + "!/" + entries[i]); //$NON-NLS-1$ //$NON-NLS-2$
-							jarRecord.urlRecords.add(record);
-
-							int taglibDeltaKind = ITaglibIndexDelta.ADDED;
-							Hashtable table = getImplicitReferences(jar.getFullPath().toString());
-							if (table != null && table.get(record.getURI()) != null) {
-								taglibDeltaKind = ITaglibIndexDelta.CHANGED;
+		ZipInputStream zip = getZipInputStream(jar);
+		if(zip != null) {
+			try {
+				ZipEntry entry;
+				while ((entry = zip.getNextEntry()) != null) {
+					if (entry.getName().endsWith(".tld")) { //$NON-NLS-1$
+						if (entry.getName().equals(JarUtilities.JSP11_TAGLIB)) {
+							jarRecord.has11TLD = true;
+						}
+						InputStream contents = copyZipEntry(zip);
+						if (contents != null) {
+							TaglibInfo info = extractInfo(jarLocationString, contents);
+		
+							if (info != null && info.uri != null && info.uri.length() > 0) {
+								URLRecord record = new URLRecord();
+								record.info = info;
+								record.baseLocation = jarLocationString;
+								try {
+									record.url = new URL("jar:file:" + jarLocationString + "!/" + entry.getName()); //$NON-NLS-1$ //$NON-NLS-2$
+									jarRecord.urlRecords.add(record);
+		
+									int taglibDeltaKind = ITaglibIndexDelta.ADDED;
+									Hashtable table = getImplicitReferences(jar.getFullPath().toString());
+									if (table != null && table.get(record.getURI()) != null) {
+										taglibDeltaKind = ITaglibIndexDelta.CHANGED;
+									}
+		
+									getImplicitReferences(jar.getFullPath().toString()).put(info.uri, record);
+									TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, record, taglibDeltaKind));
+									if (_debugIndexCreation)
+										Logger.log(Logger.INFO, "created record for " + record.getURI() + "@" + record.getURL()); //$NON-NLS-1$ //$NON-NLS-2$
+								}
+								catch (MalformedURLException e) {
+									// don't record this URI
+									Logger.logException(e);
+								}
 							}
-
-							getImplicitReferences(jar.getFullPath().toString()).put(record.getURI(), record);
-							TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, record, taglibDeltaKind));
-							if (_debugIndexCreation)
-								Logger.log(Logger.INFO, "created record for " + record.getURI() + "@" + record.getURL()); //$NON-NLS-1$ //$NON-NLS-2$
+							try {
+								contents.close();
+							}
+							catch (IOException e) {
+								Logger.log(Logger.ERROR_DEBUG, null, e);
+							}
 						}
-						catch (MalformedURLException e) {
-							// don't record this URI
-							Logger.logException(e);
+						else {
+							Logger.log(Logger.ERROR_DEBUG, getClass().getName() + "could not read resource " + jar.getFullPath()); //$NON-NLS-1$
 						}
 					}
-					try {
-						contents.close();
-					}
-					catch (IOException e) {
-					}
 				}
-				else {
-					Logger.log(Logger.ERROR_DEBUG, getClass().getName() + "could not read resource " + jar.getFullPath()); //$NON-NLS-1$
-				}
+			} catch (IOException e) { }
+			finally {
+				closeInputStream(zip);
 			}
 		}
 		if (jarRecord.has11TLD) {
@@ -2079,6 +2320,58 @@
 		}
 	}
 
+	private InputStream copyZipEntry(ZipInputStream stream) {
+		ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+		InputStream copy = null;
+
+		if (stream != null) {
+			int c;
+			// array dim restriction?
+			byte bytes[] = new byte[2048];
+			try {
+				while ((c = stream.read(bytes)) >= 0) {
+					buffer.write(bytes, 0, c);
+				}
+				copy = new ByteArrayInputStream(buffer.toByteArray());
+				closeZipEntry(stream);
+			}
+			catch (IOException ioe) {
+				// no cleanup can be done
+			}
+		}
+		return copy;
+	}
+
+	private ZipInputStream getZipInputStream(IResource jar) {
+		if (jar == null || jar.getType() != IResource.FILE || !jar.isAccessible())
+			return null;
+
+		try {
+			InputStream zipStream = ((IFile) jar).getContents();
+			return new ZipInputStream(zipStream);
+		} catch (CoreException e) { }
+		return null;
+	}
+
+	private void closeInputStream(InputStream stream) {
+		if (stream != null) {
+			try {
+				stream.close();
+			} catch (IOException e) { }
+		}
+			
+	}
+
+	private void closeZipEntry(ZipInputStream zis) {
+		if (zis != null) {
+			try {
+				zis.closeEntry();
+			} catch (IOException e) {
+				System.out.println("Error");
+			}
+		}
+			
+	}
 
 	void updateTag(IResource resource, int kind) {
 		TagDirRecord record = (TagDirRecord) fTagDirReferences.get(resource.getParent().getFullPath().toString());
@@ -2121,12 +2414,17 @@
 		}
 	}
 
+	/**
+	 * 
+	 * @param tld
+	 * @param deltaKind
+	 */
 	void updateTLD(IResource tld, int deltaKind) {
 		if (_debugIndexCreation)
 			Logger.log(Logger.INFO, "creating record for " + tld.getFullPath()); //$NON-NLS-1$
 		TLDRecord record = createTLDRecord(tld);
 		fTLDReferences.put(tld.getFullPath().toString(), record);
-		if (record.getURI() != null) {
+		if (record.getURI() != null && record.getURI().length() > 0) {
 			getImplicitReferences(tld.getFullPath().toString()).put(record.getURI(), record);
 		}
 		TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, record, deltaKind));
@@ -2138,7 +2436,7 @@
 		InputStream webxmlContents = null;
 		Document document = null;
 		try {
-			webxmlContents = ((IFile) webxml).getContents(true);
+			webxmlContents = ((IFile) webxml).getContents(false);
 			DocumentProvider provider = new DocumentProvider();
 			provider.setInputStream(webxmlContents);
 			provider.setValidating(false);
@@ -2156,6 +2454,7 @@
 				}
 				catch (IOException e1) {
 					// ignore
+					Logger.log(Logger.ERROR_DEBUG, null, e1);
 				}
 		}
 		if (document == null)
@@ -2169,7 +2468,7 @@
 		NodeList taglibs = document.getElementsByTagName(JSP12TLDNames.TAGLIB);
 		for (int iTaglib = 0; iTaglib < taglibs.getLength(); iTaglib++) {
 			String taglibUri = readTextofChild(taglibs.item(iTaglib), "taglib-uri").trim(); //$NON-NLS-1$
-			// specified location is relative to root of the webapp
+			// specified location is relative to root of the web-app
 			String taglibLocation = readTextofChild(taglibs.item(iTaglib), "taglib-location").trim(); //$NON-NLS-1$
 			IPath path = null;
 			if (taglibLocation.startsWith("/")) { //$NON-NLS-1$
@@ -2202,6 +2501,7 @@
 											contents.close();
 										}
 										catch (IOException e) {
+											Logger.log(Logger.ERROR_DEBUG, null, e);
 										}
 									}
 								}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java
index 4836346..02930ea 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,8 +15,8 @@
 import java.lang.ref.Reference;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.zip.CRC32;
@@ -46,7 +46,9 @@
 import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
 import org.eclipse.jst.jsp.core.internal.Logger;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.wst.sse.core.internal.util.AbstractMemoryListener;
 import org.osgi.framework.Bundle;
+import org.osgi.service.event.Event;
 
 /**
  * A non-extendable index manager for taglibs similar to the previous J2EE
@@ -97,7 +99,7 @@
 			else if (element.getElementType() == IJavaElement.JAVA_PROJECT) {
 				if ((delta.getFlags() & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0) {
 					IJavaElement proj = element;
-					handleClasspathChange((IJavaProject) proj, forceUpdate);
+					handleClasspathChange((IJavaProject) proj, delta, forceUpdate);
 				}
 				else {
 					IJavaElementDelta[] deltas = delta.getAffectedChildren();
@@ -116,7 +118,7 @@
 								// removing the index file ensures that we
 								// don't get stale data if the project is
 								// reopened
-								removeIndex(proj.getProject());
+								removeIndexFile(proj.getProject());
 							}
 						}
 					}
@@ -158,7 +160,7 @@
 			}
 		}
 
-		private void handleClasspathChange(IJavaProject project, boolean forceUpdate) {
+		private void handleClasspathChange(IJavaProject project, IJavaElementDelta delta, boolean forceUpdate) {
 			if (frameworkIsShuttingDown())
 				return;
 
@@ -179,7 +181,7 @@
 					}
 					if (description != null && !frameworkIsShuttingDown()) {
 						projectsIndexed.add(resource);
-						description.setBuildPathIsDirty();
+						description.queueElementChanged(delta);
 					}
 				}
 			}
@@ -289,8 +291,6 @@
 									}
 								}
 								for (int i = 0; i < projects.length; i++) {
-									if (deltas[i].getKind() == IResourceDelta.CHANGED && (deltas[i].getFlags() == IResourceDelta.ENCODING || deltas[i].getFlags() == IResourceDelta.MARKERS))
-										continue;
 									try {
 										if (deltas[i] != null && deltas[i].getKind() != IResourceDelta.REMOVED && projects[i].isAccessible()) {
 											ProjectDescription description = getDescription(projects[i]);
@@ -331,6 +331,79 @@
 		}
 	}
 
+	/**
+	 * An implementation of {@link Map} that has a limit to the number
+	 * of {@link Map.Entry}s it can store.  If the limit is reached then the
+	 * oldest {@link Map.Entry}s are automatically removed.
+	 */
+	private class LimitedHashMap extends LinkedHashMap {
+		/**
+		 * Default
+		 */
+		private static final long serialVersionUID = 1L;
+
+		/**
+		 * the maximum number of {@link Map.Entry}s this map can store
+		 */
+		private int fLimit;
+
+		LimitedHashMap(int limit) {
+			super(limit, .75f, true);
+			fLimit = limit;
+		}
+
+		/**
+		 * If the size of this map has increased passed the limit then return
+		 * <code>true</code>, <code>false</code> otherwise.
+		 * 
+		 * @see java.util.LinkedHashMap#removeEldestEntry(java.util.Map.Entry)
+		 */
+		protected boolean removeEldestEntry(Map.Entry eldest) {
+			boolean willRemove = this.size() > fLimit;
+			if (willRemove) {
+				// save its references to disk before it gets bumped
+				((ProjectDescription) eldest.getValue()).saveReferences();
+			}
+			return willRemove;
+		}
+	}
+
+	/**
+	 * <p>A {@link AbstractMemoryListener} that clears the {@link ProjectDescription} cache
+	 * whenever specific memory events are received.</p>
+	 * 
+	 * <p>Events:
+	 * <ul>
+	 * <li>{@link AbstractMemoryListener#SEV_SERIOUS}</li>
+	 * <li>{@link AbstractMemoryListener#SEV_CRITICAL}</li>
+	 * </ul>
+	 * </p>
+	 */
+	private class MemoryListener extends AbstractMemoryListener {
+		/**
+		 * <p>Constructor causes this listener to listen for specific memory events.</p>
+		 * <p>Events:
+		 * <ul>
+		 * <li>{@link AbstractMemoryListener#SEV_SERIOUS}</li>
+		 * <li>{@link AbstractMemoryListener#SEV_CRITICAL}</li>
+		 * </ul>
+		 * </p>
+		 */
+		MemoryListener() {
+			super(new String[] { SEV_SERIOUS, SEV_CRITICAL });
+		}
+		
+		/**
+		 * On any memory event we handle clear out the project descriptions
+		 * 
+		 * @see org.eclipse.jst.jsp.core.internal.util.AbstractMemoryListener#handleMemoryEvent(org.osgi.service.event.Event)
+		 */
+		protected void handleMemoryEvent(Event event) {
+			clearProjectDescriptions();
+		}
+		
+	}
+	
 	static final boolean _debugChangeListener = false;
 
 	static boolean _debugEvents = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/taglib/events")); //$NON-NLS-1$ //$NON-NLS-2$
@@ -349,7 +422,12 @@
 	private static final String DIRTY = "DIRTY";
 	static boolean ENABLED = false;
 
-	static ILock LOCK = Job.getJobManager().newLock();
+	/**
+	 * The minimum limitation on the number of project descriptions to keep cached.
+	 */
+	private static final int MINIMUM_LIMIT_FOR_PROJECT_DESCRIPTIONS_CACHE = 3;
+	
+	static final ILock LOCK = Job.getJobManager().newLock();
 
 	/**
 	 * NOT API.
@@ -413,6 +491,7 @@
 	 * Finds all of the visible ITaglibRecords for the given path in the
 	 * workspace. Taglib mappings from web.xml files are only visible to paths
 	 * within the web.xml's corresponding web content folder.
+	 * This method will almost certainly require a workspace lock to complete.
 	 * 
 	 * @param fullPath -
 	 *            a path within the workspace
@@ -476,16 +555,17 @@
 
 	/**
 	 * Finds a matching ITaglibRecord given the reference. Typically the
-	 * result will have to be cast to a subiinterface of ITaglibRecord.
+	 * result will have to be cast to a subinterface of ITaglibRecord. This
+	 * method will almost certainly require a workspace lock to complete.
 	 * 
-	 * @param basePath -
-	 *            the workspace-relative path for IResources, full filesystem
-	 *            path otherwise
-	 * @param reference -
-	 *            the URI to lookup, for example the uri value from a taglib
+	 * @param basePath
+	 *            - the workspace-relative path for IResources, full
+	 *            filesystem path otherwise
+	 * @param reference
+	 *            - the URI to lookup, for example the uri value from a taglib
 	 *            directive
-	 * @param crossProjects -
-	 *            whether to search across projects (currently ignored)
+	 * @param crossProjects
+	 *            - whether to search across projects (currently ignored)
 	 * 
 	 * @return a visible ITaglibRecord or null if the reference points to no
 	 *         known tag library descriptor
@@ -537,8 +617,8 @@
 	public static void shutdown() {
 		try {
 			LOCK.acquire();
-			if (_instance.isInitialized()) {
-				_instance.stop();
+			if (getInstance().isInitialized()) {
+				getInstance().stop();
 			}
 		}
 		finally {
@@ -573,6 +653,11 @@
 	private ResourceChangeListener fResourceChangeListener;
 
 	private ITaglibIndexListener[] fTaglibIndexListeners = null;
+	
+	/**
+	 * Used to keep the {@link ProjectDescription} cache clean when memory is low
+	 */
+	private MemoryListener fMemoryListener;
 
 	/** symbolic name for OSGI framework */
 	private final static String OSGI_FRAMEWORK_ID = "org.eclipse.osgi"; //$NON-NLS-1$
@@ -592,6 +677,7 @@
 			 * while we were waiting for the lock
 			 */
 			if (!isInitialized()) {
+				getWorkingLocation();
 				/*
 				 * Only consider a crash if a value exists and is DIRTY (not a
 				 * new workspace)
@@ -601,12 +687,16 @@
 					removeIndexes(false);
 				}
 
-				fProjectDescriptions = new Hashtable();
+				fProjectDescriptions = new LimitedHashMap(calculateCacheLimit());
 				fResourceChangeListener = new ResourceChangeListener();
 				fClasspathChangeListener = new ClasspathChangeListener();
+				fMemoryListener = new MemoryListener();
+
 				if (ENABLED) {
 					ResourcesPlugin.getWorkspace().addResourceChangeListener(fResourceChangeListener, IResourceChangeEvent.POST_CHANGE);
 					JavaCore.addElementChangedListener(fClasspathChangeListener);
+					//register the memory listener
+					fMemoryListener.connect();
 				}
 				setIntialized(true);
 			}
@@ -629,7 +719,7 @@
 	 * Based on org.eclipse.jdt.internal.core.search.indexing.IndexManager
 	 * 
 	 * @param containerPath
-	 * @return
+	 * @return the index file location for the given workspace path
 	 */
 	String computeIndexLocation(IPath containerPath) {
 		String fileName = computeIndexName(containerPath);
@@ -649,9 +739,12 @@
 
 	/**
 	 * @param project
-	 * @return
+	 * @return the ProjectDescription representing the given project
 	 */
 	ProjectDescription createDescription(IProject project) {
+		if (fProjectDescriptions == null)
+			return null;
+
 		ProjectDescription description = null;
 		try {
 			LOCK.acquire();
@@ -856,7 +949,7 @@
 	/**
 	 * Removes index file for the given project.
 	 */
-	private void removeIndex(IProject project) {
+	void removeIndexFile(IProject project) {
 		File indexFile = new File(computeIndexLocation(project.getFullPath()));
 		if (indexFile.exists()) {
 			indexFile.delete();
@@ -873,15 +966,7 @@
 	 *            indexes
 	 */
 	private void removeIndexes(boolean staleOnly) {
-		String osPath = getTaglibIndexStateLocation().toOSString();
-		File folder = new File(osPath);
-		if (!folder.isDirectory()) {
-			try {
-				folder.mkdir();
-			}
-			catch (SecurityException e) {
-			}
-		}
+		File folder = getWorkingLocation();
 
 		// remove any extraneous index files
 		IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
@@ -912,8 +997,12 @@
 
 	private void stop() {
 		if (isInitialized()) {
+			setIntialized(false);
+
 			ResourcesPlugin.getWorkspace().removeResourceChangeListener(fResourceChangeListener);
 			JavaCore.removeElementChangedListener(fClasspathChangeListener);
+			//unregister the memory listener
+			fMemoryListener.disconnect();
 
 			/*
 			 * Clearing the existing saved states helps prune dead data from
@@ -921,6 +1010,39 @@
 			 */
 			removeIndexes(true);
 
+			clearProjectDescriptions();
+
+			setState(CLEAN);
+			fProjectDescriptions = null;
+			fResourceChangeListener = null;
+			fClasspathChangeListener = null;
+			fMemoryListener = null;
+		}
+	}
+
+	/**
+	 * Get the working location for the taglib index
+	 * @return The File representing the taglib index's working location
+	 */
+	private File getWorkingLocation() {
+		File folder = new File(getTaglibIndexStateLocation().toOSString());
+		if (!folder.isDirectory()) {
+			try {
+				folder.mkdir();
+			}
+			catch (SecurityException e) {
+			}
+		}
+		return folder;
+	}
+
+	/**
+	 * Have all of the ProjectDescriptions write their information to disk and
+	 * then clear our map of them
+	 */
+	void clearProjectDescriptions() {
+		try {
+			LOCK.acquire();
 			Iterator i = fProjectDescriptions.values().iterator();
 			while (i.hasNext()) {
 				ProjectDescription description = (ProjectDescription) i.next();
@@ -928,12 +1050,8 @@
 			}
 
 			fProjectDescriptions.clear();
-
-			setState(CLEAN);
-			fProjectDescriptions = null;
-			fResourceChangeListener = null;
-			fClasspathChangeListener = null;
-			setIntialized(false);
+		} finally {
+			LOCK.release();
 		}
 	}
 
@@ -944,4 +1062,22 @@
 	private void setIntialized(boolean intialized) {
 		this.initialized = intialized;
 	}
+	
+	/**
+	 * <p>Calculate the maximum number of project descriptions to keep cached.</p>
+	 * <p>Calculated as:<br />
+	 * <code>MINIMUM_LIMIT_FOR_PROJECT_DESCRIPTIONS_CACHE + log(currentWorkspaceProjectCount)</code></p>
+	 * 
+	 * @return the maximum number of project descriptions to keep cached
+	 */
+	private int calculateCacheLimit() {
+		int limit = MINIMUM_LIMIT_FOR_PROJECT_DESCRIPTIONS_CACHE;
+		
+		int projectCount = ResourcesPlugin.getWorkspace().getRoot().getProjects().length;
+		if(projectCount > 0) {
+			limit += Math.log(projectCount);
+		}
+		
+		return limit;
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/.classpath b/bundles/org.eclipse.jst.jsp.ui/.classpath
new file mode 100644
index 0000000..176e21d
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/.classpath
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible"
+				pattern="org/eclipse/wst/sse/core/**" />
+			<accessrule kind="accessible"
+				pattern="org/eclipse/wst/xml/core/**" />
+			<accessrule kind="accessible"
+				pattern="org/eclipse/wst/css/core/**" />
+			<accessrule kind="accessible"
+				pattern="org/eclipse/wst/html/core/**" />
+			<accessrule kind="accessible"
+				pattern="org/eclipse/wst/sse/ui/**" />
+			<accessrule kind="accessible"
+				pattern="org/eclipse/wst/xml/ui/**" />
+			<accessrule kind="accessible"
+				pattern="org/eclipse/wst/css/ui/**" />
+			<accessrule kind="accessible"
+				pattern="org/eclipse/wst/html/ui/**" />				
+			<accessrule kind="accessible"
+				pattern="org/eclipse/wst/javascript/ui/**" />	
+			<accessrule kind="accessible"
+				pattern="org/eclipse/wst/validation/**" />
+			<accessrule kind="accessible"
+				pattern="org/eclipse/wst/common/componentcore/internal/util/IModuleConstants" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="output" path="bin" />
+</classpath>
diff --git a/bundles/org.eclipse.jst.jsp.ui/.cvsignore b/bundles/org.eclipse.jst.jsp.ui/.cvsignore
new file mode 100644
index 0000000..d00c268
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/.cvsignore
@@ -0,0 +1,8 @@
+bin
+jspeditor.jar
+temp.folder
+org.eclipse.jst.jsp.ui_6.0.0.jar
+build.xml
+@dot
+src.zip
+javaCompiler...args
diff --git a/bundles/org.eclipse.jst.jsp.ui/.options b/bundles/org.eclipse.jst.jsp.ui/.options
new file mode 100644
index 0000000..7174d60
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/.options
@@ -0,0 +1,2 @@
+org.eclipse.jst.jsp.ui/debug/jspcontentassist=false
+org.eclipse.jst.jsp.ui/projectionperf=false
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/.project b/bundles/org.eclipse.jst.jsp.ui/.project
new file mode 100644
index 0000000..2d42e46
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.jst.jsp.ui</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.core.resources.prefs
similarity index 100%
copy from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs
copy to bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.core.resources.prefs
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.core.runtime.prefs
similarity index 100%
copy from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.runtime.prefs
copy to bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.core.runtime.prefs
diff --git a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..fa697df
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,79 @@
+#Wed Mar 28 03:11:45 EDT 2007

+eclipse.preferences.version=1

+org.eclipse.jdt.core.builder.cleanOutputFolder=clean

+org.eclipse.jdt.core.builder.duplicateResourceTask=warning

+org.eclipse.jdt.core.builder.invalidClasspath=ignore

+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch

+org.eclipse.jdt.core.circularClasspath=error

+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled

+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled

+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled

+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2

+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve

+org.eclipse.jdt.core.compiler.compliance=1.4

+org.eclipse.jdt.core.compiler.debug.lineNumber=generate

+org.eclipse.jdt.core.compiler.debug.localVariable=generate

+org.eclipse.jdt.core.compiler.debug.sourceFile=generate

+org.eclipse.jdt.core.compiler.doc.comment.support=enabled

+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100

+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning

+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning

+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore

+org.eclipse.jdt.core.compiler.problem.deprecation=ignore

+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled

+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled

+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning

+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning

+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning

+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore

+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore

+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error

+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error

+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning

+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning

+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore

+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error

+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore

+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled

+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled

+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private

+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore

+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error

+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore

+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore

+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled

+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public

+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore

+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled

+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private

+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore

+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error

+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error

+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning

+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore

+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning

+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error

+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled

+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error

+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled

+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore

+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore

+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning

+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore

+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning

+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore

+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error

+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore

+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore

+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

+org.eclipse.jdt.core.compiler.problem.unusedImport=error

+org.eclipse.jdt.core.compiler.problem.unusedLabel=error

+org.eclipse.jdt.core.compiler.problem.unusedLocal=error

+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore

+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled

+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled

+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error

+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning

+org.eclipse.jdt.core.compiler.source=1.3

+org.eclipse.jdt.core.incompatibleJDKLevel=ignore

+org.eclipse.jdt.core.incompleteClasspath=error

diff --git a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..301c7ad
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,4 @@
+#Mon Apr 17 01:48:39 EDT 2006
+eclipse.preferences.version=1
+internal.default.compliance=default
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<templates/>
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
similarity index 100%
copy from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.ltk.core.refactoring.prefs
copy to bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
diff --git a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000..fc522bb
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,16 @@
+#Mon Apr 17 02:01:33 EDT 2006
+compilers.incompatible-environment=0
+compilers.p.build=0
+compilers.p.deprecated=1
+compilers.p.illegal-att-value=0
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=0
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.p.unused-element-or-attribute=0
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..aa7bc77
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,66 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.jst.jsp.ui; singleton:=true
+Bundle-Version: 1.1.501.qualifier
+Bundle-Activator: org.eclipse.jst.jsp.ui.internal.JSPUIPlugin
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Export-Package: org.eclipse.jst.jsp.css.ui.internal.properties;x-internal:=true,
+ org.eclipse.jst.jsp.css.ui.internal.registry;x-internal:=true,
+ org.eclipse.jst.jsp.css.ui.internal.views.properties;x-internal:=true,
+ org.eclipse.jst.jsp.ui,
+ org.eclipse.jst.jsp.ui.internal;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.autoedit;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.breakpointproviders;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.contentassist;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.contentproperties.ui;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.derived;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.editor;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.format;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.handlers;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.hyperlink;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.java.refactoring;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.java.search;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.java.search.ui;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.preferences;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.preferences.ui;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.registry;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.style;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.style.java;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.style.jspel;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.taginfo;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.templates;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.text;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.validation;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal.wizard;x-internal:=true,
+ org.eclipse.jst.jsp.ui.views.contentoutline
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8"
+Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0]",
+ org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.3.0)",
+ org.eclipse.wst.html.ui;bundle-version="[1.0.500,1.1.0)",
+ org.eclipse.wst.css.ui;bundle-version="[1.0.500,1.1.0)",
+ org.eclipse.wst.xml.ui;bundle-version="[1.1.100,1.2.0)",
+ org.eclipse.jst.jsp.core;bundle-version="[1.2.300,1.3.0)",
+ org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.css.core;bundle-version="[1.1.300,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.jdt.ui;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jdt.core;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.debug.core;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jdt.debug;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.search;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ltk.core.refactoring;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
+ org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.views;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.xml.core/about.html b/bundles/org.eclipse.jst.jsp.ui/about.html
similarity index 100%
copy from bundles/org.eclipse.wst.xml.core/about.html
copy to bundles/org.eclipse.jst.jsp.ui/about.html
diff --git a/bundles/org.eclipse.jst.jsp.ui/build.properties b/bundles/org.eclipse.jst.jsp.ui/build.properties
new file mode 100644
index 0000000..a5bbc9e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/build.properties
@@ -0,0 +1,21 @@
+###############################################################################
+# Copyright (c) 2004, 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/
+bin.includes = .,\
+               templates/,\
+               plugin.xml,\
+               META-INF/,\
+               icons/,\
+               plugin.properties,\
+               about.html
+bin.excludes = @dot/**,\
+               temp.folder/**
+additional.bundles = org.eclipse.jdt.core.manipulation
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/dtool16/newjsp_wiz.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/dtool16/newjsp_wiz.gif
new file mode 100644
index 0000000..5ff9b39
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/dtool16/newjsp_wiz.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/elcl16/javaassist_co.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/elcl16/javaassist_co.gif
new file mode 100644
index 0000000..e9a6bd9
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/elcl16/javaassist_co.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/etool16/newjsp_wiz.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/etool16/newjsp_wiz.gif
new file mode 100644
index 0000000..14944ac
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/etool16/newjsp_wiz.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/class_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/class_obj.gif
new file mode 100644
index 0000000..c00118d
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/class_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/default_co.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/default_co.gif
new file mode 100644
index 0000000..49a1461
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/default_co.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_default_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_default_obj.gif
new file mode 100644
index 0000000..6929d3d
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_default_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_private_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_private_obj.gif
new file mode 100644
index 0000000..1fe064e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_private_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_protected_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_protected_obj.gif
new file mode 100644
index 0000000..3377b1e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_protected_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_public_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_public_obj.gif
new file mode 100644
index 0000000..d4cb425
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_public_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_default_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_default_obj.gif
new file mode 100644
index 0000000..4244a7f
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_default_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_private_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_private_obj.gif
new file mode 100644
index 0000000..7392f19
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_private_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_protected_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_protected_obj.gif
new file mode 100644
index 0000000..5105577
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_protected_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_public_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_public_obj.gif
new file mode 100644
index 0000000..e4c2a83
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_public_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_default_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_default_obj.gif
new file mode 100644
index 0000000..ab1b576
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_default_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_private_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_private_obj.gif
new file mode 100644
index 0000000..a1cbff3
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_private_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_protected_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_protected_obj.gif
new file mode 100644
index 0000000..f58eef0
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_protected_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_public_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_public_obj.gif
new file mode 100644
index 0000000..2ebc46e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_public_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/localvariable_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/localvariable_obj.gif
new file mode 100644
index 0000000..8adce95
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/localvariable_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/package_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/package_obj.gif
new file mode 100644
index 0000000..131c28d
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/package_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/private_co.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/private_co.gif
new file mode 100644
index 0000000..5b881d8
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/private_co.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/protected_co.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/protected_co.gif
new file mode 100644
index 0000000..cd83b96
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/protected_co.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public.gif
new file mode 100644
index 0000000..7d24707
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public_co.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public_co.gif
new file mode 100644
index 0000000..a9af5d5
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public_co.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/sourceEditor.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/sourceEditor.gif
new file mode 100644
index 0000000..75ebdb8
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/sourceEditor.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-generic.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-generic.gif
new file mode 100644
index 0000000..65f516e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-generic.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-jsp.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-jsp.gif
new file mode 100644
index 0000000..4084602
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-jsp.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-template.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-template.gif
new file mode 100644
index 0000000..5d1f81b
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-template.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/wizban/newjspfile_wiz.png b/bundles/org.eclipse.jst.jsp.ui/icons/full/wizban/newjspfile_wiz.png
new file mode 100644
index 0000000..1a0ff0c
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/wizban/newjspfile_wiz.png
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspdecl.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspdecl.gif
new file mode 100644
index 0000000..35f48ef
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspdecl.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspexp.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspexp.gif
new file mode 100644
index 0000000..ab4d74b
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspexp.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspincl.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspincl.gif
new file mode 100644
index 0000000..2584c31
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspincl.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspscr.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspscr.gif
new file mode 100644
index 0000000..1753b96
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspscr.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jsptaglib.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jsptaglib.gif
new file mode 100644
index 0000000..cb55e33
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jsptaglib.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-generic.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-generic.gif
new file mode 100644
index 0000000..5e7fb33
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-generic.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-jsp.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-jsp.gif
new file mode 100644
index 0000000..ea4de33
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-jsp.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/plugin.properties b/bundles/org.eclipse.jst.jsp.ui/plugin.properties
new file mode 100644
index 0000000..35aa393
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/plugin.properties
@@ -0,0 +1,113 @@
+###############################################################################
+# Copyright (c) 2004, 2010 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+#     Matthias Fuessel, mat.fuessel@gmx.net - [177387] use base hyperlinking extension points
+###############################################################################
+providerName=Eclipse Web Tools Platform
+pluginName=SSE JSP Source Editor
+JSP_Source_Page_Editor.name=JSP Editor
+CSS_JSP_Source_Page_Editor.name=CSS JSP Editor
+JSP_Files.name=JSP Files
+JSP_Source.name=Editor
+JSP_Content_Assist.name=Content Assist
+JSP_Templates.name=Templates
+JSP_Styles.name=Styles
+JSP_Syntax_Coloring=Syntax Coloring
+JSP_Source_target_name=JSP Editors
+JSP_Validation=Validation
+JSP_Property_validation=JSP Syntax
+JSP_Typing=Typing
+
+# Snippets contributions for helping with JSP syntax
+jsp_scriptlet=<%..%> scriptlet
+jsp_scr_content=<%  %>
+jsp_hidden_comment=<%--..--%> comment
+jsp_hidden_comment_content=<%--  --%>
+jsp_declaration=<%!..%> declaration
+jsp_declaration_content=<%!  %>
+jsp_expression=<%=..%> expression
+jsp_expression_content=<%=  %>
+jsp_include_directive=include directive
+jsp_include_directive_content=<%@ include file="" %>
+jsp_page_directive=page directive
+jsp_page_directive_content=<%@ page contentType="text/html; charset=" %>
+jsp_taglib_directive=taglib directive
+jsp_taglib_directive_content=<%@ taglib uri="${uri}" prefix="${prefix}" %>
+jsp_taglib_directive_uri=URI to the containing JAR file or taglib descriptor (.tld)
+jsp_taglib_directive_prefix=Namespace prefix for tags from this library
+JSPFragmentContentSettings.name=JSP Fragment
+JSP_Property_tag_contentSettings=Tag Content
+command.jsp.refactor.rename.name=Rename
+command.jsp.refactor.rename.description=Rename a Java Element
+command.jsp.refactor.move.name=Move
+command.jsp.refactor.move.description=Move a Java Element to another package
+scope.structured.text.editor.jsp.name=Editing JSP Source
+scope.structured.text.editor.jsp.description=Editing JSP Source
+scope.jsp.core.jspsource.name=JSP Source
+scope.jsp.core.jspsource.description=JSP Source
+JSP_Type_Rename_Participant_Extension_Element.name=JSP Type Rename Participant
+JSP_Method_Rename_Participant_Extension_Element.name=JSP Method Rename Participant
+JSP_Package_Rename_Participant_Extension_Element.name=JSP Package Rename Participant
+JSP_Type_Move_Participant_Extension_Element.name=JSP Type Move Participant
+All_JSP_context_type_Extension_Element.name=All JSP
+JSP_New_context_type_Extension_Element.name=New JSP
+Tag_New_context_type_Extension_Element.name=New Tag
+JSP_Tag_context_type_Extension_Element.name=JSP Tag
+JSP_Attribute_context_type_Extension_Element.name=JSP Attribute
+JSP_Attribute_value_context_type_Extension_Element.name=JSP Attribute value
+JSP_Query_Participant_Extension_Element.name=JSP Query Participant
+JSP_Extension_Element.label=JSP
+#org.eclipse.ui.newWizards extension point
+_UI_WIZARD_NAME = JSP File
+_UI_WIZARD_CREATE_NEW_FILE = Create a new JSP file
+_UI_WIZARD_TAG_NAME = JSP Tag
+_UI_WIZARD_TAG_CREATE_NEW_FILE = Create a new JSP Tag file
+##
+AddTask.label=Add &Task...
+AddTask.tooltip=Add Task...
+AddBookmark.label=Add Boo&kmark...
+AddBookmark.tooltip=Add Bookmark...
+SelectRuler.label=Select Ruler
+## EL Error Message
+##
+CleanupDocument_label=Cleanup Document...
+CleanupDocument_tooltip=Cleanup Document
+ToggleComment_label=Toggle Comment
+ToggleComment_tooltip=Toggle Comment
+AddBlockComment_label=Add Block Comment
+AddBlockComment_tooltip=Add Block Comment
+RemoveBlockComment_label=Remove Block Comment
+RemoveBlockComment_tooltip=Remove Block Comment
+FindOccurrences_label=Occurrences in File
+RenameElement_label=Rename
+MoveElement_label=Move
+StructureSelectEnclosing_label=Enclosing Element
+StructureSelectEnclosing_tooltip=Expand selection to include enclosing element
+StructureSelectNext_label=Next Element
+StructureSelectNext_tooltip=Expand selection to include next sibling
+StructureSelectPrevious_label=Previous Element
+StructureSelectPrevious_tooltip=Expand selection to include previous sibling
+StructureSelectHistory_label=Restore Last Selection
+StructureSelectHistory_tooltip=Restore last selection
+##
+preferenceKeywords.files=editor jsp creating saving files suffix specified encoding iana validating validate fragments
+preferenceKeywords.contentassist=jsp editor content code assist complete completion insert overwrite single proposal common prefix automatically import fill argument name guess alphabetical hide auto activation trigger category categories separate specific
+preferenceKeywords.templates=editor jsp templates snippet macros
+preferenceKeywords.styles=editor jsp style customize syntax highlighting type text content foreground background bold color
+preferenceKeywords.fragments=editor jsp fragment language content type validate
+preferenceKeywords.severities=jsp errors warnings ignore options severity severities suppress project specific projectspecific
+
+##
+Java_Element_hyperlink=Java Element
+Taglib_hyperlink=Tag Library Descriptor
+
+##
+proposalCategory.jspTemplates=JSP Template Proposals
+proposalCategory.jsp=JSP Proposals
+proposalCategory.jspJava=JSP Java Proposals
diff --git a/bundles/org.eclipse.jst.jsp.ui/plugin.xml b/bundles/org.eclipse.jst.jsp.ui/plugin.xml
new file mode 100644
index 0000000..bb02d00
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/plugin.xml
@@ -0,0 +1,1300 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+	<extension point="org.eclipse.ui.editors">
+		<editor
+			name="%JSP_Source_Page_Editor.name"
+			icon="$nl$/icons//full/obj16/sourceEditor.gif"
+			extensions="jsp, jsf, jspf, jspx, tag, tagx, tagf"
+			contributorClass="org.eclipse.jst.jsp.ui.internal.editor.ActionContributorJSP"
+			class="org.eclipse.wst.sse.ui.StructuredTextEditor"
+			symbolicFontName="org.eclipse.wst.sse.ui.textfont"
+			id="org.eclipse.jst.jsp.core.jspsource.source">
+			<contentTypeBinding
+				contentTypeId="org.eclipse.jst.jsp.core.jspsource" />
+		</editor>
+		<editor
+			name="%CSS_JSP_Source_Page_Editor.name"
+			icon="$nl$/icons//full/obj16/sourceEditor.gif"
+			contributorClass="org.eclipse.jst.jsp.ui.internal.editor.ActionContributorJSP"
+			class="org.eclipse.wst.sse.ui.StructuredTextEditor"
+			symbolicFontName="org.eclipse.wst.sse.ui.textfont"
+			id="org.eclipse.jst.jsp.core.cssjspsource.source">
+			<contentTypeBinding
+				contentTypeId="org.eclipse.jst.jsp.core.cssjspsource" />
+			<contentTypeBinding
+				contentTypeId="org.eclipse.jst.jsp.core.cssjspfragmentsource" />
+		</editor>
+	</extension>
+
+	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
+		<sourceViewerConfiguration
+			class="org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP"
+			target="org.eclipse.jst.jsp.core.jspsource" />
+		<contentOutlineConfiguration
+			class="org.eclipse.jst.jsp.ui.views.contentoutline.JSPContentOutlineConfiguration"
+			target="org.eclipse.jst.jsp.core.jspsource" />
+		<quickOutlineConfiguration
+			class="org.eclipse.wst.xml.ui.internal.quickoutline.XMLQuickOutlineConfiguration"
+			target="org.eclipse.jst.jsp.core.jspsource" />
+		<propertySheetConfiguration
+			class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
+			target="org.eclipse.jst.jsp.core.jspsource" />
+  		<documentationTextHover
+        	class="org.eclipse.jst.jsp.ui.internal.taginfo.JSPTagInfoHoverProcessor"
+        	target="org.eclipse.jst.jsp.DEFAULT_JSP, org.eclipse.jst.jsp.JSP_DIRECTIVE">
+  		</documentationTextHover>
+  		<documentationTextHover
+        	class="org.eclipse.jst.jsp.ui.internal.taginfo.JSPJavaJavadocHoverProcessor"
+        	target="org.eclipse.jst.jsp.SCRIPT.JAVA">
+  		</documentationTextHover>
+		<provisionalConfiguration
+			type="sourceeditingtexttools"
+			class="org.eclipse.jst.jsp.ui.internal.editor.JSPSourceEditingTextTools"
+			target="org.eclipse.jst.jsp.core.jspsource" />
+		<provisionalConfiguration
+			type="characterpairmatcher"
+			class="org.eclipse.jst.jsp.ui.internal.text.JSPDocumentRegionEdgeMatcher"
+			target="org.eclipse.jst.jsp.core.jspsource" />
+		<provisionalConfiguration
+			type="foldingstrategy"
+			class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"
+			target="org.eclipse.jst.jsp.core.jspsource" />
+		<provisionalDefinition
+			type="preferencepages"
+			value="org.eclipse.jst.jsp.ui.preferences.jsp, org.eclipse.wst.sse.ui.preferences.jsp.source, org.eclipse.wst.sse.ui.preferences.jsp.templates, org.eclipse.wst.sse.ui.preferences.jsp.styles,,org.eclipse.jst.jsp.ui.preferences.validation, org.eclipse.wst.sse.ui.preferences.jsp.contentassist"
+			target="org.eclipse.jst.jsp.core.jspsource" />
+		<provisionalDefinition
+			type="showintarget"
+			value="org.eclipse.jdt.ui.PackageExplorer"
+			target="org.eclipse.jst.jsp.core.jspsource" />
+		<provisionalDefinition
+			type="spellingregions"
+			value="XML_COMMENT_TEXT, JSP_COMMENT_TEXT, XML_CONTENT, HTML_CONTENT"
+			target="org.eclipse.jst.jsp.core.jspsource" />
+		<provisionalDefinition
+			type="activecontexts"
+			value="org.eclipse.jst.jsp.core.jspsource, org.eclipse.jst.jsp.ui.structured.text.editor.jsp.scope, org.eclipse.wst.html.core.htmlsource, org.eclipse.core.runtime.xml, org.eclipse.wst.xml.navigation, org.eclipse.wst.xml.comments, org.eclipse.wst.xml.selection"
+        	target="org.eclipse.jst.jsp.core.jspsource" />
+
+		<contentOutlineConfiguration
+			class="org.eclipse.jst.jsp.ui.internal.views.contentoutline.TLDContentOutlineConfiguration"
+			target="org.eclipse.jst.jsp.core.tldsource" />
+		<documentationTextHover
+        	class="org.eclipse.jst.jsp.ui.internal.taginfo.XMLJavadocHoverProcessor"
+        	target="org.eclipse.wst.xml.XML_DEFAULT"/>
+	</extension>
+
+	<!--======================================================================================-->
+	<!-- source validation for JSP															  -->
+	<!--======================================================================================-->
+	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
+		<validator
+			scope="total"
+			class="org.eclipse.jst.jsp.core.internal.validation.JSPJavaValidator"
+			id="org.eclipse.jst.jsp.jspsourcevalidator">
+			<contentTypeIdentifier
+				id="org.eclipse.jst.jsp.core.jspsource">
+				<partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP">
+				</partitionType>
+				<partitionType id="org.eclipse.jst.jsp.SCRIPT.JAVA">
+				</partitionType>
+				<partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
+				</partitionType>
+			</contentTypeIdentifier>
+		</validator>
+	</extension>
+	<!--======================================================================================-->
+	<!-- source (as you type) validation for JSP EL					   						  -->
+	<!--======================================================================================-->
+	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
+		<validator
+			scope="total"
+			class="org.eclipse.jst.jsp.core.internal.validation.JSPELValidator"
+			id="org.eclipse.jst.jsp.jspelsourcevalidator">
+			<contentTypeIdentifier
+				id="org.eclipse.jst.jsp.core.jspsource">
+				<partitionType id="org.eclipse.jst.jsp.SCRIPT.JSP_EL">
+				</partitionType>
+			</contentTypeIdentifier>
+		</validator>
+	</extension>
+	<!--======================================================================================-->
+	<!-- source (as you type) validation for JSP directive			   						  -->
+	<!--======================================================================================-->
+	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
+		<validator
+			scope="total"
+			class="org.eclipse.jst.jsp.core.internal.validation.JSPDirectiveValidator"
+			id="org.eclipse.jst.jsp.tldsourcevalidator">
+			<contentTypeIdentifier
+				id="org.eclipse.jst.jsp.core.jspsource">
+				<partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP">
+				</partitionType>
+				<partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
+				</partitionType>
+			</contentTypeIdentifier>
+		</validator>
+	</extension>
+	<!--======================================================================================-->
+	<!-- source (as you type) validation for JSP action tags			   					  -->
+	<!--======================================================================================-->
+	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
+		<validator
+			scope="total"
+			class="org.eclipse.jst.jsp.ui.internal.validation.JSPActionSourceValidator"
+			id="org.eclipse.jst.jsp.ui.internal.validation.jspactionvalidator">
+			<contentTypeIdentifier
+				id="org.eclipse.jst.jsp.core.jspsource">
+				<partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP">
+				</partitionType>
+				<partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
+				</partitionType>
+			</contentTypeIdentifier>
+		</validator>
+	</extension>
+
+	<!--======================================================================================-->
+	<!-- HTML (as you type) validation					   						  			  -->
+	<!--======================================================================================-->
+	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
+		<validator
+			scope="total"
+			class="org.eclipse.jst.jsp.ui.internal.validation.JSPContentSourceValidator"
+			id="org.eclipse.jst.jsp.ui.internal.validation.htmlsyntaxvalidator">
+			<contentTypeIdentifier
+				id="org.eclipse.jst.jsp.core.jspsource">
+				<partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE"/>
+				<partitionType id="org.eclipse.jst.jsp.JSP_COMMENT"/>
+				<partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
+				<partitionType id="org.eclipse.wst.html.HTML_DECLARATION"/>
+				<partitionType id="org.eclipse.wst.html.HTML_COMMENT"/>
+				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
+				<partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
+			</contentTypeIdentifier>
+		</validator>
+	</extension>
+
+	<!--======================================================================================-->
+	<!-- JSP UI Adapter factories					   						  				  -->
+	<!--======================================================================================-->
+	<extension
+		point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
+		<adapterFactoryDescription
+			class="org.eclipse.jst.jsp.ui.internal.registry.AdapterFactoryProviderForJSP">
+			<contentType id="org.eclipse.jst.jsp.core.jspsource" />
+		</adapterFactoryDescription>
+	</extension>
+
+	<extension
+		point="org.eclipse.core.filebuffers.annotationModelCreation">
+		<factory
+			contentTypeId="org.eclipse.jst.jsp.core.jspsource"
+			class="org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModelFactory" />
+	</extension>
+
+	<extension point="org.eclipse.ui.preferencePages">
+
+		<!--======================================================================================-->
+		<!-- JSP PREFERENCE PAGES                                                                 -->
+		<!--======================================================================================-->
+		<page
+			name="%JSP_Files.name"
+			category="org.eclipse.wst.html.ui.preferences.web"
+			class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPFilesPreferencePage"
+			id="org.eclipse.jst.jsp.ui.preferences.jsp">
+			<keywordReference id="org.eclipse.jst.jsp.ui.files"/>
+		</page>
+		<page
+			name="%JSP_Source.name"
+			category="org.eclipse.jst.jsp.ui.preferences.jsp"
+			class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPSourcePreferencePage"
+			id="org.eclipse.wst.sse.ui.preferences.jsp.source">
+		</page>
+  <page
+        category="org.eclipse.wst.sse.ui.preferences.jsp.source"
+        class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPContentAssistPreferencePage"
+        id="org.eclipse.wst.sse.ui.preferences.jsp.contentassist"
+        name="%JSP_Content_Assist.name">
+     <keywordReference
+           id="org.eclipse.jst.jsp.ui.contentassist">
+     </keywordReference>
+  </page>
+		<page
+			name="%JSP_Templates.name"
+			category="org.eclipse.wst.sse.ui.preferences.jsp.source"
+			class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPTemplatePreferencePage"
+			id="org.eclipse.wst.sse.ui.preferences.jsp.templates">
+			<keywordReference id="org.eclipse.jst.jsp.ui.templates"/>
+		</page>
+		<page
+			name="%JSP_Syntax_Coloring"
+			category="org.eclipse.wst.sse.ui.preferences.jsp.source"
+			class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPSyntaxColoringPage"
+			id="org.eclipse.wst.sse.ui.preferences.jsp.styles">
+			<keywordReference id="org.eclipse.jst.jsp.ui.styles"/>
+		</page>
+		<page
+			name="%JSP_Validation"
+			category="org.eclipse.jst.jsp.ui.preferences.jsp"
+			class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPValidationPreferencePage"
+			id="org.eclipse.jst.jsp.ui.preferences.validation">
+			<keywordReference id="org.eclipse.jst.jsp.ui.severities"/>
+		</page>
+		<page
+			name="%JSP_Typing"
+			category="org.eclipse.wst.sse.ui.preferences.jsp.source"
+			class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPTypingPreferencePage"
+			id="org.eclipse.jst.jsp.ui.preferences.typing">
+		</page>
+	</extension>
+	
+	<!-- Keywords for preference and properties pages -->
+	<extension point="org.eclipse.ui.keywords">
+		<keyword
+			label="%preferenceKeywords.files"
+			id="org.eclipse.jst.jsp.ui.files"/>
+		<keyword
+			label="%preferenceKeywords.contentassist"
+			id="org.eclipse.jst.jsp.ui.contentassist"/>
+		<keyword
+			label="%preferenceKeywords.templates"
+			id="org.eclipse.jst.jsp.ui.templates"/>
+		<keyword
+			label="%preferenceKeywords.styles"
+			id="org.eclipse.jst.jsp.ui.styles"/>
+		<keyword
+			label="%preferenceKeywords.fragments"
+			id="org.eclipse.jst.jsp.ui.fragments"/>
+		<keyword
+			label="%preferenceKeywords.severities"
+			id="org.eclipse.jst.jsp.ui.severities"/>
+    </extension>
+
+	<!--======================================================================================-->
+	<!-- FOR JSP/JAVA RENAME PARTICIPATION                                                    -->
+	<!--======================================================================================-->
+	<extension
+		point="org.eclipse.ltk.core.refactoring.renameParticipants">
+		<renameParticipant
+			name="%JSP_Type_Rename_Participant_Extension_Element.name"
+			class="org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPTypeRenameParticipant"
+			id="org.eclipse.jst.jsp.ui.java.refactoring.JSPTypeRenameParticipant">
+			<enablement>
+				<with variable="affectedNatures">
+					<iterate operator="or">
+						<equals value="org.eclipse.jdt.core.javanature" />
+
+					</iterate>
+				</with>
+				<with variable="element">
+					<instanceof value="org.eclipse.jdt.core.IType" />
+
+				</with>
+			</enablement>
+		</renameParticipant>
+
+		<renameParticipant
+			name="%JSP_Method_Rename_Participant_Extension_Element.name"
+			class="org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPMethodRenameParticipant"
+			id="org.eclipse.jst.jsp.ui.java.refactoring.JSPMethodRenameParticipant">
+			<enablement>
+				<with variable="affectedNatures">
+					<iterate operator="or">
+						<equals value="org.eclipse.jdt.core.javanature" />
+
+					</iterate>
+				</with>
+				<with variable="element">
+					<instanceof value="org.eclipse.jdt.core.IMethod" />
+
+				</with>
+			</enablement>
+		</renameParticipant>
+
+		<renameParticipant
+			name="%JSP_Package_Rename_Participant_Extension_Element.name"
+			class="org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPPackageRenameParticipant"
+			id="org.eclipse.jst.jsp.ui.java.refactoring.JSPPackageRenameParticipant">
+			<enablement>
+				<with variable="affectedNatures">
+					<iterate operator="or">
+						<equals value="org.eclipse.jdt.core.javanature" />
+
+					</iterate>
+				</with>
+				<with variable="element">
+					<instanceof
+						value="org.eclipse.jdt.core.IPackageFragment" />
+
+				</with>
+			</enablement>
+		</renameParticipant>
+	</extension>
+
+	<!--======================================================================================-->
+	<!-- FOR JSP/JAVA MOVE PARTICIPATION                                                      -->
+	<!--======================================================================================-->
+	<extension
+		point="org.eclipse.ltk.core.refactoring.moveParticipants">
+
+		<moveParticipant
+			id="org.eclipse.jst.jsp.ui.java.refactoring.JSPTypeMoveParticipant"
+			name="%JSP_Type_Move_Participant_Extension_Element.name"
+			class="org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPTypeMoveParticipant">
+			<enablement>
+				<with variable="affectedNatures">
+					<iterate operator="or">
+						<equals value="org.eclipse.jdt.core.javanature" />
+					</iterate>
+				</with>
+				<with variable="element">
+					<instanceof value="org.eclipse.jdt.core.IType" />
+
+				</with>
+			</enablement>
+		</moveParticipant>
+	</extension>
+
+	<!--======================================================================================-->
+	<!-- for breakpoint                                                                       -->
+	<!--======================================================================================-->
+	<extension point="org.eclipse.wst.sse.ui.breakpoint">
+		<breakpointContribution id="org.eclipse.jst.jsp.ui.providers">
+			<provider
+				contentTypes="org.eclipse.jst.jsp.core.jspsource"
+				id="org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider">
+				<class class="org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider">
+					<parameter name="org.eclipse.jst.jsp.core.jspsource" value="*jsp,jsp_servlet._*"/>
+					<parameter name="org.eclipse.jst.jsp.core.tagsource" value="*tag,*tagx,tag._*,tagx._*"/>
+				</class>
+			</provider>
+		</breakpointContribution>
+	</extension>
+
+	<!--======================================================================================-->
+	<!-- Snippet View contributions                                                           -->
+	<!--======================================================================================-->
+	<extension
+		point="org.eclipse.wst.common.snippets.SnippetContributions">
+		<category
+			label="%JSP_Extension_Element.label"
+			smallicon="icons/snippets/tag-jsp.gif"
+			id="org.eclipse.jst.jsp.ui.category0"
+			contenttypes="org.eclipse.jst.jsp.core.jspsource">
+			<item
+				label="%jsp_hidden_comment"
+				smallicon="icons/snippets/tag-generic.gif"
+				id="org.eclipse.jst.jsp.ui.jsp_hidden_comment">
+				<content>%jsp_hidden_comment_content</content>
+			</item>
+			<item
+				label="%jsp_scriptlet"
+				smallicon="icons/snippets/jspscr.gif"
+				id="org.eclipse.jst.jsp.ui.jsp_scriptlet">
+				<content>%jsp_scr_content</content>
+			</item>
+			<item
+				label="%jsp_expression"
+				smallicon="icons/snippets/jspexp.gif"
+				id="org.eclipse.jst.jsp.ui.jsp_expression">
+				<content>%jsp_expression_content</content>
+			</item>
+			<item
+				label="%jsp_declaration"
+				smallicon="icons/snippets/jspdecl.gif"
+				id="org.eclipse.jst.jsp.ui.jsp_declaration">
+				<content>%jsp_declaration_content</content>
+			</item>
+			<item
+				label="%jsp_include_directive"
+				smallicon="icons/snippets/jspincl.gif"
+				id="org.eclipse.jst.jsp.ui.jsp_include_directive">
+				<content>%jsp_include_directive_content</content>
+			</item>
+			<item
+				label="%jsp_page_directive"
+				id="org.eclipse.jst.jsp.ui.jsp_page_directive">
+				<content>%jsp_page_directive_content</content>
+			</item>
+			<item
+				label="%jsp_taglib_directive"
+				smallicon="icons/snippets/jsptaglib.gif"
+				id="org.eclipse.jst.jsp.ui.jsp_taglib_directive">
+				<content>%jsp_taglib_directive_content</content>
+				<variable
+					description="%jsp_taglib_directive_uri"
+					id="uri" />
+
+				<variable
+					default="mylib"
+					description="%jsp_taglib_directive_prefix"
+					id="prefix" />
+
+			</item>
+		</category>
+	</extension>
+
+	<!-- Editor actionsets -->
+	<extension point="org.eclipse.ui.actionSetPartAssociations">
+		<actionSetPartAssociation
+			targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
+			<part id="org.eclipse.jst.jsp.core.jspsource.source" />
+		</actionSetPartAssociation>
+		<actionSetPartAssociation
+			targetID="org.eclipse.ui.NavigateActionSet">
+			<part id="org.eclipse.jst.jsp.core.jspsource.source" />
+		</actionSetPartAssociation>
+		<actionSetPartAssociation
+            targetID="org.eclipse.debug.ui.launchActionSet">
+            <part id="org.eclipse.jst.jsp.core.jspsource.source"/>
+		</actionSetPartAssociation>
+	</extension>
+
+	<!--======================================================================================-->
+	<!-- JSP Editor specific actions                                                          -->
+	<!--======================================================================================-->
+	<extension point="org.eclipse.ui.commands">
+		<!-- rename refactor -->
+		<command
+			name="%command.jsp.refactor.rename.name"
+			description="%command.jsp.refactor.rename.description"
+			categoryId="org.eclipse.ui.category.edit"
+			id="org.eclipse.jst.jsp.ui.refactor.rename" />
+
+		<!-- move refactor -->
+		<command
+			name="%command.jsp.refactor.move.name"
+			description="%command.jsp.refactor.move.description"
+			categoryId="org.eclipse.ui.category.edit"
+			id="org.eclipse.jst.jsp.ui.refactor.move" />
+	</extension>
+	
+	<!-- Keybinding scope for jsp source editor -->
+	<extension point="org.eclipse.ui.contexts">
+		<context
+			name="%scope.structured.text.editor.jsp.name"
+			parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
+			description="%scope.structured.text.editor.jsp.description"
+			id="org.eclipse.jst.jsp.ui.structured.text.editor.jsp.scope">
+		</context>
+		<context
+			name="%scope.jsp.core.jspsource.name"
+			parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
+			description="%scope.jsp.core.jspsource.description"
+			id="org.eclipse.jst.jsp.core.jspsource">
+		</context>
+	</extension>
+	
+	<!-- Keybindings for jsp source editor -->
+	<extension point="org.eclipse.ui.bindings">
+	    <!--  win32:  M1=CTRL, M2=SHIFT, M3=ALT -->
+		<!-- rename refactor -->
+		<key
+			sequence="M2+M3+R"
+			contextId="org.eclipse.jst.jsp.ui.structured.text.editor.jsp.scope"
+			commandId="org.eclipse.jst.jsp.ui.refactor.rename"
+			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
+		</key>
+
+		<!-- move refactor -->
+		<key
+			sequence="M2+M3+V"
+			contextId="org.eclipse.jst.jsp.ui.structured.text.editor.jsp.scope"
+			commandId="org.eclipse.jst.jsp.ui.refactor.move"
+			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
+		</key>
+	</extension>
+
+	<!--======================================================================================-->
+	<!-- Templates                                                                            -->
+	<!--======================================================================================-->
+	<extension point="org.eclipse.ui.editors.templates">
+		<contextType
+			name="%All_JSP_context_type_Extension_Element.name"
+			class="org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeJSP"
+			id="jsp_all" />
+
+		<contextType
+			name="%JSP_New_context_type_Extension_Element.name"
+			class="org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeJSP"
+			id="jsp_new" />
+
+		<contextType
+			name="%Tag_New_context_type_Extension_Element.name"
+			class="org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeJSP"
+			id="tag_new" />
+
+		<contextType
+			name="%JSP_Tag_context_type_Extension_Element.name"
+			class="org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeJSP"
+			id="jsp_tag" />
+
+		<contextType
+			name="%JSP_Attribute_context_type_Extension_Element.name"
+			class="org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeJSP"
+			id="jsp_attribute" />
+
+		<contextType
+			name="%JSP_Attribute_value_context_type_Extension_Element.name"
+			class="org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeJSP"
+			id="jsp_attribute_value" />
+
+		<include
+			file="templates/jspdefault-templates.xml"
+			translations="$nl$/templates/jspdefault-templates.properties" />
+
+	</extension>
+
+	<!--======================================================================================-->
+	<!-- queryParticipant to participate in java seraches                                     -->
+	<!--======================================================================================-->
+	<extension point="org.eclipse.jdt.ui.queryParticipants">
+		<queryParticipant
+			name="%JSP_Query_Participant_Extension_Element.name"
+			nature="org.eclipse.jdt.core.javanature"
+			class="org.eclipse.jst.jsp.ui.internal.java.search.ui.JSPQueryParticipant"
+			id="org.eclipse.jst.jsp.ui.java.search.ui.JSPQueryParticipant" />
+
+	</extension>
+	<!-- initialize xml ui preferences -->
+	<extension point="org.eclipse.core.runtime.preferences">
+		<initializer
+			class="org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceInitializer" />
+	</extension>
+
+	<!--======================================================================================-->
+	<!-- Document provider for ExternalFileEditorInput                                        -->
+	<!--======================================================================================-->
+	<extension point="org.eclipse.ui.editors.documentProviders">
+		<provider
+			inputTypes="org.eclipse.jst.jsp.ui.internal.hyperlink.ExternalFileEditorInput"
+			class="org.eclipse.ui.editors.text.TextFileDocumentProvider"
+			id="org.eclipse.jst.jsp.ui.internal.ExternalFileDocumentProvider" />
+
+	</extension>
+
+	<!-- New JSP wizard -->
+	<extension point="org.eclipse.ui.newWizards">
+		<wizard
+			id="org.eclipse.jst.jsp.ui.internal.wizard.NewJSPWizard"
+			name="%_UI_WIZARD_NAME"
+			class="org.eclipse.jst.jsp.ui.internal.wizard.NewJSPWizard"
+			category="org.eclipse.wst.web.ui"
+			icon="$nl$/icons/full/etool16/newjsp_wiz.gif">
+			<description>%_UI_WIZARD_CREATE_NEW_FILE</description>
+			<selection class="org.eclipse.core.resources.IResource" />
+		</wizard>
+
+		<wizard
+			id="org.eclipse.jst.jsp.ui.internal.wizard.NewTagWizard"
+			name="%_UI_WIZARD_TAG_NAME"
+			class="org.eclipse.jst.jsp.ui.internal.wizard.NewTagWizard"
+			category="org.eclipse.wst.web.ui"
+			icon="$nl$/icons/full/etool16/newjsp_wiz.gif">
+			<description>%_UI_WIZARD_TAG_CREATE_NEW_FILE</description>
+			<selection class="org.eclipse.core.resources.IResource" />
+		</wizard>
+	</extension>
+
+	<!-- Add new JSP wizard to Project Explorer -->
+	<extension
+		id="org.eclipse.jst.jsp.commonWizard.newJSP"
+		point="org.eclipse.ui.navigator.navigatorContent">
+		<commonWizard
+        menuGroupId="org.eclipse.wst.web.ui"
+        type="new"
+        wizardId="org.eclipse.jst.jsp.ui.internal.wizard.NewJSPWizard">
+			<enablement>
+				<or>
+					<adapt type="org.eclipse.core.resources.IResource">
+						<test
+							property="org.eclipse.wst.common.project.facet.core.projectFacet"
+							value="jst.web"/>
+					</adapt>
+				</or>
+			</enablement>
+		</commonWizard>
+	</extension>
+
+	<extension point="org.eclipse.ui.popupMenus">
+		<viewerContribution
+			targetID="org.eclipse.jst.jsp.core.jspsource.source.RulerContext"
+			id="org.eclipse.ui.texteditor.ruler.context.actions">
+			<action
+				label="%AddTask.label"
+				helpContextId="org.eclipse.ui.AddTask_action_context"
+				class="org.eclipse.ui.texteditor.TaskRulerAction"
+				tooltip="%AddTask.tooltip"
+				menubarPath="additions"
+				id="org.eclipse.ui.texteditor.TaskRulerAction" />
+
+			<action
+				label="%AddBookmark.label"
+				helpContextId="org.eclipse.ui.bookmark_action_context"
+				class="org.eclipse.ui.texteditor.BookmarkRulerAction"
+				tooltip="%AddBookmark.tooltip"
+				menubarPath="additions"
+				id="org.eclipse.ui.texteditor.BookmarkRulerAction" />
+
+		</viewerContribution>
+		<viewerContribution
+			targetID="org.eclipse.jst.jsp.core.jspfragmentsource.source.RulerContext"
+			id="org.eclipse.ui.texteditor.ruler.context.actions">
+			<action
+				label="%AddTask.label"
+				helpContextId="org.eclipse.ui.AddTask_action_context"
+				class="org.eclipse.ui.texteditor.TaskRulerAction"
+				tooltip="%AddTask.tooltip"
+				menubarPath="additions"
+				id="org.eclipse.ui.texteditor.TaskRulerAction" />
+
+			<action
+				label="%AddBookmark.label"
+				helpContextId="org.eclipse.ui.bookmark_action_context"
+				class="org.eclipse.ui.texteditor.BookmarkRulerAction"
+				tooltip="%AddBookmark.tooltip"
+				menubarPath="additions"
+				id="org.eclipse.ui.texteditor.BookmarkRulerAction" />
+
+		</viewerContribution>
+		<viewerContribution
+			targetID="org.eclipse.jst.jsp.core.tagsource.source.RulerContext"
+			id="org.eclipse.ui.texteditor.ruler.context.actions">
+			<action
+				label="%AddTask.label"
+				helpContextId="org.eclipse.ui.AddTask_action_context"
+				class="org.eclipse.ui.texteditor.TaskRulerAction"
+				tooltip="%AddTask.tooltip"
+				menubarPath="additions"
+				id="org.eclipse.ui.texteditor.TaskRulerAction" />
+
+			<action
+				label="%AddBookmark.label"
+				helpContextId="org.eclipse.ui.bookmark_action_context"
+				class="org.eclipse.ui.texteditor.BookmarkRulerAction"
+				tooltip="%AddBookmark.tooltip"
+				menubarPath="additions"
+				id="org.eclipse.ui.texteditor.BookmarkRulerAction" />
+
+		</viewerContribution>
+		<viewerContribution
+			targetID="org.eclipse.jst.jsp.core.tldsource.source.RulerContext"
+			id="org.eclipse.ui.texteditor.ruler.context.actions">
+			<action
+				label="%AddTask.label"
+				helpContextId="org.eclipse.ui.AddTask_action_context"
+				class="org.eclipse.ui.texteditor.TaskRulerAction"
+				tooltip="%AddTask.tooltip"
+				menubarPath="additions"
+				id="org.eclipse.ui.texteditor.TaskRulerAction" />
+
+			<action
+				label="%AddBookmark.label"
+				helpContextId="org.eclipse.ui.bookmark_action_context"
+				class="org.eclipse.ui.texteditor.BookmarkRulerAction"
+				tooltip="%AddBookmark.tooltip"
+				menubarPath="additions"
+				id="org.eclipse.ui.texteditor.BookmarkRulerAction" />
+
+		</viewerContribution>
+	</extension>
+
+	<extension point="org.eclipse.ui.editorActions">
+	<editorContribution
+			id="org.eclipse.jst.jsp.core.jspsource.source.editorActions"
+			targetID="org.eclipse.jst.jsp.core.jspsource.source">
+	<!--		<action
+				id="CleanupDocument"
+				label="%CleanupDocument_label"
+				definitionId="org.eclipse.wst.sse.ui.cleanup.document"
+				tooltip="%CleanupDocument_tooltip"
+				class="org.eclipse.wst.html.ui.internal.edit.ui.CleanupActionHTMLDelegate"
+				actionID="CleanupDocument">
+			</action>
+			<action
+				id="ToggleComment"
+				label="%ToggleComment_label"
+				definitionId="org.eclipse.wst.sse.ui.toggle.comment"
+				tooltip="%ToggleComment_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.actions.ToggleCommentActionXMLDelegate"
+				actionID="ToggleComment">
+			</action>
+			<action
+				id="AddBlockComment"
+				label="%AddBlockComment_label"
+				definitionId="org.eclipse.wst.sse.ui.add.block.comment"
+				tooltip="%AddBlockComment_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.actions.AddBlockCommentActionXMLDelegate"
+				actionID="AddBlockComment">
+			</action>
+			<action
+				id="RemoveBlockComment"
+				label="%RemoveBlockComment_label"
+				definitionId="org.eclipse.wst.sse.ui.remove.block.comment"
+				tooltip="%RemoveBlockComment_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.actions.RemoveBlockCommentActionXMLDelegate"
+				actionID="RemoveBlockComment">
+			</action>-->
+			<!--<action
+				id="RenameElement"
+				label="%RenameElement_label"
+				definitionId="org.eclipse.jst.jsp.ui.refactor.rename"
+				class="org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameElementActionDelegate"
+				actionID="RenameElement">
+			</action>
+			<action
+				id="MoveElement"
+				label="%MoveElement_label"
+				definitionId="org.eclipse.jst.jsp.ui.refactor.move"
+				class="org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPMoveElementActionDelegate"
+				actionID="MoveElement">
+			</action>
+			<action
+				id="FindOccurrences"
+				label="%FindOccurrences_label"
+				definitionId="org.eclipse.wst.sse.ui.search.find.occurrences"
+				class="org.eclipse.jst.jsp.ui.internal.java.search.JSPFindOccurrencesActionDelegate"
+				actionID="FindOccurrences">
+			</action>-->
+			<!--<action
+				id="StructureSelectEnclosing"
+				label="%StructureSelectEnclosing_label"
+				definitionId="org.eclipse.wst.sse.ui.structure.select.enclosing"
+				tooltip="%StructureSelectEnclosing_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectEnclosingXMLActionDelegate"
+				actionID="StructureSelectEnclosing">
+			</action>
+			<action
+				id="StructureSelectNext"
+				label="%StructureSelectNext_label"
+				definitionId="org.eclipse.wst.sse.ui.structure.select.next"
+				tooltip="%StructureSelectNext_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectNextXMLActionDelegate"
+				actionID="StructureSelectNext">
+			</action>
+			<action
+				id="StructureSelectPrevious"
+				label="%StructureSelectPrevious_label"
+				definitionId="org.eclipse.wst.sse.ui.structure.select.previous"
+				tooltip="%StructureSelectPrevious_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectPreviousXMLActionDelegate"
+				actionID="StructureSelectPrevious">
+			</action>
+			<action
+				id="StructureSelectHistory"
+				label="%StructureSelectHistory_label"
+				definitionId="org.eclipse.wst.sse.ui.structure.select.last"
+				tooltip="%StructureSelectHistory_tooltip"
+				class="org.eclipse.wst.sse.ui.internal.selection.StructuredSelectHistoryActionDelegate"
+				actionID="StructureSelectHistory">
+			</action>-->
+		</editorContribution>
+        <editorContribution
+            targetID="org.eclipse.jst.jsp.core.jspsource.source"
+            id="org.eclipse.jst.jsp.core.jspsource.ruler.actions">
+         <action
+               label="%AddBookmark.label"
+               helpContextId="org.eclipse.ui.bookmark_action_context"
+               class="org.eclipse.ui.texteditor.BookmarkRulerAction"
+               actionID="RulerDoubleClick"
+               id="org.eclipse.ui.texteditor.BookmarkRulerAction"/>
+         <action
+               label="%SelectRuler.label"
+               class="org.eclipse.ui.texteditor.SelectRulerAction"
+               actionID="RulerClick"
+               id="org.eclipse.ui.texteditor.SelectRulerAction"/>
+        </editorContribution>
+	</extension>
+	
+	<extension
+       point="org.eclipse.ui.handlers">
+       <handler
+             class="org.eclipse.jst.jsp.ui.internal.java.refactoring.RenameElementHandler"
+             commandId="org.eclipse.jst.jsp.ui.refactor.rename">
+             <activeWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
+             	</reference>
+             </activeWhen>
+             <enabledWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
+             	</reference>
+             </enabledWhen>
+       </handler>
+       <handler
+             class="org.eclipse.jst.jsp.ui.internal.java.refactoring.MoveElementHandler"
+             commandId="org.eclipse.jst.jsp.ui.refactor.move">
+             <activeWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
+             	</reference>
+             </activeWhen>
+             <enabledWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
+             	</reference>
+             </enabledWhen>
+       </handler>
+       <handler
+             class="org.eclipse.jst.jsp.ui.internal.handlers.JSPFindOccurrencesHandler"
+             commandId="org.eclipse.wst.sse.ui.search.find.occurrences">
+             <activeWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
+             	</reference>
+             </activeWhen>
+             <enabledWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
+             	</reference>
+             </enabledWhen>
+       </handler>
+	</extension>
+	
+	<extension point="org.eclipse.ui.perspectiveExtensions">
+        <perspectiveExtension targetID="org.eclipse.wst.web.ui.webDevPerspective">
+            <newWizardShortcut id="org.eclipse.jst.jsp.ui.internal.wizard.NewJSPWizard"/>
+        </perspectiveExtension> 
+	</extension>
+	
+	<!-- JSP Fragment Property Page -->
+	<extension point="org.eclipse.ui.propertyPages">
+		<!-- for j2ee web project -->
+		<page
+			name="%JSPFragmentContentSettings.name"
+			class="org.eclipse.jst.jsp.ui.internal.contentproperties.ui.ProjectJSPFContentSettingsPropertyPage"
+			id="org.eclipse.jst.jsp.ui.internal.contentproperties.ProjectJSPFContentSettingsPropertyPage">
+         	<enabledWhen>
+               	<and>
+					<adapt type="org.eclipse.core.resources.IProject">
+						<or> 
+							<test 
+								forcePluginActivation="true"
+								property="org.eclipse.wst.common.project.facet.core.projectFacet"
+								value="jst.web" />
+						</or>
+					</adapt>
+				</and> 
+			</enabledWhen>
+			<keywordReference id="org.eclipse.jst.jsp.ui.fragments"/>
+		</page>
+		<page
+			name="%JSPFragmentContentSettings.name"
+			class="org.eclipse.jst.jsp.ui.internal.contentproperties.ui.JSPFContentSettingsPropertyPage"
+			id="org.eclipse.jst.jsp.ui.internal.contentproperties.JSPFContentSettingsPropertyPage">
+         	<enabledWhen>
+               	<and>
+					<adapt type="org.eclipse.core.resources.IFile">
+						<or> 
+							<test 
+								forcePluginActivation="true"
+								property="org.eclipse.core.resources.contentTypeId"
+								value="org.eclipse.jst.jsp.core.jspfragmentsource" />
+							<test 
+								forcePluginActivation="true"
+								property="org.eclipse.core.resources.contentTypeId"
+								value="org.eclipse.jst.jsp.core.cssjspfragmentsource" />
+						</or>
+					</adapt>
+				</and> 
+			</enabledWhen>
+			<keywordReference id="org.eclipse.jst.jsp.ui.fragments"/>
+		</page>
+		<page
+			name="%JSP_Property_validation" 
+			class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPValidationPreferencePage"
+			id="org.eclipse.jst.jsp.ui.propertyPage.project.validation"
+			category="ValidationPropertiesPage">
+			<enabledWhen>
+				<adapt type="org.eclipse.core.resources.IProject">
+					<test property="org.eclipse.core.resources.projectNature" value="org.eclipse.jdt.core.javanature"/>
+				</adapt>
+			</enabledWhen>
+			<keywordReference id="org.eclipse.jst.jsp.ui.severities"/>
+		</page>
+		<page
+			name="%JSP_Property_tag_contentSettings"
+			class="org.eclipse.jst.jsp.ui.internal.contentproperties.ui.TagContentSettingsPropertyPage"
+			id="org.eclipse.jst.jsp.ui.propertyPage.project.tag.content.settings"
+			category="org.eclipse.ui.propertypages.info.file">
+         	<enabledWhen>
+               	<and>
+					<adapt type="org.eclipse.core.resources.IFile">
+						<or> 
+							<test 
+								forcePluginActivation="true"
+								property="org.eclipse.core.resources.contentTypeId"
+								value="org.eclipse.jst.jsp.core.tagsource" />
+						</or>
+					</adapt>
+				</and> 
+			</enabledWhen>
+		</page>
+	</extension>	
+	<!--  jsp-for-css editor configurations -->		
+	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
+		<contentOutlineConfiguration
+			class="org.eclipse.wst.css.ui.views.contentoutline.CSSContentOutlineConfiguration"
+			target="org.eclipse.jst.jsp.core.cssjspsource" />
+		<sourceViewerConfiguration
+			class="org.eclipse.wst.css.ui.StructuredTextViewerConfigurationCSS"
+			target="org.eclipse.jst.jsp.core.cssjspsource" />
+		<propertySheetConfiguration
+			class="org.eclipse.jst.jsp.css.ui.internal.views.properties.JSPedCSSPropertySheetConfiguration"
+			target="org.eclipse.jst.jsp.core.cssjspsource" />
+		<provisionalConfiguration
+			type="characterpairmatcher"
+			class="org.eclipse.wst.css.ui.internal.text.CSSDocumentRegionEdgeMatcher"
+			target="org.eclipse.jst.jsp.core.cssjspsource" />
+		<provisionalConfiguration
+			type="foldingstrategy"
+			class="org.eclipse.wst.css.ui.internal.projection.CSSFoldingStrategy"
+			target="org.eclipse.jst.jsp.core.cssjspsource" />
+		<provisionalDefinition
+			type="preferencepages"
+			value="org.eclipse.wst.sse.ui.preferences.css, org.eclipse.wst.sse.ui.preferences.css.source, org.eclipse.wst.css.ui.preferences.templates, org.eclipse.wst.sse.ui.preferences.css.styles"
+			target="org.eclipse.jst.jsp.core.cssjspsource" />
+	</extension>
+		<extension
+		point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
+		<adapterFactoryDescription
+			class="org.eclipse.jst.jsp.css.ui.internal.registry.AdapterFactoryProviderJSPedCSS">
+			<contentType id="org.eclipse.jst.jsp.core.cssjspsource" />
+		</adapterFactoryDescription>
+	</extension>
+	<extension
+		point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets">
+		<target
+			id="org.eclipse.jst.jsp.core.jspsource"
+			name="%JSP_Source_target_name">
+		</target>
+	</extension>
+	<extension
+		point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
+		<hyperlinkDetector
+			class="org.eclipse.jst.jsp.ui.internal.hyperlink.JSPJavaHyperlinkDetector"
+			id="org.eclipse.jst.jsp.ui.internal.hyperlink.JSPJavaHyperlinkDetector"
+			name="%Java_Element_hyperlink"
+			targetId="org.eclipse.jst.jsp.core.jspsource">
+		</hyperlinkDetector>
+		<hyperlinkDetector
+			class="org.eclipse.jst.jsp.ui.internal.hyperlink.TaglibHyperlinkDetector"
+			id="org.eclipse.jst.jsp.ui.internal.hyperlink.TaglibHyperlinkDetector"
+			name="%Taglib_hyperlink"
+			targetId="org.eclipse.jst.jsp.core.jspsource">
+		</hyperlinkDetector>
+		<hyperlinkDetector
+			class="org.eclipse.jst.jsp.ui.internal.hyperlink.XMLJavaHyperlinkDetector"
+			id="org.eclipse.jst.jsp.ui.internal.hyperlink.XMLJavaHyperlinkDetector"
+			name="%Java_Element_hyperlink"
+			targetId="org.eclipse.core.runtime.xml">
+		</hyperlinkDetector>
+   </extension>
+   
+   <extension point="org.eclipse.core.expressions.definitions">
+		<definition id="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
+            <with variable="activeContexts">
+	           <iterate operator="or">
+	              <equals value="org.eclipse.jst.jsp.core.jspsource"/>
+	           </iterate>
+            </with>
+		</definition>
+	</extension>
+	
+	<extension point="org.eclipse.ui.menus">
+	    <menuContribution locationURI="menu:refactorMenuId">
+	       <separator name="jspRefactorBegin" visible="false"></separator>
+	       <command commandId="org.eclipse.jst.jsp.ui.refactor.rename" id="RenameElement" label="%command.jsp.refactor.rename.name" style="push">
+			   <visibleWhen checkEnabled="false">
+					<reference definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition"></reference>
+				</visibleWhen>
+	       </command>
+	       <command commandId="org.eclipse.jst.jsp.ui.refactor.move" id="MoveElement" label="%command.jsp.refactor.move.name" style="push">
+			   <visibleWhen checkEnabled="false">
+					<reference definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition"></reference>
+				</visibleWhen>
+	       </command>
+	       <separator name="jspRefactorBegin" visible="false"></separator>
+		</menuContribution>
+	</extension>
+	
+	<!-- Enable the FormatHandler for JSP Content Type -->
+	<extension point="org.eclipse.ui.handlers">
+		<handler 
+			class="org.eclipse.wst.sse.ui.internal.handlers.FormatHandler"
+			commandId="org.eclipse.wst.sse.ui.format">
+			<activeWhen>
+				<reference definitionId="org.eclipse.wst.jsp.ui.jspContentType.definition"></reference>
+			</activeWhen>
+			<enabledWhen>
+				<reference definitionId="org.eclipse.wst.jsp.ui.jspContentType.definition"></reference>
+			</enabledWhen>
+		</handler>
+	</extension>
+	
+	<!-- Set up a definition for JSP Content Types -->
+	<extension point="org.eclipse.core.expressions.definitions">
+		<definition id="org.eclipse.wst.jsp.ui.jspContentType.definition">
+			<iterate ifEmpty="false">
+				<adapt type="org.eclipse.core.resources.IFile">
+					<!-- Force property tester to load, should not cause entire plug-in to start -->
+					<test property="org.eclipse.wst.sse.core.resources.contentTypeId"
+						value="org.eclipse.jst.jsp.core.jspsource" forcePluginActivation="true"/>
+				</adapt>
+			</iterate>
+		</definition>
+	</extension>
+	<extension point="org.eclipse.wst.sse.ui.characterPairing">
+		<inserter class="org.eclipse.wst.html.ui.internal.text.CharacterPairInserter" id="org.eclipse.wst.jsp.ui.inserter">
+			<contentTypeIdentifier
+				id="org.eclipse.jst.jsp.core.jspsource"
+				partitions="org.eclipse.jst.jsp.JSP_DIRECTIVE,org.eclipse.wst.html.HTML_DEFAULT,org.eclipse.wst.html.HTML_DECLARATION">
+			</contentTypeIdentifier>
+		</inserter>
+	</extension>
+	<extension point="org.eclipse.wst.sse.ui.characterPairing">
+		<inserter class="org.eclipse.jst.jsp.ui.internal.text.JavaCharacterPairInserter" id="org.eclipse.wst.jsp.java.ui.inserter">
+			<contentTypeIdentifier
+				id="org.eclipse.jst.jsp.core.jspsource"
+				partitions="org.eclipse.jst.jsp.SCRIPT.JAVA">
+			</contentTypeIdentifier>
+		</inserter>
+	</extension>
+	<extension point="org.eclipse.wst.sse.ui.characterPairing">
+		<inserter class="org.eclipse.wst.css.ui.internal.text.CSSCharacterPairInserter" id="org.eclipse.jst.jsp.css.ui.inserter">
+			<contentTypeIdentifier
+				id="org.eclipse.jst.jsp.core.jspsource"
+				partitions="org.eclipse.wst.css.STYLE">
+			</contentTypeIdentifier>
+		</inserter>
+	</extension>
+ <extension
+       point="org.eclipse.wst.sse.ui.completionProposal">
+    <proposalCategory
+          icon="icons/full/obj16/tag-template.gif"
+          id="org.eclipse.jst.jsp.ui.proposalCategory.jspTemplates"
+          name="%proposalCategory.jspTemplates">
+    </proposalCategory>
+    <proposalCategory
+          icon="icons/full/obj16/tag-jsp.gif"
+          id="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
+          name="%proposalCategory.jsp">
+    </proposalCategory>
+    <proposalCategory
+          icon="icons/full/elcl16/javaassist_co.gif"
+          id="org.eclipse.jst.jsp.ui.proposalCategory.jspJava"
+          name="%proposalCategory.jspJava">
+    </proposalCategory>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.html.ui.proposalComputer.htmlTags">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.html.HTML_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.html.HTML_COMMENT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.sse.ST_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_COMMENT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.html.ui.proposalComputer.htmlTemplates">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.html.HTML_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.html.HTML_COMMENT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.sse.ST_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_COMMENT">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.xml.ui.proposalComputer.xmlTags">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.xml.XML_DEFAULT">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.xml.ui.proposalComputer.xmlTemplates">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.xml.XML_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jspTemplates"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPTemplatesCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspTemplates">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.html.HTML_DEFAULT">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jsp">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.LibraryTagsCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.libraryTags">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.html.HTML_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.html.HTML_COMMENT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.sse.ST_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_COMMENT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jspJava"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspJava">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.jst.jsp.SCRIPT.JAVA">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.xml.XML_CDATA">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.DEFAULT_JSP">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.SCRIPT.DELIMITER">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.html.SCRIPT">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jspJava"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPELCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspEL">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.jst.jsp.SCRIPT.JSP_EL">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jspJava"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPImportCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspImport">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPPropertyCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspProperty">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPUseBeanCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspUseBean">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPTaglibCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspTaglib">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+       </contentType>
+    </proposalComputer>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.css.ui.proposalComputer.css">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.css.STYLE">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.css.ui.proposalComputer.cssTemplates">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.css.STYLE">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+ </extension>
+  <extension
+       point="org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration">
+    <categoriesConfiguration
+          class="org.eclipse.jst.jsp.ui.internal.preferences.JSPCompletionProposalCategoriesConfiguration"
+          contentTypeID="org.eclipse.jst.jsp.core.jspsource">
+    </categoriesConfiguration>
+ </extension>
+</plugin>
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/properties/JSPedCSSPropertySource.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/properties/JSPedCSSPropertySource.java
new file mode 100644
index 0000000..09c7828
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/properties/JSPedCSSPropertySource.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.css.ui.internal.properties;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
+import org.eclipse.wst.css.ui.internal.properties.CSSPropertySource;
+
+
+
+public class JSPedCSSPropertySource extends CSSPropertySource {
+
+	public JSPedCSSPropertySource(ICSSNode target) {
+		super(target);
+	}
+	
+	public void setPropertyValue(Object name, Object value) {
+		// workaround to avoid DOMException: if value contains jsp element, nothing happen.
+		String v = value.toString();
+		if (v.indexOf("${") != -1 || v.indexOf("<%=") != -1){
+			IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+			String title = JSPUIMessages.Title_InvalidValue; //$NON-NLS-1$
+			String message = JSPUIMessages.Message_InvalidValue; //$NON-NLS-1$
+			MessageDialog.openWarning(window.getShell(), title, message);
+			return;
+		}
+		super.setPropertyValue(name, value);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/registry/AdapterFactoryProviderJSPedCSS.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/registry/AdapterFactoryProviderJSPedCSS.java
new file mode 100644
index 0000000..809e87b
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/registry/AdapterFactoryProviderJSPedCSS.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.css.ui.internal.registry;
+
+import org.eclipse.jst.jsp.css.core.internal.modelhandler.ModelHandlerForJSPedCSS;
+import org.eclipse.wst.css.ui.internal.registry.AdapterFactoryProviderCSS;
+import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
+
+public class AdapterFactoryProviderJSPedCSS extends AdapterFactoryProviderCSS {
+
+
+	public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
+		return (contentTypeDescription instanceof ModelHandlerForJSPedCSS);
+	}
+
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/views/properties/JSPedCSSPropertySheetConfiguration.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/views/properties/JSPedCSSPropertySheetConfiguration.java
new file mode 100644
index 0000000..7403816
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/views/properties/JSPedCSSPropertySheetConfiguration.java
@@ -0,0 +1,188 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.css.ui.internal.views.properties;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jst.jsp.css.ui.internal.properties.JSPedCSSPropertySource;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.progress.UIJob;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.IPropertySourceProvider;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+
+public class JSPedCSSPropertySheetConfiguration extends PropertySheetConfiguration {
+	private class CSSPropertySheetRefreshAdapter implements INodeAdapter {
+		public boolean isAdapterForType(Object type) {
+			return false;
+		}
+
+		public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
+			if (fPropertySheetPage != null) {
+				getPropertiesRefreshJob().addPropertySheetPage(fPropertySheetPage);
+			}
+		}
+	}
+
+	private class CSSPropertySourceProvider implements IPropertySourceProvider {
+		private IPropertySource fPropertySource = null;
+		private ICSSNode fSource = null;
+
+		public IPropertySource getPropertySource(Object object) {
+			if (fSource != null && object.equals(fSource)) {
+				return fPropertySource;
+			}
+
+			if (object instanceof ICSSNode) {
+				fSource = (ICSSNode)object;
+				fPropertySource = new JSPedCSSPropertySource(fSource);
+			}
+			else {
+				fSource = null;
+				fPropertySource = null;
+			}
+			return fPropertySource;
+		}
+	}
+
+	private class PropertiesRefreshJob extends UIJob {
+		public static final int UPDATE_DELAY = 200;
+
+		private Set propertySheetPages = null;
+
+		public PropertiesRefreshJob() {
+			super(XMLUIMessages.JFaceNodeAdapter_1);
+			setSystem(true);
+			setPriority(Job.SHORT);
+			propertySheetPages = new HashSet(1);
+		}
+
+		void addPropertySheetPage(IPropertySheetPage page) {
+			propertySheetPages.add(page);
+			schedule(UPDATE_DELAY);
+		}
+
+		public IStatus runInUIThread(IProgressMonitor monitor) {
+			Object[] pages = propertySheetPages.toArray();
+			propertySheetPages.clear();
+
+			for (int i = 0; i < pages.length; i++) {
+				PropertySheetPage page = (PropertySheetPage) pages[i];
+				if (page.getControl() != null && !page.getControl().isDisposed()) {
+					page.refresh();
+				}
+			}
+
+			return Status.OK_STATUS;
+		}
+	}
+
+	private PropertiesRefreshJob fPropertiesRefreshJob = null;
+
+	IPropertySheetPage fPropertySheetPage;
+
+	private IPropertySourceProvider fPropertySourceProvider = null;
+
+	private INodeAdapter fRefreshAdapter = new CSSPropertySheetRefreshAdapter();
+
+	private INodeNotifier[] fSelectedNotifiers;
+
+	/**
+	 * Create new instance of CSSPropertySheetConfiguration
+	 */
+	public JSPedCSSPropertySheetConfiguration() {
+		// Must have empty constructor to createExecutableExtension
+		super();
+	}
+
+	public ISelection getInputSelection(IWorkbenchPart selectingPart, ISelection selection) {
+		// remove UI refresh adapters
+		if (fSelectedNotifiers != null) {
+			for (int i = 0; i < fSelectedNotifiers.length; i++) {
+				fSelectedNotifiers[i].removeAdapter(fRefreshAdapter);
+			}
+			fSelectedNotifiers = null;
+		}
+
+		ISelection preferredSelection = super.getInputSelection(selectingPart, selection);
+		if (preferredSelection instanceof IStructuredSelection) {
+			Object[] selectedObjects = new Object[((IStructuredSelection) selection).size()];
+			System.arraycopy(((IStructuredSelection) selection).toArray(), 0, selectedObjects, 0, selectedObjects.length);
+			for (int i = 0; i < selectedObjects.length; i++) {
+				if (selectedObjects[i] instanceof ICSSNode) {
+					ICSSNode node = (ICSSNode) selectedObjects[i];
+					while (node.getNodeType() == ICSSNode.PRIMITIVEVALUE_NODE || node.getNodeType() == ICSSNode.STYLEDECLITEM_NODE) {
+						node = node.getParentNode();
+						selectedObjects[i] = node;
+					}
+				}
+			}
+
+			/*
+			 * Add UI refresh adapters and remember notifiers for later
+			 * removal
+			 */
+			if (selectedObjects.length > 0) {
+				List selectedNotifiers = new ArrayList(1);
+				for (int i = 0; i < selectedObjects.length; i++) {
+					if (selectedObjects[i] instanceof INodeNotifier) {
+						selectedNotifiers.add(selectedObjects[i]);
+						((INodeNotifier) selectedObjects[i]).addAdapter(fRefreshAdapter);
+					}
+				}
+				fSelectedNotifiers = (INodeNotifier[]) selectedNotifiers.toArray(new INodeNotifier[selectedNotifiers.size()]);
+			}
+			preferredSelection = new StructuredSelection(selectedObjects);
+		}
+		return preferredSelection;
+	}
+
+	PropertiesRefreshJob getPropertiesRefreshJob() {
+		if (fPropertiesRefreshJob == null) {
+			fPropertiesRefreshJob = new PropertiesRefreshJob();
+		}
+		return fPropertiesRefreshJob;
+	}
+
+	public IPropertySourceProvider getPropertySourceProvider(IPropertySheetPage page) {
+		if (fPropertySourceProvider == null) {
+			fPropertySourceProvider = new CSSPropertySourceProvider();
+			fPropertySheetPage = page;
+		}
+		return fPropertySourceProvider;
+	}
+
+	public void unconfigure() {
+		super.unconfigure();
+		if (fSelectedNotifiers != null) {
+			for (int i = 0; i < fSelectedNotifiers.length; i++) {
+				fSelectedNotifiers[i].removeAdapter(fRefreshAdapter);
+			}
+			fSelectedNotifiers = null;
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
new file mode 100644
index 0000000..7c17b85
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
@@ -0,0 +1,357 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Matthias Fuessel, mat.fuessel@gmx.net - [177387] use base hyperlinking extension points     
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jdt.ui.PreferenceConstants;
+import org.eclipse.jdt.ui.text.IJavaPartitions;
+import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.ITextDoubleClickStrategy;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.formatter.IContentFormatter;
+import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.core.internal.text.StructuredTextPartitionerForJSP;
+import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.jst.jsp.ui.internal.autoedit.AutoEditStrategyForTabs;
+import org.eclipse.jst.jsp.ui.internal.autoedit.StructuredAutoEditStrategyJSP;
+import org.eclipse.jst.jsp.ui.internal.autoedit.StructuredAutoEditStrategyJSPJava;
+import org.eclipse.jst.jsp.ui.internal.contentassist.JSPStructuredContentAssistProcessor;
+import org.eclipse.jst.jsp.ui.internal.format.FormattingStrategyJSPJava;
+import org.eclipse.jst.jsp.ui.internal.style.LineStyleProviderForJSP;
+import org.eclipse.jst.jsp.ui.internal.style.java.LineStyleProviderForJava;
+import org.eclipse.jst.jsp.ui.internal.style.jspel.LineStyleProviderForJSPEL;
+import org.eclipse.wst.css.core.text.ICSSPartitions;
+import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
+import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
+import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
+import org.eclipse.wst.xml.core.text.IXMLPartitions;
+import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
+
+/**
+ * Configuration for a source viewer which shows JSP content.
+ * <p>
+ * Clients can subclass and override just those methods which must be specific
+ * to their needs.
+ * </p>
+ * 
+ * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration
+ * @since 1.0
+ */
+public class StructuredTextViewerConfigurationJSP extends StructuredTextViewerConfiguration {
+	/*
+	 * One instance per configuration because not sourceviewer-specific and
+	 * it's a String array
+	 */
+	private String[] fConfiguredContentTypes;
+	/*
+	 * One instance per configuration
+	 */
+	private LineStyleProvider fLineStyleProviderForJava;
+	/*
+	 * One instance per configuration
+	 */
+	private LineStyleProvider fLineStyleProviderForJSP;
+	/*
+	 * One instance per configuration
+	 */
+	private LineStyleProvider fLineStyleProviderForJSPEL;
+	private StructuredTextViewerConfiguration fHTMLSourceViewerConfiguration;
+	private JavaSourceViewerConfiguration fJavaSourceViewerConfiguration;
+	private StructuredTextViewerConfiguration fXMLSourceViewerConfiguration;
+	private ILabelProvider fStatusLineLabelProvider;
+
+	/**
+	 * Create new instance of StructuredTextViewerConfigurationJSP
+	 */
+	public StructuredTextViewerConfigurationJSP() {
+		// Must have empty constructor to createExecutableExtension
+		super();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer,
+	 *      java.lang.String)
+	 */
+	public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
+		IAutoEditStrategy[] strategies = null;
+
+		if (contentType == IXMLPartitions.XML_DEFAULT) {
+			// xml autoedit strategies
+			strategies = getXMLSourceViewerConfiguration().getAutoEditStrategies(sourceViewer, contentType);
+		}
+		else if (contentType == IJSPPartitions.JSP_CONTENT_JAVA) {
+			// jsp java autoedit strategies
+			List allStrategies = new ArrayList(0);
+
+			// add the scritplet autoedit strategy first
+			allStrategies.add(new StructuredAutoEditStrategyJSPJava());
+			
+			IAutoEditStrategy[] javaStrategies = getJavaSourceViewerConfiguration().getAutoEditStrategies(sourceViewer, IJavaPartitions.JAVA_PARTITIONING);
+			for (int i = 0; i < javaStrategies.length; i++) {
+				allStrategies.add(javaStrategies[i]);
+			}
+			// be sure this is added last, after others, so it can modify
+			// results from earlier steps.
+			// add auto edit strategy that handles when tab key is pressed
+			allStrategies.add(new AutoEditStrategyForTabs());
+
+			strategies = (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
+		}
+		else if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.HTML_DECLARATION || contentType == IJSPPartitions.JSP_DIRECTIVE) {
+			// html and jsp autoedit strategies
+			List allStrategies = new ArrayList(0);
+
+			// add the jsp autoedit strategy first then add all html's
+			allStrategies.add(new StructuredAutoEditStrategyJSP());
+
+			IAutoEditStrategy[] htmlStrategies = getHTMLSourceViewerConfiguration().getAutoEditStrategies(sourceViewer, contentType);
+			for (int i = 0; i < htmlStrategies.length; i++) {
+				allStrategies.add(htmlStrategies[i]);
+			}
+
+			strategies = (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
+		}
+		else {
+			// default autoedit strategies
+			List allStrategies = new ArrayList(0);
+
+			IAutoEditStrategy[] superStrategies = super.getAutoEditStrategies(sourceViewer, contentType);
+			for (int i = 0; i < superStrategies.length; i++) {
+				allStrategies.add(superStrategies[i]);
+			}
+
+			// be sure this is added last, after others, so it can modify
+			// results from earlier steps.
+			// add auto edit strategy that handles when tab key is pressed
+			allStrategies.add(new AutoEditStrategyForTabs());
+
+			strategies = (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
+		}
+
+		return strategies;
+	}
+
+	public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+		if (fConfiguredContentTypes == null) {
+			/*
+			 * A little bit of cheating because assuming html's configured
+			 * content types will add default, unknown, and all xml configured
+			 * content types
+			 */
+			String[] htmlTypes = getHTMLSourceViewerConfiguration().getConfiguredContentTypes(sourceViewer);
+			String[] jspTypes = StructuredTextPartitionerForJSP.getConfiguredContentTypes();
+			fConfiguredContentTypes = new String[htmlTypes.length + jspTypes.length];
+
+			int index = 0;
+			System.arraycopy(htmlTypes, 0, fConfiguredContentTypes, index, htmlTypes.length);
+			System.arraycopy(jspTypes, 0, fConfiguredContentTypes, index += htmlTypes.length, jspTypes.length);
+		}
+
+		return fConfiguredContentTypes;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration#getContentAssistProcessors(
+	 * 	org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
+	 */
+	protected IContentAssistProcessor[] getContentAssistProcessors(
+			ISourceViewer sourceViewer, String partitionType) {
+		
+		IContentAssistProcessor processor = new JSPStructuredContentAssistProcessor(
+				this.getContentAssistant(), partitionType, sourceViewer);
+		return new IContentAssistProcessor[]{processor};
+	}
+
+	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
+		IContentFormatter formatter = super.getContentFormatter(sourceViewer);
+		// super was unable to create a formatter, probably because
+		// sourceViewer does not have document set yet, so just create a
+		// generic one
+		if (!(formatter instanceof MultiPassContentFormatter))
+			formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);
+
+		MultiPassContentFormatter multiFormatter = (MultiPassContentFormatter) formatter;
+		multiFormatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
+		multiFormatter.setSlaveStrategy(new FormattingStrategyJSPJava(), IJSPPartitions.JSP_CONTENT_JAVA);
+
+		return formatter;
+	}
+
+	public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
+		ITextDoubleClickStrategy strategy = null;
+
+		// html or javascript
+		if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.SCRIPT)
+			strategy = getHTMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, contentType);
+		else if (contentType == IJSPPartitions.JSP_CONTENT_JAVA || contentType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT)
+			// JSP Java or JSP JavaScript
+			strategy = getJavaSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, contentType);
+		else if (contentType == IJSPPartitions.JSP_DEFAULT)
+			// JSP (just treat like html)
+			strategy = getHTMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, IHTMLPartitions.HTML_DEFAULT);
+		else
+			strategy = super.getDoubleClickStrategy(sourceViewer, contentType);
+
+		return strategy;
+	}
+
+	private StructuredTextViewerConfiguration getHTMLSourceViewerConfiguration() {
+		if (fHTMLSourceViewerConfiguration == null) {
+			fHTMLSourceViewerConfiguration = new StructuredTextViewerConfigurationHTML();
+		}
+		return fHTMLSourceViewerConfiguration;
+	}
+
+	public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
+		String[] indentations = null;
+
+		if (contentType == IXMLPartitions.XML_DEFAULT)
+			indentations = getXMLSourceViewerConfiguration().getIndentPrefixes(sourceViewer, contentType);
+		else
+			indentations = getHTMLSourceViewerConfiguration().getIndentPrefixes(sourceViewer, contentType);
+
+		return indentations;
+	}
+
+	private JavaSourceViewerConfiguration getJavaSourceViewerConfiguration() {
+		if (fJavaSourceViewerConfiguration == null) {
+			IPreferenceStore store = PreferenceConstants.getPreferenceStore();
+			/*
+			 * NOTE: null text editor is being passed to
+			 * JavaSourceViewerConfiguration because
+			 * StructuredTextViewerConfiguration does not know current editor.
+			 * this is okay because editor is not needed in the cases we are
+			 * using javasourceviewerconfiguration.
+			 */
+			fJavaSourceViewerConfiguration = new JavaSourceViewerConfiguration(JavaUI.getColorManager(), store, null, IJavaPartitions.JAVA_PARTITIONING);
+		}
+		return fJavaSourceViewerConfiguration;
+	}
+
+	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
+		LineStyleProvider[] providers = null;
+
+		if (partitionType == IHTMLPartitions.HTML_DEFAULT || partitionType == IHTMLPartitions.HTML_COMMENT || partitionType == IHTMLPartitions.HTML_DECLARATION) {
+			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitions.HTML_DEFAULT);
+		}
+		else if (partitionType == IHTMLPartitions.SCRIPT || partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT) {
+			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitions.SCRIPT);
+		}
+		else if (partitionType == ICSSPartitions.STYLE || partitionType == ICSSPartitions.COMMENT) {
+			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, ICSSPartitions.STYLE);
+		}
+		else if (partitionType == IXMLPartitions.XML_DEFAULT || partitionType == IXMLPartitions.XML_CDATA || partitionType == IXMLPartitions.XML_COMMENT || partitionType == IXMLPartitions.XML_DECLARATION || partitionType == IXMLPartitions.XML_PI) {
+			providers = getXMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IXMLPartitions.XML_DEFAULT);
+		}
+		else if (partitionType == IJSPPartitions.JSP_CONTENT_JAVA) {
+			providers = new LineStyleProvider[]{getLineStyleProviderForJava()};
+		}
+		else if (partitionType == IJSPPartitions.JSP_DEFAULT_EL) {
+			providers = new LineStyleProvider[]{getLineStyleProviderForJSPEL()};
+		}
+		else if (partitionType == IJSPPartitions.JSP_COMMENT || partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER || partitionType == IJSPPartitions.JSP_DEFAULT || partitionType == IJSPPartitions.JSP_DIRECTIVE) {
+			providers = new LineStyleProvider[]{getLineStyleProviderForJSP()};
+		}
+
+		return providers;
+	}
+
+	private LineStyleProvider getLineStyleProviderForJava() {
+		if (fLineStyleProviderForJava == null) {
+			fLineStyleProviderForJava = new LineStyleProviderForJava();
+		}
+		return fLineStyleProviderForJava;
+	}
+
+	private LineStyleProvider getLineStyleProviderForJSP() {
+		if (fLineStyleProviderForJSP == null) {
+			fLineStyleProviderForJSP = new LineStyleProviderForJSP();
+		}
+		return fLineStyleProviderForJSP;
+	}
+
+	private LineStyleProvider getLineStyleProviderForJSPEL() {
+		if (fLineStyleProviderForJSPEL == null) {
+			fLineStyleProviderForJSPEL = new LineStyleProviderForJSPEL();
+		}
+		return fLineStyleProviderForJSPEL;
+	}
+
+	public ILabelProvider getStatusLineLabelProvider(ISourceViewer sourceViewer) {
+		if (fStatusLineLabelProvider == null) {
+			fStatusLineLabelProvider = new JFaceNodeLabelProvider() {
+				public String getText(Object element) {
+					if (element == null)
+						return null;
+
+					StringBuffer s = new StringBuffer();
+					Node node = (Node) element;
+					while (node != null) {
+						if (node.getNodeType() != Node.DOCUMENT_NODE) {
+							s.insert(0, super.getText(node));
+						}
+
+						if (node.getNodeType() == Node.ATTRIBUTE_NODE)
+							node = ((Attr) node).getOwnerElement();
+						else
+							node = node.getParentNode();
+					
+						if (node != null && node.getNodeType() != Node.DOCUMENT_NODE) {
+							s.insert(0, IPath.SEPARATOR);
+						}
+					}
+					return s.toString();
+				}
+
+			};
+		}
+		return fStatusLineLabelProvider;
+	}
+
+	private StructuredTextViewerConfiguration getXMLSourceViewerConfiguration() {
+		if (fXMLSourceViewerConfiguration == null) {
+			fXMLSourceViewerConfiguration = new StructuredTextViewerConfigurationXML();
+		}
+		return fXMLSourceViewerConfiguration;
+	}
+
+	protected Map getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
+		Map targets = super.getHyperlinkDetectorTargets(sourceViewer);
+		targets.put(ContentTypeIdForJSP.ContentTypeID_JSP, null);
+
+		// also add html & xml since there could be html/xml content in jsp
+		// (just hope the hyperlink detectors will do additional checking)
+		targets.put(ContentTypeIdForHTML.ContentTypeID_HTML, null);
+		targets.put(ContentTypeIdForXML.ContentTypeID_XML, null);
+		return targets;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionConstantsJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionConstantsJSP.java
new file mode 100644
index 0000000..a400780
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionConstantsJSP.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal;
+
+/**
+ * @author pavery
+ */
+public interface IActionConstantsJSP {
+	public final static String ACTION_NAME_RENAME_ELEMENT = "RenameElement"; //$NON-NLS-1$
+	public final static String ACTION_NAME_MOVE_ELEMENT = "MoveElement"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionDefinitionIdsJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionDefinitionIdsJSP.java
new file mode 100644
index 0000000..f90607e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionDefinitionIdsJSP.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal;
+
+import org.eclipse.jdt.ui.actions.IJavaEditorActionDefinitionIds;
+
+/**
+ * @author pavery
+ */
+public interface IActionDefinitionIdsJSP {
+	public final static String RENAME_ELEMENT = IJavaEditorActionDefinitionIds.RENAME_ELEMENT;
+	public final static String MOVE_ELEMENT = IJavaEditorActionDefinitionIds.MOVE_ELEMENT;
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java
new file mode 100644
index 0000000..2f70c20
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Strings used by JSP UI
+ * 
+ * @plannedfor 1.0
+ */
+public class JSPUIMessages extends NLS {
+	private static final String BUNDLE_NAME = "org.eclipse.jst.jsp.ui.internal.JSPUIPluginResources";//$NON-NLS-1$
+	private static ResourceBundle fResourceBundle;
+	
+	static {
+		// load message values from bundle file
+		NLS.initializeMessages(BUNDLE_NAME, JSPUIMessages.class);
+	}
+
+	public static ResourceBundle getResourceBundle() {
+		try {
+			if (fResourceBundle == null)
+				fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
+		}
+		catch (MissingResourceException x) {
+			fResourceBundle = null;
+		}
+		return fResourceBundle;
+	}
+
+	public static String Sample_JSP_doc;
+	public static String JSP_Delimiters_UI_;
+	public static String Refactor_label;
+	public static String RenameElement_label; // resource bundle
+	public static String MoveElement_label; // resource bundle
+	public static String MoveElementWizard;
+	public static String OK;
+	public static String JSP_changes;
+	public static String ActionContributorJSP_0;
+	public static String JSPRenameElementAction_0;
+	public static String JSPMoveElementAction_0;
+	public static String BasicRefactorSearchRequestor_0;
+	public static String BasicRefactorSearchRequestor_1;
+	public static String BasicRefactorSearchRequestor_2;
+	public static String BasicRefactorSearchRequestor_3;
+	public static String BasicRefactorSearchRequestor_4;
+	public static String BasicRefactorSearchRequestor_5;
+	public static String BasicRefactorSearchRequestor_6;
+	public static String BreakpointNotAllowed;
+	public static String _UI_WIZARD_NEW_TITLE;
+	public static String _UI_WIZARD_NEW_HEADING;
+	public static String _UI_WIZARD_NEW_DESCRIPTION;
+	public static String _UI_WIZARD_TAG_NEW_TITLE;
+	public static String _UI_WIZARD_TAG_NEW_HEADING;
+	public static String _UI_WIZARD_TAG_NEW_DESCRIPTION;
+	public static String _ERROR_FILENAME_MUST_END_JSP;
+	public static String _WARNING_FILE_MUST_BE_INSIDE_JAVA_PROJECT;
+	public static String _WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT;
+	public static String ResourceGroup_nameExists;
+	public static String NewJSPTemplatesWizardPage_0;
+	public static String NewJSPTemplatesWizardPage_1;
+	public static String NewJSPTemplatesWizardPage_2;
+	public static String NewJSPTemplatesWizardPage_3;
+	public static String NewJSPTemplatesWizardPage_4;
+	public static String NewJSPTemplatesWizardPage_5;
+	public static String NewJSPTemplatesWizardPage_6;
+	public static String NewJSPTemplatesWizardPage_7;
+	public static String NewTagTemplatesWizardPage_0;
+	public static String NewTagTemplatesWizardPage_1;
+	public static String NewTagTemplatesWizardPage_2;
+	public static String NewTagTemplatesWizardPage_3;
+	public static String NewTagTemplatesWizardPage_4;
+	public static String NewTagTemplatesWizardPage_5;
+	public static String NewTagTemplatesWizardPage_6;
+	public static String NewTagTemplatesWizardPage_7;
+	public static String ToggleComment_label; // resource bundle
+	public static String ToggleComment_tooltip; // resource bundle
+	public static String ToggleComment_description; // resource bundle
+	public static String AddBlockComment_label; // resource bundle
+	public static String AddBlockComment_tooltip; // resource bundle
+	public static String AddBlockComment_description; // resource bundle
+	public static String RemoveBlockComment_label; // resource bundle
+	public static String RemoveBlockComment_tooltip; // resource bundle
+	public static String RemoveBlockComment_description; // resource bundle
+	public static String CleanupDocument_label; // resource bundle
+	public static String CleanupDocument_tooltip; // resource bundle
+	public static String CleanupDocument_description; // resource bundle
+	public static String FindOccurrences_label;	// resource bundle
+	public static String OccurrencesSearchQuery_0;
+	public static String OccurrencesSearchQuery_2;
+	public static String Override_method_in;
+	public static String Creating_files_encoding;
+	public static String Content_Assist_not_availab_UI_;
+	public static String Java_Content_Assist_is_not_UI_;
+	public static String JSPSourcePreferencePage_0;
+	public static String JSPSourcePreferencePage_1;
+	public static String JSPSourcePreferencePage_2;
+	public static String JSPColorPage_jsp_content;
+	public static String JSPFilesPreferencePage_0;
+	public static String JSPFilesPreferencePage_1;
+	public static String JSPFContentSettingsPropertyPage_0;
+	public static String JSPFContentSettingsPropertyPage_1;
+	public static String JSPFContentSettingsPropertyPage_2;
+	public static String JSPFContentSettingsPropertyPage_3;
+	public static String JSPFContentSettingsPropertyPage_4;
+	public static String ProjectJSPFContentSettingsPropertyPage_0;
+	public static String TagPropertyPage_desc;
+	public static String Title_InvalidValue;
+	public static String Message_InvalidValue;
+	public static String SyntaxColoringPage_0;
+	public static String SyntaxColoringPage_2;
+	public static String SyntaxColoringPage_3;
+	public static String SyntaxColoringPage_4;
+	public static String SyntaxColoringPage_5;
+	public static String SyntaxColoringPage_6;
+	public static String _UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK;
+	
+	public static String JSPTyping_Auto_Complete;
+	public static String JSPTyping_Complete_Scriptlets;
+	public static String JSPTyping_Complete_Braces;
+	public static String JSPTyping_Complete_Comments;
+	public static String JSPTyping_Java_Code;
+	public static String JSPTyping_Close_Strings;
+	public static String JSPTyping_Close_Brackets;
+	public static String JSPValidationPreferencePage_0;
+
+	// below are the strings for the validation page
+	public static String Validation_description;
+	public static String Validation_Warning;
+	public static String Validation_Error;
+	public static String Validation_Ignore;
+
+	public static String VALIDATION_HEADER_DIRECTIVE;
+	public static String VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_DIFFERENT_URIS;
+	public static String VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_SAME_URIS;
+	public static String VALIDATION_DIRECTIVE_TAGLIB_MISSING_PREFIX;
+	public static String VALIDATION_DIRECTIVE_TAGLIB_MISSING_URI_OR_TAGDIR;
+	public static String VALIDATION_DIRECTIVE_TAGLIB_UNRESOLVABLE_URI_OR_TAGDIR;
+	public static String VALIDATION_DIRECTIVE_PAGE_SUPERCLASS_NOT_FOUND;
+	public static String VALIDATION_DIRECTIVE_INCLUDE_NO_FILE_SPECIFIED;
+	public static String VALIDATION_DIRECTIVE_INCLUDE_FILE_NOT_FOUND;
+	
+	public static String VALIDATION_HEADER_JAVA;
+	public static String VALIDATION_JAVA_NOTICE;
+	public static String VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED;
+	public static String VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED;
+	public static String VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE;
+	public static String VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE;
+	public static String VALIDATION_JAVA_UNUSED_IMPORT;
+
+	public static String VALIDATION_HEADER_EL;
+	public static String VALIDATION_EL_SYNTAX;
+	public static String VALIDATION_EL_LEXER;
+
+	public static String VALIDATION_HEADER_CUSTOM_ACTIONS;
+	public static String VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE;
+	public static String VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE;
+	public static String VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE;
+	public static String VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG;
+	public static String VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE;
+	public static String VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND;
+	public static String VALIDATION_TRANSLATION_TEI_CLASS_NOT_INSTANTIATED;
+	public static String VALIDATION_TRANSLATION_TEI_CLASS_RUNTIME_EXCEPTION;
+	public static String VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND;
+
+	public static String VALIDATION_HEADER_STANDARD_ACTIONS;
+	public static String VALIDATION_TRANSLATION_USEBEAN_INVALID_ID;
+	public static String VALIDATION_TRANSLATION_USBEAN_MISSING_TYPE_INFO;
+	public static String VALIDATION_TRANSLATION_USEBEAN_AMBIGUOUS_TYPE_INFO;
+
+	public static String Open;
+	public static String TLDHyperlink_hyperlinkText;
+	public static String CustomTagHyperlink_hyperlinkText;
+	public static String TLDContentOutlineConfiguration_0;
+
+	public static String JSPFilesPreferencePage_Search_group;
+	public static String JSPFilesPreferencePage_Supply_JSP_search_to_Java_search;
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPlugin.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPlugin.java
new file mode 100644
index 0000000..43ccb80
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPlugin.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal;
+
+import java.io.IOException;
+
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
+import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;
+import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
+import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
+import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistryImpl;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class JSPUIPlugin extends AbstractUIPlugin {
+	public final static String ID = "org.eclipse.jst.jsp.ui"; //$NON-NLS-1$
+
+	protected static JSPUIPlugin instance = null;	
+	
+	/**
+	 * The template store for the jsp editor. 
+	 */
+	private TemplateStore fTemplateStore;
+	
+	/** 
+	 * The template context type registry for the jsp editor. 
+	 */
+	private ContextTypeRegistry fContextTypeRegistry;
+
+	public JSPUIPlugin() {
+		super();
+		instance = this;
+	}
+
+	public static JSPUIPlugin getDefault() {
+		return instance;
+	}
+
+	public synchronized static JSPUIPlugin getInstance() {
+		return instance;
+	}
+
+	public AdapterFactoryRegistry getAdapterFactoryRegistry() {
+		return AdapterFactoryRegistryImpl.getInstance();
+
+	}
+
+	/**
+	 * Returns the template store for the jsp editor templates.
+	 * 
+	 * @return the template store for the jsp editor templates
+	 */
+	public TemplateStore getTemplateStore() {
+		if (fTemplateStore == null) {
+			fTemplateStore= new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), JSPUIPreferenceNames.TEMPLATES_KEY);
+
+			try {
+				fTemplateStore.load();
+			} catch (IOException e) {
+				Logger.logException(e);
+			}
+		}		
+		return fTemplateStore;
+	}
+	
+	/**
+	 * Returns the template context type registry for the jsp plugin.
+	 * 
+	 * @return the template context type registry for the jsp plugin
+	 */
+	public ContextTypeRegistry getTemplateContextRegistry() {
+		if (fContextTypeRegistry == null) {
+			ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
+			registry.addContextType(TemplateContextTypeIdsJSP.ALL);
+			registry.addContextType(TemplateContextTypeIdsJSP.NEW);
+			registry.addContextType(TemplateContextTypeIdsJSP.TAG);
+			registry.addContextType(TemplateContextTypeIdsJSP.ATTRIBUTE);
+			registry.addContextType(TemplateContextTypeIdsJSP.ATTRIBUTE_VALUE);
+			registry.addContextType(TemplateContextTypeIdsJSP.NEW_TAG);
+			
+			fContextTypeRegistry= registry;
+		}
+
+		return fContextTypeRegistry;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
new file mode 100644
index 0000000..a5d31eb
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
@@ -0,0 +1,170 @@
+###############################################################################
+# Copyright (c) 2004, 2009 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+## The following line is a sample JSP document.  Please translate only the following parts:
+## Use below tags ONLY for JSP 1.1
+## Welcome!
+## Use below tags ONLY for JSP 1.2
+## Welcome!
+Sample_JSP_doc=<%@ page \n\tlanguage=\"java\" \n\tcontentType=\"text/html; charset=ISO-8859-1\"\n%>\n<jsp:include flush=\"true\" page=\"titleBar.jsp\"/>\n\n<%-- Use below tags ONLY for JSP 1.1 --%>\n<%\n\tSystem.out.println(\"Welcome!\");\n%>\n<%-- Use below tags ONLY for JSP 1.2 --%>\n<jsp:scriptlet>\n\tSystem.out.println(\"Welcome!\");\n</jsp:scriptlet>
+JSP_Delimiters_UI_=Scripting Element Delimiters
+Refactor_label=Refactor
+RenameElement_label=Rename
+MoveElement_label=Move
+MoveElementWizard=Move the selected elements
+#
+OK=OK
+BreakpointNotAllowed=A breakpoint is not allowed on this line
+JSP_changes=JSP changes
+ActionContributorJSP_0=Refa&ctor
+JSPRenameElementAction_0=Editor selection does not resolve to a renamable Java element
+JSPMoveElementAction_0=Editor selection does not resolve to movable Java elements
+BasicRefactorSearchRequestor_0=JSP Rename
+BasicRefactorSearchRequestor_1=in file: {0} line: {1}
+BasicRefactorSearchRequestor_2=Move Type ''{0}'' to package ''{1}''
+BasicRefactorSearchRequestor_3=Rename Method ''{0}'' to ''{1}''
+BasicRefactorSearchRequestor_4=Rename Type ''{0}'' to ''{1}''
+BasicRefactorSearchRequestor_5=Rename Package ''{0}'' to ''{1}''
+BasicRefactorSearchRequestor_6=JSP Rename Change
+#
+_UI_WIZARD_NEW_TITLE = New JSP File
+_UI_WIZARD_NEW_HEADING = JSP
+_UI_WIZARD_NEW_DESCRIPTION = Create a new JSP file.
+_UI_WIZARD_TAG_NEW_TITLE = New Tag File
+_UI_WIZARD_TAG_NEW_HEADING = Tag File
+_UI_WIZARD_TAG_NEW_DESCRIPTION = Create a new Tag.
+_ERROR_FILENAME_MUST_END_JSP = The file name must end in one of the following extensions {0}. 
+_WARNING_FILE_MUST_BE_INSIDE_JAVA_PROJECT = JavaServer Pages created in projects that do not support Java might not work as expected. 
+_WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT = Files created outside of the Web Content folder will not be included in your deployed Web application. 
+ResourceGroup_nameExists = The same name already exists.
+NewJSPTemplatesWizardPage_0=Select JSP Template
+NewJSPTemplatesWizardPage_1=Select a template as initial content in the JSP page.
+NewJSPTemplatesWizardPage_2=Name
+NewJSPTemplatesWizardPage_3=Description
+NewJSPTemplatesWizardPage_4=&Use JSP Template
+NewJSPTemplatesWizardPage_5=&Preview:
+NewJSPTemplatesWizardPage_6=Templates are 'New JSP' templates found in the <a>JSP Templates</a> preference page.
+NewJSPTemplatesWizardPage_7=&Templates:
+NewTagTemplatesWizardPage_0=Select Tag file Template
+NewTagTemplatesWizardPage_1=Select a template as initial content in the Tag file.
+NewTagTemplatesWizardPage_2=Name
+NewTagTemplatesWizardPage_3=Description
+NewTagTemplatesWizardPage_4=&Use Tag file Template
+NewTagTemplatesWizardPage_5=&Preview:
+NewTagTemplatesWizardPage_6=Templates are 'New Tag' templates found in the <a>JSP Templates</a> preference page.
+NewTagTemplatesWizardPage_7=&Templates:
+# Copied from sse.ui
+CleanupDocument_label=Cleanup Document...
+CleanupDocument_tooltip=Cleanup Document
+CleanupDocument_description=Cleanup Document
+ToggleComment_label=Toggle Comment
+ToggleComment_tooltip=Toggle Comment
+ToggleComment_description=Toggle Comment
+AddBlockComment_label=Add Block Comment
+AddBlockComment_tooltip=Add Block Comment
+AddBlockComment_description=Add Block Comment
+RemoveBlockComment_label=Remove Block Comment
+RemoveBlockComment_tooltip=Remove Block Comment
+RemoveBlockComment_description=Remove Block Comment
+FindOccurrences_label=Occurrences in File
+OccurrencesSearchQuery_0={0} - {1} Occurrences in {2}
+OccurrencesSearchQuery_2=file
+Content_Assist_not_availab_UI_=Content Assist not available at the current location
+Java_Content_Assist_is_not_UI_=Java Content Assist is not available for the current cursor location
+#
+Override_method_in=Override method in '
+Creating_files_encoding=Creating files encoding preference
+#
+JSPSourcePreferencePage_0=JSP Source preferences are based on the content within the JSP.
+JSPSourcePreferencePage_1=See <a>''{0}''</a> for JSP with HTML content.
+JSPSourcePreferencePage_2=See <a>''{0}''</a> for JSP with XML content.
+JSPColorPage_jsp_content=Scripting Elements
+JSPFilesPreferencePage_0=Validating files
+JSPFilesPreferencePage_1=Validate JSP fragments
+# JSP Fragments
+JSPFContentSettingsPropertyPage_0=none
+JSPFContentSettingsPropertyPage_1=The properties used instead of the page directive that cannot be specified in JSP fragment files.  The project setting is used if you specify "none."
+JSPFContentSettingsPropertyPage_2=Language:
+JSPFContentSettingsPropertyPage_3=Content Type:
+JSPFContentSettingsPropertyPage_4=Enable specific setting:
+ProjectJSPFContentSettingsPropertyPage_0=The properties for J2EE Web projects act as "project" default to be looked up when no properties are specified for a particular JSP fragment file.
+# CSS JSP
+Title_InvalidValue=Invalid Value
+Message_InvalidValue=Invalid property value.
+
+SyntaxColoringPage_0=Syntax Element:
+SyntaxColoringPage_2=Enable
+SyntaxColoringPage_3=&Bold
+SyntaxColoringPage_4=&Italic
+SyntaxColoringPage_5=&Strikethrough
+SyntaxColoringPage_6=&Underline
+_UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK=JSP editing preferences.  Note that some preferences may be set on the <a>{0}</a> preference page.
+
+# JSP Typing Preference Page
+JSPTyping_Auto_Complete=Automatically close
+JSPTyping_Complete_Scriptlets=&Scriptlet regions
+JSPTyping_Complete_Braces=&Braces in EL expressions
+JSPTyping_Complete_Comments=&JSP comments
+JSPTyping_Java_Code=Java
+JSPTyping_Close_Strings=Automatically close "s&trings"
+JSPTyping_Close_Brackets=Automatically close (parentheses), [square] and <angle> brac&kets
+# Validation page strings
+Validation_description=Select the severity level for the following validation problems:
+Validation_Warning=Warning
+Validation_Error=Error
+Validation_Ignore=Ignore
+JSPValidationPreferencePage_0=Errors/Warnings
+
+VALIDATION_HEADER_DIRECTIVE=Directives
+VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_DIFFERENT_URIS=Same prefix used for different URIs or tagdir:
+VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_SAME_URIS=Redundant tag library directive:
+VALIDATION_DIRECTIVE_TAGLIB_MISSING_PREFIX=No prefix specified:
+VALIDATION_DIRECTIVE_TAGLIB_MISSING_URI_OR_TAGDIR=No URI or tagdir specified:
+VALIDATION_DIRECTIVE_TAGLIB_UNRESOLVABLE_URI_OR_TAGDIR=Unresolvable URI or tagdir:
+VALIDATION_DIRECTIVE_PAGE_SUPERCLASS_NOT_FOUND=Superclass not found:
+VALIDATION_DIRECTIVE_INCLUDE_NO_FILE_SPECIFIED=Included fragment file not specified:
+VALIDATION_DIRECTIVE_INCLUDE_FILE_NOT_FOUND=Included fragment file not found:
+
+VALIDATION_HEADER_JAVA=Java
+VALIDATION_JAVA_NOTICE=These values override those on the <a>''{0}''</a> page:
+VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED=Local variable never used:
+VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED=Parameter is never read:
+VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE=Null pointer access:
+VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE=Potential null pointer access:
+VALIDATION_JAVA_UNUSED_IMPORT=Unused import:
+	
+VALIDATION_HEADER_EL=Expression Language
+VALIDATION_EL_SYNTAX=EL Syntax problem:
+VALIDATION_EL_LEXER=Unable to analyze EL expression due to lexical analysis error: 
+
+VALIDATION_HEADER_CUSTOM_ACTIONS=Custom actions
+VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE=Missing required attribute:
+VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE=Unknown attribute:
+VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE=Attribute does not support runtime expressions:
+VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG=Tag declared with empty content has content:
+VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE=TagExtraInfo validation message:
+VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND=TagExtraInfo class not on Java Build Path:
+VALIDATION_TRANSLATION_TEI_CLASS_NOT_INSTANTIATED=Failure instantiating TagExtraInfo class:
+VALIDATION_TRANSLATION_TEI_CLASS_RUNTIME_EXCEPTION=Other problems with TagExtraInfo class:	
+VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND=Classic tag handler class not on Java Build Path:
+
+VALIDATION_HEADER_STANDARD_ACTIONS=Standard actions
+VALIDATION_TRANSLATION_USEBEAN_INVALID_ID=Invalid 'id' specified for jsp:useBean:
+VALIDATION_TRANSLATION_USBEAN_MISSING_TYPE_INFO=Missing type information for jsp:useBean:
+VALIDATION_TRANSLATION_USEBEAN_AMBIGUOUS_TYPE_INFO=Ambiguous type information for jsp:useBean:
+
+Open=Open ''{0}''
+TLDHyperlink_hyperlinkText=Open Descriptor
+CustomTagHyperlink_hyperlinkText=Open Declaration
+TLDContentOutlineConfiguration_0=Show Content Values
+TagPropertyPage_desc=Specify the surrounding language used in this tag file:
+
+JSPFilesPreferencePage_Search_group=Search
+JSPFilesPreferencePage_Supply_JSP_search_to_Java_search=&Include JSP matches in Java searches
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/Logger.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/Logger.java
new file mode 100644
index 0000000..5df00f6
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/Logger.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal;
+
+import com.ibm.icu.util.StringTokenizer;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.osgi.framework.Bundle;
+
+/**
+ * Small convenience class to log messages to plugin's log file and also, if desired,
+ * the console. This class should only be used by classes in this plugin. Other
+ * plugins should make their own copy, with appropriate ID.
+ */
+public class Logger {
+	private static final String PLUGIN_ID = "org.eclipse.jst.jsp.ui"; //$NON-NLS-1$
+
+	private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
+
+	public static final int OK = IStatus.OK; // 0
+	public static final int INFO = IStatus.INFO; // 1
+	public static final int WARNING = IStatus.WARNING; // 2
+	public static final int ERROR = IStatus.ERROR; // 4
+
+	public static final int OK_DEBUG = 200 + OK;
+	public static final int INFO_DEBUG = 200 + INFO;
+	public static final int WARNING_DEBUG = 200 + WARNING;
+	public static final int ERROR_DEBUG = 200 + ERROR;
+
+	/**
+	 * Adds message to log.
+	 * @param level severity level of the message (OK, INFO, WARNING, ERROR, OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
+	 * @param message text to add to the log
+	 * @param exception exception thrown
+	 */
+	protected static void _log(int level, String message, Throwable exception) {
+		if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
+			if (!isDebugging())
+				return;
+		}
+
+		int severity = IStatus.OK;
+		switch (level) {
+			case INFO_DEBUG :
+			case INFO :
+				severity = IStatus.INFO;
+				break;
+			case WARNING_DEBUG :
+			case WARNING :
+				severity = IStatus.WARNING;
+				break;
+			case ERROR_DEBUG :
+			case ERROR :
+				severity = IStatus.ERROR;
+		}
+		message = (message != null) ? message : "null"; //$NON-NLS-1$
+		Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
+		Bundle bundle = Platform.getBundle(PLUGIN_ID);
+		if (bundle != null) 
+			Platform.getLog(bundle).log(statusObj);
+	}
+
+	/**
+	 * Prints message to log if category matches /debug/tracefilter option.
+	 * @param message text to print
+	 * @param category category of the message, to be compared with /debug/tracefilter
+	 */
+	protected static void _trace(String category, String message, Throwable exception) {
+		if (isTracing(category)) {
+			message = (message != null) ? message : "null"; //$NON-NLS-1$
+			Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
+			Bundle bundle = Platform.getBundle(PLUGIN_ID);
+			if (bundle != null) 
+				Platform.getLog(bundle).log(statusObj);
+		}
+	}
+
+	/**
+	 * @return true if the platform is debugging
+	 */
+	public static boolean isDebugging() {
+		return Platform.inDebugMode();
+	}
+
+	/**
+	 * Determines if currently tracing a category
+	 * @param category
+	 * @return true if tracing category, false otherwise
+	 */
+	public static boolean isTracing(String category) {
+		if (!isDebugging())
+			return false;
+
+		String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
+		if (traceFilter != null) {
+			StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
+			while (tokenizer.hasMoreTokens()) {
+				String cat = tokenizer.nextToken().trim();
+				if (category.equals(cat)) {
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+
+	public static void log(int level, String message) {
+		_log(level, message, null);
+	}
+
+	public static void log(int level, String message, Throwable exception) {
+		_log(level, message, exception);
+	}
+
+	public static void logException(String message, Throwable exception) {
+		_log(ERROR, message, exception);
+	}
+
+	public static void logException(Throwable exception) {
+		_log(ERROR, exception.getMessage(), exception);
+	}
+
+	public static void traceException(String category, String message, Throwable exception) {
+		_trace(category, message, exception);
+	}
+
+	public static void traceException(String category, Throwable exception) {
+		_trace(category, exception.getMessage(), exception);
+	}
+
+	public static void trace(String category, String message) {
+		_trace(category, message, null);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/actions/JSPNodeActionManager.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/actions/JSPNodeActionManager.java
new file mode 100644
index 0000000..ba58b98
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/actions/JSPNodeActionManager.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.actions;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.wst.html.ui.internal.contentoutline.HTMLNodeActionManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.w3c.dom.Node;
+
+public class JSPNodeActionManager extends HTMLNodeActionManager {
+
+	public JSPNodeActionManager(IStructuredModel model, Viewer viewer) {
+		super(model, viewer);
+	}
+	
+	protected boolean canContributeChildActions(Node node){
+		String nodeName = node.getNodeName().toLowerCase();
+		return !(nodeName.equals(JSP11Namespace.ElementName.SCRIPTLET) || nodeName.equals(JSP11Namespace.ElementName.DECLARATION) || nodeName.equals(JSP11Namespace.ElementName.EXPRESSION));
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/AutoEditStrategyForTabs.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/AutoEditStrategyForTabs.java
new file mode 100644
index 0000000..1ecbc02
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/AutoEditStrategyForTabs.java
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *******************************************************************************/
+
+package org.eclipse.jst.jsp.ui.internal.autoedit;
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.ConfigurableLineTracker;
+import org.eclipse.jface.text.DocumentCommand;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ILineTracker;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension3;
+import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
+import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
+
+/**
+ * AutoEditStrategy to handle characters inserted when Tab key is pressed
+ */
+public class AutoEditStrategyForTabs implements IAutoEditStrategy {
+	private final String TAB_CHARACTER = "\t"; //$NON-NLS-1$
+
+	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
+		// if not in smart insert mode just ignore
+		if (!isSmartInsertMode())
+			return;
+
+		// spaces for tab character
+		if (command.length == 0 && command.text != null && command.text.length() > 0 && command.text.indexOf(TAB_CHARACTER) != -1)
+			smartInsertForTab(command, document);
+	}
+
+	/**
+	 * Insert spaces for tabs
+	 * 
+	 * @param command
+	 */
+	private void smartInsertForTab(DocumentCommand command, IDocument document) {
+		// tab key was pressed. now check preferences to see if need to insert
+		// spaces instead of tab
+		int indentationWidth = getIndentationWidth();
+		if (indentationWidth > -1) {
+			String originalText = command.text;
+			StringBuffer newText = new StringBuffer(originalText);
+
+			// determine where in line this command begins
+			int lineOffset = -1;
+			try {
+				IRegion lineInfo = document.getLineInformationOfOffset(command.offset);
+				lineOffset = command.offset - lineInfo.getOffset();
+			} catch (BadLocationException e) {
+				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+			}
+
+			ILineTracker lineTracker = getLineTracker(document, originalText);
+
+			int startIndex = 0;
+			int index = newText.indexOf(TAB_CHARACTER);
+			while (index != -1) {
+				String indent = getIndentString(indentationWidth, lineOffset, lineTracker, index);
+
+				// replace \t character with spaces
+				newText.replace(index, index + 1, indent);
+				if (lineTracker != null) {
+					try {
+						lineTracker.replace(index, 1, indent);
+					} catch (BadLocationException e) {
+						// if something goes wrong with replacing text, just
+						// reset to current string
+						lineTracker.set(newText.toString());
+						Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+					}
+				}
+
+				startIndex = index + indent.length();
+				index = newText.indexOf(TAB_CHARACTER, startIndex);
+			}
+			command.text = newText.toString();
+		}
+	}
+
+	/**
+	 * Calculate number of spaces for next tab stop
+	 */
+	private String getIndentString(int indentationWidth, int lineOffset, ILineTracker lineTracker, int index) {
+		int indentSize = indentationWidth;
+		int offsetInLine = -1;
+		if (lineTracker != null) {
+			try {
+				IRegion lineInfo = lineTracker.getLineInformationOfOffset(index);
+				if (lineInfo.getOffset() == 0 && lineOffset > -1)
+					offsetInLine = lineOffset + index;
+				else
+					offsetInLine = index - lineInfo.getOffset();
+			} catch (BadLocationException e) {
+				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+			}
+		} else {
+			if (lineOffset > -1) {
+				offsetInLine = lineOffset + index;
+			}
+		}
+		if (offsetInLine > -1 && indentationWidth > 0) {
+			int remainder = offsetInLine % indentationWidth;
+			indentSize = indentationWidth - remainder;
+		}
+
+		StringBuffer indent = new StringBuffer();
+		for (int i = 0; i < indentSize; i++)
+			indent.append(' ');
+		return indent.toString();
+	}
+
+	/**
+	 * Set up a line tracker for text within command if text is multi-line
+	 */
+	private ILineTracker getLineTracker(IDocument document, String originalText) {
+		ConfigurableLineTracker lineTracker = null;
+		int[] delims = TextUtilities.indexOf(document.getLegalLineDelimiters(), originalText, 0);
+		if (delims[0] != -1 || delims[1] != -1) {
+			lineTracker = new ConfigurableLineTracker(document.getLegalLineDelimiters());
+			lineTracker.set(originalText);
+		}
+		return lineTracker;
+	}
+
+	/**
+	 * Return true if active editor is in smart insert mode, false otherwise
+	 * 
+	 * @return
+	 */
+	private boolean isSmartInsertMode() {
+		boolean isSmartInsertMode = false;
+
+		ITextEditor textEditor = null;
+		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+		if (window != null) {
+			IWorkbenchPage page = window.getActivePage();
+			if (page != null) {
+				IEditorPart editor = page.getActiveEditor();
+				if (editor != null) {
+					if (editor instanceof ITextEditor)
+						textEditor = (ITextEditor) editor;
+					else
+						textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
+				}
+			}
+		}
+
+		// check if smart insert mode
+		if (textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT)
+			isSmartInsertMode = true;
+		return isSmartInsertMode;
+	}
+
+	/**
+	 * Returns indentation width if using spaces for indentation, -1 otherwise
+	 * 
+	 * @return
+	 */
+	private int getIndentationWidth() {
+		int width = -1;
+
+		Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
+		if (HTMLCorePreferenceNames.SPACE.equals(preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR)))
+			width = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
+
+		return width;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java
new file mode 100644
index 0000000..d0c7abd
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.autoedit;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DocumentCommand;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension3;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.w3c.dom.Node;
+
+public class StructuredAutoEditStrategyJSP implements IAutoEditStrategy {
+	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
+		Object textEditor = getActiveTextEditor();
+		if (!(textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT))
+			return;
+
+		IStructuredModel model = null;
+		try {
+			model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+
+			if (model != null) {
+				if (command.text != null) {
+					smartInsertForEndTag(command, document, model);
+
+					if (command.text.equals("%") && isPreferenceEnabled(JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS)) { //$NON-NLS-1$
+						// scriptlet - add end %>
+						IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
+						if (node != null && prefixedWith(document, command.offset, "<") && !node.getSource().endsWith("%>")) { //$NON-NLS-1$ //$NON-NLS-2$
+							command.text += " %>"; //$NON-NLS-1$
+							command.shiftsCaret = false;
+							command.caretOffset = command.offset + 1;
+							command.doit = false;
+						}
+					}
+					if (command.text.equals("{") && isPreferenceEnabled(JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES)) { //$NON-NLS-1$
+						IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
+						if (node != null && (prefixedWith(document, command.offset, "$") || prefixedWith(document, command.offset, "#")) && //$NON-NLS-1$ //$NON-NLS-2$
+									!node.getSource().endsWith("}")) { //$NON-NLS-1$ //$NON-NLS-2$
+							command.text += " }"; //$NON-NLS-1$
+							command.shiftsCaret = false;
+							command.caretOffset = command.offset + 1;
+							command.doit = false;
+						}
+					}
+				}
+			}
+		}
+		finally {
+			if (model != null)
+				model.releaseFromRead();
+		}
+	}
+	
+	private boolean isPreferenceEnabled(String key) {
+		return (key != null && JSPUIPlugin.getDefault().getPreferenceStore().getBoolean(key));
+	}
+
+	/**
+	 * Return the active text editor if possible, otherwise the active editor
+	 * part.
+	 * 
+	 * @return
+	 */
+	private Object getActiveTextEditor() {
+		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+		if (window != null) {
+			IWorkbenchPage page = window.getActivePage();
+			if (page != null) {
+				IEditorPart editor = page.getActiveEditor();
+				if (editor != null) {
+					if (editor instanceof ITextEditor)
+						return editor;
+					ITextEditor textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
+					if (textEditor != null)
+						return textEditor;
+					return editor;
+				}
+			}
+		}
+		return null;
+	}
+
+	private boolean prefixedWith(IDocument document, int offset, String string) {
+
+		try {
+			return document.getLength() >= string.length() && document.get(offset - string.length(), string.length()).equals(string);
+		}
+		catch (BadLocationException e) {
+			Logger.logException(e);
+			return false;
+		}
+	}
+	
+	private boolean isCommentNode(IDOMNode node) {
+		return ((node != null) && (node instanceof IDOMElement) && ((IDOMElement) node).isCommentTag());
+	}
+
+	private boolean isDocumentNode(IDOMNode node) {
+		return ((node != null) && (node.getNodeType() == Node.DOCUMENT_NODE));
+	}
+	
+	private void smartInsertForEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
+		try {
+			if (command.text.equals("/") && (document.getLength() >= 1) && document.get(command.offset - 1, 1).equals("<") && HTMLUIPlugin.getDefault().getPreferenceStore().getBoolean(HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
+				IDOMNode parentNode = (IDOMNode) ((IDOMNode) model.getIndexedRegion(command.offset - 1)).getParentNode();
+				if (isCommentNode(parentNode)) {
+					// loop and find non comment node parent
+					while ((parentNode != null) && isCommentNode(parentNode)) {
+						parentNode = (IDOMNode) parentNode.getParentNode();
+					}
+				}
+
+				if (!isDocumentNode(parentNode)) {
+					// only add end tag if one does not already exist or if
+					// add '/' does not create one already
+					IStructuredDocumentRegion endTagStructuredDocumentRegion = parentNode.getEndStructuredDocumentRegion();
+					IDOMNode ancestor = parentNode;
+					boolean smartInsertForEnd = false;
+					if(endTagStructuredDocumentRegion != null) {
+						// Look for ancestors by the same name that are missing end tags
+						while((ancestor = (IDOMNode) ancestor.getParentNode()) != null) {
+							if(ancestor.getEndStructuredDocumentRegion() == null && parentNode.getNodeName().equals(ancestor.getNodeName())) {
+								smartInsertForEnd = true;
+								break;
+							}
+						}
+					}
+					if (endTagStructuredDocumentRegion == null || smartInsertForEnd) {
+						StringBuffer toAdd = new StringBuffer(parentNode.getNodeName());
+						if (toAdd.length() > 0) {
+							toAdd.append(">"); //$NON-NLS-1$
+							String suffix = toAdd.toString();
+							if ((document.getLength() < command.offset + suffix.length()) || (!suffix.equals(document.get(command.offset, suffix.length())))) {
+								command.text += suffix;
+							}
+						}
+					}
+				}
+			}
+		}
+		catch (BadLocationException e) {
+			Logger.logException(e);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSPJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSPJava.java
new file mode 100644
index 0000000..dfd0a26
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSPJava.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.autoedit;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DocumentCommand;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension3;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+
+public class StructuredAutoEditStrategyJSPJava implements IAutoEditStrategy {
+
+	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
+		Object textEditor = getActiveTextEditor();
+		if (!(textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT))
+			return;
+		
+		IStructuredModel model = null;
+		try {
+			// Auto edit for JSP Comments
+			if ("-".equals(command.text) && isPreferenceEnabled(JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS)) { //$NON-NLS-1$
+				if (prefixedWith(document, command.offset, "<%-")) { //$NON-NLS-1$
+					
+					model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+					if (model != null) {
+						IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
+						IDOMNode parent = (node != null) ? (IDOMNode) node.getParentNode() : null;
+						// Parent is the scriptlet tag
+						if (parent != null && !parent.getSource().endsWith("--%>")) { //$NON-NLS-1$
+							IStructuredDocumentRegion end = parent.getEndStructuredDocumentRegion();
+							if (end != null) {
+								try {
+									document.replace(end.getStartOffset(), 0, "--"); //$NON-NLS-1$
+								} catch (BadLocationException e) {
+									Logger.logException(e);
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+		finally {
+			if (model != null)
+				model.releaseFromRead();
+		}
+	}
+	
+	private boolean isPreferenceEnabled(String key) {
+		return (key != null && JSPUIPlugin.getDefault().getPreferenceStore().getBoolean(key));
+	}
+	
+	/**
+	 * Return the active text editor if possible, otherwise the active editor
+	 * part.
+	 * 
+	 * @return
+	 */
+	private Object getActiveTextEditor() {
+		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+		if (window != null) {
+			IWorkbenchPage page = window.getActivePage();
+			if (page != null) {
+				IEditorPart editor = page.getActiveEditor();
+				if (editor != null) {
+					if (editor instanceof ITextEditor)
+						return editor;
+					ITextEditor textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
+					if (textEditor != null)
+						return textEditor;
+					return editor;
+				}
+			}
+		}
+		return null;
+	}
+
+	private boolean prefixedWith(IDocument document, int offset, String string) {
+
+		try {
+			return document.getLength() >= string.length() && document.get(offset - string.length(), string.length()).equals(string);
+		}
+		catch (BadLocationException e) {
+			Logger.logException(e);
+			return false;
+		}
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/AbstractBreakpointProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/AbstractBreakpointProvider.java
new file mode 100644
index 0000000..f7e3772
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/AbstractBreakpointProvider.java
@@ -0,0 +1,268 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.breakpointproviders;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
+import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.provisional.IDOMSourceEditingTextTools;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Abstract breakpoint provider class which implements breakpoint provider
+ * interface.
+ * 
+ * This is a temporary class for JavaBreakpointProvider and
+ * JavaScriptBreakpointProvider, and should be refactored to separate Java and
+ * JavaScript parts.
+ */
+public abstract class AbstractBreakpointProvider implements IBreakpointProvider {
+
+	protected static final int END_OF_LINE = -1;
+	protected static final int JAVA = 1;
+	protected static final int JAVASCRIPT = 2;
+	private static final String[] JAVASCRIPT_LANGUAGE_KEYS = new String[]{"javascript", "javascript1.0", "javascript1.1_3", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+				"javascript1.2", "javascript1.3", "javascript1.4", "javascript1.5", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+				"javascript1.6", "jscript", "sashscript"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+	private static final String JSP_DIRECTIVE_PAGE = "jsp:directive.page"; //$NON-NLS-1$
+
+	protected static final int NO_VALID_CONTENT = -2;
+	protected static final int UNSUPPORTED = 0;
+
+	protected static boolean contains(String[] haystack, String needle) {
+		for (int i = 0; i < haystack.length; i++) {
+			if (haystack[i].equals(needle)) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	/*
+	 * Return the page language
+	 */
+	protected static int getPageLanguage(Document doc) {
+		if (doc == null)
+			return UNSUPPORTED;
+
+		NodeList pageDirectives = doc.getElementsByTagName(JSP_DIRECTIVE_PAGE);
+		// Search for first language directive
+		for (int i = 0; i < pageDirectives.getLength(); i++) {
+			Node child = pageDirectives.item(i);
+			Node languageAttr = child.getAttributes().getNamedItem("language"); //$NON-NLS-1$
+			if (languageAttr != null) {
+				String pageLanguage = languageAttr.getNodeValue();
+				if (pageLanguage == null || pageLanguage.length() == 0)
+					return UNSUPPORTED;
+				pageLanguage = pageLanguage.toLowerCase();
+				if (contains(JAVASCRIPT_LANGUAGE_KEYS, pageLanguage))
+					return JAVASCRIPT;
+				else if (pageLanguage.equals("java"))//$NON-NLS-1$
+					return JAVA;
+				else
+					return UNSUPPORTED;
+			}
+		}
+		return JAVA; // Java is default if no language directive
+	}
+
+	/*
+	 * Search the RegionContainer's regions looking for JSP content. If valid
+	 * content is found, return the position >= 0 If no valid content is
+	 * found, return NO_VALID_CONTENT. If a region starts after the line's
+	 * endOffset, return END_OF_LINE.
+	 */
+	private static int getValidRegionPosition(IStructuredModel model, ITextRegionCollection regionContainer, int startOffset, int endOffset) {
+
+		ITextRegionList regions = regionContainer.getRegions();
+		for (int i = 0; i < regions.size(); i++) {
+			ITextRegion region = regions.get(i);
+			if (region instanceof ITextRegionCollection) {
+				int validPosition = getValidRegionPosition(model, (ITextRegionCollection) region, startOffset, endOffset);
+				if (validPosition == END_OF_LINE || validPosition >= 0)
+					return validPosition;
+			}
+			else {
+				// region must be at least partially on selected line
+				if (regionContainer.getEndOffset(region) > startOffset) {
+
+					int regionStartOffset = regionContainer.getStartOffset(region);
+					// if region starts after line's endOffset, we're done
+					// searching
+					if (regionStartOffset > endOffset)
+						return END_OF_LINE;
+
+					// If region is JSP content, make sure the language is
+					// Java not Javascript by
+					// checking the content assist adapter's type.
+					if (region.getType().equals(DOMJSPRegionContexts.JSP_CONTENT)) {
+						// DWM: this logic is not incorrect ... given changes
+						// to adapters, etc.
+						// but probably don't need anything here, since both
+						// Java and JavaScript
+						// are supported in V5.
+
+						// nsd_TODO: verify this!!!
+
+						// INodeNotifier notifier =
+						// (INodeNotifier)model.getNode(region.getStartOffset());
+						// IAdapterFactory factory =
+						// model.getFactoryRegistry().getFactoryFor(ContentAssistAdapter.class);
+						// if(factory instanceof
+						// HTMLContentAssistAdapterFactory) {
+						// INodeAdapter adapter =
+						// ((HTMLContentAssistAdapterFactory)factory).createAdapter(notifier,
+						// region);
+						// if(adapter != null && adapter instanceof
+						// JSPJavaContentAssistAdapter)
+
+						if (regionStartOffset > startOffset)
+							return regionStartOffset;
+						else
+							return startOffset;
+						// }
+					}
+					// a custom tag, jsp:useBean, getproperty or setproperty
+					// statement is also a valid breakpoint location
+					else if (region.getType().equals(DOMRegionContext.XML_TAG_NAME) && (isCustomTagRegion(model.getIndexedRegion(regionStartOffset)) || regionContainer.getText(region).equals(JSP12Namespace.ElementName.USEBEAN) || regionContainer.getText(region).equals(JSP12Namespace.ElementName.GETPROPERTY) || regionContainer.getText(region).equals(JSP12Namespace.ElementName.SETPROPERTY))) {
+
+						if (regionStartOffset > startOffset)
+							return regionStartOffset;
+						else
+							return startOffset;
+					}
+					else {
+						// Defect #241090, the Text Nodes inside of JSP
+						// scriptlets, expressions, and declarations are valid
+						// breakpoint-able locations
+						boolean isCodeNode = false;
+						IndexedRegion node = model.getIndexedRegion(regionStartOffset);
+						if (node != null && node instanceof Node) {
+							Node domNode = (Node) node;
+							Node root = domNode.getOwnerDocument().getDocumentElement();
+							if (root != null && root.getNodeName().equals(JSP12Namespace.ElementName.ROOT) && domNode.getNodeType() == Node.TEXT_NODE && domNode.getParentNode() != null) {
+								String parentName = domNode.getParentNode().getNodeName();
+								isCodeNode = parentName.equals(JSP12Namespace.ElementName.SCRIPTLET) || parentName.equals(JSP12Namespace.ElementName.EXPRESSION) || parentName.equals(JSP12Namespace.ElementName.DECLARATION);
+							}
+						}
+						if (isCodeNode) {
+							if (regionStartOffset > startOffset)
+								return regionStartOffset;
+							else
+								return startOffset;
+						}
+					}
+				}
+			}
+		}
+		return NO_VALID_CONTENT;
+	}
+
+	private static boolean isCustomTagRegion(IndexedRegion node) {
+
+		if (node instanceof Element) {
+			Element xmlElement = (Element) node;
+			ModelQuery mq = ModelQueryUtil.getModelQuery(xmlElement.getOwnerDocument());
+			CMElementDeclaration decl = mq.getCMElementDeclaration(xmlElement);
+			if (decl instanceof CMNodeWrapper) {
+				CMNode cmNode = ((CMNodeWrapper) decl).getOriginNode();
+				return cmNode instanceof TLDElementDeclaration;
+			}
+		}
+		return false;
+	}
+
+	private ISourceEditingTextTools fSourceEditingTextTools;
+
+
+	protected IResource getEditorInputResource(IEditorInput input) {
+		IResource resource = (IResource) input.getAdapter(IFile.class);
+		if (resource == null) {
+			resource = (IResource) input.getAdapter(IResource.class);
+		}
+		return resource;
+	}
+
+	public ISourceEditingTextTools getSourceEditingTextTools() {
+		return fSourceEditingTextTools;
+	}
+
+	protected int getValidPosition(IDocument idoc, int lineNumber) {
+		if (!(getSourceEditingTextTools() instanceof IDOMSourceEditingTextTools)) {
+			return NO_VALID_CONTENT;
+		}
+		if (idoc == null)
+			return NO_VALID_CONTENT;
+
+		int startOffset, endOffset;
+		try {
+			startOffset = idoc.getLineOffset(lineNumber - 1);
+			endOffset = idoc.getLineOffset(lineNumber) - 1;
+
+			if (idoc == null)
+				return NO_VALID_CONTENT;
+			String lineText = idoc.get(startOffset, endOffset - startOffset).trim();
+
+			// blank lines or lines with only an open or close brace or
+			// scriptlet tag cannot have a breakpoint
+			if (lineText.equals("") || lineText.equals("{") || //$NON-NLS-2$//$NON-NLS-1$
+						lineText.equals("}") || lineText.equals("<%"))//$NON-NLS-2$//$NON-NLS-1$
+				return NO_VALID_CONTENT;
+		}
+		catch (BadLocationException e) {
+			return NO_VALID_CONTENT;
+		}
+
+		IStructuredDocumentRegion flatNode = ((IStructuredDocument) idoc).getRegionAtCharacterOffset(startOffset);
+		// go through the node's regions looking for JSP content
+		// until reaching the end of the line
+		while (flatNode != null) {
+			int validPosition = getValidRegionPosition(((IDOMDocument) ((IDOMSourceEditingTextTools) getSourceEditingTextTools()).getDOMDocument()).getModel(), flatNode, startOffset, endOffset);
+
+			if (validPosition == END_OF_LINE)
+				return NO_VALID_CONTENT;
+
+			if (validPosition >= 0)
+				return validPosition;
+
+			flatNode = flatNode.getNext();
+		}
+		return NO_VALID_CONTENT;
+	}
+
+	public void setSourceEditingTextTools(ISourceEditingTextTools sourceEditingTextTools) {
+		fSourceEditingTextTools = sourceEditingTextTools;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaBreakpointProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaBreakpointProvider.java
new file mode 100644
index 0000000..bc0725b
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaBreakpointProvider.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.breakpointproviders;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.debug.core.JDIDebugModel;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.wst.xml.ui.internal.provisional.IDOMSourceEditingTextTools;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+/**
+ * A BreakpointProvider supporting server-side Java as a JSP language
+ * 
+ * @deprecated
+ */
+public class JavaBreakpointProvider extends AbstractBreakpointProvider {
+
+	/*
+	 * @param res @return String
+	 */
+	private static final String getTypeName(IResource res) {
+		IPath path = res.getFullPath();
+		// Assume under Web Content folder if more than 2 segments
+		if (path.segmentCount() > 2) {
+			path = path.removeFirstSegments(2);
+		}
+		else {
+			path = path.removeFirstSegments(1);
+		}
+		String typeName = path.toString().replace(IPath.SEPARATOR, '.');
+		if (res.getFileExtension() != null) {
+			typeName = typeName.substring(0, typeName.lastIndexOf('.'));
+		}
+		return typeName;
+	}
+
+
+
+	public IStatus addBreakpoint(IDocument document, IEditorInput input, int lineNumber, int offset) throws CoreException {
+		int pos = getValidPosition(document, lineNumber);
+		if (pos != NO_VALID_CONTENT) {
+			IResource res = getEditorInputResource(input);
+			if (res != null) {
+				String typeName = getTypeName(res);
+				try {
+					JDIDebugModel.createLineBreakpoint(res, typeName, lineNumber, pos, pos, 0, true, null);
+				}
+				catch (CoreException e) {
+					return e.getStatus();
+				}
+			}
+		}
+		return new Status(IStatus.OK, JSPUIPlugin.ID, IStatus.OK, JSPUIMessages.OK, null); //$NON-NLS-1$
+	}
+
+	public boolean canAddBreakpoint(IDocument document, IEditorInput input, Node node, int lineNumber, int offset) {
+		IResource res = input instanceof IFileEditorInput ? ((IFileEditorInput) input).getFile() : null;
+		Document doc = null;
+		if (getSourceEditingTextTools() instanceof IDOMSourceEditingTextTools) {
+			doc = ((IDOMSourceEditingTextTools) getSourceEditingTextTools()).getDOMDocument();
+		}
+
+		return res != null && !isBreakpointExist(res, lineNumber) && isValidPosition(document, lineNumber) && (getPageLanguage(doc) == JAVA);
+	}
+
+	public IResource getResource(IEditorInput input) {
+		return getEditorInputResource(input);
+	}
+
+	/*
+	 * @param res @param lineNumber @return boolean
+	 */
+	private boolean isBreakpointExist(IResource res, int lineNumber) {
+		try {
+			return JDIDebugModel.lineBreakpointExists(getTypeName(res), lineNumber) != null;
+		}
+		catch (CoreException e) {
+			return false;
+		}
+	}
+
+	/*
+	 * @param doc @param idoc @param lineNumber @return boolean
+	 */
+	private boolean isValidPosition(IDocument idoc, int lineNumber) {
+		return getValidPosition(idoc, lineNumber) != NO_VALID_CONTENT;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaScriptBreakpointProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaScriptBreakpointProvider.java
new file mode 100644
index 0000000..2c7c51d
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaScriptBreakpointProvider.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.breakpointproviders;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IBreakpointManager;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.ui.IEditorInput;
+import org.w3c.dom.Document;
+
+/**
+ * A IBreakpointProvider supporting server-side JavaScript as a JSP language
+ * 
+ */
+public class JavaScriptBreakpointProvider extends AbstractBreakpointProvider {
+	public boolean canAddBreakpoint(IDocument document, IEditorInput input, int lineNumber, int offset) {
+		IResource res = getEditorInputResource(input);
+		Document doc = null;
+		return res != null && !isBreakpointExist(res, lineNumber) && isValidPosition(document, lineNumber) && (getPageLanguage(doc) != JAVA);
+	}
+
+
+	public IStatus addBreakpoint(IDocument document, IEditorInput input, int lineNumber, int offset) {
+		int pos = getValidPosition(document, lineNumber);
+		if (pos != NO_VALID_CONTENT && canAddBreakpoint(document, input, lineNumber, offset)) {
+			IResource res = getEditorInputResource(input);
+			if (res != null) {
+				new JavascriptLineBreakpoint(res, lineNumber, pos, pos);
+			}
+		}
+		return new Status(IStatus.OK, JSPUIPlugin.ID, IStatus.OK, JSPUIMessages.OK, null); //$NON-NLS-1$
+	}
+
+	/*
+	 * @param res @param lineNumber @return boolean
+	 */
+	private boolean isBreakpointExist(IResource res, int lineNumber) {
+		IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
+		IBreakpoint[] breakpoints = manager.getBreakpoints();
+		for (int i = 0; i < breakpoints.length; i++) {
+			if (!(breakpoints[i] instanceof JavascriptLineBreakpoint))
+				continue;
+			JavascriptLineBreakpoint breakpoint = (JavascriptLineBreakpoint) breakpoints[i];
+			try {
+				if (breakpoint.getResource().equals(res) && breakpoint.getLineNumber() == lineNumber) {
+					return true;
+				}
+			}
+			catch (CoreException e) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	/*
+	 * @param doc @param idoc @param lineNumber @return boolean
+	 */
+	private boolean isValidPosition(IDocument idoc, int lineNumber) {
+		return getValidPosition(idoc, lineNumber) != NO_VALID_CONTENT;
+	}
+
+	public IResource getResource(IEditorInput input) {
+		return getEditorInputResource(input);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
new file mode 100644
index 0000000..ec9081e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
@@ -0,0 +1,221 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.breakpointproviders;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.jdt.debug.core.JDIDebugModel;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModel;
+import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
+import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider;
+
+/**
+ * A IBreakpointProvider supporting JSP breakpoints for a Non-Java Language
+ * Source JSP page
+ */
+public class JavaStratumBreakpointProvider implements IBreakpointProvider, IExecutableExtension {
+	private static final String DEFAULT_CLASS_PATTERN = "*jsp,jsp_servlet._*";
+	private Object fData = null;
+
+	public IStatus addBreakpoint(IDocument document, IEditorInput input, int editorLineNumber, int offset) throws CoreException {
+		// check if there is a valid position to set breakpoint
+		int pos = getValidPosition(document, editorLineNumber);
+		IStatus status = null;
+		if (pos >= 0) {
+			IResource res = getResourceFromInput(input);
+			if (res != null) {
+				String path = null;
+				IBreakpoint point = JDIDebugModel.createStratumBreakpoint(res, "JSP", res.getName(), path, getClassPattern(res), editorLineNumber, pos, pos, 0, true, null); //$NON-NLS-1$
+				if (point == null) {
+					status = new Status(IStatus.ERROR, JSPUIPlugin.ID, IStatus.ERROR, "unsupported input type", null); //$NON-NLS-1$
+				}
+			}
+			else if (input instanceof IStorageEditorInput) {
+				// For non-resources, use the workspace root and a coordinated
+				// attribute that is used to
+				// prevent unwanted (breakpoint) markers from being loaded
+				// into the editors.
+				res = ResourcesPlugin.getWorkspace().getRoot();
+				String id = input.getName();
+				if (input instanceof IStorageEditorInput && ((IStorageEditorInput) input).getStorage() != null && ((IStorageEditorInput) input).getStorage().getFullPath() != null) {
+					id = ((IStorageEditorInput) input).getStorage().getFullPath().toString();
+				}
+				Map attributes = new HashMap();
+				attributes.put(StructuredResourceMarkerAnnotationModel.SECONDARY_ID_KEY, id);
+				String path = null;
+				IBreakpoint point = JDIDebugModel.createStratumBreakpoint(res, "JSP", input.getName(), path, getClassPattern(res), editorLineNumber, pos, pos, 0, true, attributes); //$NON-NLS-1$
+				if (point == null) {
+					status = new Status(IStatus.ERROR, JSPUIPlugin.ID, IStatus.ERROR, "unsupported input type", null); //$NON-NLS-1$
+				}
+			}
+		}
+		else {
+			status = new Status(IStatus.INFO, JSPUIPlugin.ID, IStatus.INFO, JSPUIMessages.BreakpointNotAllowed, null);
+		}
+		if (status == null) {
+			status = new Status(IStatus.OK, JSPUIPlugin.ID, IStatus.OK, JSPUIMessages.OK, null);
+		}
+		return status;
+	}
+
+	private String getClassPattern(IResource resource) {
+		if (resource != null) {
+			String shortName = resource.getName();
+			String extension = resource.getFileExtension();
+			if (extension != null && extension.length() < shortName.length()) {
+				shortName = shortName.substring(0, shortName.length() - extension.length() - 1);
+			}
+			if (fData instanceof String && fData.toString().length() > 0) {
+				/*
+				 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154475
+				 */
+				return fData + ",_" + shortName;
+			}
+			else if (fData instanceof Map && resource.isAccessible() && resource.getType() == IResource.FILE) {
+				IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(resource.getName());
+				if (types.length == 0) {
+					// if failed to find quickly, be more aggressive
+					IContentDescription d = null;
+					try {
+						// optimized description lookup, might not succeed
+						d = ((IFile) resource).getContentDescription();
+						if (d != null) {
+							types = new IContentType[]{d.getContentType()};
+						}
+					}
+					catch (CoreException e) {
+						/*
+						 * should not be possible given the accessible and
+						 * file type check above
+						 */
+					}
+				}
+				// wasn't found earlier
+				if (types == null) {
+					types = Platform.getContentTypeManager().findContentTypesFor(resource.getName());
+				}
+				StringBuffer patternBuffer = new StringBuffer("_" + shortName);
+				for (int i = 0; i < types.length; i++) {
+					Object pattern = ((Map) fData).get(types[i].getId());
+					if (pattern != null) {
+						patternBuffer.append(","); //$NON-NLS-1$
+						patternBuffer.append(pattern);
+					}
+				}
+				return patternBuffer.toString();
+			}
+		}
+		return DEFAULT_CLASS_PATTERN;
+	}
+
+	public IResource getResource(IEditorInput input) {
+		return getResourceFromInput(input);
+	}
+
+	private IResource getResourceFromInput(IEditorInput input) {
+		IResource resource = (IResource) input.getAdapter(IFile.class);
+		if (resource == null) {
+			resource = (IResource) input.getAdapter(IResource.class);
+		}
+		return resource;
+	}
+
+	/**
+	 * Finds a valid position somewhere on lineNumber in document, idoc, where
+	 * a breakpoint can be set and returns that position. -1 is returned if a
+	 * position could not be found.
+	 * 
+	 * @param idoc
+	 * @param editorLineNumber
+	 * @return position to set breakpoint or -1 if no position could be found
+	 */
+	private int getValidPosition(IDocument idoc, int editorLineNumber) {
+		int result = -1;
+		if (idoc != null) {
+
+			int startOffset = 0;
+			int endOffset = 0;
+			try {
+				IRegion line = idoc.getLineInformation(editorLineNumber - 1);
+				startOffset = line.getOffset();
+				endOffset = Math.max(line.getOffset(), line.getOffset() + line.getLength());
+
+				String lineText = idoc.get(startOffset, endOffset - startOffset).trim();
+
+				// blank lines or lines with only an open or close brace or
+				// scriptlet tag cannot have a breakpoint
+				if (lineText.equals("") || lineText.equals("{") || //$NON-NLS-1$ //$NON-NLS-2$
+							lineText.equals("}") || lineText.equals("<%")) //$NON-NLS-1$ //$NON-NLS-2$
+				{
+					result = -1;
+				}
+				else {
+					// get all partitions for current line
+					ITypedRegion[] partitions = null;
+
+					partitions = idoc.computePartitioning(startOffset, endOffset - startOffset);
+
+
+					for (int i = 0; i < partitions.length; ++i) {
+						String type = partitions[i].getType();
+						// if found jsp java content, jsp directive tags,
+						// custom
+						// tags,
+						// return that position
+						if (type == IJSPPartitions.JSP_CONTENT_JAVA || type == IJSPPartitions.JSP_DIRECTIVE ||
+								type == IJSPPartitions.JSP_DEFAULT_EL || type == IJSPPartitions.JSP_DEFAULT_EL2) {
+							result = partitions[i].getOffset();
+						}
+					}
+				}
+			}
+			catch (BadLocationException e) {
+				result = -1;
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	 * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement,
+	 *      java.lang.String, java.lang.Object)
+	 */
+	public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+		fData = data;
+	}
+
+	public void setSourceEditingTextTools(ISourceEditingTextTools tools) {
+		// not used
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavascriptLineBreakpoint.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavascriptLineBreakpoint.java
new file mode 100644
index 0000000..1fad596
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavascriptLineBreakpoint.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/*
+ * Created on Jul 20, 2003
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.eclipse.jst.jsp.ui.internal.breakpointproviders;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * @author davidw
+ * 
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class JavascriptLineBreakpoint {
+
+	/**
+	 * @param res
+	 * @param lineNumber
+	 * @param pos
+	 * @param pos1
+	 */
+	public JavascriptLineBreakpoint(IResource res, int lineNumber, int pos, int pos1) {
+
+		// TODO Should be deleted? Along with calling class?
+	}
+
+	/**
+	 * 
+	 */
+	public JavascriptLineBreakpoint() {
+		super();
+	}
+
+	/**
+	 * 
+	 */
+	public IResource getResource() throws CoreException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	/**
+	 * @return
+	 */
+	public int getLineNumber() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java
new file mode 100644
index 0000000..07256dd
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java
@@ -0,0 +1,263 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Genuitec, LLC - Fix for bug 203303
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jdt.core.IImportContainer;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP20TLDNames;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.text.edits.InsertEdit;
+import org.eclipse.text.edits.MalformedTreeException;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class AutoImportProposal extends JSPCompletionProposal {
+	
+	// the import string, no quotes or colons
+	String fImportDeclaration;
+	IImportContainer fImportContainer;
+
+	public AutoImportProposal(String importDeclaration, String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance, boolean updateReplacementLengthOnValidate) {
+		super(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, relevance, updateReplacementLengthOnValidate);
+		setImportDeclaration(importDeclaration);
+	}
+
+	public AutoImportProposal(String importDeclaration, IImportContainer importContainer ,String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance, boolean updateReplacementLengthOnValidate) {
+		this(importDeclaration, replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, relevance, updateReplacementLengthOnValidate);
+		fImportContainer = importContainer;
+	}
+
+	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
+		super.apply(viewer, trigger, stateMask, offset);
+		// if the import doesn't exist, add it
+		String importDecl = getImportDeclaration().replaceAll(";", "");  //$NON-NLS-1$//$NON-NLS-2$
+		if (fImportContainer == null || !(fImportContainer.getImport(importDecl).exists() || isImportPageDirective(viewer, offset)))
+			addImportDeclaration(viewer);
+	}
+	
+	private boolean isImportPageDirective(ITextViewer viewer, int offset){
+		Node node = (Node) ContentAssistUtils.getNodeAt(viewer, offset);
+		
+		while ((node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getParentNode() != null)) {
+			node = node.getParentNode();
+		}
+		if (node.getNodeName().equalsIgnoreCase(JSP11Namespace.ElementName.DIRECTIVE_PAGE)){
+			NamedNodeMap nodeMap = node.getAttributes();
+			if (nodeMap != null)
+				return nodeMap.getNamedItem(JSP20TLDNames.IMPORT) != null;
+		}
+		
+		return false ;
+	}
+	/**
+	 * adds the import declaration to the document in the viewer in the appropriate position
+	 * @param viewer
+	 */
+	private void addImportDeclaration(ITextViewer viewer) {
+		IDocument doc = viewer.getDocument();
+		
+		// calculate once and pass along
+		boolean isXml = isXmlFormat(doc);
+		
+		int insertPosition = getInsertPosition(doc, isXml);
+		String insertText = createImportDeclaration(doc, isXml);
+		InsertEdit insert = new InsertEdit(insertPosition, insertText);
+		try {
+			insert.apply(doc);
+		}
+		catch (MalformedTreeException e) {
+			Logger.logException(e);
+		}
+		catch (BadLocationException e) {
+			Logger.logException(e);
+		}
+		
+		// make sure the cursor position after is correct
+		setCursorPosition(getCursorPosition() + insertText.length());
+	}
+	
+ 	private Node getInsertNode(IDOMDocument documentNode) {
+		NodeList childNodes = documentNode.getChildNodes();
+		for (int i = 0; i < childNodes.getLength(); i++) {
+			if (childNodes.item(i).getNodeType() == Node.ELEMENT_NODE)
+				return childNodes.item(i);
+		}
+		return documentNode.getFirstChild();
+	}
+	
+	/**
+	 * 
+	 * @param doc
+	 * @param isXml
+	 * @return position after <jsp:root> if xml, otherwise right before the document element
+	 */
+	private int getInsertPosition(IDocument doc, boolean isXml) {
+		int pos = 0;
+		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+		try {
+			if (sModel != null) {
+				if (sModel instanceof IDOMModel) {
+					IDOMDocument documentNode = ((IDOMModel) sModel).getDocument();
+					/*
+					 * document element must be sole Element child of Document
+					 * to remain valid
+					 */
+					Node targetElement = null;
+					if (isXml) {
+						targetElement = documentNode.getDocumentElement();
+					}
+					if (targetElement == null)
+						targetElement = getInsertNode(documentNode);
+					if (targetElement != null) {
+						IStructuredDocumentRegion sdRegion = ((IDOMNode) targetElement).getFirstStructuredDocumentRegion();
+						if (isXml) {
+							/*
+							 * document Element must be sole Element child of
+							 * Document to remain valid, so insert after
+							 */
+							pos = sdRegion.getEndOffset();
+							try {
+								while (pos < doc.getLength() && (doc.getChar(pos) == '\r' || doc.getChar(pos) == '\n')) {
+									pos++;
+								}
+							}
+							catch (BadLocationException e) {
+								// not important, use pos as determined earlier
+							}
+						}
+						else {
+							// insert before target element
+							pos = sdRegion.getStartOffset();
+						}
+					}
+					else {
+						pos = 0;
+					}
+				}
+			}
+		}
+		finally {
+			if (sModel != null)
+				sModel.releaseFromRead();
+		}
+		return pos;
+	}
+	
+	// Genuitec bug #6227,
+	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203303
+	private boolean isCustomTagDocument(IDocument doc) {
+		boolean isTag = false;
+		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+		try {
+			if (sModel instanceof IDOMModel) {
+				String contentType = ((IDOMModel) sModel).getContentTypeIdentifier();
+				if (contentType != null) {
+					IContentType modelCT = Platform.getContentTypeManager().getContentType(contentType);
+					IContentType tagCT = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPTAG);
+					if (modelCT != null && tagCT != null) {
+						isTag = modelCT.isKindOf(tagCT);
+					}
+				}
+			}
+		}
+		finally {
+			if (sModel != null)
+				sModel.releaseFromRead();
+		}
+		return isTag;
+	}
+		 
+	/**
+	 * 
+	 * @param doc
+	 * @return true if this document is xml-jsp syntax, otherwise false
+	 */
+	private boolean isXmlFormat(IDocument doc) {
+		boolean isXml = false;
+		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+		try {
+			if (sModel != null) {
+				if (!isXml) {
+					if (sModel instanceof IDOMModel) {
+						IDOMDocument documentNode = ((IDOMModel) sModel).getDocument();
+						Element docElement = documentNode.getDocumentElement();
+						isXml = docElement != null && ((docElement.getNodeName().equals("jsp:root")) || docElement.getAttributeNode("xmlns:jsp") != null || ((((IDOMNode) docElement).getStartStructuredDocumentRegion() == null && ((IDOMNode) docElement).getEndStructuredDocumentRegion() == null))); //$NON-NLS-1$  //$NON-NLS-2$
+					}
+				}
+			}
+		}
+		finally {
+			if (sModel != null)
+				sModel.releaseFromRead();
+		}
+		return isXml;
+	}
+	/**
+	 * 
+	 * @param doc
+	 * @param isXml
+	 * @return appropriate import declaration string depending if document is xml or not
+	 */
+	private String createImportDeclaration(IDocument doc, boolean isXml) {
+		String delim = (doc instanceof IStructuredDocument) ? ((IStructuredDocument) doc).getLineDelimiter() : TextUtilities.getDefaultLineDelimiter(doc);
+		boolean isCustomTag = isCustomTagDocument(doc);
+		final String opening;
+		final String closing;
+		if (isCustomTag) {
+			if (isXml) {
+				opening = "<jsp:directive.tag import=\""; //$NON-NLS-1$
+				closing = "\"/>"; //$NON-NLS-1$
+			}
+			else {
+				opening = "<%@tag import=\""; //$NON-NLS-1$
+				closing = "\"%>"; //$NON-NLS-1$
+			}
+		}
+		else {
+			if (isXml) {
+				opening = "<jsp:directive.page import=\""; //$NON-NLS-1$
+				closing = "\"/>"; //$NON-NLS-1$
+			}
+			else {
+				opening = "<%@page import=\""; //$NON-NLS-1$
+				closing = "\"%>"; //$NON-NLS-1$
+			}
+		}
+		return opening + getImportDeclaration() + closing + delim;
+	}
+
+	public String getImportDeclaration() {
+		return fImportDeclaration;
+	}
+	public void setImportDeclaration(String importDeclaration) {
+		fImportDeclaration = importDeclaration;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/BeanInfoProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/BeanInfoProvider.java
new file mode 100644
index 0000000..918bd23
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/BeanInfoProvider.java
@@ -0,0 +1,442 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.beans.Introspector;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import com.ibm.icu.util.StringTokenizer;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+
+/**
+ * Navigates the IJavaProject classpath (incl. source) on a given resource and infers bean properties
+ * given a fully qualified beanname. Bean properties can be retrieved using:
+ * <code>getRuntimeProperties(IResource baseResource, String typeName)</code>
+ * 
+ * @plannedfor 1.0
+ */
+public class BeanInfoProvider implements IBeanInfoProvider {
+
+	public class JavaPropertyDescriptor implements IJavaPropertyDescriptor {
+		String fType = null;
+		String fName = null;
+		boolean fReadable = true;
+		boolean fWritable = true;
+
+		public JavaPropertyDescriptor(String name, String type, boolean readable, boolean writable) {
+			fName = name;
+			fType = type;
+			fReadable = readable;
+			fWritable = writable;
+		}
+
+		public String getDeclaredType() {
+			return fType;
+		}
+
+		public String getDisplayName() {
+			return fName;
+		}
+
+		public String getName() {
+			return fName;
+		}
+
+		public boolean getReadable() {
+			return fReadable;
+		}
+
+		public boolean getWriteable() {
+			return fWritable;
+		}
+	}
+
+	// looks up encoded type (see Class.getName), and gives you a displayable string
+	private HashMap fEncodedTypeMap = null;
+	// to avoid repeat properties from showing up
+	private HashSet fRepeatMethods = null;
+
+	public BeanInfoProvider() {
+		fRepeatMethods = new HashSet();
+	}
+
+	/**
+	 * Returns the inferred properties of a bean based on the project from the baseResource,
+	 * and the fully qualified name of the bean.
+	 * 
+	 * @param baseResource the base resource where the bean is being used
+	 * @param typeName the <i>fully qualified</i> type name (eg. javax.swing.JButton) of the bean
+	 */
+	public IJavaPropertyDescriptor[] getRuntimeProperties(IResource baseResource, String typeName) {
+		IJavaProject javaProject = JavaCore.create(baseResource.getProject());
+		QualifiedName typeQualifiedName = getTypeQualifiedName(typeName);
+		List getMethodResults = new ArrayList();
+		List isMethodResults = new ArrayList();
+		List setMethodResults = new ArrayList();
+		List descriptorResults = new ArrayList();
+		try {
+			IType type = javaProject.findType(typeQualifiedName.getQualifier() + "." + typeQualifiedName.getLocalName()); //$NON-NLS-1$
+			// type must exist
+			if(type != null) {
+				ITypeHierarchy hierarchy = type.newTypeHierarchy(null);
+				IType[] supers = hierarchy.getAllSuperclasses(type);
+	
+				IMethod[] methods = type.getMethods();
+				// iterate the bean's methods
+				for (int i = 0; i < methods.length; i++)
+					acceptMethod(getMethodResults, isMethodResults, setMethodResults, methods[i]);
+				// the bean hierarchy's methods
+				for (int i = 0; i < supers.length; i++) {
+					methods = supers[i].getMethods();
+					for (int j = 0; j < methods.length; j++)
+						acceptMethod(getMethodResults, isMethodResults, setMethodResults, methods[j]);
+				}
+				adaptMethodsToPropertyDescriptors(getMethodResults, isMethodResults, setMethodResults, descriptorResults);
+			}
+		}
+		catch (JavaModelException jmex) {
+			Logger.logException("Problem navigating JavaProject in BeanInfoProvider", jmex); //$NON-NLS-1$
+		}
+
+		IJavaPropertyDescriptor[] finalResults = new IJavaPropertyDescriptor[descriptorResults.size()];
+		System.arraycopy(descriptorResults.toArray(), 0, finalResults, 0, descriptorResults.size());
+		return finalResults;
+	}
+
+	/**
+	 * Retrieves the necessary information from method declaration lists, creates and fills a list of JavaPropertyDescriptors.
+	 * @param getMethods
+	 * @param isMethods
+	 * @param setMethods
+	 * @param descriptorResults
+	 */
+	private void adaptMethodsToPropertyDescriptors(List getMethods, List isMethods, List setMethods, List descriptors) throws JavaModelException {
+		List readable = new ArrayList();
+		HashMap types = new HashMap();
+
+		// iterate through get* and is* methods, updating 'readable' list and 'types' map
+		filterGetMethods(getMethods, readable, types);
+		filterIsMethods(isMethods, readable, types);
+
+		// iterate set* methods, checking overlap w/ readable
+		Iterator it = setMethods.iterator();
+		IMethod temp = null;
+		String name = ""; //$NON-NLS-1$
+		String type = ""; //$NON-NLS-1$
+		String[] encodedParams = null;
+		String returnType = ""; //$NON-NLS-1$
+		String param0 = ""; //$NON-NLS-1$
+
+		while (it.hasNext()) {
+			temp = (IMethod) it.next();
+			name = createPropertyNameFromMethod(temp);
+			// invalid naming convention
+			if (name == null)
+				continue;
+
+			returnType = getDecodedTypeName(temp.getReturnType());
+			// setter should have no return type
+			if (!returnType.equals("void")) //$NON-NLS-1$
+				continue;
+
+			// need to get type from parameter
+			encodedParams = temp.getParameterTypes();
+			if (encodedParams != null && encodedParams.length > 0) {
+				if (encodedParams.length > 1) {
+					// multiple params
+					param0 = getDecodedTypeName(encodedParams[0]);
+					if (!param0.equals("int")) //$NON-NLS-1$
+						// not a valid indexed property
+						continue;
+					
+					type = getDecodedTypeName(encodedParams[1]);
+				}
+				else {
+					// one param, regular setter
+					if (isArray(encodedParams[0]))
+						type = getDecodedTypeName(encodedParams[0]);
+				}
+			}
+
+			if (readable.contains(name)) {
+				// writable and readable
+				if (!fRepeatMethods.contains(name)) {
+					descriptors.add(new JavaPropertyDescriptor(name, (String) types.get(name), true, true));
+					readable.remove(name);
+					fRepeatMethods.add(name);
+				}
+			}
+			else {
+				// wasn't readable, just writable
+				String[] params = temp.getParameterTypes();
+				// can't be setProperty if no parameters
+				if (!(params.length > 0))
+					continue;
+				if (!fRepeatMethods.contains(name)) {
+					type = getDecodedTypeName(params[0]);
+					descriptors.add(new JavaPropertyDescriptor(name, type, false, true));
+					fRepeatMethods.add(name);
+				}
+			}
+		}
+		// add leftover from readable, get* and is* methods (readable = true, writable = false)
+		it = readable.iterator();
+		while (it.hasNext()) {
+			name = (String) it.next();
+			if (!fRepeatMethods.contains(name)) {
+				descriptors.add(new JavaPropertyDescriptor(name, (String) types.get(name), true, false));
+				fRepeatMethods.add(name);
+			}
+		}
+	}
+
+	private void filterGetMethods(List getMethods, List readable, HashMap types) throws JavaModelException {
+		IMethod temp;
+		String name;
+		String encodedReturnType;
+		String returnType;
+		Iterator it = getMethods.iterator();
+		String[] encodedParams;
+		String paramType;
+		// iterate get* methods
+		while (it.hasNext()) {
+			temp = (IMethod) it.next();
+			name = createPropertyNameFromMethod(temp);
+			// invalid bean naming convention
+			if (name == null)
+				continue;
+
+			encodedReturnType = temp.getReturnType();
+			returnType = getDecodedTypeName(encodedReturnType);
+
+			//  can't get be a getProperty if returns void
+			if (returnType.equals("void")) //$NON-NLS-1$
+				continue;
+
+			// check params in case it's indexed propety
+			encodedParams = temp.getParameterTypes();
+			if (encodedParams != null && encodedParams.length == 1) {
+				paramType = getDecodedTypeName(encodedParams[0]);
+				// syntax is > Type getter(int);
+				if (!paramType.equals("int")) { //$NON-NLS-1$
+					//it's not an indexed property
+					continue;
+				}
+				// it is indexed, prop type is an ARRAY
+				returnType += "[]"; //$NON-NLS-1$
+			}
+
+			readable.add(name);
+			types.put(name, returnType);
+		}
+
+	}
+
+	private void filterIsMethods(List isMethodResults, List readable, HashMap types) throws JavaModelException {
+		IMethod temp;
+		String name;
+		String encodedReturnType;
+		String returnType;
+		String[] encodedParams;
+		String paramType;
+		// iterate is* methods
+		Iterator it = isMethodResults.iterator();
+		while (it.hasNext()) {
+			temp = (IMethod) it.next();
+			name = createPropertyNameFromMethod(temp);
+			// invalid bean naming convention
+			if (name == null)
+				continue;
+			encodedReturnType = temp.getReturnType();
+			returnType = getDecodedTypeName(encodedReturnType);
+
+			// isProperty only valid for boolean
+			if (!returnType.equals("boolean")) //$NON-NLS-1$
+				continue;
+
+			// check params in case it's indexed propety
+			encodedParams = temp.getParameterTypes();
+			if (encodedParams != null && encodedParams.length == 1) {
+				paramType = getDecodedTypeName(encodedParams[0]);
+				// syntax is > Type getter(int);
+				if (!paramType.equals("int")) { //$NON-NLS-1$
+					//it's not a valid indexed property
+					continue;
+				}
+			}
+
+			readable.add(name);
+			types.put(name, returnType);
+		}
+	}
+
+	/**
+	 * Pass in a get*|set*|is* method and it will return an inferred property name using <code>Introspector.decapitalize(String)</code>
+	 * @param temp
+	 * @return an inferred property name based on the IMethod name, null if the name is not valid according to bean spec
+	 */
+	private String createPropertyNameFromMethod(IMethod temp) {
+		String name = temp.getElementName();
+		if (name.startsWith("is")) //$NON-NLS-1$
+			name = Introspector.decapitalize(name.substring(2));
+		else
+			// must be get or set
+			name = Introspector.decapitalize(name.substring(3));
+		return name;
+	}
+
+	/**
+	 * Initial filtering of methods.  Checks prefix if it's valid length.  If the prefix is "get" the  method name 
+	 * is placed in the getMethodResults List.  If the prefix is "is", the name is added to the isMethodResults list.  If the
+	 * prefix is "set", it's added to the setMethodResultsList.
+	 * 
+	 * @param getMethodResults
+	 * @param isMethodResults
+	 * @param setMethodResults
+	 * @param method
+	 */
+	private void acceptMethod(List getMethodResults, List isMethodResults, List setMethodResults, IMethod method) throws JavaModelException {
+		if (!fRepeatMethods.contains(method.getElementName())) {
+			fRepeatMethods.add(method.getElementName());
+			int flags = method.getFlags();
+			String methodName = method.getElementName();
+			if (Flags.isPublic(flags)) {
+				if (methodName.length() > 3 && methodName.startsWith("get")) //$NON-NLS-1$
+					getMethodResults.add(method);
+				else if (methodName.length() > 2 && methodName.startsWith("is")) //$NON-NLS-1$
+					isMethodResults.add(method);
+				else if (methodName.length() > 3 && methodName.startsWith("set")) //$NON-NLS-1$
+					setMethodResults.add(method);
+			}
+		}
+	}
+
+	/**
+	 * @param typeName
+	 * @return a Qualified name with the package as the qualifier, and class name as LocalName
+	 */
+	private QualifiedName getTypeQualifiedName(String typeName) {
+		StringTokenizer st = new StringTokenizer(typeName, ".", false); //$NON-NLS-1$
+		int length = st.countTokens();
+		int count = 0;
+		StringBuffer root = new StringBuffer();
+		while (count++ < length - 1) {
+			root.append(st.nextToken());
+			if (count < length - 1)
+				root.append('.');
+		}
+		return new QualifiedName(root.toString(), st.nextToken());
+	}
+
+	/**
+	 * Checks if encodedTypeName is an array
+	 * @param encodedTypeName
+	 * @return true if encodedTypeName is an array, false otherwise.
+	 */
+	private boolean isArray(String encodedTypeName) {
+		if (encodedTypeName != null && encodedTypeName.length() > 0) {
+			if (encodedTypeName.charAt(0) == '[')
+				return true;
+		}
+		return false;
+	}
+
+	/**
+	 * Returns the decoded (displayable) name fo the type.
+	 * Either a primitive type (int, long, float...) Object (String)
+	 * @param type
+	 * @return decoded name for the encoded string
+	 */
+	private String getDecodedTypeName(String encoded) {
+		HashMap map = getEncodedTypeMap();
+
+		StringBuffer decoded = new StringBuffer();
+		char BRACKET = '[';
+		String BRACKETS = "[]"; //$NON-NLS-1$
+		char identifier = ' ';
+		int last = 0;
+		// count brackets
+		while (encoded.indexOf(BRACKET, last) != -1) {
+			last++;
+		}
+		identifier = encoded.charAt(last);
+		Object primitiveType = map.get(String.valueOf(identifier));
+		// L > binary type name, Q > source type name
+		if (identifier == 'L' || identifier == 'Q') {
+			// handle object
+			String classname = encoded.substring(last + 1, encoded.length() - 1);
+			decoded.append(classname);
+		}
+		else if (primitiveType != null) {
+			// handle primitive type (from IField.getSignature())
+			decoded.append((String) primitiveType);
+		}
+		else {
+			// handle primitive type (from Class.getName())
+			decoded.append(encoded);
+		}
+		// handle arrays
+		if (last > 0) {
+			for (int i = 0; i < last; i++) {
+				decoded.append(BRACKETS);
+			}
+		}
+		return decoded.toString();
+	}
+
+	/**
+	 *	from Class.getName() javadoc
+	 *	also see Signature in jdt.core api
+	 *<pre>
+	 *			B            byte
+	 *			C            char
+	 *			D            double
+	 *			F            float
+	 *			I            int
+	 *			J            long
+	 *			Lclassname;  class or interface
+	 *			Qsourcename; source
+	 *			S            short
+	 *			Z            boolean
+	 *			V	   		 void
+	 *</pre>
+	 *
+	 * @return the "encoding letter" to "type" map.
+	 */
+	private HashMap getEncodedTypeMap() {
+		if (fEncodedTypeMap == null) {
+			fEncodedTypeMap = new HashMap();
+			fEncodedTypeMap.put("B", "byte"); //$NON-NLS-1$ //$NON-NLS-2$
+			fEncodedTypeMap.put("C", "char"); //$NON-NLS-1$ //$NON-NLS-2$
+			fEncodedTypeMap.put("D", "double"); //$NON-NLS-1$ //$NON-NLS-2$
+			fEncodedTypeMap.put("F", "float"); //$NON-NLS-1$ //$NON-NLS-2$
+			fEncodedTypeMap.put("I", "int"); //$NON-NLS-1$ //$NON-NLS-2$
+			fEncodedTypeMap.put("J", "long"); //$NON-NLS-1$ //$NON-NLS-2$
+			fEncodedTypeMap.put("S", "short"); //$NON-NLS-1$ //$NON-NLS-2$
+			fEncodedTypeMap.put("Z", "boolean"); //$NON-NLS-1$ //$NON-NLS-2$
+			fEncodedTypeMap.put("V", "void"); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+		return fEncodedTypeMap;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java
new file mode 100644
index 0000000..912121e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jface.text.templates.TemplateProposal;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
+
+/**
+ * Purpose of this class is to make the additional proposal info into content
+ * fit for an HTML viewer (by escaping characters)
+ * 
+ * @plannedfor 1.0
+ */
+class CustomTemplateProposal extends TemplateProposal implements IRelevanceCompletionProposal {
+	// copies of this class exist in:
+	// org.eclipse.jst.jsp.ui.internal.contentassist
+	// org.eclipse.wst.html.ui.internal.contentassist
+	// org.eclipse.wst.xml.ui.internal.contentassist
+
+	public CustomTemplateProposal(Template template, TemplateContext context, IRegion region, Image image, int relevance) {
+		super(template, context, region, image, relevance);
+	}
+
+	public String getAdditionalProposalInfo() {
+		String additionalInfo = super.getAdditionalProposalInfo();
+		return StringUtils.convertToHTMLContent(additionalInfo);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IBeanInfoProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IBeanInfoProvider.java
new file mode 100644
index 0000000..eed9ef7
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IBeanInfoProvider.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.core.resources.IResource;
+
+/**
+ * @plannedfor 1.0
+ */
+public interface IBeanInfoProvider {
+	IJavaPropertyDescriptor[] getRuntimeProperties(IResource baseResource, String typeName);
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IJavaPropertyDescriptor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IJavaPropertyDescriptor.java
new file mode 100644
index 0000000..423e3f6
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IJavaPropertyDescriptor.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+/**
+ * @plannedfor 1.0
+ */
+public interface IJavaPropertyDescriptor {
+
+	String getDeclaredType();
+
+	String getDisplayName();
+
+	String getName();
+
+	boolean getReadable();
+
+	boolean getWriteable();
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java
new file mode 100644
index 0000000..eded388
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java
@@ -0,0 +1,309 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.WorkingCopyOwner;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.ui.internal.IReleasable;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.osgi.framework.Bundle;
+
+
+/**
+ * @plannedfor 1.0
+ * @deprecated This class is no longer used locally and will be removed in the future
+ */
+public class JSPCompletionProcessor implements IContentAssistProcessor, IReleasable {
+	// for debugging
+	private static final boolean DEBUG;
+	static {
+		String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jsptranslation"); //$NON-NLS-1$
+		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+
+	private static final String JDT_CORE_PLUGIN_ID = "org.eclipse.jdt.core"; //$NON-NLS-1$
+
+	protected int fJspSourcePosition, fJavaPosition;
+	protected String fErrorMessage = null;
+	protected StructuredTextViewer fViewer = null;
+	private JSPTranslationAdapter fTranslationAdapter = null;
+	// translation adapter may be stale, check the model id
+	private String fModelId = null;
+
+	/**
+	 * Returns a list of completion proposals based on the specified location
+	 * within the document that corresponds to the current cursor position
+	 * within the text viewer.
+	 * 
+	 * @param viewer
+	 *            the viewer whose document is used to compute the proposals
+	 * @param documentPosition
+	 *            an offset within the document for which completions should
+	 *            be computed
+	 * @return an array of completion proposals or <code>null</code> if no
+	 *         proposals are possible
+	 */
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int pos) {
+		return computeCompletionProposals(viewer, pos, 0);
+	}
+	
+	/**
+	 * The same as the normal <code>computeCompeltaionProposals</code> except the calculated
+	 * java position is offset by the given extra offset.
+	 * 
+	 * @param viewer
+	 *            the viewer whose document is used to compute the proposals
+	 * @param documentPosition
+	 *            an offset within the document for which completions should
+	 *            be computed
+	 * @param javaPositionExtraOffset
+	 * 				the extra offset for the java position
+	 * @return an array of completion proposals or <code>null</code> if no
+	 *         proposals are possible
+	 */
+	protected ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int pos, int javaPositionExtraOffset) {
+		initialize(pos);
+
+		JSPProposalCollector collector = null;
+		
+		IDOMModel xmlModel = null;
+		try {
+			if (viewer instanceof StructuredTextViewer)
+				fViewer = (StructuredTextViewer) viewer;
+
+			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(fViewer.getDocument());
+
+			IDOMDocument xmlDoc = xmlModel.getDocument();
+			if (fTranslationAdapter == null || xmlModel.getId() != fModelId) {
+				fTranslationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
+				fModelId = xmlModel.getId();
+			}
+			if (fTranslationAdapter != null) {
+
+				JSPTranslation translation = fTranslationAdapter.getJSPTranslation();
+				fJavaPosition = translation.getJavaOffset(getDocumentPosition())+javaPositionExtraOffset;
+
+				if (DEBUG)
+					System.out.println(debug(translation));
+
+				try {
+
+					ICompilationUnit cu = translation.getCompilationUnit();
+
+					// can't get java proposals w/out a compilation unit
+					// or without a valid position
+					if (cu == null || -1 == fJavaPosition)
+						return new ICompletionProposal[0];
+					
+					collector = getProposalCollector(cu, translation);
+					synchronized (cu) {
+						cu.codeComplete(fJavaPosition, collector, (WorkingCopyOwner) null);
+					}
+				}
+				catch (CoreException coreEx) {
+					// a possible Java Model Exception due to not being a Web
+					// (Java) Project
+					coreEx.printStackTrace();
+				}
+			}
+		}
+		catch (Exception exc) {
+			exc.printStackTrace();
+			// throw out exceptions on code assist.
+		}
+		finally {
+			if (xmlModel != null) {
+				xmlModel.releaseFromRead();
+			}
+		}
+		ICompletionProposal[] results = new ICompletionProposal[0];
+		if(collector != null) {
+			results = collector.getJSPCompletionProposals();
+			if (results == null || results.length < 1)
+				fErrorMessage = JSPUIMessages.Java_Content_Assist_is_not_UI_;
+		}
+		return results;
+	}
+	
+	protected JSPProposalCollector getProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
+		return new JSPProposalCollector(cu, translation);
+	}
+	
+	/**
+	 * For debugging translation mapping only.
+	 * 
+	 * @param translation
+	 */
+	private String debug(JSPTranslation translation) {
+		StringBuffer debugString = new StringBuffer();
+		HashMap jsp2java = translation.getJsp2JavaMap();
+		String javaText = translation.getJavaText();
+		String jspText = fViewer.getDocument().get();
+		debugString.append("[jsp2JavaMap in JSPCompletionProcessor]\r\n"); //$NON-NLS-1$
+		debugString.append("jsp cursor position >> " + fViewer.getTextWidget().getCaretOffset() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+		Iterator it = jsp2java.keySet().iterator();
+		while (it.hasNext()) {
+			try {
+				Position jspPos = (Position) it.next();
+				Position javaPos = (Position) jsp2java.get(jspPos);
+				debugString.append("jsp > " + jspPos.offset + ":" + jspPos.length + ":" + jspText.substring(jspPos.offset, jspPos.offset + jspPos.length) + ":\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+				debugString.append("java > " + javaPos.offset + ":" + javaPos.length + ":" + javaText.substring(javaPos.offset, javaPos.offset + javaPos.length) + ":\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+				debugString.append("-------------------------------------------------\n"); //$NON-NLS-1$
+			}
+			catch (Exception e) {
+				// eat exceptions, it's only for debug
+			}
+		}
+		return debugString.toString();
+	}
+
+	/**
+	 * Returns information about possible contexts based on the specified
+	 * location within the document that corresponds to the current cursor
+	 * position within the text viewer.
+	 * 
+	 * @param viewer
+	 *            the viewer whose document is used to compute the possible
+	 *            contexts
+	 * @param documentPosition
+	 *            an offset within the document for which context information
+	 *            should be computed
+	 * @return an array of context information objects or <code>null</code>
+	 *         if no context could be found
+	 */
+	public org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(org.eclipse.jface.text.ITextViewer viewer, int documentOffset) {
+		return null;
+	}
+
+	/**
+	 * Returns a string of characters which when pressed should automatically
+	 * display content-assist proposals.
+	 * 
+	 * @return string of characters
+	 */
+	public java.lang.String getAutoProposalInvocationCharacters() {
+		return null;
+	}
+
+	/**
+	 * Returns a string of characters which when pressed should automatically
+	 * display a content-assist tip.
+	 * 
+	 * @return string of characters
+	 */
+	public java.lang.String getAutoTipInvocationCharacters() {
+		return null;
+	}
+
+	/**
+	 * Returns the characters which when entered by the user should
+	 * automatically trigger the presentation of possible completions.
+	 * 
+	 * @return the auto activation characters for completion proposal or
+	 *         <code>null</code> if no auto activation is desired
+	 */
+	public char[] getCompletionProposalAutoActivationCharacters() {
+		return null;
+	}
+
+	/**
+	 * Returns the characters which when entered by the user should
+	 * automatically trigger the presentation of context information.
+	 * 
+	 * @return the auto activation characters for presenting context
+	 *         information or <code>null</code> if no auto activation is
+	 *         desired
+	 */
+	public char[] getContextInformationAutoActivationCharacters() {
+		return null;
+	}
+
+	/**
+	 * Returns a validator used to determine when displayed context
+	 * information should be dismissed. May only return <code>null</code> if
+	 * the processor is incapable of computing context information.
+	 * 
+	 * @return a context information validator, or <code>null</code> if the
+	 *         processor is incapable of computing context information
+	 */
+	public org.eclipse.jface.text.contentassist.IContextInformationValidator getContextInformationValidator() {
+		return null;
+	}
+
+	protected int getDocumentPosition() {
+		return fJspSourcePosition;
+	}
+
+	public String getErrorMessage() {
+		// TODO: get appropriate error message
+		// if (fCollector.getErrorMessage() != null &&
+		// fCollector.getErrorMessage().length() > 0)
+		// return fCollector.getErrorMessage();
+		return fErrorMessage;
+	}
+
+	/**
+	 * Initialize the code assist processor.
+	 */
+	protected void initialize(int pos) {
+		initializeJavaPlugins();
+
+		fJspSourcePosition = pos;
+		fErrorMessage = null;
+	}
+
+	/**
+	 * Initialize the Java Plugins that the JSP processor requires.
+	 * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=143765
+	 * We should not call "start", because that will cause that 
+	 * state to be remembered, and re-started automatically during 
+	 * the next boot up sequence. 
+	 * 
+	 * ISSUE: we may be able to get rid of this all together, in future, 
+	 * since 99% we probably have already used some JDT class by the time 
+	 * we need JDT to be active ... but ... this is the safest fix for 
+	 * this point in 1.5 stream. Next release, let's just remove this, 
+	 * re-discover what ever bug this was fixing (if any) and if there is 
+	 * one, then we'll either put back in, as is, or come up with a 
+	 * more appropriate fix. 
+	 * 
+	 */
+	protected void initializeJavaPlugins() {
+		try {
+			Bundle bundle = Platform.getBundle(JDT_CORE_PLUGIN_ID);
+			bundle.loadClass("dummyClassNameThatShouldNeverExist");
+		}
+		catch (ClassNotFoundException e) {
+			// this is the expected result, we just want to 
+			// nudge the bundle to be sure its activated. 
+		}
+	}
+
+	public void release() {
+		fTranslationAdapter = null;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java
new file mode 100644
index 0000000..c4a6036
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension3;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension5;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+
+/**
+ * Implements IJavaCompletionProposal for use with JSPProposalCollector.
+ *
+ * @plannedfor 1.0
+ */
+public class JSPCompletionProposal extends CustomCompletionProposal implements IJavaCompletionProposal, ICompletionProposalExtension3, ICompletionProposalExtension5 {
+
+	private static final char[] TRIGGERS = new char[] { '.', '[' };
+	/*
+	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
+	 * 
+	 * This is a wrapped proposal so we don't need to 
+	 * make "slow" calls to the java proposal up front, only when needed
+	 * for example, getAdditionalInfo() reads external javadoc, and it makes
+	 * no sense
+	 */ 
+	ICompletionProposal fJavaCompletionProposal = null;
+	
+	public JSPCompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance, boolean updateReplacementLengthOnValidate) {
+		super(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, relevance, updateReplacementLengthOnValidate);
+	}
+	
+	/**
+	 * Sets cursor position after applying.
+	 */
+	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
+		if (trigger != (char) 0 ) {
+			setReplacementString(getReplacementString() + trigger);
+			setCursorPosition(getCursorPosition() + 1);
+		}
+		super.apply(viewer, trigger, stateMask, offset);
+		//move the caret to the end of the change
+		int endOffsetOfChanges = getReplacementString().length() + getReplacementOffset();
+		viewer.getTextWidget().setCaretOffset(endOffsetOfChanges);
+	}
+
+	final public ICompletionProposal getJavaCompletionProposal() {
+		return fJavaCompletionProposal;
+	}
+
+	final public void setJavaCompletionProposal(ICompletionProposal javaCompletionProposal) {
+		fJavaCompletionProposal = javaCompletionProposal;
+	}
+	
+	public String getAdditionalProposalInfo() {
+		String additionalInfo = super.getAdditionalProposalInfo();
+		ICompletionProposal javaProposal = getJavaCompletionProposal();
+		if(javaProposal != null)
+			additionalInfo = javaProposal.getAdditionalProposalInfo();
+		
+		return additionalInfo;
+	}
+
+	/**
+	 * use the java proposals image if there is one for this proposals image
+	 */                                                                     
+	public Image getImage() {                                               
+		if(this.fJavaCompletionProposal != null) {                          
+			return this.fJavaCompletionProposal.getImage();                 
+		} else {                                                            
+			return super.getImage();                                        
+		}                                                                   
+	}                                                                       
+
+	/* 
+	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension5#getAdditionalProposalInfo(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
+		Object additionalInfo = super.getAdditionalProposalInfo();
+		ICompletionProposal javaProposal = getJavaCompletionProposal();
+		if (javaProposal != null) {
+			if (javaProposal instanceof ICompletionProposalExtension5)
+				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=260951
+				additionalInfo = ((ICompletionProposalExtension5) javaProposal).getAdditionalProposalInfo(monitor);
+			else
+				additionalInfo = javaProposal.getAdditionalProposalInfo();
+		}
+
+		return additionalInfo;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getInformationControlCreator()
+	 */
+	public IInformationControlCreator getInformationControlCreator() {
+		// [277530] Use the java proposal's information control creator
+		ICompletionProposal javaProposal = getJavaCompletionProposal();
+		IInformationControlCreator informationControlCreator = null;
+
+		if (javaProposal instanceof ICompletionProposalExtension3)
+			informationControlCreator = ((ICompletionProposalExtension3) javaProposal).getInformationControlCreator();
+
+		return informationControlCreator;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getPrefixCompletionStart(org.eclipse.jface.text.IDocument, int)
+	 */
+	public int getPrefixCompletionStart(IDocument document, int completionOffset) {
+		ICompletionProposal javaProposal = getJavaCompletionProposal();
+		if (javaProposal instanceof ICompletionProposalExtension3)
+			return ((ICompletionProposalExtension3) javaProposal).getPrefixCompletionStart(document, completionOffset);
+
+		return getReplacementOffset();
+	}
+
+	public char[] getTriggerCharacters() {
+		return TRIGGERS;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getPrefixCompletionText(org.eclipse.jface.text.IDocument, int)
+	 */
+	public CharSequence getPrefixCompletionText(IDocument document, int completionOffset) {
+		ICompletionProposal javaProposal = getJavaCompletionProposal();
+		if (javaProposal instanceof ICompletionProposalExtension3)
+			return ((ICompletionProposalExtension3) javaProposal).getPrefixCompletionText(document, completionOffset);
+
+		return getReplacementString();
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposalComputer.java
new file mode 100644
index 0000000..99161fb
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposalComputer.java
@@ -0,0 +1,226 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.Iterator;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * <p>Computes JSP specific proposals</p>
+ * 
+ * @base org.eclipse.jst.jsp.ui.internal.contentassist.JSPContentAssistProcessor
+ */
+public class JSPCompletionProposalComputer extends DefaultXMLCompletionProposalComputer {
+	/**
+	 * <p>Create the computer</p>
+	 */
+	public JSPCompletionProposalComputer() {
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(java.lang.String, org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion, org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode, org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected ContentAssistRequest computeCompletionProposals(String matchString, ITextRegion completionRegion,
+			IDOMNode treeNode, IDOMNode xmlnode, CompletionProposalInvocationContext context) {
+
+		//be sure to get the super proposals
+		ContentAssistRequest request = super.computeCompletionProposals(matchString, completionRegion, treeNode, xmlnode, context);
+		
+		//calculate JSP specific proposals
+		int documentPosition = context.getInvocationOffset();
+		IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion(
+				context.getViewer(), documentPosition);
+
+		Document doc = null;
+		if (xmlnode != null) {
+			if (xmlnode.getNodeType() == Node.DOCUMENT_NODE) {
+				doc = (Document) xmlnode;
+			} else {
+				doc = xmlnode.getOwnerDocument();
+			}
+		}
+		String[] directiveNames = {"page", "include", "taglib"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		
+		ITextRegion prevTextRegion = null;
+		try {
+			int offset = sdRegion.getStartOffset(completionRegion);
+			if(offset > 0) {
+				offset--;
+			}
+			ITypedRegion prevRegion = context.getDocument().getPartition(offset);
+			prevTextRegion = sdRegion.getRegionAtCharacterOffset(prevRegion.getOffset());
+		} catch(BadLocationException e) {
+			//this should never happen
+			Logger.logException(e);
+		}
+		
+		// suggest JSP Expression inside of XML comments
+		if (completionRegion.getType() == DOMRegionContext.XML_COMMENT_TEXT && !isXMLFormat(doc)) {
+			if (request == null) {
+				request = new ContentAssistRequest(treeNode, xmlnode, sdRegion,
+						completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
+			}
+			request.addProposal(new CustomCompletionProposal("<%=  %>",//$NON-NLS-1$
+					documentPosition, 0, 4,
+					JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP),
+					"jsp:expression", null, "&lt;%= %&gt;", XMLRelevanceConstants.R_JSP)); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+		/* handle proposals in and around JSP_DIRECTIVE_OPEN,
+		 * JSP_DIRECTIVE_CLOSE (preceded by OPEN) and JSP_DIRECTIVE_NAME
+		 */
+		else if ((completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN &&
+				documentPosition >= sdRegion.getTextEndOffset(completionRegion)) ||
+				(completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME &&
+						documentPosition <= sdRegion.getTextEndOffset(completionRegion)) ||
+				(completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE &&
+						prevTextRegion != null &&
+						prevTextRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN &&
+						documentPosition <= sdRegion.getTextEndOffset(completionRegion))) {
+
+			if (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN ||
+					completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE) {
+				
+				if (request == null) {
+					request = new ContentAssistRequest(xmlnode, xmlnode, sdRegion,
+							completionRegion, documentPosition, 0, matchString);
+				}
+				
+				//determine if there is any part of a directive name already existing
+				Iterator regions = sdRegion.getRegions().iterator();
+				String nameString = null;
+				int begin = request.getReplacementBeginPosition();
+				int length = request.getReplacementLength();
+				while (regions.hasNext()) {
+					ITextRegion region = (ITextRegion) regions.next();
+					if (region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
+						nameString = sdRegion.getText(region);
+						begin = sdRegion.getStartOffset(region);
+						length = region.getTextLength();
+						break;
+					}
+				}
+				if (nameString == null) {
+					nameString = ""; //$NON-NLS-1$
+				}
+				
+				/* Suggest the directive names that have been determined to be
+				 * appropriate based on existing content
+				 */
+				for (int i = 0; i < directiveNames.length; i++) {
+					if (directiveNames[i].startsWith(nameString) || documentPosition <= begin) {
+						request.addProposal(new CustomCompletionProposal(directiveNames[i], begin,
+								length, directiveNames[i].length(),
+								JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP),
+								directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
+					}
+				}
+			}
+			// by default, JSP_DIRECTIVE_NAME
+			else { 
+				if (request == null) {
+					request = new ContentAssistRequest(xmlnode, xmlnode, sdRegion,
+							completionRegion, sdRegion.getStartOffset(completionRegion),
+							completionRegion.getTextLength(), matchString);
+				}
+				//add each of the directive names as a proposal
+				for (int i = 0; i < directiveNames.length; i++) {
+					if (directiveNames[i].startsWith(matchString)) {
+						request.addProposal(new CustomCompletionProposal(
+								directiveNames[i], request.getReplacementBeginPosition(),
+								request.getReplacementLength(), directiveNames[i].length(),
+								JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP),
+								directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
+					}
+				}
+			}
+		}
+		else if ((completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME &&
+				documentPosition > sdRegion.getTextEndOffset(completionRegion)) ||
+				(completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE &&
+						documentPosition <= sdRegion.getStartOffset(completionRegion))) {
+			
+			if (request == null) {
+				request = computeAttributeProposals(matchString, completionRegion,
+						treeNode, xmlnode, context);
+			}
+		}
+		// no name?: <%@ %>
+		else if (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE &&
+				documentPosition <= sdRegion.getStartOffset(completionRegion)) {
+			if (request != null) {
+				request = computeAttributeProposals(matchString, completionRegion, treeNode,
+						xmlnode, context);
+			}
+			Iterator regions = sdRegion.getRegions().iterator();
+			String nameString = null;
+			while (regions.hasNext()) {
+				ITextRegion region = (ITextRegion) regions.next();
+				if (region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
+					nameString = sdRegion.getText(region);
+					break;
+				}
+			}
+			if (nameString == null) {
+				for (int i = 0; i < directiveNames.length; i++) {
+					request.addProposal(new CustomCompletionProposal(
+							directiveNames[i], request.getReplacementBeginPosition(),
+							request.getReplacementLength(), directiveNames[i].length(),
+							JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP),
+							directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
+				}
+			}
+		}
+
+		return request;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		//nothing to suggest here
+	}
+
+	/**
+	 * @param doc determine if this doc is XML format
+	 * @return <code>true</code> if the given doc is of XML format, <code>false</code> otherwise.
+	 */
+	private boolean isXMLFormat(Document doc) {
+		if (doc == null)
+			return false;
+		Element docElement = doc.getDocumentElement();
+		return docElement != null && ((docElement.getNodeName().equals("jsp:root")) ||
+				((((IDOMNode) docElement).getStartStructuredDocumentRegion() == null &&
+						((IDOMNode) docElement).getEndStructuredDocumentRegion() == null))); //$NON-NLS-1$
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistHelper.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistHelper.java
new file mode 100644
index 0000000..1bbb4c4
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistHelper.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+
+/**
+ * <p>Helpful utility methods for JSP content assist</p>
+ */
+public class JSPContentAssistHelper {
+	/**
+	 * Returns project request is in
+	 * 
+	 * @param request
+	 * @return {@link IResource} representing the project the given request was made in
+	 */
+	public static IResource getResource(ContentAssistRequest request) {
+		IResource resource = null;
+		String baselocation = null;
+
+		if (request != null) {
+			IStructuredDocumentRegion region = request.getDocumentRegion();
+			if (region != null) {
+				IDocument document = region.getParentDocument();
+				IStructuredModel model = null;
+				try {
+					model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+					if (model != null) {
+						baselocation = model.getBaseLocation();
+					}
+				} finally {
+					if (model != null)
+						model.releaseFromRead();
+				}
+			}
+		}
+
+		if (baselocation != null) {
+			// copied from JSPTranslationAdapter#getJavaProject
+			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+			IPath filePath = new Path(baselocation);
+			IFile file = null;
+
+			if (filePath.segmentCount() > 1) {
+				file = root.getFile(filePath);
+			}
+			if (file != null) {
+				resource = file.getProject();
+			}
+		}
+		return resource;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java
new file mode 100644
index 0000000..892f559
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java
@@ -0,0 +1,1149 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.Vector;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.ITextViewerExtension5;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.jst.jsp.core.internal.contentmodel.JSPCMDocumentFactory;
+import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
+import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapter;
+import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapterFactory;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
+import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;
+import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
+import org.eclipse.wst.html.core.internal.contentmodel.JSPCMDocument;
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
+import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.text.IStructuredPartitions;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.ui.internal.IReleasable;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
+import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceConstants;
+import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
+import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
+import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
+import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocumentTracker;
+import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.core.text.IXMLPartitions;
+import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.ProposalComparator;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistProcessor;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistUtilities;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Adds proposals not normally covered by the generic behavior with the
+ * content model
+ * 
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see JSPStructuredContentAssistProcessor
+ */
+public class JSPContentAssistProcessor extends AbstractContentAssistProcessor {
+
+	protected int depthCount = 0;
+	protected ITextViewer fViewer = null;
+	protected boolean useEmbeddedResults = true;
+	protected boolean isInternalAdapter = false;
+	protected HashMap fNameToProcessorMap = null;
+	protected HashMap fPartitionToProcessorMap = null;
+	private final ICompletionProposal[] EMPTY_PROPOSAL_SET = new ICompletionProposal[0];
+	private JSPTemplateCompletionProcessor fTemplateProcessor = null;
+	private List fTemplateContexts = new ArrayList();
+	private IContentAssistProcessor fJSContentAssistProcessor;
+
+	public JSPContentAssistProcessor() {
+		super();
+		initNameToProcessorMap();
+		initPartitionToProcessorMap();
+	}
+
+	/**
+	 * init map for extra content assist processors (useBean,
+	 * get/setProperty). points [tagname > processor]
+	 */
+	protected void initNameToProcessorMap() {
+		fNameToProcessorMap = new HashMap();
+		JSPPropertyContentAssistProcessor jspPropertyCAP = new JSPPropertyContentAssistProcessor();
+		fNameToProcessorMap.put(JSP11Namespace.ElementName.SETPROPERTY, jspPropertyCAP);
+		fNameToProcessorMap.put(JSP11Namespace.ElementName.GETPROPERTY, jspPropertyCAP);
+		fNameToProcessorMap.put(JSP11Namespace.ElementName.USEBEAN, new JSPUseBeanContentAssistProcessor());
+		fNameToProcessorMap.put(JSP11Namespace.ElementName.DIRECTIVE_TAGLIB, new JSPTaglibDirectiveContentAssistProcessor());
+	}
+
+	/**
+	 * int map that points [partition > processor]. This takes place of
+	 * embedded adapters for now.
+	 */
+	protected void initPartitionToProcessorMap() {
+		fPartitionToProcessorMap = new HashMap();
+		HTMLContentAssistProcessor htmlProcessor = new HTMLContentAssistProcessor();
+		JSPJavaContentAssistProcessor jspJavaProcessor = new JSPJavaContentAssistProcessor();
+		XMLContentAssistProcessor xmlProcessor = new XMLContentAssistProcessor();
+		IContentAssistProcessor javascriptProcessor = getJSContentAssistProcessor();
+
+		fPartitionToProcessorMap.put(IHTMLPartitions.HTML_DEFAULT, htmlProcessor);
+		fPartitionToProcessorMap.put(IXMLPartitions.XML_DEFAULT, xmlProcessor);
+		fPartitionToProcessorMap.put(IStructuredPartitions.DEFAULT_PARTITION, htmlProcessor);
+		fPartitionToProcessorMap.put(IJSPPartitions.JSP_DEFAULT, jspJavaProcessor);
+		fPartitionToProcessorMap.put(IJSPPartitions.JSP_DIRECTIVE, xmlProcessor);
+		fPartitionToProcessorMap.put(IHTMLPartitions.HTML_COMMENT, htmlProcessor);
+		fPartitionToProcessorMap.put(IJSPPartitions.JSP_DEFAULT_EL, jspJavaProcessor);
+		if (javascriptProcessor != null) {
+			fPartitionToProcessorMap.put(IJSPPartitions.JSP_CONTENT_JAVASCRIPT, javascriptProcessor);
+			fPartitionToProcessorMap.put(IHTMLPartitions.SCRIPT, javascriptProcessor); // default
+		}
+		// to
+		// javascript
+		// for
+		// all
+		// script
+	}
+
+	protected void addCommentProposal(ContentAssistRequest contentAssistRequest) {
+		// do nothing
+	}
+
+	protected void addDocTypeProposal(ContentAssistRequest contentAssistRequest) {
+		// do nothing
+	}
+
+	protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
+		if (ContentTypeIdForJSP.ContentTypeID_JSPTAG.equals(((IDOMNode) contentAssistRequest.getNode()).getModel().getContentTypeIdentifier())) {
+			addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.NEW_TAG);
+		}
+		else {
+			addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.NEW);
+		}
+
+		super.addEmptyDocumentProposals(contentAssistRequest);
+		addTagInsertionProposals(contentAssistRequest, 0);
+	}
+
+	protected void addEndTagNameProposals(ContentAssistRequest contentAssistRequest) {
+		// do nothing
+	}
+
+	protected void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest) {
+		// do nothing
+	}
+
+	protected void addStartDocumentProposals(ContentAssistRequest contentAssistRequest) {
+		// do nothing
+	}
+
+	protected void addTagCloseProposals(ContentAssistRequest contentAssistRequest) {
+		// do nothing
+	}
+
+	protected void addXMLProposal(ContentAssistRequest contentAssistRequest) {
+		// do nothing
+	}
+
+	protected void addEndTagProposals(ContentAssistRequest contentAssistRequest) {
+		// do nothing
+	}
+
+	protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.ATTRIBUTE);
+	}
+
+	/**
+	 * add proposals for tags in attribute values
+	 */
+	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.ATTRIBUTE_VALUE);
+
+		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
+
+		// add JSP extra proposals from JSPBeanInfoContentAssistProcessor
+		// JSPPropertyContentAssistProcessor
+
+		// 2.1
+		// get results from JSPUseBean and JSPProperty here
+		// (look up processor in a map based on node name)
+		JSPDummyContentAssistProcessor extraProcessor = (JSPDummyContentAssistProcessor) fNameToProcessorMap.get(node.getNodeName());
+		if (extraProcessor != null && contentAssistRequest != null) {
+			extraProcessor.addAttributeValueProposals(contentAssistRequest);
+		}
+
+		ModelQuery mq = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
+		if (mq != null) {
+			CMDocument doc = mq.getCorrespondingCMDocument(node);
+			// this shouldn't have to have the prefix coded in
+			if (doc instanceof JSPCMDocument || doc instanceof CMNodeWrapper || node.getNodeName().startsWith("jsp:")) //$NON-NLS-1$
+				return;
+		}
+
+		// Find the attribute name for which this position should have a value
+		IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
+		ITextRegionList openRegions = open.getRegions();
+		int i = openRegions.indexOf(contentAssistRequest.getRegion());
+		if (i < 0)
+			return;
+		ITextRegion nameRegion = null;
+		while (i >= 0) {
+			nameRegion = openRegions.get(i--);
+			if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
+				break;
+		}
+		
+		// on an empty value, add all the JSP and taglib tags
+		CMElementDeclaration elementDecl = getCMElementDeclaration(node);
+		if (nameRegion != null && elementDecl != null) {
+			String attributeName = open.getText(nameRegion);
+			if (attributeName != null) {
+				String currentValue = node.getAttributes().getNamedItem(attributeName).getNodeValue();
+				
+				if(currentValue == null || currentValue.length() == 0) { //$NON-NLS-1$
+					List additionalElements = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
+					for (i = 0; i < additionalElements.size(); i++) {
+						Object additionalElement = additionalElements.get(i);
+						if(additionalElement instanceof CMElementDeclaration) {
+							CMElementDeclaration ed = (CMElementDeclaration) additionalElement;
+	
+							String tagname = getContentGenerator().getRequiredName(node, ed);
+							StringBuffer contents = new StringBuffer("\""); //$NON-NLS-1$
+							getContentGenerator().generateTag(node, ed, contents);
+							contents.append('"'); //$NON-NLS-1$
+							CustomCompletionProposal proposal = new CustomCompletionProposal(contents.toString(), contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), contents.length(), JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), tagname, null, null, XMLRelevanceConstants.R_JSP_ATTRIBUTE_VALUE);
+							contentAssistRequest.addProposal(proposal);
+						}
+					}
+				
+				}
+			}
+		}
+		else if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+			try {
+				// Create a new model for Content Assist to operate on. This
+				// will simulate
+				// a full Document and then adjust the offset numbers in the
+				// list of results.
+				IStructuredModel internalModel = null;
+				IModelManager mmanager = StructuredModelManager.getModelManager();
+				internalModel = mmanager.createUnManagedStructuredModelFor(ContentTypeIdForJSP.ContentTypeID_JSP);
+				IDOMNode xmlNode = null;
+				IDOMModel xmlOuterModel = null;
+				if (contentAssistRequest.getNode() instanceof IDOMNode) {
+					xmlNode = (IDOMNode) contentAssistRequest.getNode();
+					xmlOuterModel = xmlNode.getModel();
+					internalModel.setResolver(xmlOuterModel.getResolver());
+					internalModel.setBaseLocation(xmlOuterModel.getBaseLocation());
+				}
+				String contents = StringUtils.strip(contentAssistRequest.getText());
+				if (xmlNode != null && contents != null) {
+					int additionalShifts = 0;
+					// Be sure that custom tags from taglibs also show up
+					// by
+					// adding taglib declarations to the internal model.
+					TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(xmlOuterModel.getStructuredDocument());
+					if (mgr != null) {
+						List trackers = mgr.getCMDocumentTrackers(contentAssistRequest.getReplacementBeginPosition());
+						if (trackers != null) {
+							for (i = 0; i < trackers.size(); i++) {
+								CMDocumentTracker tracker = (CMDocumentTracker) trackers.get(i);
+								String declaration = tracker.getStructuredDocumentRegion().getText();
+								if (declaration != null) {
+									contents = declaration + contents;
+									additionalShifts += declaration.length();
+								}
+							}
+						}
+					}
+					// Also copy any jsp:useBean tags so that
+					// jsp:[gs]etProperty will function
+					Document doc = null;
+					if (contentAssistRequest.getNode().getNodeType() == Node.DOCUMENT_NODE)
+						doc = (Document) node;
+					else
+						doc = node.getOwnerDocument();
+					NodeList useBeans = doc.getElementsByTagName(JSP12Namespace.ElementName.USEBEAN);
+					for (int k = 0; k < useBeans.getLength(); k++) {
+						IDOMNode useBean = (IDOMNode) useBeans.item(k);
+						if (useBean.getStartOffset() < contentAssistRequest.getReplacementBeginPosition()) {
+							StringBuffer useBeanText = new StringBuffer("<jsp:useBean"); //$NON-NLS-1$
+							for (int j = 0; j < useBean.getAttributes().getLength(); j++) {
+								Attr attr = (Attr) useBean.getAttributes().item(j);
+								useBeanText.append(' ');
+								useBeanText.append(attr.getName());
+								useBeanText.append("=\""); //$NON-NLS-1$
+								useBeanText.append(attr.getValue());
+								useBeanText.append('"');
+							}
+							useBeanText.append("/>"); //$NON-NLS-1$
+							additionalShifts += useBeanText.length();
+							contents = useBeanText.toString() + contents;
+						}
+					}
+					internalModel.getStructuredDocument().set(contents);
+					int internalOffset = 0;
+					boolean quoted = false;
+					// if quoted, use position inside and shift by one
+					if (contentAssistRequest.getMatchString().length() > 0 && (contentAssistRequest.getMatchString().charAt(0) == '\'' || contentAssistRequest.getMatchString().charAt(0) == '"')) {
+						internalOffset = contentAssistRequest.getMatchString().length() - 1 + additionalShifts;
+						quoted = true;
+					}
+					// if unquoted, use position inside
+					else if (contentAssistRequest.getMatchString().length() > 0 && contentAssistRequest.getMatchString().charAt(0) == '<')
+						internalOffset = contentAssistRequest.getMatchString().length() + additionalShifts;
+					else
+						internalOffset = contentAssistRequest.getReplacementBeginPosition() - contentAssistRequest.getStartOffset() + additionalShifts;
+					depthCount++;
+					IndexedRegion internalNode = null;
+					int tmpOffset = internalOffset;
+					while (internalNode == null && tmpOffset >= 0)
+						internalNode = internalModel.getIndexedRegion(tmpOffset--);
+
+					if (internalModel.getFactoryRegistry() != null) {
+						// set up the internal model
+						if (internalModel.getFactoryRegistry().getFactoryFor(PageDirectiveAdapter.class) == null) {
+							internalModel.getFactoryRegistry().addFactory(new PageDirectiveAdapterFactory());
+						}
+						PageDirectiveAdapter outerEmbeddedTypeAdapter = (PageDirectiveAdapter) xmlOuterModel.getDocument().getAdapterFor(PageDirectiveAdapter.class);
+						PageDirectiveAdapter internalEmbeddedTypeAdapter = (PageDirectiveAdapter) ((INodeNotifier) ((Node) internalNode).getOwnerDocument()).getAdapterFor(PageDirectiveAdapter.class);
+						internalEmbeddedTypeAdapter.setEmbeddedType(outerEmbeddedTypeAdapter.getEmbeddedType());
+					}
+
+					AdapterFactoryRegistry adapterRegistry = JSPUIPlugin.getDefault().getAdapterFactoryRegistry();
+					Iterator adapterList = adapterRegistry.getAdapterFactories();
+					// And all those appropriate for this particular type
+					// of content
+					while (adapterList.hasNext()) {
+						try {
+							AdapterFactoryProvider provider = (AdapterFactoryProvider) adapterList.next();
+							if (provider.isFor(internalModel.getModelHandler())) {
+								provider.addAdapterFactories(internalModel);
+							}
+						}
+						catch (Exception e) {
+							Logger.logException(e);
+						}
+					}
+
+					/**
+					 * the internal adapter does all the real work of using
+					 * the JSP content model to form proposals
+					 */
+					ICompletionProposal[] results = null;
+					depthCount--;
+					if (results != null) {
+						for (i = 0; i < results.length; i++) {
+							contentAssistRequest.addProposal(new CustomCompletionProposal(((CustomCompletionProposal) results[i]).getReplacementString(), ((CustomCompletionProposal) results[i]).getReplacementOffset() - additionalShifts + contentAssistRequest.getStartOffset() + (quoted ? 1 : 0), ((CustomCompletionProposal) results[i]).getReplacementLength(), ((CustomCompletionProposal) results[i]).getCursorPosition(), results[i].getImage(), results[i].getDisplayString(), ((CustomCompletionProposal) results[i]).getContextInformation(), ((CustomCompletionProposal) results[i]).getAdditionalProposalInfo(), (results[i] instanceof IRelevanceCompletionProposal) ? ((IRelevanceCompletionProposal) results[i]).getRelevance() : IRelevanceConstants.R_NONE));
+						}
+					}
+				}
+			}
+			catch (Exception e) {
+				Logger.logException("Error in embedded JSP Content Assist", e); //$NON-NLS-1$
+			}
+		}
+
+
+	}
+
+	/**
+	 * For JSP files and segments, this is just the JSP
+	 *         document, but when editing tag files and their fragments, it
+	 *         should be the tag document.
+	 * 
+	 * It may also vary based on the model being edited in the future.
+	 * 
+	 * @return the default non-embedded CMDocument for the document being
+	 *         edited. 
+	 */
+	CMDocument getDefaultJSPCMDocument(IDOMNode node) {
+		// handle tag files here
+		String contentType = node.getModel().getContentTypeIdentifier();
+		if (ContentTypeIdForJSP.ContentTypeID_JSPTAG.equals(contentType))
+			return JSPCMDocumentFactory.getCMDocument(CMDocType.TAG20_DOC_TYPE);
+
+		CMDocument jcmdoc = null;
+		String modelPath = node.getModel().getBaseLocation();
+		if (modelPath != null && !IModelManager.UNMANAGED_MODEL.equals(modelPath)) {
+			float version = DeploymentDescriptorPropertyCache.getInstance().getJSPVersion(new Path(modelPath));
+			jcmdoc = JSPCMDocumentFactory.getCMDocument(version);
+		}
+		if (jcmdoc == null) {
+			jcmdoc = JSPCMDocumentFactory.getCMDocument();
+		}
+
+		return jcmdoc;
+	}
+
+	protected void init() {
+		super.init();
+	}
+
+	public void setErrorMessage(String errorMessage) {
+		if (depthCount == 0)
+			fErrorMessage = errorMessage;
+	}
+
+	/**
+	 * This method is acting as a "catch all" for pulling together content
+	 * assist proposals from different Processors when document partitioning
+	 * alone couldn't determine definitively what content assist should show
+	 * up at that particular position in the document
+	 * 
+	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(ITextViewer,
+	 *      int)
+	 */
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition) {
+		fTemplateContexts.clear();
+
+		IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion(viewer, documentPosition);
+		fViewer = viewer;
+		ICompletionProposal[] jspResults = EMPTY_PROPOSAL_SET;
+		ICompletionProposal[] embeddedResults = EMPTY_PROPOSAL_SET;
+
+		// check the actual partition type
+		String partitionType = getPartitionType(viewer, documentPosition);
+		IStructuredDocument structuredDocument = (IStructuredDocument) viewer.getDocument();
+
+		IStructuredDocumentRegion fn = structuredDocument.getRegionAtCharacterOffset(documentPosition);
+
+		// ////////////////////////////////////////////////////////////////////////////
+		// ANOTHER WORKAROUND UNTIL PARTITIONING TAKES CARE OF THIS
+		// check for xml-jsp tags...
+		if (partitionType == IJSPPartitions.JSP_DIRECTIVE && fn != null) {
+			IStructuredDocumentRegion possibleXMLJSP = ((fn.getType() == DOMRegionContext.XML_CONTENT) && fn.getPrevious() != null) ? fn.getPrevious() : fn;
+			ITextRegionList regions = possibleXMLJSP.getRegions();
+			if (regions.size() > 1) {
+				// check bounds cases
+				ITextRegion xmlOpenOrClose = regions.get(0);
+				if (xmlOpenOrClose.getType() == DOMRegionContext.XML_TAG_OPEN && documentPosition == possibleXMLJSP.getStartOffset()) {
+					// do regular jsp content assist
+				}
+				else if (xmlOpenOrClose.getType() == DOMRegionContext.XML_END_TAG_OPEN && documentPosition > possibleXMLJSP.getStartOffset()) {
+					// do regular jsp content assist
+				}
+				else {
+					// possible xml-jsp
+					ITextRegion nameRegion = regions.get(1);
+					String name = possibleXMLJSP.getText(nameRegion);
+					if (name.equals("jsp:scriptlet") || name.equals("jsp:expression") || name.equals("jsp:declaration")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+						return getJSPJavaCompletionProposals(viewer, documentPosition);
+					}
+				}
+			}
+		}
+
+		// ////////////////////////////////////////////////////////////////////////////
+		// ** THIS IS A TEMP FIX UNTIL PARTITIONING TAKES CARE OF THIS...
+		// check for XML-JSP in a <script> region
+		if (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitions.SCRIPT) {
+			// fn should be block text
+			IStructuredDocumentRegion decodedSDRegion = decodeScriptBlock(fn.getFullText());
+			// System.out.println("decoded > " +
+			// blockOfText.substring(decodedSDRegion.getStartOffset(),
+			// decodedSDRegion.getEndOffset()));
+			if (decodedSDRegion != null) {
+				IStructuredDocumentRegion sdr = decodedSDRegion;
+				while (sdr != null) {
+					// System.out.println("sdr " + sdr.getType());
+					// System.out.println("sdr > " +
+					// blockOfText.substring(sdr.getStartOffset(),
+					// sdr.getEndOffset()));
+					if (sdr.getType() == DOMJSPRegionContexts.JSP_CONTENT) {
+						if (documentPosition >= fn.getStartOffset() + sdr.getStartOffset() && documentPosition <= fn.getStartOffset() + sdr.getEndOffset()) {
+							return getJSPJavaCompletionProposals(viewer, documentPosition);
+						}
+					}
+					else if (sdr.getType() == DOMRegionContext.XML_TAG_NAME) {
+						if (documentPosition > fn.getStartOffset() + sdr.getStartOffset() && documentPosition < fn.getStartOffset() + sdr.getEndOffset()) {
+							return EMPTY_PROPOSAL_SET;
+						}
+						else if (documentPosition == fn.getStartOffset() + sdr.getEndOffset() && sdr.getNext() != null && sdr.getNext().getType() == DOMJSPRegionContexts.JSP_CONTENT) {
+							// the end of an open tag <script>
+							// <jsp:scriptlet>| blah </jsp:scriptlet>
+							return getJSPJavaCompletionProposals(viewer, documentPosition);
+						}
+						else if (documentPosition == fn.getStartOffset() + sdr.getStartOffset() && sdr.getPrevious() != null && sdr.getPrevious().getType() == DOMRegionContext.XML_TAG_NAME) {
+							return getJSPJavaCompletionProposals(viewer, documentPosition);
+						}
+					}
+					sdr = sdr.getNext();
+				}
+			}
+		}
+		// /////////////////////////////////////////////////////////////////////////
+		// check special JSP delimiter cases
+		if (fn != null && partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER) {
+			IStructuredDocumentRegion fnDelim = fn;
+
+			// if it's a nested JSP region, need to get the correct
+			// StructuredDocumentRegion
+			// not sure why this check was there...
+			// if (fnDelim.getType() == XMLRegionContext.BLOCK_TEXT) {
+			Iterator blockRegions = fnDelim.getRegions().iterator();
+			ITextRegion temp = null;
+			ITextRegionContainer trc;
+			while (blockRegions.hasNext()) {
+				temp = (ITextRegion) blockRegions.next();
+				// we hit a nested
+				if (temp instanceof ITextRegionContainer) {
+					trc = (ITextRegionContainer) temp;
+					// it's in this region
+					if (documentPosition >= trc.getStartOffset() && documentPosition < trc.getEndOffset()) {
+						Iterator nestedJSPRegions = trc.getRegions().iterator();
+						while (nestedJSPRegions.hasNext()) {
+							temp = (ITextRegion) nestedJSPRegions.next();
+							if (XMLContentAssistUtilities.isJSPOpenDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
+								// HTML content assist
+								// we actually want content assist for the
+								// previous type of region,
+								// well get those proposals from the embedded
+								// adapter
+								if (documentPosition > 0) {
+									partitionType = getPartitionType(viewer, documentPosition - 1);
+									break;
+								}
+							}
+							else if (XMLContentAssistUtilities.isJSPCloseDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
+								// JSP content assist
+								return getJSPJavaCompletionProposals(viewer, documentPosition);
+							}
+						}
+					}
+				}
+				// }
+			}
+
+			// take care of XML-JSP delimter cases
+			if (XMLContentAssistUtilities.isXMLJSPDelimiter(fnDelim)) {
+				// since it's a delimiter, we know it's a ITextRegionContainer
+				ITextRegion firstRegion = fnDelim.getRegions().get(0);
+				if (fnDelim.getStartOffset() == documentPosition && (firstRegion.getType() == DOMRegionContext.XML_TAG_OPEN)) {
+					// |<jsp:scriptlet> </jsp:scriptlet>
+					// (pa) commented out so that we get regular behavior JSP
+					// macros etc...
+					// return getHTMLCompletionProposals(viewer,
+					// documentPosition);
+				}
+				else if (fnDelim.getStartOffset() == documentPosition && (firstRegion.getType() == DOMRegionContext.XML_END_TAG_OPEN)) {
+					// <jsp:scriptlet> |</jsp:scriptlet>
+					// check previous partition type to see if it's JAVASCRIPT
+					// if it is, we're just gonna let the embedded JAVASCRIPT
+					// adapter get the proposals
+					if (documentPosition > 0) {
+						String checkType = getPartitionType(viewer, documentPosition - 1);
+						if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) { // this
+							// check
+							// is
+							// failing
+							// for
+							// XML-JSP
+							// (region
+							// is
+							// not
+							// javascript...)
+							return getJSPJavaCompletionProposals(viewer, documentPosition);
+						}
+						partitionType = IJSPPartitions.JSP_CONTENT_JAVASCRIPT;
+					}
+				}
+				else if ((firstRegion.getType() == DOMRegionContext.XML_TAG_OPEN) && documentPosition >= fnDelim.getEndOffset()) {
+					// anything else inbetween
+					return getJSPJavaCompletionProposals(viewer, documentPosition);
+				}
+			}
+			else if (XMLContentAssistUtilities.isJSPDelimiter(fnDelim)) {
+				// the delimiter <%, <%=, <%!, ...
+				if (XMLContentAssistUtilities.isJSPCloseDelimiter(fnDelim)) {
+					if (documentPosition == fnDelim.getStartOffset()) {
+						// check previous partition type to see if it's
+						// JAVASCRIPT
+						// if it is, we're just gonna let the embedded
+						// JAVASCRIPT adapter get the proposals
+						if (documentPosition > 0) {
+							String checkType = getPartitionType(viewer, documentPosition - 1);
+							if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) {
+								return getJSPJavaCompletionProposals(viewer, documentPosition);
+							}
+							partitionType = IJSPPartitions.JSP_CONTENT_JAVASCRIPT;
+						}
+					}
+				}
+				else if (XMLContentAssistUtilities.isJSPOpenDelimiter(fnDelim)) {
+					// if it's the first position of open delimiter
+					// use embedded HTML results
+					if (documentPosition == fnDelim.getStartOffset()) {
+						embeddedResults = getHTMLCompletionProposals(viewer, documentPosition);
+					}
+					else if (documentPosition == fnDelim.getEndOffset()) {
+						// it's at the EOF <%|
+						return getJSPJavaCompletionProposals(viewer, documentPosition);
+					}
+				}
+			}
+		}
+
+		// need to check if it's JSP region inside of CDATA w/ no region
+		// <![CDATA[ <%|%> ]]>
+		// or a comment region
+		// <!-- <% |%> -->
+		if (fn != null && (fn.getType() == DOMRegionContext.XML_CDATA_TEXT || fn.getType() == DOMRegionContext.XML_COMMENT_TEXT)) {
+			if (fn instanceof ITextRegionContainer) {
+				Object[] cdataRegions = fn.getRegions().toArray();
+				ITextRegion r = null;
+				ITextRegion jspRegion = null;
+				for (int i = 0; i < cdataRegions.length; i++) {
+					r = (ITextRegion) cdataRegions[i];
+					if (r instanceof ITextRegionContainer) {
+						// CDATA embedded container, or comment container
+						Object[] jspRegions = ((ITextRegionContainer) r).getRegions().toArray();
+						for (int j = 0; j < jspRegions.length; j++) {
+							jspRegion = (ITextRegion) jspRegions[j];
+							if (jspRegion.getType() == DOMJSPRegionContexts.JSP_CLOSE) {
+								if (sdRegion.getStartOffset(jspRegion) == documentPosition)
+									return getJSPJavaCompletionProposals(viewer, documentPosition);
+							}
+						}
+					}
+				}
+
+			}
+		}
+
+		// check if it's in an attribute value, if so, don't add CDATA
+		// proposal
+		ITextRegion attrContainer = (fn != null) ? fn.getRegionAtCharacterOffset(documentPosition) : null;
+		if (attrContainer != null && attrContainer instanceof ITextRegionContainer) {
+			if (attrContainer.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+				// test location of the cursor
+				// return null if it's in the middle of an open/close
+				// delimeter
+				Iterator attrRegions = ((ITextRegionContainer) attrContainer).getRegions().iterator();
+				ITextRegion testRegion = null;
+				while (attrRegions.hasNext()) {
+					testRegion = (ITextRegion) attrRegions.next();
+					// need to check for other valid attribute regions
+					if (XMLContentAssistUtilities.isJSPOpenDelimiter(testRegion.getType())) {
+						if (!(((ITextRegionContainer) attrContainer).getEndOffset(testRegion) <= documentPosition))
+							return EMPTY_PROPOSAL_SET;
+					}
+					else if (XMLContentAssistUtilities.isJSPCloseDelimiter(testRegion.getType())) {
+						if (!(((ITextRegionContainer) attrContainer).getStartOffset(testRegion) >= documentPosition))
+							return EMPTY_PROPOSAL_SET;
+					}
+				}
+				// TODO: handle non-Java code such as nested tags
+				if (testRegion.getType().equals(DOMJSPRegionContexts.JSP_CONTENT))
+					return getJSPJavaCompletionProposals(viewer, documentPosition);
+				return EMPTY_PROPOSAL_SET;
+			}
+		}
+
+		IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(partitionType);
+		if (p != null) {
+			embeddedResults = p.computeCompletionProposals(viewer, documentPosition);
+			// get bean methods, objects, and constants if there are any...
+			if (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitions.SCRIPT) {
+				ICompletionProposal[] beanResults = getJSPJavaBeanProposals(viewer, documentPosition);
+				if (beanResults != null && beanResults.length > 0) {
+					ICompletionProposal[] added = new ICompletionProposal[beanResults.length + embeddedResults.length];
+					System.arraycopy(beanResults, 0, added, 0, beanResults.length);
+					System.arraycopy(embeddedResults, 0, added, beanResults.length, embeddedResults.length);
+					embeddedResults = added;
+				}
+			}
+		}
+		else {
+			// the partition type is probably not mapped
+		}
+
+		// fix for:
+		// HTML content assist give JSP tags in between empty script tags
+		if (!((getJSContentAssistProcessor() != null && getJSContentAssistProcessor().getClass().isInstance(p)) || p instanceof CSSContentAssistProcessor)) {
+			fTemplateContexts.clear();
+			jspResults = super.computeCompletionProposals(viewer, documentPosition);
+		}
+		
+		//merge the embedded results
+		if (useEmbeddedResults && embeddedResults != null && embeddedResults.length > 0) {
+			jspResults = merge(jspResults, embeddedResults);
+		}
+		if (jspResults == null)
+			jspResults = EMPTY_PROPOSAL_SET;
+		setErrorMessage(jspResults.length == 0 ? UNKNOWN_CONTEXT : null);
+
+		// fix for:
+		// check for |<%-- --%> first position of jsp comment
+		if (partitionType == IJSPPartitions.JSP_COMMENT) {
+			if (sdRegion.getStartOffset() == documentPosition) {
+				ICompletionProposal[] htmlResults = getHTMLCompletionProposals(viewer, documentPosition);
+				jspResults = merge(jspResults, htmlResults);
+			}
+		}
+
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=86656
+		if (partitionType == IJSPPartitions.JSP_DIRECTIVE) {
+			ICompletionProposal[] importProposals = getImportProposals(viewer, documentPosition);
+			if (importProposals.length > 0)
+				jspResults = merge(jspResults, importProposals);
+		}
+		return jspResults;
+	}
+
+	private ICompletionProposal[] getImportProposals(ITextViewer viewer, int documentPosition) {
+		List importProposals = new ArrayList();
+		ICompletionProposal[] proposals = getJSPJavaCompletionProposals(viewer, documentPosition);
+		for (int i = 0; i < proposals.length; i++) {
+			if (proposals[i] instanceof JSPCompletionProposal) {
+
+				ICompletionProposal importProposal = adjustImportProposal((JSPCompletionProposal) proposals[i]);
+				importProposals.add(importProposal);
+			}
+		}
+		return (ICompletionProposal[]) importProposals.toArray(new ICompletionProposal[importProposals.size()]);
+	}
+
+
+	private ICompletionProposal adjustImportProposal(JSPCompletionProposal importProposal) {
+
+		// just need to remove the ";"
+		// and adjust offsets for the change
+		String newReplace = importProposal.getReplacementString().replaceAll(";", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		importProposal.setReplacementString(newReplace);
+
+		String newDisplay = importProposal.getDisplayString().replaceAll(";", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		importProposal.setDisplayString(newDisplay);
+
+		int newReplacementLength = importProposal.getReplacementLength() - 1;
+		if (newReplacementLength >= 0)
+			importProposal.setReplacementLength(newReplacementLength);
+
+		int newCursorPosition = importProposal.getCursorPosition() - 1;
+		importProposal.setCursorPosition(newCursorPosition);
+
+		return importProposal;
+	}
+
+	/**
+	 * Adds 2 arrays of {@link ICompletionProposal}s to a {@link TreeSet}
+	 * eliminating duplicates and sorting with a {@link ProposalComparator}
+	 * then returning the new merged, filtered, sorted, array of {@link ICompletionProposal}s.
+	 * 
+	 * @param proposalsOne
+	 * @param proposalsTwo
+	 * @return a new merged, filtered, sorted array of {@link ICompletionProposal}s created from
+	 * the two given arrays of {@link ICompletionProposal}s.
+	 */
+	private ICompletionProposal[] merge(ICompletionProposal[] proposalsOne, ICompletionProposal[] proposalsTwo) {
+		Set results = new TreeSet(new ProposalComparator());
+
+		if (proposalsOne != null) {
+			for (int i = 0; i < proposalsOne.length; i++)
+				results.add(proposalsOne[i]);
+		}
+		if (proposalsTwo != null) {
+			for (int i = 0; i < proposalsTwo.length; i++)
+				results.add(proposalsTwo[i]);
+		}
+
+		return (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()]);
+	}
+
+	private IContentAssistProcessor getJSContentAssistProcessor() {
+		if (fJSContentAssistProcessor == null) {
+			fJSContentAssistProcessor = new StructuredTextViewerConfigurationHTML().getContentAssistant(null).getContentAssistProcessor(IHTMLPartitions.SCRIPT);
+		}
+		return fJSContentAssistProcessor;
+	}
+
+	/*
+	 * This method will return JSPJava Proposals that are relevant to any java
+	 * beans that in scope at the documentPosition
+	 * 
+	 * TODO (pa) are taglib vars getting filtered?
+	 * 
+	 * @param viewer @param documentPosition @return ICompletionProposal[]
+	 */
+	private ICompletionProposal[] getJSPJavaBeanProposals(ITextViewer viewer, int documentPosition) {
+		ICompletionProposal[] regularJSPResults = getJSPJavaCompletionProposals(viewer, documentPosition);
+		Vector filteredProposals = new Vector();
+		ICompletionProposal[] finalResults = EMPTY_PROPOSAL_SET;
+		for (int i = 0; i < regularJSPResults.length; i++) {
+			ICompletionProposal test = regularJSPResults[i];
+
+			System.out.println("proposal > " + test.getDisplayString()); //$NON-NLS-1$
+			System.out.println("relevance > " + ((CustomCompletionProposal) test).getRelevance()); //$NON-NLS-1$
+
+			if (isRelevanceAllowed(((CustomCompletionProposal) test).getRelevance())) {
+				filteredProposals.add(test);
+			}
+		}
+		if (filteredProposals.size() > 0) {
+			finalResults = new ICompletionProposal[filteredProposals.size()];
+			Iterator it = filteredProposals.iterator();
+			int j = 0;
+			while (it.hasNext()) {
+				finalResults[j++] = (ICompletionProposal) it.next();
+			}
+		}
+		return finalResults;
+	}
+
+	// These are the only things I'm allowing for use bean if the language is
+	// JAVASCRIPT
+	// I'm filtering based on JavaContentAssistProposal relevance
+	//
+	// 485 > method that belongs to the bean
+	// 486 > bean object
+	// 386 > bean CONSTANT
+	private boolean isRelevanceAllowed(int relevance) {
+		return (relevance == 485 || relevance == 486 || relevance == 326);
+	}
+
+
+	/**
+	 * 
+	 * @param viewer
+	 * @param documentPosition
+	 * @return ICompletionProposal[]
+	 */
+	private ICompletionProposal[] getHTMLCompletionProposals(ITextViewer viewer, int documentPosition) {
+
+		IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(IHTMLPartitions.HTML_DEFAULT);
+		return p.computeCompletionProposals(viewer, documentPosition);
+	}
+
+	/**
+	 * 
+	 * @param viewer
+	 * @param documentPosition
+	 * @return ICompletionProposal[]
+	 */
+	protected ICompletionProposal[] getJSPJavaCompletionProposals(ITextViewer viewer, int documentPosition) {
+		JSPJavaContentAssistProcessor p = (JSPJavaContentAssistProcessor) fPartitionToProcessorMap.get(IJSPPartitions.JSP_DEFAULT);
+		return p.computeCompletionProposals(viewer, documentPosition);
+	}
+
+	/**
+	 * @param viewer
+	 * @param documentPosition
+	 * @return String
+	 */
+	protected String getPartitionType(ITextViewer viewer, int documentPosition) {
+		String partitionType = null;
+		try {
+			if (viewer instanceof ITextViewerExtension5)
+				partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, ((ITextViewerExtension5) viewer).modelOffset2WidgetOffset(documentPosition), false);
+			else
+				partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, documentPosition, false);
+		}
+		catch (BadLocationException e) {
+			partitionType = IDocument.DEFAULT_CONTENT_TYPE;
+		}
+		return partitionType;
+	}
+
+	/*
+	 * ** TEMP WORKAROUND FOR CMVC 241882 Takes a String and blocks out
+	 * jsp:scriptlet, jsp:expression, and jsp:declaration @param blockText
+	 * @return
+	 */
+	private IStructuredDocumentRegion decodeScriptBlock(String blockText) {
+		XMLSourceParser parser = new XMLSourceParser();
+		// use JSP_CONTENT for region type
+		parser.addBlockMarker(new BlockMarker("jsp:scriptlet", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
+		parser.addBlockMarker(new BlockMarker("jsp:expression", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
+		parser.addBlockMarker(new BlockMarker("jsp:declaration", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
+		parser.reset(blockText);
+		return parser.getDocumentRegions();
+	}
+
+	/*
+	 * @see ContentAssistAdapter#computeContextInformation(ITextViewer, int,
+	 *      IndexedRegion)
+	 */
+	public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset, IndexedRegion indexedNode) {
+		return super.computeContextInformation(viewer, documentOffset);
+	}
+
+	/*
+	 * @see ContentAssistAdapter#getContextInformationAutoActivationCharacters()
+	 */
+	public char[] getContextInformationAutoActivationCharacters() {
+		return super.getContextInformationAutoActivationCharacters();
+	}
+
+
+	public char[] getCompletionProposalAutoActivationCharacters() {
+		IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(IHTMLPartitions.HTML_DEFAULT);
+		return p.getCompletionProposalAutoActivationCharacters();
+	}
+
+	/*
+	 * @see ContentAssistAdapter#getContextInformationValidator()
+	 */
+	public IContextInformationValidator getContextInformationValidator() {
+		return super.getContextInformationValidator();
+	}
+
+	protected boolean isXMLFormat(Document doc) {
+		if (doc == null)
+			return false;
+		Element docElement = doc.getDocumentElement();
+		return docElement != null && ((docElement.getNodeName().equals("jsp:root")) || ((((IDOMNode) docElement).getStartStructuredDocumentRegion() == null && ((IDOMNode) docElement).getEndStructuredDocumentRegion() == null))); //$NON-NLS-1$
+	}
+
+	/*
+	 * @see ContentAssistAdapter#release()
+	 */
+	public void release() {
+		super.release();
+		// release *ContentAssistProcessors in maps
+		// CMVC 254023
+		releasePartitionToProcessorMap();
+		releaseNameToProcessorMap();
+	}
+
+	protected void releasePartitionToProcessorMap() {
+		releaseMap(fPartitionToProcessorMap);
+	}
+
+	protected void releaseNameToProcessorMap() {
+		releaseMap(fNameToProcessorMap);
+	}
+
+	protected void releaseMap(HashMap map) {
+		if (map != null) {
+			if (!map.isEmpty()) {
+				Iterator it = map.keySet().iterator();
+				Object key = null;
+				while (it.hasNext()) {
+					key = it.next();
+					if (map.get(key) instanceof IReleasable) {
+						((IReleasable) map.get(key)).release();
+					}
+				}
+			}
+			map.clear();
+			map = null;
+		}
+	}
+
+	/**
+	 * @see AbstractContentAssistProcessor#computeCompletionProposals(int,
+	 *      String, ITextRegion, IDOMNode, IDOMNode)
+	 */
+	protected ContentAssistRequest computeCompletionProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
+
+		ContentAssistRequest request = super.computeCompletionProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
+		IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion(fTextViewer, documentPosition);
+
+		Document doc = null;
+		if (xmlnode != null) {
+			if (xmlnode.getNodeType() == Node.DOCUMENT_NODE)
+				doc = (Document) xmlnode;
+			else
+				doc = xmlnode.getOwnerDocument();
+		}
+		String[] directiveNames = {"page", "include", "taglib"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		// suggest JSP Expression inside of XML comments
+		if (completionRegion.getType() == DOMRegionContext.XML_COMMENT_TEXT && !isXMLFormat(doc)) {
+			if (request == null)
+				request = newContentAssistRequest(treeNode, xmlnode, sdRegion, completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
+			request.addProposal(new CustomCompletionProposal("<%=  %>", documentPosition, 0, 4, JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), "jsp:expression", null, "&lt;%= %&gt;", XMLRelevanceConstants.R_JSP)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		}
+		// handle proposals in and around JSP_DIRECTIVE_OPEN and
+		// JSP_DIRECTIVE_NAME
+		else if ((completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN && documentPosition >= sdRegion.getTextEndOffset(completionRegion)) || (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME && documentPosition <= sdRegion.getTextEndOffset(completionRegion))) {
+			if (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN) {
+				if (request == null)
+					request = newContentAssistRequest(xmlnode, xmlnode, sdRegion, completionRegion, documentPosition, 0, matchString);
+				Iterator regions = sdRegion.getRegions().iterator();
+				String nameString = null;
+				int begin = request.getReplacementBeginPosition();
+				int length = request.getReplacementLength();
+				while (regions.hasNext()) {
+					ITextRegion region = (ITextRegion) regions.next();
+					if (region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
+						nameString = sdRegion.getText(region);
+						begin = sdRegion.getStartOffset(region);
+						length = region.getTextLength();
+						break;
+					}
+				}
+				if (nameString == null)
+					nameString = ""; //$NON-NLS-1$
+				for (int i = 0; i < directiveNames.length; i++) {
+					if (directiveNames[i].startsWith(nameString) || documentPosition <= begin)
+						request.addProposal(new CustomCompletionProposal(directiveNames[i], begin, length, directiveNames[i].length(), JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
+				}
+			}
+			else { // by default, JSP_DIRECTIVE_NAME
+				if (request == null)
+					request = newContentAssistRequest(xmlnode, xmlnode, sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
+				for (int i = 0; i < directiveNames.length; i++) {
+					if (directiveNames[i].startsWith(matchString))
+						request.addProposal(new CustomCompletionProposal(directiveNames[i], request.getReplacementBeginPosition(), request.getReplacementLength(), directiveNames[i].length(), JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
+				}
+			}
+		}
+		else if ((completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME && documentPosition > sdRegion.getTextEndOffset(completionRegion)) || (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE && documentPosition <= sdRegion.getStartOffset(completionRegion))) {
+			if (request == null)
+				request = computeAttributeProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
+			super.addTagCloseProposals(request);
+			// CMVC 274033, this is being added for all <jsp:* tags
+			// in addAttributeNameProposals(contentAssistRequest)
+			// super.addAttributeNameProposals(request);
+		}
+		// no name?: <%@ %>
+		else if (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE && documentPosition <= sdRegion.getStartOffset(completionRegion)) {
+			if (request != null)
+				request = computeAttributeProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
+			Iterator regions = sdRegion.getRegions().iterator();
+			String nameString = null;
+			while (regions.hasNext()) {
+				ITextRegion region = (ITextRegion) regions.next();
+				if (region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
+					nameString = sdRegion.getText(region);
+					break;
+				}
+			}
+			if (nameString == null) {
+				for (int i = 0; i < directiveNames.length; i++) {
+					request.addProposal(new CustomCompletionProposal(directiveNames[i], request.getReplacementBeginPosition(), request.getReplacementLength(), directiveNames[i].length(), JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
+				}
+			}
+		}
+
+		// bug115927 use original document position for all/any region
+		// templates
+		addTemplates(request, TemplateContextTypeIdsJSP.ALL, documentPosition);
+		return request;
+	}
+
+	private JSPTemplateCompletionProcessor getTemplateCompletionProcessor() {
+		if (fTemplateProcessor == null) {
+			fTemplateProcessor = new JSPTemplateCompletionProcessor();
+		}
+		return fTemplateProcessor;
+	}
+
+	/**
+	 * Adds templates to the list of proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 */
+	private void addTemplates(ContentAssistRequest contentAssistRequest, String context) {
+		addTemplates(contentAssistRequest, context, contentAssistRequest.getReplacementBeginPosition());
+	}
+
+	/**
+	 * Adds templates to the list of proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 */
+	private void addTemplates(ContentAssistRequest contentAssistRequest, String context, int startOffset) {
+		if (contentAssistRequest == null)
+			return;
+
+		// if already adding template proposals for a certain context type, do
+		// not add again
+		if (!fTemplateContexts.contains(context)) {
+			fTemplateContexts.add(context);
+			boolean useProposalList = !contentAssistRequest.shouldSeparate();
+
+			if (getTemplateCompletionProcessor() != null) {
+				getTemplateCompletionProcessor().setContextType(context);
+				ICompletionProposal[] proposals = getTemplateCompletionProcessor().computeCompletionProposals(fTextViewer, startOffset);
+				for (int i = 0; i < proposals.length; ++i) {
+					if (useProposalList)
+						contentAssistRequest.addProposal(proposals[i]);
+					else
+						contentAssistRequest.addMacro(proposals[i]);
+				}
+			}
+		}
+	}
+
+	protected void addEntityProposals(ContentAssistRequest contentAssistRequest, int documentPosition, ITextRegion completionRegion, IDOMNode treeNode) {
+		// ignore
+	}
+
+	protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.TAG);
+		//don't need to call super here because otherwise we duplicate what the HTMLCOntentAssistProcessor that is running is already doing
+	}
+
+	/**
+	 * Use the embedded content assist processor to determine the content generator
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor#getContentGenerator()
+	 */
+	public XMLContentModelGenerator getContentGenerator() {
+		if (fGenerator == null) {
+			fGenerator = ((AbstractContentAssistProcessor) fPartitionToProcessorMap.get(IHTMLPartitions.HTML_DEFAULT)).getContentGenerator();
+		}
+		return fGenerator;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java
new file mode 100644
index 0000000..2b14ece
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java
@@ -0,0 +1,306 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.List;
+import java.util.Properties;
+import java.util.Vector;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * This class is a "null" version of AbstractContentAssistProcessor
+ * 
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see DefaultXMLCompletionProposalComputer
+ */
+public class JSPDummyContentAssistProcessor extends AbstractContentAssistProcessor {
+	protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
+		super.addAttributeNameProposals(contentAssistRequest);
+	}
+
+	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
+		super.addAttributeValueProposals(contentAssistRequest);
+	}
+
+
+	protected void addCommentProposal(ContentAssistRequest contentAssistRequest) {
+		super.addCommentProposal(contentAssistRequest);
+	}
+
+
+	protected void addContent(List contentList, CMContent content) {
+		super.addContent(contentList, content);
+	}
+
+
+	protected void addDocTypeProposal(ContentAssistRequest contentAssistRequest) {
+		super.addDocTypeProposal(contentAssistRequest);
+	}
+
+
+	protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
+		super.addEmptyDocumentProposals(contentAssistRequest);
+	}
+
+
+	protected void addEndTagNameProposals(ContentAssistRequest contentAssistRequest) {
+		super.addEndTagNameProposals(contentAssistRequest);
+	}
+
+
+	protected void addEndTagProposals(ContentAssistRequest contentAssistRequest) {
+		super.addEndTagProposals(contentAssistRequest);
+	}
+
+
+	protected void addEntityProposals(ContentAssistRequest contentAssistRequest, int documentPosition, ITextRegion completionRegion, IDOMNode treeNode) {
+		super.addEntityProposals(contentAssistRequest, documentPosition, completionRegion, treeNode);
+	}
+
+
+	protected void addEntityProposals(Vector proposals, Properties map, String key, int nodeOffset, IStructuredDocumentRegion parent, ITextRegion completionRegion) {
+		super.addEntityProposals(proposals, map, key, nodeOffset, parent, completionRegion);
+	}
+
+
+	protected void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest) {
+		super.addPCDATAProposal(nodeName, contentAssistRequest);
+	}
+
+
+	protected void addStartDocumentProposals(ContentAssistRequest contentAssistRequest) {
+		super.addStartDocumentProposals(contentAssistRequest);
+	}
+
+
+	protected void addTagCloseProposals(ContentAssistRequest contentAssistRequest) {
+		super.addTagCloseProposals(contentAssistRequest);
+	}
+
+
+	protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
+		super.addTagInsertionProposals(contentAssistRequest, childPosition);
+	}
+
+
+	protected void addTagNameProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
+		super.addTagNameProposals(contentAssistRequest, childPosition);
+	}
+
+	protected boolean attributeInList(IDOMNode node, Node parent, CMNode cmnode) {
+		return super.attributeInList(node, parent, cmnode);
+	}
+
+
+	protected boolean beginsWith(String aString, String prefix) {
+		return super.beginsWith(aString, prefix);
+	}
+
+
+	protected ContentAssistRequest computeAttributeProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
+		return super.computeAttributeProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
+	}
+
+
+	protected ContentAssistRequest computeAttributeValueProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
+		return super.computeAttributeValueProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
+	}
+
+
+	protected ContentAssistRequest computeCompletionProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
+		return super.computeCompletionProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
+	}
+
+
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
+		return super.computeCompletionProposals(viewer, documentOffset);
+	}
+
+
+	protected ContentAssistRequest computeContentProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
+		return super.computeContentProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
+	}
+
+
+	/**
+	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer,
+	 *      int)
+	 */
+	public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
+		return super.computeContextInformation(viewer, documentOffset);
+	}
+
+	protected ContentAssistRequest computeEndTagOpenProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
+		return super.computeEndTagOpenProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
+	}
+
+
+	protected ICompletionProposal[] computeEntityReferenceProposals(int documentPosition, ITextRegion completionRegion, IDOMNode treeNode) {
+		return super.computeEntityReferenceProposals(documentPosition, completionRegion, treeNode);
+	}
+
+	protected ContentAssistRequest computeEqualsProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
+		return super.computeEqualsProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
+	}
+
+	protected ContentAssistRequest computeStartDocumentProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
+		return super.computeStartDocumentProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
+	}
+
+	protected ContentAssistRequest computeTagCloseProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
+		return super.computeTagCloseProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
+	}
+
+	protected ContentAssistRequest computeTagNameProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
+		return super.computeTagNameProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
+	}
+
+	protected ContentAssistRequest computeTagOpenProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
+		return super.computeTagOpenProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
+	}
+
+	protected String getAdditionalInfo(CMNode parentOrOwner, CMNode cmnode) {
+		return super.getAdditionalInfo(parentOrOwner, cmnode);
+	}
+
+	protected List getAvailableChildrenAtIndex(Element parent, int index, int validityChecking) {
+		return super.getAvailableChildrenAtIndex(parent, index, validityChecking);
+	}
+
+	protected List getAvailableRootChildren(Document document, int childIndex) {
+		return super.getAvailableRootChildren(document, childIndex);
+	}
+
+	protected CMElementDeclaration getCMElementDeclaration(Node node) {
+		return super.getCMElementDeclaration(node);
+	}
+
+	public char[] getCompletionProposalAutoActivationCharacters() {
+		return super.getCompletionProposalAutoActivationCharacters();
+	}
+
+	protected ITextRegion getCompletionRegion(int offset, IStructuredDocumentRegion flatNode) {
+		return super.getCompletionRegion(offset, flatNode);
+	}
+
+	protected ITextRegion getCompletionRegion(int documentPosition, Node domnode) {
+		return super.getCompletionRegion(documentPosition, domnode);
+	}
+
+	public XMLContentModelGenerator getContentGenerator() {
+		return super.getContentGenerator();
+	}
+
+	public char[] getContextInformationAutoActivationCharacters() {
+		return super.getContextInformationAutoActivationCharacters();
+	}
+
+	public IContextInformationValidator getContextInformationValidator() {
+		return super.getContextInformationValidator();
+	}
+
+	protected int getElementPosition(Node child) {
+		return super.getElementPosition(child);
+	}
+
+	/**
+	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
+	 */
+	public String getErrorMessage() {
+		return super.getErrorMessage();
+	}
+
+	protected String getMatchString(IStructuredDocumentRegion parent, ITextRegion aRegion, int offset) {
+		return super.getMatchString(parent, aRegion, offset);
+	}
+
+	protected ITextRegion getNameRegion(IStructuredDocumentRegion flatNode) {
+		return super.getNameRegion(flatNode);
+	}
+
+
+	protected List getPossibleDataTypeValues(Node node, CMAttributeDeclaration ad) {
+		return super.getPossibleDataTypeValues(node, ad);
+	}
+
+
+	protected String getRequiredName(Node parentOrOwner, CMNode cmnode) {
+		return super.getRequiredName(parentOrOwner, cmnode);
+	}
+
+	protected String getRequiredText(Node parentOrOwner, CMAttributeDeclaration attrDecl) {
+		return super.getRequiredText(parentOrOwner, attrDecl);
+	}
+
+	protected String getRequiredText(Node parentOrOwner, CMElementDeclaration elementDecl) {
+		return super.getRequiredText(parentOrOwner, elementDecl);
+	}
+
+	protected List getValidChildElementDeclarations(Element parent, int childPosition, int kindOfAction) {
+		return super.getValidChildElementDeclarations(parent, childPosition, kindOfAction);
+	}
+
+	protected void init() {
+		super.init();
+	}
+
+	protected boolean isCloseRegion(ITextRegion region) {
+		return super.isCloseRegion(region);
+	}
+
+	protected boolean isNameRegion(ITextRegion region) {
+		return super.isNameRegion(region);
+	}
+
+	protected boolean isQuote(String string) {
+		return super.isQuote(string);
+	}
+
+	protected Properties mapToProperties(CMNamedNodeMap map) {
+		return super.mapToProperties(map);
+	}
+
+	public void setErrorMessage(String errorMessage) {
+		super.setErrorMessage(errorMessage);
+	}
+
+	protected void setErrorMessage(String errorMessage, String append) {
+		super.setErrorMessage(errorMessage, append);
+	}
+
+	protected void setErrorMessage(String errorMessage, String prepend, String append) {
+		super.setErrorMessage(errorMessage, prepend, append);
+	}
+
+	protected boolean stringsEqual(String a, String b) {
+		return super.stringsEqual(a, b);
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java
new file mode 100644
index 0000000..fc32b3c
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java
@@ -0,0 +1,24 @@
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+
+/**
+ * @deprecated This class is no longer used locally and will be removed in the future
+ */
+public class JSPELCompletionProcessor extends JSPCompletionProcessor {
+	protected JSPProposalCollector getProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
+		return new JSPELProposalCollector(cu, translation);
+	}
+	
+	/**
+	 * The java position offset needs to be shifted 3 for the "get" in the java
+	 * proposal mapped to a given JSP EL proposal
+	 */
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int pos) {
+		//3 for the "get" at the beginning of the java proposal
+		return computeCompletionProposals(viewer, pos, 3);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProposalComputer.java
new file mode 100644
index 0000000..709baa0
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProposalComputer.java
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentImpl;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDFunction;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserConstants;
+import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserTokenManager;
+import org.eclipse.jst.jsp.core.internal.java.jspel.SimpleCharStream;
+import org.eclipse.jst.jsp.core.internal.java.jspel.Token;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+
+/**
+ * <p>Compute JSP EL completion proposals</p>
+ */
+public class JSPELCompletionProposalComputer extends
+		JSPJavaCompletionProposalComputer {
+	
+	/**
+	 * @see org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		ITextViewer viewer = context.getViewer();
+		int documentPosition = context.getInvocationOffset();
+
+		// get results from JSP completion processor
+		//3 for the "get" at the beginning of the java proposal
+		List results = new ArrayList(computeJavaCompletionProposals(viewer, documentPosition, 3));
+
+		//get the function proposals for syntax like: ${ fn:| }
+		IStructuredDocumentRegion flat = ContentAssistUtils.getStructuredDocumentRegion(viewer, documentPosition);
+		if (flat != null) {
+			ITextRegion cursorRegion = flat.getRegionAtCharacterOffset(documentPosition);
+			String elText;
+			int startOffset;
+			//if container then need to get inner region
+			//else can use flat region
+			if (cursorRegion instanceof ITextRegionContainer) {
+				ITextRegionContainer container = (ITextRegionContainer) cursorRegion;
+				cursorRegion = container.getRegionAtCharacterOffset(documentPosition);
+				elText = container.getText(cursorRegion);
+				startOffset = container.getStartOffset(cursorRegion);
+			} else {
+				elText = flat.getText(cursorRegion);
+				startOffset = flat.getStartOffset(cursorRegion);
+			}
+			
+			//sanity check that we are actually in EL region
+			if (cursorRegion.getType() == DOMJSPRegionContexts.JSP_EL_CONTENT) {
+				String prefix = getPrefix(documentPosition - startOffset, elText);
+				if (null != prefix) {
+					List proposals = getFunctionProposals(prefix, viewer, documentPosition);
+					results.addAll(proposals);
+				}
+			}
+		}
+
+		return results;
+	}
+	
+	/**
+	 * @see org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaCompletionProposalComputer#getProposalCollector(
+	 * 		org.eclipse.jdt.core.ICompilationUnit, org.eclipse.jst.jsp.core.internal.java.JSPTranslation)
+	 */
+	protected JSPProposalCollector getProposalCollector(ICompilationUnit cu,
+			JSPTranslation translation) {
+		
+		return new JSPELProposalCollector(cu, translation);
+	}
+
+	/**
+	 * <p>Gets the EL prefix from the relative position and the given EL text</p>
+	 * 
+	 * @param relativePosition
+	 * @param elText
+	 * @return
+	 */
+	private String getPrefix(int relativePosition, String elText) {
+		java.io.StringReader reader = new java.io.StringReader(elText);
+		JSPELParserTokenManager scanner = new JSPELParserTokenManager(new SimpleCharStream(reader, 1, 1));
+		Token curToken = null, lastIdentifier = null;
+		while (JSPELParserConstants.EOF != (curToken = scanner.getNextToken()).kind) {
+			if (JSPELParserConstants.COLON == curToken.kind && curToken.endColumn == relativePosition && null != lastIdentifier) {
+				return (lastIdentifier.image);
+			}
+
+			if (JSPELParserConstants.IDENTIFIER == curToken.kind) {
+				lastIdentifier = curToken;
+			}
+			else {
+				lastIdentifier = null;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * <p>Get the EL function proposals, ex: ${fn:| }</p>
+	 * @param prefix
+	 * @param viewer
+	 * @param offset
+	 * @return
+	 */
+	private List getFunctionProposals(String prefix, ITextViewer viewer, int offset) {
+		TLDCMDocumentManager docMgr = TaglibController.getTLDCMDocumentManager(viewer.getDocument());
+		ArrayList completionList = new ArrayList();
+		if (docMgr == null)
+			return null;
+
+		Iterator taglibs = docMgr.getCMDocumentTrackers(offset).iterator();
+		while (taglibs.hasNext()) {
+			TaglibTracker tracker = (TaglibTracker) taglibs.next();
+			if (tracker.getPrefix().equals(prefix)) {
+				CMDocumentImpl doc = (CMDocumentImpl) tracker.getDocument();
+
+				List functions = doc.getFunctions();
+				for (Iterator it = functions.iterator(); it.hasNext();) {
+					TLDFunction function = (TLDFunction) it.next();
+					CustomCompletionProposal proposal = new CustomCompletionProposal(function.getName() + "()", //$NON-NLS-1$
+								offset, 0, function.getName().length() + 1, null, function.getName() + " - " + function.getSignature(), null, null, 1); //$NON-NLS-1$
+
+					completionList.add(proposal);
+				}
+			}
+		}
+		return completionList;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java
new file mode 100644
index 0000000..dbc6c55
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java
@@ -0,0 +1,152 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentImpl;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDFunction;
+import org.eclipse.jst.jsp.core.internal.java.jspel.ASTExpression;
+import org.eclipse.jst.jsp.core.internal.java.jspel.ASTFunctionInvocation;
+import org.eclipse.jst.jsp.core.internal.java.jspel.FindFunctionInvocationVisitor;
+import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParser;
+import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserConstants;
+import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserTokenManager;
+import org.eclipse.jst.jsp.core.internal.java.jspel.ParseException;
+import org.eclipse.jst.jsp.core.internal.java.jspel.SimpleCharStream;
+import org.eclipse.jst.jsp.core.internal.java.jspel.Token;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+
+/**
+ * @deprecated This class is no longer used locally and will be removed in the future
+ */
+public class JSPELContentAssistProcessor extends JSPJavaContentAssistProcessor {
+	protected char elCompletionProposalAutoActivationCharacters[] = new char[]{'.', ':'};
+
+	protected JSPCompletionProcessor getJspCompletionProcessor() {
+		if (fJspCompletionProcessor == null) {
+			fJspCompletionProcessor = new JSPELCompletionProcessor();
+		}
+		return fJspCompletionProcessor;
+	}
+
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition) {
+
+
+		// get results from JSP completion processor
+		fJspCompletionProcessor = getJspCompletionProcessor();
+		ICompletionProposal[] results = fJspCompletionProcessor.computeCompletionProposals(viewer, documentPosition);
+		fErrorMessage = fJspCompletionProcessor.getErrorMessage();
+		if (results.length == 0 && (fErrorMessage == null || fErrorMessage.length() == 0)) {
+			fErrorMessage = UNKNOWN_CONTEXT;
+		}
+
+		IStructuredDocumentRegion flat = ContentAssistUtils.getStructuredDocumentRegion(viewer, documentPosition);
+		
+		if (flat != null) {
+			ITextRegion cursorRegion = flat.getRegionAtCharacterOffset(documentPosition);
+			if (DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE == cursorRegion.getType()) {
+				ITextRegionContainer container = (ITextRegionContainer) cursorRegion;
+				cursorRegion = container.getRegionAtCharacterOffset(documentPosition);
+				if (cursorRegion.getType() == DOMJSPRegionContexts.JSP_EL_CONTENT) {
+					String elText = container.getText(cursorRegion).trim();
+					String prefix = getPrefix(documentPosition - container.getStartOffset(cursorRegion) - 1, elText);
+					if (null != prefix) {
+						List proposals = getFunctionProposals(prefix, (StructuredTextViewer) viewer, documentPosition);
+						results = new ICompletionProposal[proposals.size()];
+						proposals.toArray(results);
+					}
+				}
+			}
+		}
+
+
+		return results;
+	}
+
+	protected String getPrefix(int relativePosition, String elText) {
+		java.io.StringReader reader = new java.io.StringReader(elText);
+		JSPELParserTokenManager scanner = new JSPELParserTokenManager(new SimpleCharStream(reader, 1, 1));
+		Token curToken = null, lastIdentifier = null;
+		while (JSPELParserConstants.EOF != (curToken = scanner.getNextToken()).kind) {
+			if (JSPELParserConstants.COLON == curToken.kind && curToken.endColumn == relativePosition && null != lastIdentifier) {
+				return (lastIdentifier.image);
+			}
+
+			if (JSPELParserConstants.IDENTIFIER == curToken.kind) {
+				lastIdentifier = curToken;
+			}
+			else {
+				lastIdentifier = null;
+			}
+		}
+		return null;
+	}
+
+	protected ASTFunctionInvocation getInvocation(int relativePosition, String elText) {
+		FindFunctionInvocationVisitor visitor = new FindFunctionInvocationVisitor(relativePosition);
+		JSPELParser parser = JSPELParser.createParser(elText);
+		try {
+			ASTExpression expression = parser.Expression();
+			return (ASTFunctionInvocation) expression.jjtAccept(visitor, null);
+		}
+		catch (ParseException e) { /* parse exception = no completion */
+		}
+		return (null);
+	}
+
+
+	public char[] getCompletionProposalAutoActivationCharacters() {
+		return elCompletionProposalAutoActivationCharacters;
+	}
+
+	protected List getFunctionProposals(String prefix, StructuredTextViewer viewer, int offset) {
+		TLDCMDocumentManager docMgr = TaglibController.getTLDCMDocumentManager(viewer.getDocument());
+		ArrayList completionList = new ArrayList();
+		if (docMgr == null)
+			return null;
+
+		Iterator taglibs = docMgr.getCMDocumentTrackers(offset).iterator();
+		while (taglibs.hasNext()) {
+			TaglibTracker tracker = (TaglibTracker) taglibs.next();
+			if (tracker.getPrefix().equals(prefix)) {
+				CMDocumentImpl doc = (CMDocumentImpl) tracker.getDocument();
+
+				List functions = doc.getFunctions();
+				for (Iterator it = functions.iterator(); it.hasNext();) {
+					TLDFunction function = (TLDFunction) it.next();
+					CustomCompletionProposal proposal = new CustomCompletionProposal(function.getName() + "()", //$NON-NLS-1$
+								offset, 0, function.getName().length() + 1, null, function.getName() + " - " + function.getSignature(), null, null, 1); //$NON-NLS-1$
+
+					completionList.add(proposal);
+				}
+			}
+		}
+		return completionList;
+	}
+
+
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java
new file mode 100644
index 0000000..5c7a039
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.jdt.core.CompletionProposal;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.swt.graphics.Image;
+
+public class JSPELProposalCollector extends JSPProposalCollector {
+
+	public JSPELProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
+		super(cu, translation);
+	}
+
+	protected IJavaCompletionProposal createJavaCompletionProposal(CompletionProposal proposal) {
+		JSPCompletionProposal jspProposal = null;
+		
+		if(null == proposal || null == proposal.getName())
+			return(null);
+		
+		String rawName = new String(proposal.getName());
+		String completion = null;
+		
+		if(proposal.getKind() == CompletionProposal.METHOD_REF && proposal.findParameterNames(null).length == 0) {
+			if(rawName.length() > 3 && rawName.startsWith("get")) { //$NON-NLS-1$
+				completion = rawName.substring(3,4).toLowerCase() + rawName.substring(4, rawName.length());
+			} else {
+				return null;
+			}
+			
+			// java offset
+			int offset = proposal.getReplaceStart();
+			
+			// replacement length
+			//-3 for "get" pre text on the java proposal
+			int length = proposal.getReplaceEnd() - offset - 3;
+			
+			// translate offset from Java > JSP
+			offset = getTranslation().getJspOffset(offset);
+			
+			// cursor position after must be calculated
+			int positionAfter = offset + completion.length();
+				
+			// from java proposal
+			IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
+			Image image = null;
+			String longDisplayString = javaProposal.getDisplayString();
+			int fistSpaceIndex = longDisplayString.indexOf(' ');
+			String shortDisplayString = longDisplayString;
+			
+			if(fistSpaceIndex != -1) {
+				shortDisplayString = longDisplayString.substring(fistSpaceIndex);
+			}
+				
+			String displayString = completion + " " + shortDisplayString; //$NON-NLS-1$
+			IContextInformation contextInformation = javaProposal.getContextInformation();
+			String additionalInfo = javaProposal.getAdditionalProposalInfo();
+			int relevance = javaProposal.getRelevance();
+			
+			boolean updateLengthOnValidate = true;
+			
+			jspProposal = new JSPCompletionProposal(completion, offset, length, positionAfter, image, displayString, contextInformation, additionalInfo, relevance, updateLengthOnValidate);
+			
+			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
+			// set wrapped java proposal so additional info can be calculated on demand
+			jspProposal.setJavaCompletionProposal(javaProposal);
+			
+			return jspProposal;
+		} else {
+			return null;
+		}
+	}
+
+//	protected void acceptMethod(char[] declaringTypePackageName, char[] declaringTypeName, char[] name, char[][] parameterPackageNames, char[][] parameterTypeNames, char[][] parameterNames, char[] returnTypePackageName, char[] returnTypeName, char[] completionName, int modifiers, int start, int end, int relevance) {
+//		String rawName = String.valueOf(name);
+//		if(parameterNames.length == 0 && rawName.length() > 3 && rawName.startsWith("get"))
+//		{
+//			String mangledName = rawName.substring(3,4).toLowerCase() + rawName.substring(4, rawName.length());
+//			super.acceptField(declaringTypePackageName, declaringTypeName, mangledName.toCharArray(), returnTypePackageName, returnTypeName, mangledName.toCharArray(), modifiers, start, end, relevance);
+//		}
+//	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPImportCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPImportCompletionProposalComputer.java
new file mode 100644
index 0000000..c0bfb7f
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPImportCompletionProposalComputer.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+
+/**
+ * <p>Generates JSP import completion proposals</p>
+ */
+public class JSPImportCompletionProposalComputer extends
+		JSPJavaCompletionProposalComputer {
+
+	/**
+	 * @see org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		List proposals = computeJavaCompletionProposals(context.getViewer(), context.getInvocationOffset(), 0);
+		List importProposals = new ArrayList(proposals.size());
+		for (int i = 0; i < proposals.size(); i++) {
+			if (proposals.get(i) instanceof JSPCompletionProposal) {
+
+				ICompletionProposal importProposal = adjustImportProposal((JSPCompletionProposal) proposals.get(i));
+				importProposals.add(importProposal);
+			}
+		}
+		return importProposals;
+		
+	}
+
+	/**
+	 * <p>JSP import proposals need to be adjusted, this does that</p>
+	 * 
+	 * @param importProposal {@link JSPCompletionProposal} to adjust
+	 * @return adjusted {@link ICompletionProposal}
+	 */
+	private ICompletionProposal adjustImportProposal(JSPCompletionProposal importProposal) {
+		// just need to remove the ";"
+		// and adjust offsets for the change
+		String newReplace;
+		if (importProposal instanceof AutoImportProposal){
+			newReplace =((AutoImportProposal)importProposal).getImportDeclaration() .replaceAll(";", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+		else{
+			 newReplace = importProposal.getReplacementString().replaceAll(";", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+		importProposal.setReplacementString(newReplace);
+
+		String newDisplay = importProposal.getDisplayString().replaceAll(";", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		importProposal.setDisplayString(newDisplay);
+
+		int newReplacementLength = importProposal.getReplacementLength() - 1;
+		if (newReplacementLength >= 0) {
+			importProposal.setReplacementLength(newReplacementLength);
+		}
+
+		int newCursorPosition = importProposal.getCursorPosition() - 1;
+		importProposal.setCursorPosition(newCursorPosition);
+
+		return importProposal;
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaCompletionProposalComputer.java
new file mode 100644
index 0000000..27364a4
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaCompletionProposalComputer.java
@@ -0,0 +1,583 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.WorkingCopyOwner;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension3;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.ITextViewerExtension5;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistUtilities;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
+import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
+import org.osgi.framework.Bundle;
+
+/**
+ * <p>Generates Java proposals for JSP documents</p>
+ * 
+ * @base org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaContentAssistProcessor
+ */
+public class JSPJavaCompletionProposalComputer extends DefaultXMLCompletionProposalComputer {
+	private static final String JDT_CORE_PLUGIN_ID = "org.eclipse.jdt.core"; //$NON-NLS-1$
+
+	/** The translation adapter used to create the Java proposals */
+	private JSPTranslationAdapter fTranslationAdapter = null;
+	
+	/** translation adapter may be stale, check the model id */
+	private String fModelId = null;
+
+	/**
+	 * Create the computer
+	 */
+	public JSPJavaCompletionProposalComputer() {
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#sessionEnded()
+	 */
+	public void sessionEnded() {
+		fTranslationAdapter = null;
+	}
+
+	/**
+	 * <p>Return a list of proposed code completions based on the specified
+	 * location within the document that corresponds to the current cursor
+	 * position within the text-editor control.</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		List results = new ArrayList(0);
+		if(isValidContext(context)) {
+			ITextViewer viewer = context.getViewer();
+			int documentPosition = context.getInvocationOffset();
+			IndexedRegion treeNode = ContentAssistUtils.getNodeAt(viewer, documentPosition);
+			
+			// get results from JSP completion processor
+			results = computeJavaCompletionProposals(viewer, documentPosition, 0);
+
+			IDOMNode xNode = null;
+			IStructuredDocumentRegion flat = null;
+			if (treeNode instanceof IDOMNode) {
+				xNode = (IDOMNode) treeNode;
+				flat = xNode.getFirstStructuredDocumentRegion();
+				if (flat != null && flat.getType() == DOMJSPRegionContexts.JSP_CONTENT) {
+					flat = flat.getPrevious();
+				}
+			}
+
+			// this is in case it's a <%@, it will be a region container...
+			ITextRegion openRegion = null;
+			if (flat != null && flat instanceof ITextRegionContainer) {
+				ITextRegionList v = ((ITextRegionContainer) flat).getRegions();
+				if (v.size() > 0)
+					openRegion = v.get(0);
+			}
+
+			// ADD CDATA PROPOSAL IF IT'S AN XML-JSP TAG
+			if (flat != null && flat.getType() != DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN &&
+					flat.getType() != DOMJSPRegionContexts.JSP_DECLARATION_OPEN &&
+					flat.getType() != DOMJSPRegionContexts.JSP_EXPRESSION_OPEN &&
+					flat.getType() != DOMRegionContext.BLOCK_TEXT &&
+					(openRegion != null &&
+							openRegion.getType() != DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN) &&
+							!inAttributeRegion(flat, documentPosition)) {
+				
+				// determine if cursor is before or after selected range
+				int adjustedDocPosition = documentPosition;
+				int realCaretPosition = viewer.getTextWidget().getCaretOffset();
+				int selectionLength = viewer.getSelectedRange().y;
+				if (documentPosition > realCaretPosition) {
+					adjustedDocPosition -= selectionLength;
+				}
+
+				CustomCompletionProposal cdataProposal = createCDATAProposal(adjustedDocPosition, selectionLength);
+				results.add(cdataProposal);
+			}
+		}
+
+		return results;
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeContextInformation(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+	
+		ITextViewer viewer = context.getViewer();
+		int documentOffset = context.getInvocationOffset();
+		
+		List results = new ArrayList();
+		// need to compute context info here, if it's JSP, call java computer
+		IDocument doc = viewer.getDocument();
+		IDocumentPartitioner dp = null;
+		if (doc instanceof IDocumentExtension3) {
+			dp = ((IDocumentExtension3) doc).getDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
+		}
+		if (dp != null) {
+			//IDocumentPartitioner dp = viewer.getDocument().getDocumentPartitioner();
+			String type = dp.getPartition(documentOffset).getType();
+			if (type == IJSPPartitions.JSP_DEFAULT || type == IJSPPartitions.JSP_CONTENT_JAVA) {
+				// get context info from completion results...
+				List proposals = computeCompletionProposals(context,monitor);
+				for (int i = 0; i < proposals.size(); i++) {
+					IContextInformation ci = ((ICompletionProposal)proposals.get(i)).getContextInformation();
+					if (ci != null)
+						results.add(ci);
+				}
+			}
+		}
+		return results;
+	}
+	
+	/**
+	 * The same as the normal <code>computeCompeltaionProposals</code> except the calculated
+	 * java position is offset by the given extra offset.
+	 * 
+	 * @param viewer
+	 *            the viewer whose document is used to compute the proposals
+	 * @param documentPosition
+	 *            an offset within the document for which completions should
+	 *            be computed
+	 * @param javaPositionExtraOffset
+	 * 				the extra offset for the java position
+	 * @return an array of completion proposals or <code>null</code> if no
+	 *         proposals are possible
+	 */
+	protected List computeJavaCompletionProposals(ITextViewer viewer,
+			int pos, int javaPositionExtraOffset) {
+		
+		initializeJavaPlugins();
+
+		JSPProposalCollector collector = null;
+		
+		IDOMModel xmlModel = null;
+		try {
+			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
+
+			IDOMDocument xmlDoc = xmlModel.getDocument();
+			if (fTranslationAdapter == null || xmlModel.getId() != fModelId) {
+				fTranslationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
+				fModelId = xmlModel.getId();
+			}
+			if (fTranslationAdapter != null) {
+
+				JSPTranslation translation = fTranslationAdapter.getJSPTranslation();
+				int javaPosition = translation.getJavaOffset(pos) + javaPositionExtraOffset;
+
+				try {
+
+					ICompilationUnit cu = translation.getCompilationUnit();
+
+					// can't get java proposals w/out a compilation unit
+					// or without a valid position
+					if (cu == null || -1 == javaPosition)
+						return new ArrayList(0);
+					
+					collector = getProposalCollector(cu, translation);
+					synchronized (cu) {
+						cu.codeComplete(javaPosition, collector, (WorkingCopyOwner) null);
+					}
+				}
+				catch (CoreException coreEx) {
+					// a possible Java Model Exception due to not being a Web
+					// (Java) Project
+					coreEx.printStackTrace();
+				}
+			}
+		}
+		catch (Exception exc) {
+			exc.printStackTrace();
+			// throw out exceptions on code assist.
+		}
+		finally {
+			if (xmlModel != null) {
+				xmlModel.releaseFromRead();
+			}
+		}
+		ICompletionProposal[] results = new ICompletionProposal[0];
+		if(collector != null) {
+			results = collector.getJSPCompletionProposals();
+			if (results == null || results.length < 1)
+				this.setErrorMessage(JSPUIMessages.Java_Content_Assist_is_not_UI_);
+		}
+		
+		return Arrays.asList(results);
+	}
+	
+	protected JSPProposalCollector getProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
+		return new JSPProposalCollector(cu, translation);
+	}
+	
+	private CustomCompletionProposal createCDATAProposal(int adjustedDocPosition, int selectionLength) {
+		return new CustomCompletionProposal("<![CDATA[]]>", //$NON-NLS-1$
+					adjustedDocPosition, selectionLength, // should be the selection length
+					9, SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_CDATASECTION), 
+					"CDATA Section", //$NON-NLS-1$
+					null, null, XMLRelevanceConstants.R_CDATA);
+	}
+
+	private boolean inAttributeRegion(IStructuredDocumentRegion flat, int documentPosition) {
+		ITextRegion attrContainer = flat.getRegionAtCharacterOffset(documentPosition);
+		if (attrContainer != null && attrContainer instanceof ITextRegionContainer) {
+			if (attrContainer.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	/**
+	 * Initialize the Java Plugins that the JSP processor requires.
+	 * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=143765
+	 * We should not call "start", because that will cause that 
+	 * state to be remembered, and re-started automatically during 
+	 * the next boot up sequence. 
+	 * 
+	 * ISSUE: we may be able to get rid of this all together, in future, 
+	 * since 99% we probably have already used some JDT class by the time 
+	 * we need JDT to be active ... but ... this is the safest fix for 
+	 * this point in 1.5 stream. Next release, let's just remove this, 
+	 * re-discover what ever bug this was fixing (if any) and if there is 
+	 * one, then we'll either put back in, as is, or come up with a 
+	 * more appropriate fix. 
+	 * 
+	 */
+	private void initializeJavaPlugins() {
+		try {
+			Bundle bundle = Platform.getBundle(JDT_CORE_PLUGIN_ID);
+			bundle.loadClass("dummyClassNameThatShouldNeverExist"); //$NON-NLS-1$
+		}
+		catch (ClassNotFoundException e) {
+			// this is the expected result, we just want to 
+			// nudge the bundle to be sure its activated. 
+		}
+	}
+	
+	/**
+	 * @param viewer
+	 * @param documentPosition
+	 * @return String
+	 */
+	private String getPartitionType(ITextViewer viewer, int documentPosition) {
+		String partitionType = null;
+		try {
+			if (viewer instanceof ITextViewerExtension5)
+				partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, ((ITextViewerExtension5) viewer).modelOffset2WidgetOffset(documentPosition), false);
+			else
+				partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, documentPosition, false);
+		}
+		catch (BadLocationException e) {
+			partitionType = IDocument.DEFAULT_CONTENT_TYPE;
+		}
+		return partitionType;
+	}
+	
+	/**
+	 * <p>Determines if the context is a valid one for JSP Java proposals.
+	 * The default result is <code>true</code></p>
+	 * 
+	 * @param context check this context to see if it is valid for JSP
+	 * Java proposals
+	 * @return <code>true</code> if the given context is a valid one for
+	 * JSP Java proposals, <code>false</code> otherwise.  <code>true</code>
+	 * is the default response if a specific case for <code>false</code> is
+	 * not found.
+	 */
+	private boolean isValidContext(CompletionProposalInvocationContext context) {
+		ITextViewer viewer = context.getViewer();
+		int documentPosition = context.getInvocationOffset();
+		
+		String partitionType = getPartitionType(viewer, documentPosition);
+		IStructuredDocument structuredDocument = (IStructuredDocument) viewer.getDocument();
+		IStructuredDocumentRegion fn = structuredDocument.getRegionAtCharacterOffset(documentPosition);
+		IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion(viewer, documentPosition);
+		// ////////////////////////////////////////////////////////////////////////////
+		// ANOTHER WORKAROUND UNTIL PARTITIONING TAKES CARE OF THIS
+		// check for xml-jsp tags...
+		if (partitionType == IJSPPartitions.JSP_DIRECTIVE && fn != null) {
+			IStructuredDocumentRegion possibleXMLJSP = ((fn.getType() == DOMRegionContext.XML_CONTENT) && fn.getPrevious() != null) ? fn.getPrevious() : fn;
+			ITextRegionList regions = possibleXMLJSP.getRegions();
+			if (regions.size() > 1) {
+				// check bounds cases
+				ITextRegion xmlOpenOrClose = regions.get(0);
+				if (xmlOpenOrClose.getType() != DOMRegionContext.XML_TAG_OPEN &&
+						documentPosition != possibleXMLJSP.getStartOffset() &&
+						xmlOpenOrClose.getType() != DOMRegionContext.XML_END_TAG_OPEN &&
+						documentPosition <= possibleXMLJSP.getStartOffset()) {
+					
+					// possible xml-jsp
+					ITextRegion nameRegion = regions.get(1);
+					String name = possibleXMLJSP.getText(nameRegion);
+					if (name.equals("jsp:scriptlet") || name.equals("jsp:expression") || name.equals("jsp:declaration")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+						return true;
+					}
+				}
+			}
+		}
+
+		// ////////////////////////////////////////////////////////////////////////////
+		// ** THIS IS A TEMP FIX UNTIL PARTITIONING TAKES CARE OF THIS...
+		// check for XML-JSP in a <script> region
+		if (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitions.SCRIPT) {
+			// fn should be block text
+			IStructuredDocumentRegion decodedSDRegion = decodeScriptBlock(fn.getFullText());
+			// System.out.println("decoded > " +
+			// blockOfText.substring(decodedSDRegion.getStartOffset(),
+			// decodedSDRegion.getEndOffset()));
+			if (decodedSDRegion != null) {
+				IStructuredDocumentRegion sdr = decodedSDRegion;
+				while (sdr != null) {
+					// System.out.println("sdr " + sdr.getType());
+					// System.out.println("sdr > " +
+					// blockOfText.substring(sdr.getStartOffset(),
+					// sdr.getEndOffset()));
+					if (sdr.getType() == DOMJSPRegionContexts.JSP_CONTENT) {
+						if (documentPosition >= fn.getStartOffset() + sdr.getStartOffset() && documentPosition <= fn.getStartOffset() + sdr.getEndOffset()) {
+							return true;
+						}
+					}
+					else if (sdr.getType() == DOMRegionContext.XML_TAG_NAME) {
+						if (documentPosition > fn.getStartOffset() + sdr.getStartOffset() && documentPosition < fn.getStartOffset() + sdr.getEndOffset()) {
+							return false;
+						}
+						else if (documentPosition == fn.getStartOffset() + sdr.getEndOffset() && sdr.getNext() != null && sdr.getNext().getType() == DOMJSPRegionContexts.JSP_CONTENT) {
+							// the end of an open tag <script>
+							// <jsp:scriptlet>| blah </jsp:scriptlet>
+							return true;
+						}
+						else if (documentPosition == fn.getStartOffset() + sdr.getStartOffset() && sdr.getPrevious() != null && sdr.getPrevious().getType() == DOMRegionContext.XML_TAG_NAME) {
+							return true;
+						}
+					}
+					sdr = sdr.getNext();
+				}
+			}
+		}
+		// /////////////////////////////////////////////////////////////////////////
+		// check special JSP delimiter cases
+		if (fn != null && partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER) {
+			IStructuredDocumentRegion fnDelim = fn;
+
+			// if it's a nested JSP region, need to get the correct
+			// StructuredDocumentRegion
+			// not sure why this check was there...
+			// if (fnDelim.getType() == XMLRegionContext.BLOCK_TEXT) {
+			Iterator blockRegions = fnDelim.getRegions().iterator();
+			ITextRegion temp = null;
+			ITextRegionContainer trc;
+			while (blockRegions.hasNext()) {
+				temp = (ITextRegion) blockRegions.next();
+				// we hit a nested
+				if (temp instanceof ITextRegionContainer) {
+					trc = (ITextRegionContainer) temp;
+					// it's in this region
+					if (documentPosition >= trc.getStartOffset() && documentPosition < trc.getEndOffset()) {
+						Iterator nestedJSPRegions = trc.getRegions().iterator();
+						while (nestedJSPRegions.hasNext()) {
+							temp = (ITextRegion) nestedJSPRegions.next();
+							if (XMLContentAssistUtilities.isJSPOpenDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
+								// HTML content assist
+								// we actually want content assist for the
+								// previous type of region,
+								// well get those proposals from the embedded
+								// adapter
+								if (documentPosition > 0) {
+									partitionType = getPartitionType(viewer, documentPosition - 1);
+									break;
+								}
+							}
+							else if (XMLContentAssistUtilities.isJSPCloseDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
+								// JSP content assist
+								return true;
+							}
+						}
+					}
+				}
+				// }
+			}
+
+			// take care of XML-JSP delimter cases
+			if (XMLContentAssistUtilities.isXMLJSPDelimiter(fnDelim)) {
+				// since it's a delimiter, we know it's a ITextRegionContainer
+				ITextRegion firstRegion = fnDelim.getRegions().get(0);
+				if (fnDelim.getStartOffset() == documentPosition && (firstRegion.getType() == DOMRegionContext.XML_TAG_OPEN)) {
+					// |<jsp:scriptlet> </jsp:scriptlet>
+					// (pa) commented out so that we get regular behavior JSP
+					// macros etc...
+					// return getHTMLCompletionProposals(viewer,
+					// documentPosition);
+				}
+				else if (fnDelim.getStartOffset() == documentPosition && (firstRegion.getType() == DOMRegionContext.XML_END_TAG_OPEN)) {
+					// <jsp:scriptlet> |</jsp:scriptlet>
+					// check previous partition type to see if it's JAVASCRIPT
+					// if it is, we're just gonna let the embedded JAVASCRIPT
+					// adapter get the proposals
+					if (documentPosition > 0) {
+						String checkType = getPartitionType(viewer, documentPosition - 1);
+						if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) { // this
+							// check is failing for XML-JSP (region is not javascript...)
+							return true;
+						}
+						partitionType = IJSPPartitions.JSP_CONTENT_JAVASCRIPT;
+					}
+				}
+				else if ((firstRegion.getType() == DOMRegionContext.XML_TAG_OPEN) && documentPosition >= fnDelim.getEndOffset()) {
+					// anything else inbetween
+					return true;
+				}
+			}
+			else if (XMLContentAssistUtilities.isJSPDelimiter(fnDelim)) {
+				// the delimiter <%, <%=, <%!, ...
+				if (XMLContentAssistUtilities.isJSPCloseDelimiter(fnDelim)) {
+					if (documentPosition == fnDelim.getStartOffset()) {
+						// check previous partition type to see if it's
+						// JAVASCRIPT
+						// if it is, we're just gonna let the embedded
+						// JAVASCRIPT adapter get the proposals
+						if (documentPosition > 0) {
+							String checkType = getPartitionType(viewer, documentPosition - 1);
+							if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) {
+								return true;
+							}
+							partitionType = IJSPPartitions.JSP_CONTENT_JAVASCRIPT;
+						}
+					}
+				}
+				else if (XMLContentAssistUtilities.isJSPOpenDelimiter(fnDelim)) {
+					// if it's the first position of open delimiter
+					// use embedded HTML results
+					if (documentPosition == fnDelim.getEndOffset()) {
+						// it's at the EOF <%|
+						return true;
+					}
+				}
+			}
+		}
+
+		// need to check if it's JSP region inside of CDATA w/ no region
+		// <![CDATA[ <%|%> ]]>
+		// or a comment region
+		// <!-- <% |%> -->
+		if (fn != null && (fn.getType() == DOMRegionContext.XML_CDATA_TEXT || fn.getType() == DOMRegionContext.XML_COMMENT_TEXT)) {
+			if (fn instanceof ITextRegionContainer) {
+				Object[] cdataRegions = fn.getRegions().toArray();
+				ITextRegion r = null;
+				ITextRegion jspRegion = null;
+				for (int i = 0; i < cdataRegions.length; i++) {
+					r = (ITextRegion) cdataRegions[i];
+					if (r instanceof ITextRegionContainer) {
+						// CDATA embedded container, or comment container
+						Object[] jspRegions = ((ITextRegionContainer) r).getRegions().toArray();
+						for (int j = 0; j < jspRegions.length; j++) {
+							jspRegion = (ITextRegion) jspRegions[j];
+							if (jspRegion.getType() == DOMJSPRegionContexts.JSP_CLOSE) {
+								if (sdRegion.getStartOffset(jspRegion) == documentPosition) {
+									return true;
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+
+		// check if it's in an attribute value, if so, don't add CDATA
+		// proposal
+		ITextRegion attrContainer = (fn != null) ? fn.getRegionAtCharacterOffset(documentPosition) : null;
+		if (attrContainer != null && attrContainer instanceof ITextRegionContainer) {
+			if (attrContainer.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+				// test location of the cursor
+				// return null if it's in the middle of an open/close delimiter
+				Iterator attrRegions = ((ITextRegionContainer) attrContainer).getRegions().iterator();
+				ITextRegion testRegion = null;
+				while (attrRegions.hasNext()) {
+					testRegion = (ITextRegion) attrRegions.next();
+					// need to check for other valid attribute regions
+					if (XMLContentAssistUtilities.isJSPOpenDelimiter(testRegion.getType())) {
+						if (!(((ITextRegionContainer) attrContainer).getEndOffset(testRegion) <= documentPosition))
+							return false;
+					}
+					else if (XMLContentAssistUtilities.isJSPCloseDelimiter(testRegion.getType())) {
+						if (!(((ITextRegionContainer) attrContainer).getStartOffset(testRegion) >= documentPosition))
+							return false;
+					}
+				}
+				// TODO: handle non-Java code such as nested tags
+				if (testRegion.getType().equals(DOMJSPRegionContexts.JSP_CONTENT)) {
+					return true;
+				}
+				return false;
+			}
+		}
+		
+		return true;
+	}
+	
+	/**
+	 * ** TEMP WORKAROUND FOR CMVC 241882 Takes a String and blocks out
+	 * jsp:scriptlet, jsp:expression, and jsp:declaration @param blockText
+	 * @return
+	 */
+	private IStructuredDocumentRegion decodeScriptBlock(String blockText) {
+		XMLSourceParser parser = new XMLSourceParser();
+		// use JSP_CONTENT for region type
+		parser.addBlockMarker(new BlockMarker("jsp:scriptlet", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
+		parser.addBlockMarker(new BlockMarker("jsp:expression", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
+		parser.addBlockMarker(new BlockMarker("jsp:declaration", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
+		parser.reset(blockText);
+		return parser.getDocumentRegions();
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
new file mode 100644
index 0000000..91ff803
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
@@ -0,0 +1,306 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.ui.PreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension3;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.ui.internal.IReleasable;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
+import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
+
+/**
+ * @plannedfor 1.0
+ * @deprecated This class is no longer used locally and will be removed in the future
+ */
+public class JSPJavaContentAssistProcessor implements IContentAssistProcessor, IReleasable {
+	/**
+	 * Preference listener to keep track of changes to content assist
+	 * preferences
+	 */
+	private class PreferenceListener implements IPropertyChangeListener {
+		public void propertyChange(PropertyChangeEvent event) {
+			String property = event.getProperty();
+			IPreferenceStore store = getJavaPreferenceStore();
+
+			if (PreferenceConstants.CODEASSIST_AUTOACTIVATION.equals(property)) {
+				fAutoActivate = store.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION);
+			}
+			else if (PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA.equals(property)) {
+				String autoCharacters = store.getString(PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA);
+				completionProposalAutoActivationCharacters = (autoCharacters != null) ? autoCharacters.toCharArray() : new char[0];
+			}
+		}
+	}
+
+	private boolean fAutoActivate = true;
+	protected char completionProposalAutoActivationCharacters[] = new char[]{'.'};
+	protected char contextInformationAutoActivationCharacters[] = null;
+	protected static final String UNKNOWN_CONTEXT = JSPUIMessages.Content_Assist_not_availab_UI_;
+	protected String fErrorMessage = null;
+	protected JSPCompletionProcessor fJspCompletionProcessor = null;
+	private IPropertyChangeListener fJavaPreferenceListener;
+
+	public JSPJavaContentAssistProcessor() {
+		super();
+	}
+
+	/**
+	 * Return a list of proposed code completions based on the specified
+	 * location within the document that corresponds to the current cursor
+	 * position within the text-editor control.
+	 * 
+	 * @param documentPosition
+	 *            a location within the document
+	 * @return an array of code-assist items
+	 */
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition) {
+
+		IndexedRegion treeNode = ContentAssistUtils.getNodeAt(viewer, documentPosition);
+
+		// get results from JSP completion processor
+		fJspCompletionProcessor = getJspCompletionProcessor();
+		ICompletionProposal[] results = fJspCompletionProcessor.computeCompletionProposals(viewer, documentPosition);
+		fErrorMessage = fJspCompletionProcessor.getErrorMessage();
+		if (results.length == 0 && (fErrorMessage == null || fErrorMessage.length() == 0)) {
+			fErrorMessage = UNKNOWN_CONTEXT;
+		}
+
+		IDOMNode xNode = null;
+		IStructuredDocumentRegion flat = null;
+		if (treeNode instanceof IDOMNode) {
+			xNode = (IDOMNode) treeNode;
+			flat = xNode.getFirstStructuredDocumentRegion();
+			if (flat != null && flat.getType() == DOMJSPRegionContexts.JSP_CONTENT) {
+				flat = flat.getPrevious();
+			}
+		}
+
+		// this is in case it's a <%@, it will be a region container...
+		ITextRegion openRegion = null;
+		if (flat != null && flat instanceof ITextRegionContainer) {
+			ITextRegionList v = ((ITextRegionContainer) flat).getRegions();
+			if (v.size() > 0)
+				openRegion = v.get(0);
+		}
+
+		// ADD CDATA PROPOSAL IF IT'S AN XML-JSP TAG
+		if (flat != null && flat.getType() != DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN && flat.getType() != DOMJSPRegionContexts.JSP_DECLARATION_OPEN && flat.getType() != DOMJSPRegionContexts.JSP_EXPRESSION_OPEN && flat.getType() != DOMRegionContext.BLOCK_TEXT && (openRegion != null && openRegion.getType() != DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN) && !inAttributeRegion(flat, documentPosition)) {
+
+			// determine if cursor is before or after selected range
+			int adjustedDocPosition = documentPosition;
+			int realCaretPosition = viewer.getTextWidget().getCaretOffset();
+			int selectionLength = viewer.getSelectedRange().y;
+			if (documentPosition > realCaretPosition) {
+				adjustedDocPosition -= selectionLength;
+			}
+
+			CustomCompletionProposal cdataProposal = createCDATAProposal(adjustedDocPosition, selectionLength);
+			ICompletionProposal[] newResults = new ICompletionProposal[results.length + 1];
+			System.arraycopy(results, 0, newResults, 0, results.length);
+			newResults[results.length] = cdataProposal;
+			results = newResults;
+		}
+
+		// (pa) ** this is code in progress...
+		// add ending %> proposal for non closed JSP tags
+		// String tagText = flat.getText();
+		// // TODO need a much better compare (using constants?)
+		//		if(tagText.equals("<%") || tagText.equals("<%=") || tagText.equals("<%!"));
+		// {
+		//			ICompletionProposal testah = ContentAssistUtils.computeJSPEndTagProposal(viewer,documentPosition, treeNode, "<%" , SharedXMLEditorPluginImageHelper.IMG_OBJ_TAG_GENERIC);
+		// if(testah != null)
+		// {
+		//				ICompletionProposal[] newResults = new ICompletionProposal[results.length + 1];
+		// System.arraycopy( results, 0, newResults, 0, results.length);
+		// newResults[results.length] = testah;
+		// results = newResults;
+		// }
+		// }
+
+		return results;
+	}
+
+	private CustomCompletionProposal createCDATAProposal(int adjustedDocPosition, int selectionLength) {
+		return new CustomCompletionProposal("<![CDATA[]]>", //$NON-NLS-1$
+					adjustedDocPosition, selectionLength, // should be the selection length
+					9, SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_CDATASECTION), 
+					"CDATA Section", //$NON-NLS-1$
+					null, null, XMLRelevanceConstants.R_CDATA);
+	}
+
+	private boolean inAttributeRegion(IStructuredDocumentRegion flat, int documentPosition) {
+		ITextRegion attrContainer = flat.getRegionAtCharacterOffset(documentPosition);
+		if (attrContainer != null && attrContainer instanceof ITextRegionContainer) {
+			if (attrContainer.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Returns the characters which when entered by the user should
+	 * automatically trigger the presentation of possible completions.
+	 * 
+	 * @return the auto activation characters for completion proposal or
+	 *         <code>null</code> if no auto activation is desired
+	 */
+	public char[] getCompletionProposalAutoActivationCharacters() {
+		// if no listener has been created, preferenes have not been
+		// initialized
+		if (fJavaPreferenceListener == null)
+			initializePreferences();
+
+		if (fAutoActivate)
+			return completionProposalAutoActivationCharacters;
+		else
+			return null;
+	}
+
+	/**
+	 * Returns the characters which when entered by the user should
+	 * automatically trigger the presentation of context information.
+	 * 
+	 * @return the auto activation characters for presenting context
+	 *         information or <code>null</code> if no auto activation is
+	 *         desired
+	 */
+	public char[] getContextInformationAutoActivationCharacters() {
+		return contextInformationAutoActivationCharacters;
+	}
+
+	/**
+	 * Return the reason why computeProposals was not able to find any
+	 * completions.
+	 * 
+	 * @return an error message or null if no error occurred
+	 */
+	public String getErrorMessage() {
+		return fErrorMessage;
+	}
+
+	/**
+	 * @see ContentAssistAdapter#release()
+	 */
+	public void release() {
+		// remove listener on java preferences if we added one
+		if (fJavaPreferenceListener != null) {
+			getJavaPreferenceStore().removePropertyChangeListener(fJavaPreferenceListener);
+		}
+
+		if (fJspCompletionProcessor != null) {
+			fJspCompletionProcessor.release();
+			fJspCompletionProcessor = null;
+		}
+	}
+
+	/**
+	 * 
+	 */
+	protected JSPCompletionProcessor getJspCompletionProcessor() {
+		if (fJspCompletionProcessor == null) {
+			fJspCompletionProcessor = new JSPCompletionProcessor();
+		}
+		return fJspCompletionProcessor;
+	}
+
+	/**
+	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer,
+	 *      int)
+	 */
+	public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
+		List results = new ArrayList();
+		// need to compute context info here, if it's JSP, call java computer
+		IDocument doc = viewer.getDocument();
+		IDocumentPartitioner dp = null;
+		if (doc instanceof IDocumentExtension3) {
+			dp = ((IDocumentExtension3) doc).getDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
+		}
+		if (dp != null) {
+			//IDocumentPartitioner dp = viewer.getDocument().getDocumentPartitioner();
+			String type = dp.getPartition(documentOffset).getType();
+			if (type == IJSPPartitions.JSP_DEFAULT || type == IJSPPartitions.JSP_CONTENT_JAVA) {
+				// get context info from completion results...
+				ICompletionProposal[] proposals = computeCompletionProposals(viewer, documentOffset);
+				for (int i = 0; i < proposals.length; i++) {
+					IContextInformation ci = proposals[i].getContextInformation();
+					if (ci != null)
+						results.add(ci);
+				}
+			}
+		}
+		return (IContextInformation[]) results.toArray(new IContextInformation[results.size()]);
+	}
+
+	/**
+	 * Returns a validator used to determine when displayed context
+	 * information should be dismissed. May only return <code>null</code> if
+	 * the processor is incapable of computing context information.
+	 * 
+	 * @return a context information validator, or <code>null</code> if the
+	 *         processor is incapable of computing context information
+	 */
+	public IContextInformationValidator getContextInformationValidator() {
+		return new JavaParameterListValidator();
+	}
+
+	/**
+	 * Gets the java preference store. If this is the first time getting it,
+	 * add a preference listener to it.
+	 * 
+	 * @return IPreferenceStore
+	 */
+	private IPreferenceStore getJavaPreferenceStore() {
+		IPreferenceStore store = PreferenceConstants.getPreferenceStore();
+		if (fJavaPreferenceListener == null) {
+			fJavaPreferenceListener = new PreferenceListener();
+			store.addPropertyChangeListener(fJavaPreferenceListener);
+		}
+		return store;
+	}
+
+	/**
+	 * Initialize preference for content assist
+	 */
+	private void initializePreferences() {
+		IPreferenceStore store = getJavaPreferenceStore();
+
+		fAutoActivate = store.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION);
+		String autoCharacters = store.getString(PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA);
+		completionProposalAutoActivationCharacters = (autoCharacters != null) ? autoCharacters.toCharArray() : new char[0];
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyCompletionProposalComputer.java
new file mode 100644
index 0000000..1018f8e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyCompletionProposalComputer.java
@@ -0,0 +1,249 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
+import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * <p>This class computes attribute value completion proposals
+ * for <code>&lt;jsp:[gs]etProperty&gt;</code> tags.</p>
+ */
+public class JSPPropertyCompletionProposalComputer extends
+		DefaultXMLCompletionProposalComputer {
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
+
+		//only add attribute value proposals for specific elements
+		if(node.getNodeName().equals(JSP11Namespace.ElementName.SETPROPERTY) ||
+				node.getNodeName().equals(JSP11Namespace.ElementName.GETPROPERTY)) {
+		
+			// Find the attribute name for which this position should have a value
+			IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
+			ITextRegionList openRegions = open.getRegions();
+			int i = openRegions.indexOf(contentAssistRequest.getRegion());
+			if (i < 0)
+				return;
+	
+			// get the attribute in question (first attr name to the left of the cursor)
+			ITextRegion attrNameRegion = null;
+			String attributeName = null;
+			while (i >= 0) {
+				attrNameRegion = openRegions.get(i--);
+				if (attrNameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
+					break;
+			}
+			if (attrNameRegion != null)
+				attributeName = open.getText(attrNameRegion);
+	
+			// determine get or set
+			ITextRegion tagNameRegion = null;
+			boolean isGetProperty = true;
+			for (int j = 0; j < openRegions.size(); j++) {
+				tagNameRegion = openRegions.get(j);
+				if (tagNameRegion.getType() == DOMRegionContext.XML_TAG_NAME &&
+						open.getText(tagNameRegion).trim().equals("jsp:setProperty")) { //$NON-NLS-1$
+					isGetProperty = false;
+					break;
+				}
+			}
+	
+			String currentValue = null;
+			if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
+				currentValue = contentAssistRequest.getText();
+			else
+				currentValue = ""; //$NON-NLS-1$
+			String matchString = null;
+			// fixups since the matchString computations don't care if there are quotes around the value
+			if (currentValue.length() > StringUtils.strip(currentValue).length() &&
+					(currentValue.startsWith("\"") || currentValue.startsWith("'")) && //$NON-NLS-1$ //$NON-NLS-2$
+					contentAssistRequest.getMatchString().length() > 0) {
+				matchString = currentValue.substring(1, contentAssistRequest.getMatchString().length());
+			} else {
+				matchString = currentValue.substring(0, contentAssistRequest.getMatchString().length());
+			}
+			// for now we ignore complicated values such as jsp embedded in an attribute
+			boolean existingComplicatedValue =
+				contentAssistRequest.getRegion() != null &&
+				contentAssistRequest.getRegion() instanceof ITextRegionContainer;
+			if (existingComplicatedValue) {
+				contentAssistRequest.getProposals().clear();
+				contentAssistRequest.getMacros().clear();
+			}
+			else {
+				if (attributeName.equals(JSP11Namespace.ATTR_NAME_NAME)) {
+					addBeanNameProposals(contentAssistRequest, node, matchString);
+				}
+				else if (attributeName.equals(JSP11Namespace.ATTR_NAME_PROPERTY)) {
+					addBeanPropertyProposals(contentAssistRequest, node, isGetProperty, matchString);
+				}
+			}
+		}
+	}
+	
+	/**
+	 * <p>Add bean property proposals to the given {@link ContentAssistRequest}</p>
+	 * 
+	 * @param contentAssistRequest
+	 * @param node
+	 * @param isGetProperty
+	 * @param matchString
+	 */
+	private void addBeanPropertyProposals(ContentAssistRequest contentAssistRequest,
+			IDOMNode node, boolean isGetProperty, String matchString) {
+		
+		if (((Element) node).hasAttribute(JSP11Namespace.ATTR_NAME_NAME)) {
+			// assumes that the node is the [gs]etProperty tag
+			String useBeanName = ((Element) node).getAttribute(JSP11Namespace.ATTR_NAME_NAME);
+			// properties can only be provided if a class/type/beanName has been declared
+			if (useBeanName.length() > 0) {
+				NodeList useBeans = node.getOwnerDocument().getElementsByTagName(JSP11Namespace.ElementName.USEBEAN);
+				if (useBeans != null) {
+					String typeName = null;
+					for (int j = 0; j < useBeans.getLength(); j++) {
+						if (useBeans.item(j).getNodeType() != Node.ELEMENT_NODE)
+							continue;
+						Element useBean = (Element) useBeans.item(j);
+						if (useBean instanceof IndexedRegion && ((IndexedRegion) useBean).getStartOffset() < node.getStartOffset()) {
+							if (useBeanName.equals(useBean.getAttribute(JSP11Namespace.ATTR_NAME_ID))) {
+								typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_CLASS);
+								if (!useBean.hasAttribute(JSP11Namespace.ATTR_NAME_CLASS) || typeName.length() < 1) {
+									typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_TYPE);
+								}
+								if (!useBean.hasAttribute(JSP11Namespace.ATTR_NAME_TYPE) || typeName.length() < 1) {
+									typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_BEAN_NAME);
+								}
+							}
+						}
+					}
+					if (typeName != null && typeName.length() > 0) {
+						// find the class/type/beanName definition and obtain the list of properties
+						IBeanInfoProvider provider = new BeanInfoProvider();
+						IResource resource = JSPContentAssistHelper.getResource(contentAssistRequest);
+						IJavaPropertyDescriptor[] descriptors = provider.getRuntimeProperties(resource, typeName);
+						CustomCompletionProposal proposal = null;
+						String displayString = ""; //$NON-NLS-1$
+						for (int j = 0; j < descriptors.length; j++) {
+							IJavaPropertyDescriptor pd = descriptors[j];
+							// check whether it's get or set kinda property
+							if (pd.getReadable() && isGetProperty || pd.getWriteable() && !isGetProperty) {
+								// filter attr value name
+								if (matchString.length() == 0 || pd.getName().toLowerCase().startsWith(matchString.toLowerCase())) {
+									displayString = pd.getDisplayName();
+									if (pd.getDeclaredType() != null && pd.getDeclaredType().length() > 0)
+										displayString += " - " + pd.getDeclaredType(); //$NON-NLS-1$
+									proposal = new CustomCompletionProposal("\"" + pd.getName() + "\"", //$NON-NLS-1$ //$NON-NLS-2$
+												contentAssistRequest.getReplacementBeginPosition(),
+												contentAssistRequest.getReplacementLength(),
+												pd.getName().length() + 2,
+												SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE),
+												displayString, null, pd.getDeclaredType(), XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+									contentAssistRequest.addProposal(proposal);
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+
+	/**
+	 * <p>Add bean name propoasals to the given {@link ContentAssistRequest}</p>
+	 * 
+	 * @param contentAssistRequest
+	 * @param node
+	 * @param matchString
+	 */
+	private void addBeanNameProposals(ContentAssistRequest contentAssistRequest, IDOMNode node, String matchString) {
+		// will not catch useBeans specified using other than actual DOM Nodes
+		NodeList useBeans = node.getOwnerDocument().getElementsByTagName(JSP11Namespace.ElementName.USEBEAN);
+		if (useBeans != null) {
+			String id = ""; //$NON-NLS-1$
+			String displayString = null;
+			String classOrType = null;
+			String imageName = JSPEditorPluginImages.IMG_OBJ_CLASS_OBJ;
+			for (int j = 0; j < useBeans.getLength(); j++) {
+				if (useBeans.item(j).getNodeType() != Node.ELEMENT_NODE) {
+					continue;
+				}
+				Element useBean = (Element) useBeans.item(j);
+				if (useBean instanceof IndexedRegion &&
+						((IndexedRegion) useBean).getStartOffset() < node.getStartOffset() &&
+						useBean.hasAttribute(JSP11Namespace.ATTR_NAME_ID)) {
+					
+					id = useBean.hasAttribute(JSP11Namespace.ATTR_NAME_ID) ?
+							StringUtils.strip(useBean.getAttribute(JSP11Namespace.ATTR_NAME_ID)) : null;
+					displayString = null;
+					classOrType = null;
+					imageName = JSPEditorPluginImages.IMG_OBJ_CLASS_OBJ;
+					// set the Image based on whether the class, type, or beanName attribute is present
+					if (useBean.hasAttribute(JSP11Namespace.ATTR_NAME_CLASS))
+						classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_CLASS);
+					if ((classOrType == null || classOrType.length() < 1) && useBean.hasAttribute(JSP11Namespace.ATTR_NAME_TYPE)) {
+						classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_TYPE);
+						imageName = JSPEditorPluginImages.IMG_OBJ_PUBLIC;
+					}
+					if ((classOrType == null || classOrType.length() < 1) && useBean.hasAttribute(JSP11Namespace.ATTR_NAME_BEAN_NAME)) {
+						classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_BEAN_NAME);
+						imageName = JSPEditorPluginImages.IMG_OBJ_PUBLIC;
+					}
+					if (classOrType != null && classOrType.length() > 0) {
+						displayString = id + " - " + classOrType; //$NON-NLS-1$
+					} else {
+						displayString = id;
+					}
+
+					// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=2341
+					if(id != null) {
+					    // filter
+						if (matchString.length() == 0 || id.startsWith(matchString)) {
+							CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + id + "\"", //$NON-NLS-1$ //$NON-NLS-2$
+										contentAssistRequest.getReplacementBeginPosition(), 
+                                        contentAssistRequest.getReplacementLength(), 
+                                        id.length() + 2, 
+                                        JSPEditorPluginImageHelper.getInstance().getImage(imageName), 
+                                        displayString, null, null, 
+                                        XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+							contentAssistRequest.addProposal(proposal);
+						}
+					}
+				}
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java
new file mode 100644
index 0000000..c8b5dcc
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+
+/**
+ * This class computes attribute value completion proposals for &lt;jsp:[gs]etProperty&gt; tags.
+ * 
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see JSPPropertyCompletionProposalComputer
+ */
+public class JSPPropertyContentAssistProcessor extends JSPDummyContentAssistProcessor {
+	private JSPPropertyCompletionProposalComputer fComputer;
+	
+	public JSPPropertyContentAssistProcessor() {
+		super();
+		fComputer = new JSPPropertyCompletionProposalComputer();
+	}
+
+	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
+		fComputer.addAttributeValueProposals(contentAssistRequest, null);
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
new file mode 100644
index 0000000..321e274
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
@@ -0,0 +1,240 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.jdt.core.CompletionProposal;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IImportContainer;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.internal.ui.text.java.ProposalContextInformation;
+import org.eclipse.jdt.ui.text.java.CompletionProposalCollector;
+import org.eclipse.jdt.ui.text.java.CompletionProposalComparator;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Passed into ICodeComplete#codeComplete(int offset, CompletionRequestor requestor).
+ * Adapts IJavaCompletionProposals to JSPCompletion proposals.
+ * This includes:
+ *  - translating offsets
+ *  - "fixing" up display strings
+ *  - filtering some unwanted proposals
+ *
+ * @plannedfor 1.0
+ */
+public class JSPProposalCollector extends CompletionProposalCollector {
+
+	private JSPTranslation fTranslation;
+	private Comparator fComparator;
+	private IImportContainer fImportContainer;
+
+	public JSPProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
+		super(cu);
+	
+		if(translation == null)
+			throw new IllegalArgumentException("JSPTranslation cannot be null"); //$NON-NLS-1$
+		
+		fTranslation = translation;
+		fImportContainer = cu.getImportContainer();
+	}
+
+	/**
+	 * Ensures that we only return JSPCompletionProposals.
+	 * @return an array of JSPCompletionProposals
+	 */
+	public JSPCompletionProposal[] getJSPCompletionProposals() {
+		List results = new ArrayList();
+		IJavaCompletionProposal[] javaProposals = getJavaCompletionProposals();
+		// need to filter out non JSPCompletionProposals
+		// because their offsets haven't been translated
+		for (int i = 0; i < javaProposals.length; i++) {
+			if(javaProposals[i] instanceof JSPCompletionProposal)
+				results.add(javaProposals[i]);
+		}
+		Collections.sort(results, getComparator());
+		return (JSPCompletionProposal[])results.toArray(new JSPCompletionProposal[results.size()]);
+	}
+	
+	private Comparator getComparator() {
+		if(fComparator == null)
+			fComparator = new CompletionProposalComparator();
+		return fComparator;
+	}
+	
+	/**
+	 * Overridden to:
+	 *  - translate Java -> JSP offsets
+	 *  - fix cursor-position-after
+	 *  - fix mangled servlet name in display string
+	 *  - remove unwanted proposals (servlet constructor)
+	 */
+	protected IJavaCompletionProposal createJavaCompletionProposal(CompletionProposal proposal) {
+		
+		JSPCompletionProposal jspProposal = null;
+		
+		// ignore constructor proposals (they're not relevant for our JSP proposal list)
+		if(!proposal.isConstructor()) {
+			
+			if(proposal.getKind() == CompletionProposal.TYPE_REF) {
+				String signature = String.valueOf(proposal.getDeclarationSignature());
+				String completion = String.valueOf(proposal.getCompletion());
+				if(completion.indexOf(signature + ".") != -1) { //$NON-NLS-1$
+					jspProposal = createAutoImportProposal(proposal);			
+				}
+			}
+			
+			// default behavior
+			if(jspProposal == null)
+				jspProposal = createJspProposal(proposal);		
+		}
+		return jspProposal;
+	}
+
+	/**
+	 * Retrieves the type name from the string <code>fullName</code>
+	 * @param fullName the fully qualified Java name
+	 * @return the type name
+	 */
+	private String getTypeName(String fullName) {
+		int index = fullName.lastIndexOf('.');
+		return (index != -1) ? fullName.substring(index + 1) : fullName;
+	}
+
+	private JSPCompletionProposal createAutoImportProposal(CompletionProposal proposal) {
+		
+		JSPCompletionProposal jspProposal = null;
+
+		String completion = new String(proposal.getCompletion());
+		
+		// it's fully qualified so we should
+		// add an import statement
+		// create an autoimport proposal
+		String newCompletion = getTypeName(completion);
+		
+		// java offset
+		int offset = proposal.getReplaceStart();
+		// replacement length
+		int length = proposal.getReplaceEnd() - offset;
+		// translate offset from Java > JSP
+		offset = fTranslation.getJspOffset(offset);
+		// cursor position after must be calculated
+		int positionAfter = calculatePositionAfter(proposal, newCompletion, offset);
+		
+		// from java proposal
+		IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
+		proposal.getDeclarationSignature();
+		Image image = javaProposal.getImage();
+		String displayString = javaProposal.getDisplayString();
+		displayString = getTranslation().fixupMangledName(displayString);
+		IContextInformation contextInformation = javaProposal.getContextInformation();
+		// don't do this, it's slow
+		// String additionalInfo = javaProposal.getAdditionalProposalInfo();
+		int relevance = javaProposal.getRelevance();
+		
+		boolean updateLengthOnValidate = true;
+		
+		jspProposal = new AutoImportProposal(completion, fImportContainer, newCompletion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
+		
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
+		// set wrapped java proposal so additional info can be calculated on demand
+		jspProposal.setJavaCompletionProposal(javaProposal);
+		
+		return jspProposal;
+	}
+
+	private JSPCompletionProposal createJspProposal(CompletionProposal proposal) {
+		
+		JSPCompletionProposal jspProposal;
+		String completion = String.valueOf(proposal.getCompletion());
+		// java offset
+		int offset = proposal.getReplaceStart();
+		// replacement length
+		int length = proposal.getReplaceEnd() - offset;
+		// translate offset from Java > JSP
+		offset = fTranslation.getJspOffset(offset);
+		// cursor position after must be calculated
+		int positionAfter = calculatePositionAfter(proposal, completion, offset);
+		
+		// from java proposal
+		IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
+		proposal.getDeclarationSignature();
+		Image image = javaProposal.getImage();
+		String displayString = javaProposal.getDisplayString();
+		displayString = getTranslation().fixupMangledName(displayString);
+		IContextInformation contextInformation = javaProposal.getContextInformation();
+		// String additionalInfo = javaProposal.getAdditionalProposalInfo();
+		
+		/* the context information is calculated with respect to the java document
+		 * thus it needs to be updated in respect of the JSP document.
+		 */
+		if(contextInformation instanceof ProposalContextInformation) {
+			ProposalContextInformation proposalInfo = (ProposalContextInformation)contextInformation;
+			int contextInfoJSPOffset = fTranslation.getJspOffset(proposalInfo.getContextInformationPosition());
+			proposalInfo.setContextInformationPosition(contextInfoJSPOffset);
+		}
+		
+		int relevance = javaProposal.getRelevance();
+		
+		boolean updateLengthOnValidate = true;
+		
+		jspProposal = new JSPCompletionProposal(completion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
+		
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
+		// set wrapped java proposal so additional info can be calculated on demand
+		jspProposal.setJavaCompletionProposal(javaProposal);
+		
+		return jspProposal;
+	}
+
+	/**
+	 * Cacluates the where the cursor should be after applying this proposal.
+	 * eg. method(|) if the method proposal chosen had params.
+	 * 
+	 * @param proposal
+	 * @param completion
+	 * @param currentCursorOffset
+	 * @return
+	 */
+	private int calculatePositionAfter(CompletionProposal proposal, String completion, int currentCursorOffset) {
+		// calculate cursor position after
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=118398
+		//int positionAfter = currentCursorOffset+completion.length();
+		int positionAfter = completion.length();
+		
+		int kind = proposal.getKind();
+		
+		// may need better logic here...
+		// put cursor inside parenthesis if there's params
+		// only checking for any kind of declaration
+		if(kind == CompletionProposal.ANONYMOUS_CLASS_DECLARATION || kind == CompletionProposal.METHOD_DECLARATION || kind == CompletionProposal.POTENTIAL_METHOD_DECLARATION || kind == CompletionProposal.METHOD_REF) {
+			String[] params = Signature.getParameterTypes(String.valueOf(proposal.getSignature()));
+			if(completion.length() > 0 && params.length > 0)
+				positionAfter--;
+		}
+		return positionAfter;
+	}
+	
+	static char[] getTypeTriggers() {
+		return TYPE_TRIGGERS;
+	}
+
+	public JSPTranslation getTranslation() {
+		return fTranslation;
+	}
+	
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPStructuredContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPStructuredContentAssistProcessor.java
new file mode 100644
index 0000000..aa2b995
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPStructuredContentAssistProcessor.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.jdt.ui.PreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
+import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
+import org.eclipse.wst.xml.ui.internal.contentassist.AttributeContextInformationPresenter;
+
+/**
+ * <p>Implementation of {@link StructuredContentAssistProcessor} for JSP documents</p>
+ * 
+ * <p>Currently this implementation still uses the HTML preferences for auto
+ * activation characters, but in the future this should probably change</p>
+ */
+public class JSPStructuredContentAssistProcessor extends StructuredContentAssistProcessor {
+
+	/** auto activation characters */
+	private char[] fCompletionPropoaslAutoActivationCharacters;
+	
+	/** property key for determining if auto activation is enabled */
+	private String fAutoActivationEnabledPropertyKey;
+	
+	/** property key for determining what the auto activation characters are */
+	private String fAutoActivationCharactersPropertyKey;
+	
+	/** the context information validator for this processor */
+	private IContextInformationValidator fContextInformationValidator;
+	
+	/**
+	 * <p>Constructor</p>
+	 * 
+	 * @param assistant {@link ContentAssistant} to use
+	 * @param partitionTypeID the partition type this processor is for
+	 * @param viewer {@link ITextViewer} this processor is acting in
+	 */
+	public JSPStructuredContentAssistProcessor(ContentAssistant assistant,
+			String partitionTypeID, ITextViewer viewer) {
+		
+		super(assistant, partitionTypeID, viewer, isJavaPartitionType(partitionTypeID) ?
+				PreferenceConstants.getPreferenceStore() : HTMLUIPlugin.getDefault().getPreferenceStore());
+
+		//determine which property keys to used based on weather this processor is for Java or HTML syntax
+		if(isJavaPartitionType(partitionTypeID)) {
+			fAutoActivationEnabledPropertyKey = PreferenceConstants.CODEASSIST_AUTOACTIVATION;
+			fAutoActivationCharactersPropertyKey = PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA;
+		} else {
+			fAutoActivationEnabledPropertyKey = HTMLUIPreferenceNames.AUTO_PROPOSE;
+			fAutoActivationCharactersPropertyKey = HTMLUIPreferenceNames.AUTO_PROPOSE_CODE;
+		}
+		
+		//get the current user preference
+		getAutoActivationCharacterPreferences();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getContextInformationValidator()
+	 */
+	public IContextInformationValidator getContextInformationValidator() {
+		if (this.fContextInformationValidator == null) {
+			this.fContextInformationValidator = new AttributeContextInformationPresenter();
+		}
+		return this.fContextInformationValidator;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLStructuredContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
+	 */
+	public char[] getCompletionProposalAutoActivationCharacters() {
+		return fCompletionPropoaslAutoActivationCharacters;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#propertyChange(
+	 * 	org.eclipse.jface.util.PropertyChangeEvent)
+	 */
+	public void propertyChange(PropertyChangeEvent event) {
+		String property = event.getProperty();
+		if(property.equals(fAutoActivationEnabledPropertyKey) ||
+				property.equals(fAutoActivationCharactersPropertyKey)) {
+			
+			getAutoActivationCharacterPreferences();
+		}
+	}
+	
+	/**
+	 * <p>Gets the auto activation character user preferences for Java and stores them for later use</p>
+	 */
+	private void getAutoActivationCharacterPreferences() {
+		IPreferenceStore store = getPreferenceStore();
+		
+		boolean doAuto = store.getBoolean(fAutoActivationEnabledPropertyKey);
+		if (doAuto) {
+			fCompletionPropoaslAutoActivationCharacters =
+				store.getString(fAutoActivationCharactersPropertyKey).toCharArray();
+		} else {
+			fCompletionPropoaslAutoActivationCharacters = null;
+		}
+	}
+	
+	/**
+	 * @param partitionTypeID check to see if this partition type ID is for a Java partition type
+	 * @return <code>true</code> if the given partiton type is a Java partition type,
+	 * <code>false</code> otherwise
+	 */
+	private static boolean isJavaPartitionType(String partitionTypeID) {
+		return IJSPPartitions.JSP_CONTENT_JAVA.equals(partitionTypeID) || IJSPPartitions.JSP_DEFAULT_EL.equals(partitionTypeID) || IJSPPartitions.JSP_DEFAULT_EL2.equals(partitionTypeID);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibCompletionProposalComputer.java
new file mode 100644
index 0000000..a51b8c6
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibCompletionProposalComputer.java
@@ -0,0 +1,418 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport;
+import org.eclipse.jst.jsp.core.taglib.IJarRecord;
+import org.eclipse.jst.jsp.core.taglib.ITLDRecord;
+import org.eclipse.jst.jsp.core.taglib.ITagDirRecord;
+import org.eclipse.jst.jsp.core.taglib.ITaglibDescriptor;
+import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
+import org.eclipse.jst.jsp.core.taglib.IURLRecord;
+import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.html.core.internal.contentmodel.JSP20Namespace;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceConstants;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
+import org.w3c.dom.Node;
+
+/**
+ * <p>Compute JSP taglib completion proposals</p>
+ */
+public class JSPTaglibCompletionProposalComputer extends
+		DefaultXMLCompletionProposalComputer {
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		IPath basePath = getBasePath(contentAssistRequest);
+		if (basePath != null) {
+			IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
+	
+			//only add attribute value proposals for specific elements
+			if(node.getNodeName().equals(JSP11Namespace.ElementName.DIRECTIVE_TAGLIB)) {
+				// Find the attribute name for which this position should have a value
+				IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
+				ITextRegionList openRegions = open.getRegions();
+				int i = openRegions.indexOf(contentAssistRequest.getRegion());
+				if (i < 0)
+					return;
+				ITextRegion nameRegion = null;
+				while (i >= 0) {
+					nameRegion = openRegions.get(i--);
+					if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
+						break;
+				}
+		
+				String attributeName = null;
+				if (nameRegion != null)
+					attributeName = open.getText(nameRegion);
+		
+				String currentValue = null;
+				if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
+					currentValue = contentAssistRequest.getText();
+				else
+					currentValue = ""; //$NON-NLS-1$
+				String matchString = null;
+				// fixups
+				int start = contentAssistRequest.getReplacementBeginPosition();
+				int length = contentAssistRequest.getReplacementLength();
+				if (currentValue.length() > StringUtils.strip(currentValue).length() &&
+						(currentValue.startsWith("\"") || currentValue.startsWith("'")) && //$NON-NLS-1$ //$NON-NLS-2$
+						contentAssistRequest.getMatchString().length() > 0) {
+					
+					matchString = currentValue.substring(1, contentAssistRequest.getMatchString().length());
+				}
+				else {
+					matchString = currentValue.substring(0, contentAssistRequest.getMatchString().length());
+				}
+				boolean existingComplicatedValue = contentAssistRequest.getRegion() != null &&
+						contentAssistRequest.getRegion() instanceof ITextRegionContainer;
+				if (existingComplicatedValue) {
+					contentAssistRequest.getProposals().clear();
+					contentAssistRequest.getMacros().clear();
+				}
+				else {
+					String lowerCaseMatch = matchString.toLowerCase(Locale.US);
+					if (attributeName.equals(JSP11Namespace.ATTR_NAME_URI)) {
+						ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
+						/*
+						 * a simple enough way to remove duplicates (resolution at
+						 * runtime would be nondeterministic anyway)
+						 */
+						Map uriToRecords = new HashMap();
+						for (int taglibRecordNumber = 0; taglibRecordNumber < availableTaglibRecords.length; taglibRecordNumber++) {
+							ITaglibRecord taglibRecord = availableTaglibRecords[taglibRecordNumber];
+							ITaglibDescriptor descriptor = taglibRecord.getDescriptor();
+							String uri = null;
+							switch (taglibRecord.getRecordType()) {
+								case ITaglibRecord.URL :
+									uri = descriptor.getURI();
+									uriToRecords.put(uri, taglibRecord);
+									break;
+								case ITaglibRecord.JAR : {
+									IPath location = ((IJarRecord) taglibRecord).getLocation();
+									IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(location);
+									IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
+									for (int fileNumber = 0; fileNumber < files.length; fileNumber++) {
+										if (localContextRoot.isPrefixOf(files[fileNumber].getFullPath())) {
+											uri = IPath.SEPARATOR +
+													files[fileNumber].getFullPath().removeFirstSegments(localContextRoot.segmentCount()).toString();
+											uriToRecords.put(uri, taglibRecord);
+										}
+										else {
+											uri = FacetModuleCoreSupport.getRuntimePath(files[fileNumber].getFullPath()).toString();
+											uriToRecords.put(uri, taglibRecord);
+										}
+									}
+									break;
+								}
+								case ITaglibRecord.TLD : {
+									IPath path = ((ITLDRecord) taglibRecord).getPath();
+									IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
+									if (localContextRoot.isPrefixOf(path)) {
+										uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
+										uriToRecords.put(uri, taglibRecord);
+									}
+									else {
+										uri = FacetModuleCoreSupport.getRuntimePath(path).toString();
+										uriToRecords.put(uri, taglibRecord);
+									}
+									break;
+								}
+							}
+						}
+						/*
+						 * use the records and their descriptors to construct
+						 * proposals
+						 */
+						Object[] uris = uriToRecords.keySet().toArray();
+						for (int uriNumber = 0; uriNumber < uris.length; uriNumber++) {
+							String uri = uris[uriNumber].toString();
+							ITaglibRecord taglibRecord = (ITaglibRecord) uriToRecords.get(uri);
+							ITaglibDescriptor descriptor = (taglibRecord).getDescriptor();
+							if (uri != null && uri.length() > 0 && (matchString.length() == 0 ||
+									uri.toLowerCase(Locale.US).startsWith(lowerCaseMatch))) {
+								
+								String url = getSmallImageURL(taglibRecord);
+								ImageDescriptor imageDescriptor = JSPUIPlugin.getInstance().getImageRegistry().getDescriptor(url);
+								if (imageDescriptor == null && url != null) {
+									URL imageURL;
+									try {
+										imageURL = new URL(url);
+										imageDescriptor = ImageDescriptor.createFromURL(imageURL);
+										JSPUIPlugin.getInstance().getImageRegistry().put(url, imageDescriptor);
+									}
+									catch (MalformedURLException e) {
+										Logger.logException(e);
+									}
+								}
+								String additionalInfo = descriptor.getDisplayName() + "<br/>" + //$NON-NLS-1$
+										descriptor.getDescription() + "<br/>" + descriptor.getTlibVersion(); //$NON-NLS-1$
+								Image image = null;
+								try {
+									image = JSPUIPlugin.getInstance().getImageRegistry().get(url);
+								}
+								catch (Exception e) {
+									Logger.logException(e);
+								}
+								if (image == null) {
+									image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
+								}
+								CustomCompletionProposal proposal = new CustomCompletionProposal(
+										"\"" + uri + "\"", start, length, uri.length() + 2, //$NON-NLS-1$ //$NON-NLS-2$
+										image, uri, null, additionalInfo, IRelevanceConstants.R_NONE);
+								contentAssistRequest.addProposal(proposal);
+							}
+						}
+					}
+					else if (attributeName.equals(JSP20Namespace.ATTR_NAME_TAGDIR)) {
+						ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
+						/*
+						 * a simple enough way to remove duplicates (resolution at
+						 * runtime would be nondeterministic anyway)
+						 */
+						Map uriToRecords = new HashMap();
+						for (int taglibRecordNumber = 0; taglibRecordNumber < availableTaglibRecords.length; taglibRecordNumber++) {
+							ITaglibRecord taglibRecord = availableTaglibRecords[taglibRecordNumber];
+							String uri = null;
+							if (taglibRecord.getRecordType() == ITaglibRecord.TAGDIR) {
+								IPath path = ((ITagDirRecord) taglibRecord).getPath();
+								IPath localContextRoot = TaglibIndex.getContextRoot(basePath);
+								if (localContextRoot.isPrefixOf(path)) {
+									uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
+									uriToRecords.put(uri, taglibRecord);
+								}
+							}
+						}
+						/*
+						 * use the records and their descriptors to construct
+						 * proposals
+						 */
+						Object[] uris = uriToRecords.keySet().toArray();
+						for (int uriNumber = 0; uriNumber < uris.length; uriNumber++) {
+							String uri = uris[uriNumber].toString();
+							ITaglibRecord taglibRecord = (ITaglibRecord) uriToRecords.get(uri);
+							ITaglibDescriptor descriptor = (taglibRecord).getDescriptor();
+							if (uri != null && uri.length() > 0 && (matchString.length() == 0 ||
+									uri.toLowerCase(Locale.US).startsWith(lowerCaseMatch))) {
+								
+								String url = getSmallImageURL(taglibRecord);
+								ImageDescriptor imageDescriptor = null;
+								if (url != null) {
+									imageDescriptor = JSPUIPlugin.getInstance().getImageRegistry().getDescriptor(url);
+								}
+								if (imageDescriptor == null && url != null) {
+									URL imageURL;
+									try {
+										imageURL = new URL(url);
+										imageDescriptor = ImageDescriptor.createFromURL(imageURL);
+										JSPUIPlugin.getInstance().getImageRegistry().put(url, imageDescriptor);
+									}
+									catch (MalformedURLException e) {
+										Logger.logException(e);
+									}
+								}
+								String additionalInfo = descriptor.getDescription() + "<br/>" + descriptor.getTlibVersion(); //$NON-NLS-1$
+								Image image = null;
+								try {
+									image = JSPUIPlugin.getInstance().getImageRegistry().get(url);
+								}
+								catch (Exception e) {
+									Logger.logException(e);
+								}
+								if (image == null) {
+									image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
+								}
+								CustomCompletionProposal proposal = new CustomCompletionProposal(
+										"\"" + uri + "\"", start, length, uri.length() + 2, image, uri, //$NON-NLS-1$ //$NON-NLS-2$
+										null, additionalInfo, IRelevanceConstants.R_NONE);
+								contentAssistRequest.addProposal(proposal);
+							}
+						}
+					}
+					else if (attributeName.equals(JSP11Namespace.ATTR_NAME_PREFIX)) {
+						Node uriAttr = node.getAttributes().getNamedItem(JSP11Namespace.ATTR_NAME_URI);
+						String uri = null;
+						if (uriAttr != null) {
+							uri = uriAttr.getNodeValue();
+							ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
+							Map prefixMap = new HashMap();
+							for (int taglibrecordNumber = 0; taglibrecordNumber < availableTaglibRecords.length; taglibrecordNumber++) {
+								ITaglibDescriptor descriptor = availableTaglibRecords[taglibrecordNumber].getDescriptor();
+								if (descriptor != null && descriptor.getURI() != null &&
+										descriptor.getURI().toLowerCase(Locale.US).equals(uri.toLowerCase(Locale.US))) {
+									String shortName = descriptor.getShortName().trim();
+									if (shortName.length() > 0) {
+										boolean valid = true;
+										for (int character = 0; character < shortName.length(); character++) {
+											valid = valid && !Character.isWhitespace(shortName.charAt(character));
+										}
+										if (valid) {
+											prefixMap.put(shortName, descriptor);
+										}
+									}
+								}
+							}
+							Object prefixes[] = prefixMap.keySet().toArray();
+							for (int j = 0; j < prefixes.length; j++) {
+								String prefix = (String) prefixes[j];
+								ITaglibDescriptor descriptor = (ITaglibDescriptor) prefixMap.get(prefix);
+								Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
+								CustomCompletionProposal proposal = new CustomCompletionProposal(
+										"\"" + prefix + "\"", start, length, prefix.length() + 2, image, //$NON-NLS-1$ //$NON-NLS-2$
+										prefix, null, descriptor.getDescription(), IRelevanceConstants.R_NONE);
+								contentAssistRequest.addProposal(proposal);
+							}
+						}
+						else {
+							Node dirAttr = node.getAttributes().getNamedItem(JSP20Namespace.ATTR_NAME_TAGDIR);
+							if (dirAttr != null) {
+								String dir = dirAttr.getNodeValue();
+								if (dir != null) {
+									ITaglibRecord record = TaglibIndex.resolve(basePath.toString(), dir, false);
+									if (record != null) {
+										ITaglibDescriptor descriptor = record.getDescriptor();
+										if (descriptor != null) {
+											String shortName = descriptor.getShortName();
+		
+											Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
+											CustomCompletionProposal proposal = new CustomCompletionProposal(
+													"\"" + shortName + "\"", start, length, shortName.length() + 2, //$NON-NLS-1$ //$NON-NLS-2$
+													image, shortName, null, descriptor.getDescription(),
+													IRelevanceConstants.R_NONE);
+											contentAssistRequest.addProposal(proposal);
+										}
+										else {
+											if (dir.startsWith("/WEB-INF/")) { //$NON-NLS-1$
+												dir = dir.substring(9);
+											}
+											String prefix = StringUtils.replace(dir, "/", "-"); //$NON-NLS-1$ //$NON-NLS-2$
+		
+											Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
+											CustomCompletionProposal proposal = new CustomCompletionProposal(
+													"\"" + prefix + "\"", start, length, prefix.length() + 2, //$NON-NLS-1$ //$NON-NLS-2$
+													image, prefix, null, null, IRelevanceConstants.R_NONE);
+											contentAssistRequest.addProposal(proposal);
+										}
+									}
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+	
+	private String getSmallImageURL(ITaglibRecord taglibRecord) {
+		String url = null;
+		switch (taglibRecord.getRecordType()) {
+			case (ITaglibRecord.TLD) : {
+				ITLDRecord record = (ITLDRecord) taglibRecord;
+				IResource file = ResourcesPlugin.getWorkspace().getRoot().getFile(record.getPath());
+				if (file.getLocation() != null && record.getDescriptor().getSmallIcon().length() > 0) {
+					url = "platform:/resource/" + //$NON-NLS-1$
+					FacetModuleCoreSupport.resolve(file.getFullPath(),
+							record.getDescriptor().getSmallIcon());
+				}
+			}
+				break;
+			case (ITaglibRecord.JAR) : {
+				IJarRecord record = (IJarRecord) taglibRecord;
+				if (record.getDescriptor().getSmallIcon().length() > 0) {
+					// url = "file:" +
+					// URIHelper.normalize(record.getDescriptor().getSmallIcon(),
+					// record.getLocation().toString(), "/"); //$NON-NLS-1$
+				}
+			}
+				break;
+			case (ITaglibRecord.TAGDIR) : {
+			}
+				break;
+			case (ITaglibRecord.URL) : {
+				IURLRecord record = (IURLRecord) taglibRecord;
+				if (record.getDescriptor().getSmallIcon().length() > 0) {
+					url = URIHelper.normalize(record.getDescriptor().getSmallIcon(), record.getURL().toString(), "/"); //$NON-NLS-1$
+				}
+			}
+				break;
+		}
+		return url;
+	}
+	
+	/**
+	 * Returns project request is in
+	 * 
+	 * @param request
+	 * @return
+	 */
+	private IPath getBasePath(ContentAssistRequest request) {
+		IPath baselocation = null;
+
+		if (request != null) {
+			IStructuredDocumentRegion region = request.getDocumentRegion();
+			if (region != null) {
+				IDocument document = region.getParentDocument();
+				IStructuredModel model = null;
+				try {
+					model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+					if (model != null) {
+						String location = model.getBaseLocation();
+						if (location != null) {
+							baselocation = new Path(location);
+						}
+					}
+				}
+				finally {
+					if (model != null)
+						model.releaseFromRead();
+				}
+			}
+		}
+		return baselocation;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibDirectiveContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibDirectiveContentAssistProcessor.java
new file mode 100644
index 0000000..9374f8f
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibDirectiveContentAssistProcessor.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+
+/**
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see JSPTaglibCompletionProposalComputer
+ */
+public class JSPTaglibDirectiveContentAssistProcessor extends JSPDummyContentAssistProcessor {
+
+	private JSPTaglibCompletionProposalComputer fComputer;
+	
+	public JSPTaglibDirectiveContentAssistProcessor() {
+		super();
+		fComputer = new JSPTaglibCompletionProposalComputer();
+	}
+
+	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
+		fComputer.addAttributeValueProposals(contentAssistRequest, null);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplateCompletionProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplateCompletionProcessor.java
new file mode 100644
index 0000000..8ab20eb
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplateCompletionProcessor.java
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.TemplateException;
+import org.eclipse.jface.text.templates.TemplateProposal;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Completion processor for JSP Templates. Most of the work is already done by
+ * the JSP Content Assist processor, so by the time the
+ * JSPTemplateCompletionProcessor is asked for content assist proposals, the
+ * jsp content assist processor has already set the context type for
+ * templates.
+ */
+class JSPTemplateCompletionProcessor extends TemplateCompletionProcessor {
+	private static final class ProposalComparator implements Comparator {
+		public int compare(Object o1, Object o2) {
+			return ((TemplateProposal) o2).getRelevance() - ((TemplateProposal) o1).getRelevance();
+		}
+	}
+
+	private static final Comparator fgProposalComparator = new ProposalComparator();
+	private String fContextTypeId = null;
+
+	/*
+	 * Copied from super class except instead of calling createContext(viewer,
+	 * region) call createContext(viewer, region, offset) instead
+	 */
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
+
+		ITextSelection selection = (ITextSelection) viewer.getSelectionProvider().getSelection();
+
+		// adjust offset to end of normalized selection
+		if (selection.getOffset() == offset)
+			offset = selection.getOffset() + selection.getLength();
+
+		String prefix = extractPrefix(viewer, offset);
+		Region region = new Region(offset - prefix.length(), prefix.length());
+		TemplateContext context = createContext(viewer, region, offset);
+		if (context == null)
+			return new ICompletionProposal[0];
+
+		// name of the selection variables {line, word}_selection
+		context.setVariable("selection", selection.getText()); // //$NON-NLS-1$
+
+		Template[] templates = getTemplates(context.getContextType().getId());
+
+		List matches = new ArrayList();
+		for (int i = 0; i < templates.length; i++) {
+			Template template = templates[i];
+			try {
+				context.getContextType().validate(template.getPattern());
+			}
+			catch (TemplateException e) {
+				continue;
+			}
+			if (template.matches(prefix, context.getContextType().getId()))
+				matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
+		}
+
+		Collections.sort(matches, fgProposalComparator);
+
+		return (ICompletionProposal[]) matches.toArray(new ICompletionProposal[matches.size()]);
+	}
+
+	/**
+	 * Creates a concrete template context for the given region in the
+	 * document. This involves finding out which context type is valid at the
+	 * given location, and then creating a context of this type. The default
+	 * implementation returns a <code>SmartReplaceTemplateContext</code> for
+	 * the context type at the given location. This takes the offset at which
+	 * content assist was invoked into consideration.
+	 * 
+	 * @param viewer
+	 *            the viewer for which the context is created
+	 * @param region
+	 *            the region into <code>document</code> for which the
+	 *            context is created
+	 * @param offset
+	 *            the original offset where content assist was invoked
+	 * @return a template context that can handle template insertion at the
+	 *         given location, or <code>null</code>
+	 */
+	private TemplateContext createContext(ITextViewer viewer, IRegion region, int offset) {
+		// pretty much same code as super.createContext except create
+		// SmartReplaceTemplateContext
+		TemplateContextType contextType = getContextType(viewer, region);
+		if (contextType != null) {
+			IDocument document = viewer.getDocument();
+			return new ReplaceNameTemplateContext(contextType, document, region.getOffset(), region.getLength(), offset);
+		}
+		return null;
+	}
+
+	protected ICompletionProposal createProposal(Template template, TemplateContext context, IRegion region, int relevance) {
+		return new CustomTemplateProposal(template, context, region, getImage(template), relevance);
+	}
+
+	protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
+		TemplateContextType type = null;
+
+		ContextTypeRegistry registry = getTemplateContextRegistry();
+		if (registry != null)
+			type = registry.getContextType(fContextTypeId);
+
+		return type;
+	}
+
+	protected Image getImage(Template template) {
+		return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_TEMPLATE);
+	}
+
+	private ContextTypeRegistry getTemplateContextRegistry() {
+		return JSPUIPlugin.getDefault().getTemplateContextRegistry();
+	}
+
+	protected Template[] getTemplates(String contextTypeId) {
+		Template templates[] = null;
+
+		TemplateStore store = getTemplateStore();
+		if (store != null)
+			templates = store.getTemplates(contextTypeId);
+
+		return templates;
+	}
+
+	private TemplateStore getTemplateStore() {
+		return JSPUIPlugin.getDefault().getTemplateStore();
+	}
+
+	void setContextType(String contextTypeId) {
+		fContextTypeId = contextTypeId;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplatesCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplatesCompletionProposalComputer.java
new file mode 100644
index 0000000..beb0589
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplatesCompletionProposalComputer.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+
+/**
+ * <p>Computes JSP template completion proposals</p>
+ */
+public class JSPTemplatesCompletionProposalComputer extends
+		DefaultXMLCompletionProposalComputer {
+
+	/** Template completion processor used to create template proposals */
+	private JSPTemplateCompletionProcessor fTemplateProcessor = null;
+	
+	/**
+	 * Create the computer
+	 */
+	public JSPTemplatesCompletionProposalComputer() {
+		this.fTemplateProcessor = new JSPTemplateCompletionProcessor();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		//get the templates specific to the context
+		List proposals = new ArrayList(super.computeCompletionProposals(context, monitor));
+		
+		//get templates not specific to the context
+		proposals.addAll(this.getTemplateProposals(TemplateContextTypeIdsJSP.ALL, context));
+	
+		return proposals;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeNameProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.ATTRIBUTE, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.ATTRIBUTE_VALUE, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagInsertionProposals(
+			ContentAssistRequest contentAssistRequest, int childPosition,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.TAG, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEmptyDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		if (ContentTypeIdForJSP.ContentTypeID_JSPTAG.equals(
+				((IDOMNode) contentAssistRequest.getNode()).getModel().getContentTypeIdentifier())) {
+			
+			addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.NEW_TAG, context);
+		} else {
+			addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.NEW, context);
+		}
+	}
+	
+	/**
+	 * <p>Get the template proposals from the template processor</p>
+	 * 
+	 * @param templateContext
+	 * @param context
+	 * @return
+	 */
+	private List getTemplateProposals(String templateContext,
+			CompletionProposalInvocationContext context) {
+		
+		List templateProposals = new ArrayList();
+		
+		if (fTemplateProcessor != null) {
+			fTemplateProcessor.setContextType(templateContext);
+			ICompletionProposal[] proposals =
+				fTemplateProcessor.computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
+		
+			templateProposals.addAll(Arrays.asList(proposals));
+		}
+		
+		return templateProposals;
+	}
+	
+	/**
+	 * <p>Adds templates to the list of proposals</p>
+	 * 
+	 * @param contentAssistRequest
+	 * @param templateContext
+	 * @param context
+	 */
+	private void addTemplates(ContentAssistRequest contentAssistRequest, String templateContext,
+			CompletionProposalInvocationContext context) {
+		
+		if (contentAssistRequest != null) {
+			boolean useProposalList = !contentAssistRequest.shouldSeparate();
+			List proposals = this.getTemplateProposals(templateContext, context);
+	
+			for (int i = 0; i < proposals.size(); ++i) {
+				if (useProposalList) {
+					contentAssistRequest.addProposal((ICompletionProposal)proposals.get(i));
+				}
+				else {
+					contentAssistRequest.addMacro((ICompletionProposal)proposals.get(i));
+				}
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanCompletionProposalComputer.java
new file mode 100644
index 0000000..a603359
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanCompletionProposalComputer.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+
+/**
+ * <p>Compute JSP use bean completion proposals</p>
+ */
+public class JSPUseBeanCompletionProposalComputer extends
+		DefaultXMLCompletionProposalComputer {
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
+
+		//only add attribute value proposals for specific elements
+		if(node.getNodeName().equals(JSP11Namespace.ElementName.USEBEAN)) {
+			// Find the attribute name for which this position should have a value
+			IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
+			ITextRegionList openRegions = open.getRegions();
+			int i = openRegions.indexOf(contentAssistRequest.getRegion());
+			if (i < 0)
+				return;
+			ITextRegion nameRegion = null;
+			while (i >= 0) {
+				nameRegion = openRegions.get(i--);
+				if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
+					break;
+			}
+	
+			String attributeName = null;
+			if (nameRegion != null)
+				attributeName = open.getText(nameRegion);
+	
+			String currentValue = null;
+			if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
+				currentValue = contentAssistRequest.getText();
+			else
+				currentValue = ""; //$NON-NLS-1$
+			String matchString = null;
+			// fixups
+			int start = contentAssistRequest.getReplacementBeginPosition();
+			int length = contentAssistRequest.getReplacementLength();
+			if (currentValue.length() > StringUtils.strip(currentValue).length() && (currentValue.startsWith("\"") || currentValue.startsWith("'")) //$NON-NLS-1$ //$NON-NLS-2$
+						&& contentAssistRequest.getMatchString().length() > 0) {
+				matchString = currentValue.substring(1, contentAssistRequest.getMatchString().length());
+				start++;
+				length = matchString.length();
+			} else
+				matchString = currentValue.substring(0, contentAssistRequest.getMatchString().length());
+			boolean existingComplicatedValue = contentAssistRequest.getRegion() != null && contentAssistRequest.getRegion() instanceof ITextRegionContainer;
+			if (existingComplicatedValue) {
+				contentAssistRequest.getProposals().clear();
+				contentAssistRequest.getMacros().clear();
+			} else {
+				if (attributeName.equals(JSP11Namespace.ATTR_NAME_CLASS)) {
+					// class is the concrete implementation class
+					IResource resource = JSPContentAssistHelper.getResource(contentAssistRequest);
+					ICompletionProposal[] classProposals = JavaTypeFinder.getClassProposals(resource, start, length);
+					if (classProposals != null) {
+						for (int j = 0; j < classProposals.length; j++) {
+							JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) classProposals[j];
+							if (matchString.length() == 0 || proposal.getQualifiedName().toLowerCase().startsWith(matchString.toLowerCase()) || proposal.getShortName().toLowerCase().startsWith(matchString.toLowerCase()))
+								contentAssistRequest.addProposal(proposal);
+						}
+					}
+				} else if (attributeName.equals(JSP11Namespace.ATTR_NAME_TYPE)) {
+					// type is the more general type for the bean
+					// which means it may be an interface
+					IResource resource = JSPContentAssistHelper.getResource(contentAssistRequest);
+					ICompletionProposal[] typeProposals = JavaTypeFinder.getTypeProposals(resource, start, length);
+					if (typeProposals != null) {
+						for (int j = 0; j < typeProposals.length; j++) {
+							JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) typeProposals[j];
+							if (matchString.length() == 0 || proposal.getQualifiedName().toLowerCase().startsWith(matchString.toLowerCase()) || proposal.getShortName().toLowerCase().startsWith(matchString.toLowerCase()))
+								contentAssistRequest.addProposal(proposal);
+						}
+					}
+				} else if (attributeName.equals(JSP11Namespace.ATTR_NAME_BEAN_NAME)) {
+					IResource resource = JSPContentAssistHelper.getResource(contentAssistRequest);
+					ICompletionProposal[] beanNameProposals = JavaTypeFinder.getBeanProposals(resource, start, length);
+					if (beanNameProposals != null) {
+						for (int j = 0; j < beanNameProposals.length; j++) {
+							if (beanNameProposals[j] instanceof CustomCompletionProposal) {
+								JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) beanNameProposals[j];
+								if (matchString.length() == 0 || proposal.getDisplayString().toLowerCase().startsWith(matchString.toLowerCase()))
+									contentAssistRequest.addProposal(proposal);
+							} else if (beanNameProposals[j] instanceof JavaTypeCompletionProposal) {
+								JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) beanNameProposals[j];
+								if (matchString.length() == 0 || proposal.getQualifiedName().toLowerCase().startsWith(matchString.toLowerCase()) || proposal.getShortName().toLowerCase().startsWith(matchString.toLowerCase()))
+									contentAssistRequest.addProposal(proposal);
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java
new file mode 100644
index 0000000..3ab7f8f
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+
+/**
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see JSPUseBeanCompletionProposalComputer
+ */
+public class JSPUseBeanContentAssistProcessor extends JSPDummyContentAssistProcessor {
+
+	private JSPUseBeanCompletionProposalComputer fComputer;
+	
+	public JSPUseBeanContentAssistProcessor() {
+		super();
+		fComputer = new JSPUseBeanCompletionProposalComputer();
+	}
+
+	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
+		fComputer.addAttributeValueProposals(contentAssistRequest, null);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaParameterListValidator.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaParameterListValidator.java
new file mode 100644
index 0000000..633a4c2
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaParameterListValidator.java
@@ -0,0 +1,228 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.jface.text.Assert;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationPresenter;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+
+
+/**
+ * @plannedfor 1.0
+ */
+public class JavaParameterListValidator implements IContextInformationValidator, IContextInformationPresenter {
+
+	private int fPosition;
+	private ITextViewer fViewer;
+	private IContextInformation fInformation;
+
+	private int fCurrentParameter;
+
+	/**
+	 * @see IContextInformationValidator#install(IContextInformation,
+	 *      ITextViewer, int)
+	 * @see IContextInformationPresenter#install(IContextInformation,
+	 *      ITextViewer, int)
+	 */
+	public void install(IContextInformation info, ITextViewer viewer, int documentPosition) {
+		fPosition = documentPosition;
+		fViewer = viewer;
+		fInformation = info;
+
+		fCurrentParameter = -1;
+	}
+
+	private int getCommentEnd(IDocument d, int pos, int end) throws BadLocationException {
+		while (pos < end) {
+			char curr = d.getChar(pos);
+			pos++;
+			if (curr == '*') {
+				if (pos < end && d.getChar(pos) == '/') {
+					return pos + 1;
+				}
+			}
+		}
+		return end;
+	}
+
+	private int getStringEnd(IDocument d, int pos, int end, char ch) throws BadLocationException {
+		while (pos < end) {
+			char curr = d.getChar(pos);
+			pos++;
+			if (curr == '\\') {
+				// ignore escaped characters
+				pos++;
+			}
+			else if (curr == ch) {
+				return pos;
+			}
+		}
+		return end;
+	}
+
+	private int getCharCount(IDocument document, int start, int end, char increment, char decrement, boolean considerNesting) throws BadLocationException {
+
+		Assert.isTrue((increment != 0 || decrement != 0) && increment != decrement);
+
+		int nestingLevel = 0;
+		int charCount = 0;
+		while (start < end) {
+			char curr = document.getChar(start++);
+			switch (curr) {
+				case '/' :
+					if (start < end) {
+						char next = document.getChar(start);
+						if (next == '*') {
+							// a comment starts, advance to the comment end
+							start = getCommentEnd(document, start + 1, end);
+						}
+						else if (next == '/') {
+							// '//'-comment: nothing to do anymore on this
+							// line
+							start = end;
+						}
+					}
+					break;
+				case '*' :
+					if (start < end) {
+						char next = document.getChar(start);
+						if (next == '/') {
+							// we have been in a comment: forget what we read
+							// before
+							charCount = 0;
+							++start;
+						}
+					}
+					break;
+				case '"' :
+				case '\'' :
+					start = getStringEnd(document, start, end, curr);
+					break;
+				default :
+
+					if (considerNesting) {
+
+						if ('(' == curr)
+							++nestingLevel;
+						else if (')' == curr)
+							--nestingLevel;
+
+						if (nestingLevel != 0)
+							break;
+					}
+
+					if (increment != 0) {
+						if (curr == increment)
+							++charCount;
+					}
+
+					if (decrement != 0) {
+						if (curr == decrement)
+							--charCount;
+					}
+			}
+		}
+
+		return charCount;
+	}
+
+	/**
+	 * @see IContextInformationValidator#isContextInformationValid(int)
+	 */
+	public boolean isContextInformationValid(int position) {
+
+		try {
+			if (position < fPosition)
+				return false;
+
+			IDocument document = fViewer.getDocument();
+			IRegion line = document.getLineInformationOfOffset(fPosition);
+
+			if (position < line.getOffset() || position >= document.getLength())
+				return false;
+
+			return (getCharCount(document, fPosition, position, '(', ')', false) >= 0);
+
+		}
+		catch (BadLocationException x) {
+			return false;
+		}
+	}
+
+	/**
+	 * @see IContextInformationPresenter#updatePresentation(int,
+	 *      TextPresentation)
+	 */
+	public boolean updatePresentation(int position, TextPresentation presentation) {
+
+		int currentParameter = -1;
+
+		try {
+			currentParameter = getCharCount(fViewer.getDocument(), fPosition, position, ',', (char) 0, true);
+		}
+		catch (BadLocationException x) {
+			return false;
+		}
+
+		if (fCurrentParameter != -1) {
+			if (currentParameter == fCurrentParameter)
+				return false;
+		}
+
+		if (fInformation == null)
+			return false;
+
+		presentation.clear();
+		fCurrentParameter = currentParameter;
+
+		String s = fInformation.getInformationDisplayString();
+		int start = 0;
+		int occurrences = 0;
+		while (occurrences < fCurrentParameter) {
+			int found = s.indexOf(',', start);
+			if (found == -1)
+				break;
+			start = found + 1;
+			++occurrences;
+		}
+
+		if (occurrences < fCurrentParameter) {
+			presentation.addStyleRange(new StyleRange(0, s.length(), null, null, SWT.NORMAL));
+			return true;
+		}
+
+		if (start == -1)
+			start = 0;
+
+		int end = s.indexOf(',', start);
+		if (end == -1)
+			end = s.length();
+
+		if (start > 0)
+			presentation.addStyleRange(new StyleRange(0, start, null, null, SWT.NORMAL));
+
+		if (end > start)
+			presentation.addStyleRange(new StyleRange(start, end - start, null, null, SWT.BOLD));
+
+		if (end < s.length())
+			presentation.addStyleRange(new StyleRange(end, s.length() - end, null, null, SWT.NORMAL));
+
+		return true;
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java
new file mode 100644
index 0000000..1ba8e64
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java
@@ -0,0 +1,300 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+
+/**
+ * An implementation of ICompletionProposal whose values can be
+ * read after creation.
+ * 
+ * @plannedfor 1.0
+ */
+public class JavaTypeCompletionProposal extends CustomCompletionProposal implements IRelevanceCompletionProposal {
+
+	private int fCursorPosition = 0;
+	private String fLocalDisplayString;
+	private String fShortName;
+	private String fQualifiedName;
+	private String fContainerName;
+
+	public JavaTypeCompletionProposal(String replacementString, int replacementOffset, int replacementLength, String qualifiedName, Image image, String typeName, String containerName,  int relevence,  boolean updateReplacementLengthOnValidate) {
+		super(replacementString, replacementOffset, replacementLength, qualifiedName.length() + 2, image, 
+                (containerName != null && containerName.length() > 0) ? typeName + " - " + containerName : typeName, null, null, relevence, true); //$NON-NLS-1$
+		// CMVC 243817, superclass was comparing incorrect display string in validate method...
+		//super(replacementString, replacementOffset, replacementLength, image, (containerName != null && containerName.length() > 0)? typeName + " - " + containerName:typeName/*qualifiedName*/, relevence);
+		fShortName = typeName;
+		fQualifiedName = qualifiedName;
+		fContainerName = containerName;
+		fCursorPosition = fQualifiedName.length() + 2;
+		//fProposalInfo = proposalInfo;
+		if (containerName != null && containerName.length() > 0)
+			fLocalDisplayString = typeName + " - " + containerName; //$NON-NLS-1$
+		else
+			fLocalDisplayString = typeName;
+	}
+
+	public String getDisplayString() {
+		return fLocalDisplayString;
+	}
+
+	public int getCursorPosition() {
+		return fCursorPosition;
+	}
+
+	public void setCursorPosition(int cursorPosition) {
+		super.setCursorPosition(cursorPosition);
+		fCursorPosition = cursorPosition;
+	}
+
+	public String getQualifiedName() {
+		return fQualifiedName;
+	}
+
+	public String getAdditionalProposalInfo() {
+		//		String info = super.getAdditionalProposalInfo();
+		//		if (info == null || info.length() == 0 && fProposalInfo != null)
+		//			return fProposalInfo.getInfo();
+		//		return info;
+		return null; // unexplained NPE
+	}
+
+	public String getShortName() {
+		return fShortName;
+	}
+
+	protected String getImport(IStructuredDocumentRegion flatNode) {
+		ITextRegionList regions = flatNode.getRegions();
+		String importSpec = null;
+		boolean isImport = false;
+		for (int i = 0; i < regions.size(); i++) {
+			ITextRegion region = regions.get(i);
+			if (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+				if (flatNode.getText(region).equals(JSP11Namespace.ATTR_NAME_IMPORT)) {
+					isImport = true;
+				}
+				else {
+					isImport = false;
+				}
+			}
+			else if (isImport && region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+				importSpec = flatNode.getText(region);
+			}
+		}
+		return importSpec;
+	}
+
+	/**
+	 * Add an import page directive for the current type name
+	 */
+	protected int applyImport(IStructuredDocument model) {
+		// if the type is in the default package or java.lang, skip it
+		if (fContainerName == null || fContainerName.length() == 0 || fContainerName.equals("java.lang")) //$NON-NLS-1$
+			return 0;
+		// collect page directives and store their import values
+		List imports = new ArrayList();
+		IStructuredDocumentRegion node = model.getFirstStructuredDocumentRegion();
+
+		// use the last position of a page directive as a hint as to where to add
+		// a new one
+		int hint = 0;
+		// watch for jsp:root so that we use the right XML/JSP format for the directive
+		boolean useXML = false;
+
+		while (node != null) {
+			// Can't just look for all StructuredDocumentRegions starting with JSP_DIRECTIVE_OPEN
+			// since the XML form is required, too
+			ITextRegionList regions = node.getRegions();
+			if (regions.size() > 1) {
+				ITextRegion name = regions.get(1);
+				// verify that this is a JSP directive
+				if (name.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
+					// verify that this is a *page* directive
+					if (node.getText(name).equals(JSP11Namespace.ATTR_NAME_PAGE) || node.getText(name).equals(JSP12Namespace.ElementName.DIRECTIVE_PAGE)) {
+						if (node.getEndOffset() < getReplacementOffset())
+							hint = node.getEndOffset();
+						String importSpec = getImport(node);
+						if (importSpec != null) {
+							imports.add(importSpec);
+						}
+					}
+				}
+				else {
+					// if this is a jsp:root tag, use the XML form
+					useXML = useXML || name.getType() == DOMJSPRegionContexts.JSP_ROOT_TAG_NAME;
+				}
+			}
+			node = node.getNext();
+		}
+
+		// evaluate requirements for a "new" import directive
+		boolean needsImport = !importHandles(fQualifiedName, imports);
+		int adjustmentLength = 0;
+		// insert "new" import directive
+		if (needsImport) {
+			String directive = null;
+
+			// vary the XML behavior
+			if (useXML) {
+				directive = "<jsp:directive.page import=\"" + fQualifiedName + "\"/>"; //$NON-NLS-1$ //$NON-NLS-2$
+			}
+			else {
+				directive = "<%@ page import=\"" + fQualifiedName + "\" %>"; //$NON-NLS-1$ //$NON-NLS-2$
+			}
+
+			try {
+				IRegion line = model.getLineInformationOfOffset(hint);
+				boolean prependNewLine = line.getOffset() + line.getLength() == hint;
+				boolean appendNewLine = hint == 0;
+				if (prependNewLine)
+					directive = model.getLineDelimiter() + directive;
+				if (appendNewLine)
+					directive = directive + model.getLineDelimiter();
+				adjustmentLength = directive.length();
+			}
+			catch (BadLocationException e) {
+				// ignore
+			}
+
+			try {
+				model.replace(hint, 0, directive);
+
+			}
+			catch (BadLocationException e) {
+				// Not that we should ever get a BLE, but if so, our
+				// replacement offset from the Content Assist call should
+				// work
+				try {
+					model.replace(getReplacementOffset(), 0, directive);
+					adjustmentLength = directive.length();
+				}
+				catch (BadLocationException e2) {
+					// now what?
+				}
+			}
+		}
+		return adjustmentLength;
+	}
+
+	/**
+	 * See if the import specification is a wildcard import, and if so, that
+	 * it applies to the given type.
+	 */
+	protected boolean isWildcardMatch(String importSpec, String type) {
+		int specLength = importSpec.length();
+		if (importSpec.endsWith("*") && specLength > 2 && type.length() >= specLength) { //$NON-NLS-1$
+			// pull out the package name including the final '.'
+			String container = importSpec.substring(0, specLength - 1);
+			// verify that the type is in the container's hierarchy and that
+			// there are no other package separators afterwards
+			if (type.startsWith(container) && type.indexOf('.', specLength - 1) < 0) {
+				// container matches
+				return true;
+			}
+		}
+		return false;
+	}
+
+	protected boolean importHandles(String type, List listOfImports) {
+		Iterator imports = listOfImports.iterator();
+		while (imports.hasNext()) {
+			String importSpec = StringUtils.strip(imports.next().toString());
+			if (importSpec.equals(type) || isWildcardMatch(importSpec, type))
+				return true;
+		}
+		return false;
+	}
+
+	public void apply(IDocument document, char trigger, int offset) {
+		// If we have a parsed IStructuredDocument, insert the short name instead of the
+		// fully qualified name and a import page directive if
+		// needed.  Do the import first so the cursor goes to the right location
+		// and we don't surprise the user.
+
+		boolean addShortForm = false; //document instanceof IStructuredDocument && fContainerName != null && fContainerName.length() > 0;
+		if (addShortForm) {
+			setReplacementString('"' + fShortName + '"');
+			int importLength = applyImport((IStructuredDocument) document);
+			setReplacementOffset(getReplacementOffset() + importLength);
+		}
+
+		setCursorPosition(getReplacementString().length());
+		super.apply(document, trigger, offset);
+
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension1#apply(org.eclipse.jface.text.ITextViewer, char, int, int)
+	 */
+	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
+		// CMVC 243815
+		// (pa) this is overridden to get around replacement length modification
+		// which is done in the super (since eclipse 2.1)
+		apply(viewer.getDocument(), trigger, offset);
+	}
+
+	// code is borrowed from JavaCompletionProposal
+	protected boolean startsWith(IDocument document, int offset, String word) {
+		int wordLength = word == null ? 0 : word.length();
+		if (offset > getReplacementOffset() + wordLength)
+			return false;
+
+		try {
+			int length = offset - getReplacementOffset();
+			// CMVC 243817
+			// slightly modified to be a little more flexible for attribute value string matching..
+			String start = StringUtils.stripQuotes(document.get(getReplacementOffset(), length));
+			return word.toLowerCase().startsWith(start.toLowerCase()) || fQualifiedName.toLowerCase().startsWith(start.toLowerCase());
+			//return word.substring(0, length).equalsIgnoreCase(start);
+		}
+		catch (BadLocationException x) {
+			// ignore
+		}
+
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal#validate(org.eclipse.jface.text.IDocument, int, org.eclipse.jface.text.DocumentEvent)
+	 //	 */
+	//	public boolean validate(IDocument document, int offset, org.eclipse.jface.text.DocumentEvent event) {
+	//		return super.validate(document, offset, event);
+	//	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal#selected(org.eclipse.jface.text.ITextViewer, boolean)
+	 */
+	public void selected(ITextViewer viewer, boolean smartToggle) {
+		// (pa) we currently don't use smart toggle...
+		super.selected(viewer, false);
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeFinder.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeFinder.java
new file mode 100644
index 0000000..f11c3b1
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeFinder.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.core.search.SearchPattern;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceConstants;
+
+/**
+ * @plannedfor 1.0
+ */
+public class JavaTypeFinder {
+
+	public static ICompletionProposal[] getBeanProposals(IResource resource, int replacementStart, int replacementLength) {
+		ICompletionProposal[] typeProposals = getTypeProposals(resource, replacementStart, replacementLength);
+		ICompletionProposal[] serialProposals = getSerializedProposals(resource, replacementStart, replacementLength);
+		ICompletionProposal[] beanProposals = new ICompletionProposal[typeProposals.length + serialProposals.length];
+
+		int i;
+		for (i = 0; i < serialProposals.length; i++) {
+			beanProposals[i] = serialProposals[i];
+		}
+		for (i = serialProposals.length; i < serialProposals.length + typeProposals.length; i++) {
+			beanProposals[i] = typeProposals[i - serialProposals.length];
+		}
+		return beanProposals;
+	}
+
+	private static void getMembers(IContainer container, List membersList) {
+		try {
+			IResource[] members = container.members(true);
+			if (members != null) {
+				for (int i = 0; i < members.length; i++) {
+					if (members[i].getType() == IResource.FILE)
+						membersList.add(members[i]);
+					else if (members[i].getType() == IResource.FOLDER)
+						getMembers((IContainer) members[i], membersList);
+				}
+			}
+		}
+		catch (CoreException e) {
+			// do nothing
+		}
+	}
+
+	private static ICompletionProposal[] getSerializedProposals(IResource resource, int replacementStart, int replacementLength) {
+		List names = new ArrayList();
+		List resources = new ArrayList();
+		getMembers(resource.getProject(), resources);
+		IResource memberResource = null;
+		for (int i = 0; i < resources.size(); i++) {
+			memberResource = (IResource) resources.get(i);
+			if (memberResource.getType() == IResource.FILE && memberResource.getName().endsWith(".ser")) { //$NON-NLS-1$
+				String path = URIHelper.normalize(memberResource.getFullPath().toString(), resource.getFullPath().toString(), resource.getProject().getFullPath().toString());
+				if (path != null) {
+					names.add(new CustomCompletionProposal("\"" + path + "\"", //$NON-NLS-1$ //$NON-NLS-2$
+								replacementStart, replacementLength, path.length() + 2, null, path, null, null, IRelevanceConstants.R_NONE));
+				}
+			}
+		}
+		return (ICompletionProposal[]) names.toArray(new ICompletionProposal[names.size()]);
+	}
+
+	/**
+	 *
+	 * @param resource
+	 * @param replacementStart
+	 * @param replacementLength
+	 * @param searchFor IJavaSearchConstants.TYPE, IJavaSearchConstants.CLASS
+	 * @return
+	 */
+	private static ICompletionProposal[] findProposals(IResource resource, int replacementStart, int replacementLength, int searchFor, boolean ignoreAbstractClasses) {
+
+		JavaTypeNameRequestor requestor = new JavaTypeNameRequestor();
+		requestor.setJSPOffset(replacementStart);
+		requestor.setReplacementLength(replacementLength);
+		requestor.setIgnoreAbstractClasses(ignoreAbstractClasses);
+
+		try {
+			IJavaElement[] elements = new IJavaElement[]{getJavaProject(resource)};
+			IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
+			new SearchEngine().searchAllTypeNames(null, null, SearchPattern.R_PATTERN_MATCH | SearchPattern.R_PREFIX_MATCH, searchFor, scope, requestor, IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
+
+		}
+		catch (CoreException exc) {
+			Logger.logException(exc);
+		}
+		catch (Exception exc) { 
+			// JavaModel
+			Logger.logException(exc);
+		}
+		return requestor.getProposals();
+	}
+
+	public static ICompletionProposal[] getTypeProposals(IResource resource, int replacementStart, int replacementLength) {
+		return findProposals(resource, replacementStart, replacementLength, IJavaSearchConstants.TYPE, false);
+	}
+	
+	public static ICompletionProposal[] getClassProposals(IResource resource, int replacementStart, int replacementLength) {
+		return findProposals(resource, replacementStart, replacementLength, IJavaSearchConstants.CLASS, true);
+	}
+
+	private static IJavaProject getJavaProject(IResource resource) {
+		IProject proj = resource.getProject();
+		IJavaProject javaProject = JavaCore.create(proj);
+		return javaProject;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeNameRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeNameRequestor.java
new file mode 100644
index 0000000..61a2dd8
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeNameRequestor.java
@@ -0,0 +1,121 @@
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.core.CompletionProposal;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.core.search.TypeNameRequestor;
+import org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceConstants;
+
+/**
+ * Use w/ JDT search engine to find all type names.
+ * Creates proposals from matches reported.
+ *
+ * @plannedfor 1.0
+ */
+public class JavaTypeNameRequestor extends TypeNameRequestor {
+	
+	private int fJSPOffset = -1;
+	private int fReplacementLength = -1;
+	private List fProposals = new ArrayList();
+	private boolean fIgnoreAbstractClasses = false;
+	
+	private CompletionProposalLabelProvider fLabelProvider = new CompletionProposalLabelProvider();
+	
+	public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path) {
+
+        int offset = getJSPOffset();
+        int length = getReplacementLength();
+		
+		// somehow offset or length was set incorrectly
+		if(offset == -1 || length == -1)
+			return;
+		// ignore abstract classes?
+		if(ignoreAbstractClasses() && Flags.isAbstract(modifiers))
+			return;
+		
+		Image image = calculateImage(modifiers);
+		
+        String containerNameString = new String(packageName);
+        String typeNameString = String.valueOf(simpleTypeName);
+			
+        // containername can be null
+        String fullName = concatenateName(containerNameString, typeNameString);
+
+        String simpleName = Signature.getSimpleName(fullName);
+        StringBuffer buf = new StringBuffer(simpleName);
+        String typeQualifier = Signature.getQualifier(fullName);
+        if (typeQualifier.length() > 0) {
+            buf.append(" - "); //$NON-NLS-1$
+            buf.append(typeQualifier);
+        }
+		
+        JavaTypeCompletionProposal proposal = new JavaTypeCompletionProposal(fullName, offset, length, fullName, image, typeNameString, typeQualifier, IRelevanceConstants.R_NONE, true);
+        proposal.setTriggerCharacters(JSPProposalCollector.getTypeTriggers());
+		fProposals.add(proposal);
+	}
+
+
+	private Image calculateImage(int modifiers) {
+		CompletionProposal p = CompletionProposal.create(CompletionProposal.TYPE_REF, getJSPOffset());
+		p.setFlags(modifiers);
+		
+		//https://bugs.eclipse.org/bugs/show_bug.cgi?id=102206
+		char[] sig = new char[]{Signature.C_UNRESOLVED};
+		p.setSignature(sig);
+		
+		ImageDescriptor descriptor = fLabelProvider.createImageDescriptor(p);
+		Image image = JSPEditorPluginImageHelper.getInstance().getImage(descriptor);
+		return image;
+	}
+	
+    /**
+     * Concatenates two names. Uses a dot for separation. Both strings can be
+     * empty or <code>null</code>.
+     */
+    public String concatenateName(String name1, String name2) {
+        StringBuffer buf = new StringBuffer();
+        if (name1 != null && name1.length() > 0) {
+            buf.append(name1);
+        }
+        if (name2 != null && name2.length() > 0) {
+            if (buf.length() > 0) {
+                buf.append('.');
+            }
+            buf.append(name2);
+        }
+        return buf.toString();
+    }
+	
+	int getJSPOffset() {
+		return fJSPOffset;
+	}
+
+	void setJSPOffset(int offset) {
+		fJSPOffset = offset;
+	}
+
+	int getReplacementLength() {
+		return fReplacementLength;
+	}
+
+	void setReplacementLength(int replacementLength) {
+		fReplacementLength = replacementLength;
+	}
+	void setIgnoreAbstractClasses(boolean ignore) {
+		fIgnoreAbstractClasses = ignore;
+	}
+	boolean ignoreAbstractClasses() {
+		return fIgnoreAbstractClasses;
+	}
+	
+	JavaTypeCompletionProposal[] getProposals() {
+		return (JavaTypeCompletionProposal[])fProposals.toArray(new JavaTypeCompletionProposal[fProposals.size()]);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/LibraryTagsCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/LibraryTagsCompletionProposalComputer.java
new file mode 100644
index 0000000..92cd295
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/LibraryTagsCompletionProposalComputer.java
@@ -0,0 +1,516 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jst.jsp.core.internal.contentmodel.JSPCMDocumentFactory;
+import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP20Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
+import org.eclipse.wst.html.core.internal.contentmodel.JSPCMDocument;
+import org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
+import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
+import org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
+import org.eclipse.wst.xml.ui.internal.editor.CMImageUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * <p>Computes tags provided by tag libraries completion proposals.</p>
+ * 
+ * <p>Extends the {@link HTMLTagsCompletionProposalComputer} to benefit from
+ * its work for determining the correct {@link XMLContentModelGenerator} to use</p>
+ */
+public class LibraryTagsCompletionProposalComputer extends
+	HTMLTagsCompletionProposalComputer {
+	
+	private int fDepthCount;
+
+	/**
+	 * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeContextInformation(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		return Collections.EMPTY_LIST;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer#validModelQueryNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)
+	 */
+	protected boolean validModelQueryNode(CMNode node) {
+		boolean isValid = false;
+		
+		//unwrap
+		if(node instanceof CMNodeWrapper) {
+			node = ((CMNodeWrapper)node).getOriginNode();
+		}
+		
+		//determine if is valid
+		if(node instanceof HTMLPropertyDeclaration) {
+			HTMLPropertyDeclaration propDec = (HTMLPropertyDeclaration)node;
+			isValid = propDec.isJSP();
+		} else if(node.supports(TLDElementDeclaration.IS_LIBRARY_TAG)){
+			Boolean isLibraryTag = (Boolean)node.getProperty(TLDElementDeclaration.IS_LIBRARY_TAG);
+			isValid = isLibraryTag != null && isLibraryTag.booleanValue();
+		}
+		
+		return isValid;
+	}
+	
+	/**
+	 * <p>JSP has none.  This overrides the default behavior to add in doctype proposals which
+	 * should really be contributed by the HTML tag computer</p>
+	 * 
+	 * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer#addStartDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addStartDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//jsp has none
+	}
+	
+	/**
+	 * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEmptyDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//jsp has none
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addTagCloseProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagCloseProposals(ContentAssistRequest contentAssistRequest, CompletionProposalInvocationContext context) {
+		//do nothing, html computer will take care of adding the > and /> suggestions
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+
+		if(!this.isXHTML) {
+			IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
+	
+			ModelQuery mq = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
+			if (mq != null) {
+				CMDocument doc = mq.getCorrespondingCMDocument(node);
+				// this shouldn't have to have the prefix coded in
+				if (doc instanceof JSPCMDocument || doc instanceof CMNodeWrapper ||
+						node.getNodeName().startsWith("jsp:")) { //$NON-NLS-1$
+					return;
+				}
+			}
+	
+			// Find the attribute name for which this position should have a value
+			IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
+			ITextRegionList openRegions = open.getRegions();
+			int i = openRegions.indexOf(contentAssistRequest.getRegion());
+			if (i < 0) {
+				return;
+			}
+			ITextRegion nameRegion = null;
+			while (i >= 0) {
+				nameRegion = openRegions.get(i--);
+				if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+					break;
+				}
+			}
+			
+			// on an empty value, add all the JSP and taglib tags
+			CMElementDeclaration elementDecl =
+				AbstractXMLModelQueryCompletionProposalComputer.getCMElementDeclaration(node);
+			if (nameRegion != null && elementDecl != null) {
+				String attributeName = open.getText(nameRegion);
+				if (attributeName != null) {
+					Node parent = contentAssistRequest.getParent();
+					
+					//ignore start quote in match string
+					String matchString = contentAssistRequest.getMatchString().trim();
+					if(matchString.startsWith("'") || matchString.startsWith("\"")) { //$NON-NLS-1$ //$NON-NLS-2$
+						matchString = matchString.substring(1);
+					}
+					
+					//get all the proposals
+					List additionalElements = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent(
+							(Element) node, elementDecl, ModelQuery.INCLUDE_ALL);
+					Iterator nodeIterator = additionalElements.iterator();
+					
+					//check each suggestion
+					while (nodeIterator.hasNext()) {
+						CMNode additionalElementDecl = (CMNode) nodeIterator.next();
+						if (additionalElementDecl != null && additionalElementDecl instanceof CMElementDeclaration &&
+								validModelQueryNode(additionalElementDecl)) {
+							CMElementDeclaration ed = (CMElementDeclaration) additionalElementDecl;
+							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89811
+							StringBuffer sb = new StringBuffer();
+							getContentGenerator().generateTag(parent, ed, sb);
+	
+							String proposedText = sb.toString();
+	
+							//filter out any proposals that dont match matchString
+							if (beginsWith(proposedText, matchString)) {
+								//wrap with ' because JSP attributes are warped with "
+								proposedText = "'" + proposedText; //$NON-NLS-1$
+								
+								//if its a container its possible the closing quote is already there
+								//don't want to risk injecting an extra
+								if(!(contentAssistRequest.getRegion() instanceof ITextRegionContainer)) {
+									proposedText += "'"; //$NON-NLS-1$
+								}
+								
+								//get the image
+								Image image = CMImageUtil.getImage(elementDecl);
+								if (image == null) {
+									image = this.getGenericTagImage();
+								}
+								
+								//create the proposal
+								int cursorAdjustment = getCursorPositionForProposedText(proposedText);
+								String proposedInfo = AbstractXMLModelQueryCompletionProposalComputer.getAdditionalInfo(
+										AbstractXMLModelQueryCompletionProposalComputer.getCMElementDeclaration(parent), elementDecl);
+								String tagname = getContentGenerator().getRequiredName(node, ed);
+								CustomCompletionProposal proposal = new CustomCompletionProposal(
+										proposedText, contentAssistRequest.getReplacementBeginPosition(),
+										contentAssistRequest.getReplacementLength(), cursorAdjustment, image, tagname, null, proposedInfo,
+										XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+								contentAssistRequest.addProposal(proposal);
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#setErrorMessage(java.lang.String)
+	 */
+	public void setErrorMessage(String errorMessage) {
+		if (fDepthCount == 0) {
+			super.setErrorMessage(errorMessage);
+		}
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getGenericTagImage()
+	 */
+	protected Image getGenericTagImage() {
+		return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getDeemphasizedTagImage()
+	 */
+	protected Image getDeemphasizedTagImage() {
+		return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getEmphasizedTagImage()
+	 */
+	protected Image getEmphasizedTagImage() {
+		return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP);
+	}
+	
+	//----------------------BELOW HERE SHOULD BE REMOVED ONCE BUG 211961 IS FIXED ---------------------
+	
+	/**
+	 * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagInsertionProposals(
+			ContentAssistRequest contentAssistRequest, int childPosition,
+			CompletionProposalInvocationContext context) {
+		
+		//get the default proposals
+		super.addTagInsertionProposals(contentAssistRequest, childPosition, context);
+		
+		/**
+		 * TODO: REMOVE THIS HACK - Bug 311961
+		 */
+		if(contentAssistRequest.getParent().getNodeType() == Node.DOCUMENT_NODE) {
+			this.forciblyAddTagLibAndJSPPropsoals((Document)contentAssistRequest.getParent(),
+					contentAssistRequest, childPosition);
+		}
+	}
+	
+	/**
+	 * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addTagNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagNameProposals(
+			ContentAssistRequest contentAssistRequest, int childPosition,
+			CompletionProposalInvocationContext context) {
+		
+		//get the default proposals
+		super.addTagNameProposals(contentAssistRequest, childPosition, context);
+		
+		/**
+		 * TODO: REMOVE THIS HACK - Bug 311961
+		 */
+		if(contentAssistRequest.getParent().getNodeType() == Node.DOCUMENT_NODE) {
+			this.forciblyAddTagLibAndJSPPropsoals((Document)contentAssistRequest.getParent(),
+					contentAssistRequest, childPosition);
+		}
+	}
+	
+	/**
+	 * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
+	 * <p>This is bad because it does not use the ModelQuery framework</p>
+	 * 
+	 * @param document
+	 * @param contentAssistRequest
+	 * @param childPosition
+	 */
+	private void forciblyAddTagLibAndJSPPropsoals(Document document, ContentAssistRequest contentAssistRequest, int childPosition) {
+		if (!isXMLFormat(document)) {
+			List additionalElements = forciblyGetTagLibAndJSPElements(new ArrayList(), document, childPosition);
+			
+			//convert CMElementDeclartions to proposals
+			for (int i = 0; i < additionalElements.size(); i++) {
+				CMElementDeclaration ed = (CMElementDeclaration) additionalElements.get(i);
+				if (ed != null) {
+					Image image = CMImageUtil.getImage(ed);
+					if (image == null) {
+						image = this.getGenericTagImage();
+					}
+					String proposedText = getRequiredText(document, ed);
+					String tagname = getRequiredName(document, ed);
+					// account for the &lt; and &gt;
+					int markupAdjustment = getContentGenerator().getMinimalStartTagLength(document, ed);
+					String proposedInfo = getAdditionalInfo(null, ed);
+					CustomCompletionProposal proposal = new CustomCompletionProposal(
+							proposedText, contentAssistRequest.getReplacementBeginPosition(),
+							contentAssistRequest.getReplacementLength(), markupAdjustment, image,
+							tagname, null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
+					contentAssistRequest.addProposal(proposal);
+				}
+			}
+		}
+	}
+	
+	/**
+	 * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
+	 * <p>This is bad because it does not use the ModelQuery framework, it
+	 * access the TLDCMDocumentManager directly</p>
+	 * <p>This is essentially a combination of the {@link TaglibModelQueryExtension} and
+	 * the {@link JSPModelQueryExtension} but it means any other extensions get left
+	 * out when creating content assist suggestion at the document root level</p>
+	 * 
+	 * @param elementDecls
+	 * @param node
+	 * @param childIndex
+	 * @return
+	 */
+	private List forciblyGetTagLibAndJSPElements(List elementDecls, Node node, int childIndex) {
+		if (node instanceof IDOMNode) {
+			/*
+			 * find the location of the intended insertion as it will give us
+			 * the correct offset for checking position dependent CMDocuments
+			 */
+			int textInsertionOffset = 0;
+			NodeList children = node.getChildNodes();
+			if (children.getLength() >= childIndex && childIndex >= 0) {
+				Node nodeAlreadyAtIndex = children.item(childIndex);
+				if (nodeAlreadyAtIndex instanceof IDOMNode)
+					textInsertionOffset = ((IDOMNode) nodeAlreadyAtIndex).getEndOffset();
+			}
+			else {
+				textInsertionOffset = ((IDOMNode) node).getStartOffset();
+			}
+			TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(((IDOMNode) node).getStructuredDocument());
+			if (mgr != null) {
+				List moreCMDocuments = mgr.getCMDocumentTrackers(textInsertionOffset);
+				if (moreCMDocuments != null) {
+					for (int i = 0; i < moreCMDocuments.size(); i++) {
+						CMDocument doc = (CMDocument) moreCMDocuments.get(i);
+						CMNamedNodeMap elements = doc.getElements();
+						if (elements != null) {
+							for (int j = 0; j < elements.getLength(); j++) {
+								CMElementDeclaration ed = (CMElementDeclaration) elements.item(j);
+								elementDecls.add(ed);
+							}
+						}
+					}
+				}
+			}
+
+			// get position dependent CMDocuments and insert their tags as
+			// proposals
+
+			ModelQueryAdapter mqAdapter = null;
+			if (node.getNodeType() == Node.DOCUMENT_NODE)
+				mqAdapter = (ModelQueryAdapter) ((IDOMNode) node).getAdapterFor(ModelQueryAdapter.class);
+			else
+				mqAdapter = (ModelQueryAdapter) ((IDOMNode) node.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
+
+			if (mqAdapter != null) {
+				CMDocument doc = mqAdapter.getModelQuery().getCorrespondingCMDocument(node);
+				if (doc != null) {
+					CMDocument jcmdoc = getDefaultJSPCMDocument((IDOMNode) node);
+					CMNamedNodeMap jspelements = jcmdoc.getElements();
+
+					/*
+					 * For a built-in JSP action the content model is properly
+					 * set up, so don't just blindly add the rest--unless this
+					 * will be a direct child of the document
+					 */
+					if (jspelements != null && (!(doc instanceof JSPCMDocument) || node.getNodeType() == Node.DOCUMENT_NODE)) {
+						List rejectElements = new ArrayList();
+
+						// determine if the document is in XML form
+						Document domDoc = null;
+						if (node.getNodeType() == Node.DOCUMENT_NODE)
+							domDoc = (Document) node;
+						else
+							domDoc = node.getOwnerDocument();
+
+						// Show XML tag forms of JSP markers if jsp:root is
+						// the document element OR it's HTML but
+						// isn't really in the text.
+						// If the document isn't strictly XML, pull out the
+						// XML tag forms it is xml format
+						rejectElements.add(JSP12Namespace.ElementName.SCRIPTLET);
+						rejectElements.add(JSP12Namespace.ElementName.EXPRESSION);
+						rejectElements.add(JSP12Namespace.ElementName.DECLARATION);
+						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_INCLUDE);
+						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_PAGE);
+						rejectElements.add(JSP12Namespace.ElementName.TEXT);
+						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
+						rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_TAG);
+						rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_ATTRIBUTE);
+						rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_VARIABLE);
+						if (isXMLFormat(domDoc)) {
+							// jsp actions
+							rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
+							rejectElements.add(JSP12Namespace.ElementName.USEBEAN);
+							rejectElements.add(JSP12Namespace.ElementName.GETPROPERTY);
+							rejectElements.add(JSP12Namespace.ElementName.SETPROPERTY);
+							rejectElements.add(JSP12Namespace.ElementName.INCLUDE);
+							rejectElements.add(JSP12Namespace.ElementName.FORWARD);
+							rejectElements.add(JSP12Namespace.ElementName.PLUGIN);
+							rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
+							rejectElements.add(JSP12Namespace.ElementName.PARAM);
+							rejectElements.add(JSP12Namespace.ElementName.PARAMS);
+						}
+
+
+						// don't show jsp:root if a document element already
+						// exists
+						Element docElement = domDoc.getDocumentElement();
+						if (docElement != null && ((docElement.getNodeName().equals("jsp:root")) || ((((IDOMNode) docElement).getStartStructuredDocumentRegion() != null || ((IDOMNode) docElement).getEndStructuredDocumentRegion() != null)))) //$NON-NLS-1$
+							rejectElements.add(JSP12Namespace.ElementName.ROOT);
+
+						for (int j = 0; j < jspelements.getLength(); j++) {
+							CMElementDeclaration ed = (CMElementDeclaration) jspelements.item(j);
+							if (rejectElements.contains(ed.getNodeName()))
+								continue;
+							elementDecls.add(ed);
+						}
+
+					}
+				}
+				// No cm document (such as for the Document (a non-Element) node itself)
+				else {
+					CMNamedNodeMap jspElements = getDefaultJSPCMDocument((IDOMNode) node).getElements();
+					int length = jspElements.getLength();
+					for (int i = 0; i < length; i++) {
+						elementDecls.add(jspElements.item(i));
+					}
+				}
+			}
+		}
+		return elementDecls;
+	}
+	
+	/**
+	 * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
+	 * 
+	 * For JSP files and segments, this is just the JSP document, but when
+	 * editing tag files and their fragments, it should be the tag document.
+	 * 
+	 * It may also vary based on the model being edited in the future.
+	 * 
+	 * @return the default non-embedded CMDocument for the document being
+	 *         edited.
+	 */
+	private CMDocument getDefaultJSPCMDocument(IDOMNode node) {
+		// handle tag files here
+		String contentType = node.getModel().getContentTypeIdentifier();
+		if (ContentTypeIdForJSP.ContentTypeID_JSPTAG.equals(contentType))
+			return JSPCMDocumentFactory.getCMDocument(CMDocType.TAG20_DOC_TYPE);
+
+		CMDocument jcmdoc = null;
+		String modelPath = node.getModel().getBaseLocation();
+		if (modelPath != null && !IModelManager.UNMANAGED_MODEL.equals(modelPath)) {
+			float version = DeploymentDescriptorPropertyCache.getInstance().getJSPVersion(new Path(modelPath));
+			jcmdoc = JSPCMDocumentFactory.getCMDocument(version);
+		}
+		if (jcmdoc == null) {
+			jcmdoc = JSPCMDocumentFactory.getCMDocument();
+		}
+
+		return jcmdoc;
+	}
+	
+	private boolean isXMLFormat(Document doc) {
+		if (doc == null)
+			return false;
+		Element docElement = doc.getDocumentElement();
+		return docElement != null && ((docElement.getNodeName().equals("jsp:root")) ||
+				((((IDOMNode) docElement).getStartStructuredDocumentRegion() == null &&
+						((IDOMNode) docElement).getEndStructuredDocumentRegion() == null))); //$NON-NLS-1$
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java
new file mode 100644
index 0000000..a53c8e0
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.ui.internal.contentassist.NoRegionContentAssistProcessorForHTML;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.text.IStructuredPartitions;
+import org.eclipse.wst.xml.core.text.IXMLPartitions;
+
+/**
+ * @plannedfor 1.0
+ */
+public class NoRegionContentAssistProcessorForJSP extends NoRegionContentAssistProcessorForHTML {
+
+	private String[] fJSPContexts = null;
+
+	public NoRegionContentAssistProcessorForJSP() {
+		super();
+		initJSPContexts();
+	}
+
+	/* 
+	 * @see org.eclipse.wst.html.ui.internal.contentassist.NoRegionContentAssistProcessorForHTML#initPartitionToProcessorMap()
+	 */
+	protected void initPartitionToProcessorMap() {
+		super.initPartitionToProcessorMap();
+		IContentAssistProcessor jspContentAssistProcessor = new JSPContentAssistProcessor();
+
+		// JSP
+		addPartitionProcessor(IStructuredPartitions.DEFAULT_PARTITION, jspContentAssistProcessor);
+		addPartitionProcessor(IXMLPartitions.XML_DEFAULT, jspContentAssistProcessor);
+		addPartitionProcessor(IHTMLPartitions.HTML_DEFAULT, jspContentAssistProcessor);
+		addPartitionProcessor(IHTMLPartitions.HTML_COMMENT, jspContentAssistProcessor);
+		addPartitionProcessor(IJSPPartitions.JSP_DEFAULT, jspContentAssistProcessor);
+		addPartitionProcessor(IJSPPartitions.JSP_DIRECTIVE, jspContentAssistProcessor);
+		addPartitionProcessor(IJSPPartitions.JSP_CONTENT_DELIMITER, jspContentAssistProcessor);
+		addPartitionProcessor(IJSPPartitions.JSP_CONTENT_JAVASCRIPT, jspContentAssistProcessor);
+
+		IContentAssistProcessor jspJavaContentAssistProcessor = new JSPJavaContentAssistProcessor();
+		addPartitionProcessor(IJSPPartitions.JSP_CONTENT_JAVA, jspJavaContentAssistProcessor);
+
+	}
+
+	protected void initNameToProcessorMap() {
+		super.initNameToProcessorMap();
+		JSPPropertyContentAssistProcessor jspPropertyCAP = new JSPPropertyContentAssistProcessor();
+		addNameProcessor(JSP11Namespace.ElementName.SETPROPERTY, jspPropertyCAP);
+		addNameProcessor(JSP11Namespace.ElementName.GETPROPERTY, jspPropertyCAP);
+		addNameProcessor(JSP11Namespace.ElementName.USEBEAN, new JSPUseBeanContentAssistProcessor());
+	}
+
+	private void initJSPContexts() {
+		fJSPContexts = new String[]{DOMJSPRegionContexts.JSP_CLOSE, DOMJSPRegionContexts.JSP_CONTENT, DOMJSPRegionContexts.JSP_DECLARATION_OPEN, DOMJSPRegionContexts.JSP_EXPRESSION_OPEN, DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN};
+	}
+
+	/**
+	 * Quick check to see if context (String) should map to
+	 * JSPContentAssistProcessor.
+	 * 
+	 * @param context
+	 * @return if it's a JSP Region (for which we need JSP Content assist)
+	 */
+	private boolean isJSPRegion(IStructuredDocumentRegion sdRegion) {
+		String context = sdRegion.getType();
+		for (int i = 0; i < fJSPContexts.length; i++) {
+			if (context == fJSPContexts[i])
+				return true;
+		}
+		return false;
+	}
+
+	protected IContentAssistProcessor guessContentAssistProcessor(ITextViewer viewer, int documentOffset) {
+		IContentAssistProcessor p = super.guessContentAssistProcessor(viewer, documentOffset);
+		if (p == null) {
+			IStructuredDocumentRegion sdRegion = ((IStructuredDocument) viewer.getDocument()).getRegionAtCharacterOffset(documentOffset);
+			if (isJSPRegion(sdRegion))
+				p = getPartitionProcessor(IJSPPartitions.JSP_CONTENT_JAVA);
+		}
+		return p;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/ReplaceNameTemplateContext.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/ReplaceNameTemplateContext.java
new file mode 100644
index 0000000..0e06e6a
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/ReplaceNameTemplateContext.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.templates.DocumentTemplateContext;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateBuffer;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.TemplateException;
+import org.eclipse.jface.text.templates.TemplateVariable;
+
+/**
+ * Just like DocumentTemplateContext except if an insert offset is passed in,
+ * during evaluation, the "prefix" before the template will be checked to see
+ * if it matches the template name. If so, overwrite the template name.
+ * Otherwise, just insert the template at the insert offset location (by not
+ * overwriting the prefix text)
+ */
+public class ReplaceNameTemplateContext extends DocumentTemplateContext {
+	private int fInsertOffset = -1;
+
+	/**
+	 * Creates a document template context.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param offset
+	 *            the offset of the document region
+	 * @param length
+	 *            the length of the document region
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length) {
+		this(type, document, new Position(offset, length));
+	}
+
+	/**
+	 * Creates a document template context. The supplied <code>Position</code>
+	 * will be queried to compute the <code>getStart</code> and
+	 * <code>getEnd</code> methods, which will therefore answer updated
+	 * position data if it is registered with the document.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param position
+	 *            the position describing the area of the document which forms
+	 *            the template context
+	 * @since 3.1
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, Position position) {
+		super(type, document, position);
+	}
+
+	/**
+	 * Creates a document template context.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param offset
+	 *            the offset of the document region
+	 * @param length
+	 *            the length of the document region
+	 * @param insertOffset
+	 *            the offset of the document region where insert was
+	 *            originally requested
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length, int insertOffset) {
+		this(type, document, new Position(offset, length));
+		fInsertOffset = insertOffset;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.templates.TemplateContext#evaluate(org.eclipse.jface.text.templates.Template)
+	 */
+	public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException {
+		TemplateBuffer buffer = super.evaluate(template);
+		if (buffer != null) {
+			if (fInsertOffset > -1 && fInsertOffset > getStart()) {
+				String prefix = getDocument().get(getStart(), fInsertOffset - getStart());
+				if (!template.getName().startsWith(prefix)) {
+					// generate a new buffer that actually contains the
+					// text that was going to be overwritten
+					int prefixSize = prefix.length();
+					TemplateVariable[] newTemplateVar = buffer.getVariables();
+					for (int i =0; i < newTemplateVar.length; i++ ){
+						int[] offsets = newTemplateVar[i].getOffsets();
+						for (int j=0; j<offsets.length ;j++){
+							offsets[j] += prefixSize;
+						}
+					}
+					buffer = new TemplateBuffer(prefix + buffer.getString(), newTemplateVar);
+				}
+			}
+		}
+		return buffer;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java
new file mode 100644
index 0000000..3ae0798
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences     
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentproperties.ui;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PropertyPage;
+
+/**
+ * JSP Fragment Property Page
+ */
+public class JSPFContentSettingsPropertyPage extends PropertyPage {
+	private static final String SELECT_NONE = JSPUIMessages.JSPFContentSettingsPropertyPage_0;
+
+	// TODO: Figure out what to do with these strings/variables
+	private String[] fLanguages = {SELECT_NONE, "java", //$NON-NLS-1$
+				"javascript"}; //$NON-NLS-1$
+	private String[] fContentTypes = {SELECT_NONE, "application/xhtml+xml", //$NON-NLS-1$
+				"application/xml", //$NON-NLS-1$
+				"text/html", //$NON-NLS-1$
+				"text/xml",  //$NON-NLS-1$
+				"text/css"}; //$NON-NLS-1$
+
+
+	private Combo fLanguageCombo;
+	private Combo fContentTypeCombo;
+
+	public JSPFContentSettingsPropertyPage() {
+		super();
+		setDescription(JSPUIMessages.JSPFContentSettingsPropertyPage_1);
+	}
+
+	private Composite createComposite(Composite parent, int numColumns) {
+		Composite composite = new Composite(parent, SWT.NULL);
+
+		// GridLayout
+		GridLayout layout = new GridLayout();
+		layout.numColumns = numColumns;
+		composite.setLayout(layout);
+
+		// GridData
+		GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
+		data.horizontalIndent = 0;
+		composite.setLayoutData(data);
+
+		return composite;
+	}
+
+	protected Control createContents(Composite parent) {
+		Composite propertyPage = createComposite(parent, 2);
+
+		// fragment language control
+		Text languageLabel = new Text(propertyPage, SWT.READ_ONLY);
+		languageLabel.setText(JSPUIMessages.JSPFContentSettingsPropertyPage_2);
+		fLanguageCombo = new Combo(propertyPage, SWT.NONE);
+		GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
+		data.horizontalIndent = 0;
+		fLanguageCombo.setLayoutData(data);
+		fLanguageCombo.setItems(fLanguages);
+
+		// fragment content type control
+		Text contentTypeLabel = new Text(propertyPage, SWT.READ_ONLY);
+		contentTypeLabel.setText(JSPUIMessages.JSPFContentSettingsPropertyPage_3);
+		fContentTypeCombo = new Combo(propertyPage, SWT.NONE);
+		data = new GridData(GridData.FILL, GridData.FILL, true, false);
+		data.horizontalIndent = 0;
+		fContentTypeCombo.setLayoutData(data);
+		fContentTypeCombo.setItems(fContentTypes);
+
+		initializeValues();
+
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.JSP_FRAGMENT_HELPID);
+		Dialog.applyDialogFont(parent);
+		return propertyPage;
+	}
+
+	/**
+	 * Get the resource this properties page is for
+	 * 
+	 * @return IResource for this properties page or null if there is no
+	 *         IResource
+	 */
+	private IResource getResource() {
+		IResource resource = null;
+		IAdaptable adaptable = getElement();
+		if (adaptable instanceof IResource) {
+			resource = (IResource) adaptable;
+		} else if (adaptable != null) {
+			Object o = adaptable.getAdapter(IResource.class);
+			if (o instanceof IResource) {
+				resource = (IResource)o;
+			}
+		}
+		return resource;
+	}
+
+	private void initializeValues() {
+		String language = JSPFContentProperties.getProperty(JSPFContentProperties.JSPLANGUAGE, getResource(), false);
+		if (language == null || language.length() == 0) {
+			// if null, use none
+			language = SELECT_NONE;
+		}
+		/*
+		 * If item is already part of combo, select it. Otherwise, add to the
+		 * combobox.
+		 */
+		int index = fLanguageCombo.indexOf(language);
+		if (index > -1)
+			fLanguageCombo.select(index);
+		else
+			fLanguageCombo.setText(language);
+
+		String contentType = JSPFContentProperties.getProperty(JSPFContentProperties.JSPCONTENTTYPE, getResource(), false);
+		if (contentType == null || contentType.length() == 0) {
+			// if null, use none
+			contentType = SELECT_NONE;
+		}
+		/*
+		 * If item is already part of combo, select it. Otherwise, add to the
+		 * combobox.
+		 */
+		index = fContentTypeCombo.indexOf(contentType);
+		if (index > -1)
+			fContentTypeCombo.select(index);
+		else
+			fContentTypeCombo.setText(contentType);
+	}
+
+	protected void performDefaults() {
+		int index = fLanguageCombo.indexOf(SELECT_NONE);
+		if (index > -1)
+			fLanguageCombo.select(index);
+
+		index = fContentTypeCombo.indexOf(SELECT_NONE);
+		if (index > -1)
+			fContentTypeCombo.select(index);
+
+		super.performDefaults();
+	}
+
+	public boolean performOk() {
+		try {
+			// save the fragment language
+			String language = fLanguageCombo.getText();
+			if (language == null || language.length() == 0 || language.equalsIgnoreCase(SELECT_NONE)) {
+				// if none, use null
+				language = null;
+			}
+			JSPFContentProperties.setProperty(JSPFContentProperties.JSPLANGUAGE, getResource(), language);
+
+			// save fragment content type
+			String contentType = fContentTypeCombo.getText();
+			if (contentType == null || contentType.length() == 0 || contentType.equalsIgnoreCase(SELECT_NONE)) {
+				// if none, use null
+				contentType = null;
+			}
+			JSPFContentProperties.setProperty(JSPFContentProperties.JSPCONTENTTYPE, getResource(), contentType);
+		}
+		catch (CoreException e) {
+			// maybe in future, let user know there was a problem saving file
+			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+		}
+
+		return super.performOk();
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/ProjectJSPFContentSettingsPropertyPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/ProjectJSPFContentSettingsPropertyPage.java
new file mode 100644
index 0000000..31976b6
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/ProjectJSPFContentSettingsPropertyPage.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentproperties.ui;
+
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+
+public class ProjectJSPFContentSettingsPropertyPage extends JSPFContentSettingsPropertyPage {
+	public ProjectJSPFContentSettingsPropertyPage() {
+		setDescription(JSPUIMessages.ProjectJSPFContentSettingsPropertyPage_0);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/TagContentSettingsPropertyPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/TagContentSettingsPropertyPage.java
new file mode 100644
index 0000000..b637ba2
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/TagContentSettingsPropertyPage.java
@@ -0,0 +1,68 @@
+package org.eclipse.jst.jsp.ui.internal.contentproperties.ui;

+

+import org.eclipse.core.resources.IFile;

+import org.eclipse.core.resources.IResource;

+import org.eclipse.core.resources.ProjectScope;

+import org.eclipse.core.runtime.preferences.DefaultScope;

+import org.eclipse.jface.layout.GridDataFactory;

+import org.eclipse.jface.preference.ComboFieldEditor;

+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;

+import org.eclipse.jst.jsp.core.internal.modelquery.TagModelQuery;

+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;

+import org.eclipse.swt.SWT;

+import org.eclipse.swt.layout.GridLayout;

+import org.eclipse.swt.widgets.Composite;

+import org.eclipse.swt.widgets.Control;

+import org.eclipse.ui.IWorkbenchPropertyPage;

+import org.eclipse.ui.dialogs.PropertyPage;

+import org.eclipse.ui.preferences.ScopedPreferenceStore;

+

+public class TagContentSettingsPropertyPage extends PropertyPage implements IWorkbenchPropertyPage {

+	private static final String[] fDisplayTypes = {"HTML", "XML"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

+	private static final String[] fValues = {"text/html", "text/xml"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

+	private ComboFieldEditor fComboFieldEditor;

+

+	public TagContentSettingsPropertyPage() {

+		super();

+		noDefaultAndApplyButton();

+		setDescription(JSPUIMessages.TagPropertyPage_desc);

+	}

+

+	protected Control createContents(Composite parent) {

+		Composite composite = new Composite(parent, SWT.NONE);

+		composite.setLayoutData(GridDataFactory.fillDefaults());

+		composite.setLayout(new GridLayout(2, true));

+

+		Object adapter = getElement().getAdapter(IFile.class);

+		if (adapter == null) {

+			adapter = getElement().getAdapter(IResource.class);

+		}

+		if (adapter != null && adapter instanceof IResource) {

+			String preferenceKey = TagModelQuery.createPreferenceKey(((IResource) adapter).getFullPath());

+			new DefaultScope().getNode(JSPCorePlugin.getDefault().getBundle().getSymbolicName()).put(preferenceKey, fValues[0]);

+			ScopedPreferenceStore store = new ScopedPreferenceStore(new ProjectScope(((IResource) adapter).getProject()), JSPCorePlugin.getDefault().getBundle().getSymbolicName());

+

+			String[][] entryNamesAndValues = new String[][]{{fDisplayTypes[0], fValues[0]}, {fDisplayTypes[1], fValues[1]}};

+			fComboFieldEditor = new ComboFieldEditor(preferenceKey, JSPUIMessages.JSPFContentSettingsPropertyPage_2, entryNamesAndValues, composite);

+			fComboFieldEditor.fillIntoGrid(composite, 2);

+			fComboFieldEditor.setPreferenceStore(store);

+			fComboFieldEditor.load();

+

+			// let the page save for us if needed

+			setPreferenceStore(store);

+		}

+		return composite;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see org.eclipse.jface.preference.PreferencePage#performOk()

+	 */

+	public boolean performOk() {

+		if (fComboFieldEditor != null) {

+			fComboFieldEditor.store();

+		}

+		return super.performOk();

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/derived/SingleCharReader.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/derived/SingleCharReader.java
new file mode 100644
index 0000000..e198a27
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/derived/SingleCharReader.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *******************************************************************************/
+
+package org.eclipse.jst.jsp.ui.internal.derived;
+
+import java.io.IOException;
+import java.io.Reader;
+
+/*
+ * Copied from org.eclipse.jdt.internal.corext.javadoc.SingleCharReader.
+ * Modification was made to fix statement unnecessarily nested within else
+ * clause warning in read(..).
+ */
+public abstract class SingleCharReader extends Reader {
+
+	/**
+	 * @see Reader#read()
+	 */
+	public abstract int read() throws IOException;
+
+	/**
+	 * @see Reader#read(char[],int,int)
+	 */
+	public int read(char cbuf[], int off, int len) throws IOException {
+		int end = off + len;
+		for (int i = off; i < end; i++) {
+			int ch = read();
+			if (ch == -1) {
+				if (i == off) {
+					return -1;
+				}
+				return i - off;
+			}
+			cbuf[i] = (char) ch;
+		}
+		return len;
+	}
+
+	/**
+	 * @see Reader#ready()
+	 */
+	public boolean ready() throws IOException {
+		return true;
+	}
+
+	/**
+	 * Gets the content as a String
+	 */
+	public String getString() throws IOException {
+		StringBuffer buf = new StringBuffer();
+		int ch;
+		while ((ch = read()) != -1) {
+			buf.append((char) ch);
+		}
+		return buf.toString();
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java
new file mode 100644
index 0000000..4a9715e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.editor;
+
+import java.util.ResourceBundle;
+
+import org.eclipse.jdt.ui.actions.RefactorActionGroup;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jst.jsp.ui.internal.IActionConstantsJSP;
+import org.eclipse.jst.jsp.ui.internal.IActionDefinitionIdsJSP;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.RetargetTextEditorAction;
+import org.eclipse.wst.html.ui.internal.edit.ui.ActionContributorHTML;
+import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
+
+/**
+ * ActionContributorJSP
+ * 
+ * This class should not be used inside multi page editor's
+ * ActionBarContributor, since cascaded init() call from the
+ * ActionBarContributor will causes exception and it leads to lose whole
+ * toolbars.
+ * 
+ * Instead, use SourcePageActionContributor for source page contributor of
+ * multi page editor.
+ * 
+ * Note that this class is still valid for single page editor.
+ */
+public class ActionContributorJSP extends ActionContributorHTML {
+
+	private RetargetTextEditorAction renameElementAction = null;
+	private RetargetTextEditorAction moveElementAction = null;
+	private IMenuManager refactorMenu = null;
+
+	private static final String[] EDITOR_IDS = {"org.eclipse.jst.jsp.core.jspsource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
+
+	public ActionContributorJSP() {
+		super();
+
+		ResourceBundle bundle = JSPUIMessages.getResourceBundle();
+		this.renameElementAction = new RetargetTextEditorAction(bundle, IActionConstantsJSP.ACTION_NAME_RENAME_ELEMENT + StructuredTextEditorActionConstants.UNDERSCORE);
+		this.renameElementAction.setActionDefinitionId(IActionDefinitionIdsJSP.RENAME_ELEMENT);
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(this.renameElementAction, IHelpContextIds.JSP_REFACTORRENAME_HELPID);
+
+		this.moveElementAction = new RetargetTextEditorAction(bundle, IActionConstantsJSP.ACTION_NAME_MOVE_ELEMENT + StructuredTextEditorActionConstants.UNDERSCORE);
+		this.moveElementAction.setActionDefinitionId(IActionDefinitionIdsJSP.MOVE_ELEMENT);
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(this.moveElementAction, IHelpContextIds.JSP_REFACTORMOVE_HELPID);
+
+		// the refactor menu, add the menu itself to add all refactor actions
+		this.refactorMenu = new MenuManager(JSPUIMessages.ActionContributorJSP_0, RefactorActionGroup.MENU_ID); //$NON-NLS-1$
+		refactorMenu.add(this.renameElementAction);
+		refactorMenu.add(this.moveElementAction);
+	}
+
+
+	protected String[] getExtensionIDs() {
+		return EDITOR_IDS;
+	}
+
+
+	protected void addToMenu(IMenuManager menu) {
+		super.addToMenu(menu);
+
+		menu.insertAfter(IWorkbenchActionConstants.M_EDIT, this.refactorMenu);
+	}
+
+
+	public void setActiveEditor(IEditorPart activeEditor) {
+
+		super.setActiveEditor(activeEditor);
+		this.renameElementAction.setAction(getAction(getTextEditor(getActiveEditorPart()), IActionConstantsJSP.ACTION_NAME_RENAME_ELEMENT));
+		this.moveElementAction.setAction(getAction(getTextEditor(getActiveEditorPart()), IActionConstantsJSP.ACTION_NAME_MOVE_ELEMENT));
+	}
+
+
+	public void setViewerSpecificContributionsEnabled(boolean enabled) {
+
+		super.setViewerSpecificContributionsEnabled(enabled);
+		this.renameElementAction.setEnabled(enabled);
+		this.moveElementAction.setEnabled(enabled);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/IHelpContextIds.java
new file mode 100644
index 0000000..7019360
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/IHelpContextIds.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.editor;
+
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+
+/**
+ * Help context ids for the JSP Source Editor.
+ * <p>
+ * This interface contains constants only; it is not intended to be
+ * implemented.
+ * </p>
+ * 
+ */
+public interface IHelpContextIds {
+	// org.eclipse.jst.jsp.ui.
+	public static final String PREFIX = JSPUIPlugin.ID + "."; //$NON-NLS-1$
+
+
+	// // figured out on the fly
+	// // JSP Source page editor
+	// public static final String JSP_SOURCEVIEW_HELPID =
+	// ContentTypeIdForJSP.ContentTypeID_JSP +"_source_HelpId"; //$NON-NLS-1$
+
+	// JSP Files Preference page
+	public static final String JSP_PREFWEBX_FILES_HELPID = PREFIX + "webx0050"; //$NON-NLS-1$
+	// JSP Styles Preference page
+	public static final String JSP_PREFWEBX_STYLES_HELPID = PREFIX + "webx0051"; //$NON-NLS-1$
+	// JSP Templates Preference page
+	public static final String JSP_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0052"; //$NON-NLS-1$
+
+
+	// JSP Fragment Property Page
+	public static final String JSP_FRAGMENT_HELPID = PREFIX + "jspf1000"; //$NON-NLS-1$
+
+	// JSP Source Editor Context Menu
+	// Refactor Rename
+	public static final String JSP_REFACTORRENAME_HELPID = PREFIX + "jspr0010"; //$NON-NLS-1$
+
+	// Refactor Move
+	public static final String JSP_REFACTORMOVE_HELPID = PREFIX + "jspr0020"; //$NON-NLS-1$
+
+	// JSP New File Wizard - Template Page
+	public static final String JSP_NEWWIZARD_TEMPLATE_HELPID = PREFIX + "jspw0010"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImageHelper.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImageHelper.java
new file mode 100644
index 0000000..d4ca9f3
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImageHelper.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.editor;
+
+import java.util.HashMap;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+
+/**
+ * Helper class to handle images provided by this plug-in.
+ * 
+ * NOTE: For internal use only. For images used externally, please use the
+ * Shared***ImageHelper class instead.
+ * 
+ * @author amywu
+ */
+public class JSPEditorPluginImageHelper {
+	private final String PLUGINID = JSPUIPlugin.ID;
+	private static JSPEditorPluginImageHelper instance = null;
+
+	//	 save a descriptor for each image
+	private HashMap fImageDescRegistry = null;
+
+	/**
+	 * Gets the instance.
+	 * 
+	 * @return Returns a JSPEditorPluginImageHelper
+	 */
+	public synchronized static JSPEditorPluginImageHelper getInstance() {
+		if (instance == null)
+			instance = new JSPEditorPluginImageHelper();
+		return instance;
+	}
+
+	/**
+	 * Retrieves the image associated with resource from the image registry.
+	 * If the image cannot be retrieved, attempt to find and load the image at
+	 * the location specified in resource.
+	 * 
+	 * @param resource
+	 *            the image to retrieve
+	 * @return Image the image associated with resource or null if one could
+	 *         not be found
+	 */
+	public Image getImage(String resource) {
+		Image image = getImageRegistry().get(resource);
+		if (image == null) {
+			// create an image
+			image = createImage(resource);
+		}
+		return image;
+	}
+   
+    /**
+     * Retrieves the Image associated with ImageDescriptor from the image
+     * descriptor registry. If the Image cannot be retrieved, it is created
+     * from the ImageDescriptor
+     * 
+     * @param resource
+     *            the image descriptor to retrieve
+     * @return Image the associated with the ImageDescriptor or
+     *         the default "missing" image descriptor if one could not be
+     *         found
+     */
+    public Image getImage(ImageDescriptor descriptor) {
+        if (descriptor == null)
+            descriptor= ImageDescriptor.getMissingImageDescriptor();
+            
+        Image result= (Image)getImageDescriptorRegistry().get(descriptor);
+        if (result != null)
+            return result;
+        
+        result= descriptor.createImage();
+        if (result != null)
+            getImageDescriptorRegistry().put(descriptor, result);
+        return result;
+    }
+
+	/**
+	 * Retrieves the image descriptor associated with resource from the image
+	 * descriptor registry. If the image descriptor cannot be retrieved,
+	 * attempt to find and load the image descriptor at the location specified
+	 * in resource.
+	 * 
+	 * @param resource
+	 *            the image descriptor to retrieve
+	 * @return ImageDescriptor the image descriptor assocated with resource or
+	 *         the default "missing" image descriptor if one could not be
+	 *         found
+	 */
+	public ImageDescriptor getImageDescriptor(String resource) {
+		ImageDescriptor imageDescriptor = null;
+		Object o = getImageDescriptorRegistry().get(resource);
+		if (o == null) {
+			//create a descriptor
+			imageDescriptor = createImageDescriptor(resource);
+		}
+		else {
+			imageDescriptor = (ImageDescriptor) o;
+		}
+		return imageDescriptor;
+	}
+
+	/**
+	 * Returns the image descriptor registry for this plugin.
+	 * 
+	 * @return HashMap - image descriptor registry for this plugin
+	 */
+	private HashMap getImageDescriptorRegistry() {
+		if (fImageDescRegistry == null)
+			fImageDescRegistry = new HashMap();
+		return fImageDescRegistry;
+	}
+
+	/**
+	 * Returns the image registry for this plugin.
+	 * 
+	 * @return ImageRegistry - image registry for this plugin
+	 */
+	private ImageRegistry getImageRegistry() {
+		return JFaceResources.getImageRegistry();
+	}
+
+	/**
+	 * Creates an image from the given resource and adds the image to the
+	 * image registry.
+	 * 
+	 * @param resource
+	 * @return Image
+	 */
+	private Image createImage(String resource) {
+		ImageDescriptor desc = getImageDescriptor(resource);
+		Image image = null;
+		
+		if (desc != null) {
+			image = desc.createImage();
+			// dont add the missing image descriptor image to the image registry
+			if (!desc.equals(ImageDescriptor.getMissingImageDescriptor()))
+				getImageRegistry().put(resource, image);
+		}
+		return image;
+	}
+
+	/**
+	 * Creates an image descriptor from the given imageFilePath and adds the
+	 * image descriptor to the image descriptor registry. If an image
+	 * descriptor could not be created, the default "missing" image descriptor
+	 * is returned but not added to the image descriptor registry.
+	 * 
+	 * @param imageFilePath
+	 * @return ImageDescriptor image descriptor for imageFilePath or default
+	 *         "missing" image descriptor if resource could not be found
+	 */
+	private ImageDescriptor createImageDescriptor(String imageFilePath) {
+		ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGINID, imageFilePath);
+		if (imageDescriptor != null) {
+			getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
+		}
+		else {
+			imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
+		}
+
+		return imageDescriptor;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImages.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImages.java
new file mode 100644
index 0000000..bd38f2a
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImages.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.editor;
+
+/**
+ * Bundle of most images used by the JSP Editor plug-in.
+ */
+public class JSPEditorPluginImages { 	
+	public static final String IMG_OBJ_CLASS_OBJ = "icons/full/obj16/class_obj.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_GENERIC = "icons/full/obj16/tag-generic.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_JSP = "icons/full/obj16/tag-jsp.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_TEMPLATE = "icons/full/obj16/tag-template.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_PUBLIC = "icons/full/obj16/public.gif";			//$NON-NLS-1$
+    
+    public static final String FIELD_PROTECTED_OBJ = "icons/full/obj16/field_protected_obj.gif"; //$NON-NLS-1$
+    public static final String FIELD_PUBLIC_OBJ = "icons/full/obj16/field_public_obj.gif"; //$NON-NLS-1$
+    public static final String FIELD_DEFAULT_OBJ= "icons/full/obj16/field_default_obj.gif"; //$NON-NLS-1$
+    public static final String FIELD_PRIVATE_OBJ = "icons/full/obj16/field_private_obj.gif"; //$NON-NLS-1$
+    
+    public static final String DEFAULT_CO = "icons/full/obj16/default_co.gif"; //$NON-NLS-1$
+    public static final String PROTECTED_CO = "icons/full/obj16/protected_co.gif"; //$NON-NLS-1$
+    public static final String PUBLIC_CO = "icons/full/obj16/public_co.gif"; //$NON-NLS-1$
+    public static final String PRIVATE_CO = "icons/full/obj16/private_co.gif"; //$NON-NLS-1$
+    
+    public static final String INNERCLASS_DEFAULT_OBJ= "icons/full/obj16/innerclass_default_obj.gif"; //$NON-NLS-1$
+    public static final String INNERCLASS_PRIVATE_OBJ = "icons/full/obj16/innerclass_private_obj.gif"; //$NON-NLS-1$
+    public static final String INNERCLASS_PROTECTED_OBJ = "icons/full/obj16/innerclass_protected_obj.gif"; //$NON-NLS-1$
+    public static final String INNERCLASS_PUBLIC_OBJ = "icons/full/obj16/innerclass_public_obj.gif"; //$NON-NLS-1$
+    
+    public static final String INNERINTERFACE_DEFAULT_OBJ = "icons/full/obj16/innerinterface_default_obj.gif"; //$NON-NLS-1$
+    public static final String INNERINTERFACE_PRIVATE_OBJ = "icons/full/obj16/innerinterface_private_obj.gif"; //$NON-NLS-1$
+    public static final String INNERINTERFACE_PROTECTED_OBJ = "icons/full/obj16/innerinterface_protected_obj.gif"; //$NON-NLS-1$
+    public static final String INNERINTERFACE_PUBLIC_OBJ = "icons/full/obj16/innerinterface_public_obj.gif"; //$NON-NLS-1$
+    
+    public static final String PACKAGE_OBJ = "icons/full/obj16/package_obj.gif"; //$NON-NLS-1$
+    
+    public static final String LOCAL_VARIABLE_OBJ = "icons/full/obj16/localvariable_obj.gif"; //$NON-NLS-1$
+    
+    public static final String IMG_OBJ_WIZBAN_NEWJSPFILE = "icons/full/wizban/newjspfile_wiz.png"; //$NON-NLS-1$
+    public static final String IMG_OBJ_WIZBAN_NEWTAGFILE = "icons/full/wizban/newjspfile_wiz.png"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSourceEditingTextTools.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSourceEditingTextTools.java
new file mode 100644
index 0000000..db26843
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSourceEditingTextTools.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.editor;
+
+
+
+import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapter;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.ui.internal.provisional.XMLSourceEditingTextTools;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Implements ISourceEditingTextTools interface
+ */
+public class JSPSourceEditingTextTools extends XMLSourceEditingTextTools {
+
+	public String getPageLanguage(Node node) {
+		String language = null;
+		Document doc = null;
+		if (node.getNodeType() == Node.DOCUMENT_NODE) {
+			doc = (Document) node;
+		}
+		else {
+			doc = node.getOwnerDocument();
+		}
+		if (doc != null) {
+			if (doc instanceof IDOMDocument) {
+				PageDirectiveAdapter adapter = (PageDirectiveAdapter) ((IDOMDocument) doc).getAdapterFor(PageDirectiveAdapter.class);
+				if (adapter != null)
+					language = adapter.getLanguage();
+			}
+			else {
+				// iterate through all of the page directives
+				NodeList pageDirectives = doc.getElementsByTagName(JSP12Namespace.ElementName.DIRECTIVE_PAGE);
+				for (int i = 0; i < pageDirectives.getLength(); i++) {
+					Element pageDirective = (Element) pageDirectives.item(i);
+					// last one to declare a language wins
+					if (pageDirective.hasAttribute(JSP11Namespace.ATTR_NAME_LANGUAGE))
+						language = pageDirective.getAttribute(JSP11Namespace.ATTR_NAME_LANGUAGE);
+				}
+			}
+		}
+		// if no language was specified anywhere, assume Java
+		if (language == null)
+			language = JSP11Namespace.ATTR_VALUE_JAVA;
+		return language;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java
new file mode 100644
index 0000000..309b910
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.format;
+
+import java.util.LinkedList;
+import java.util.Map;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.ToolFactory;
+import org.eclipse.jdt.core.formatter.CodeFormatter;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.TypedPosition;
+import org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy;
+import org.eclipse.jface.text.formatter.FormattingContextProperties;
+import org.eclipse.jface.text.formatter.IFormattingContext;
+import org.eclipse.jst.jsp.core.internal.Logger;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslationUtil;
+import org.eclipse.text.edits.MalformedTreeException;
+import org.eclipse.text.edits.TextEdit;
+
+
+public class FormattingStrategyJSPJava extends ContextBasedFormattingStrategy {
+
+	/** Documents to be formatted by this strategy */
+	private final LinkedList fDocuments = new LinkedList();
+	/** Partitions to be formatted by this strategy */
+	private final LinkedList fPartitions = new LinkedList();
+	JSPTranslation translation = null;
+
+	/**
+	 * Creates a new java formatting strategy.
+	 */
+	public FormattingStrategyJSPJava() {
+		super();
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#format()
+	 */
+	public void format() {
+		super.format();
+
+		final IDocument document = (IDocument) fDocuments.removeFirst();
+		final TypedPosition partition = (TypedPosition) fPartitions.removeFirst();
+
+		if (document != null && partition != null) {
+			try {
+
+				JSPTranslationUtil translationUtil = new JSPTranslationUtil(document);
+				ICompilationUnit cu = translationUtil.getCompilationUnit();
+				if (cu != null) {
+					String cuSource = cu.getSource();
+					TextEdit textEdit = formatString(CodeFormatter.K_COMPILATION_UNIT, cuSource, 0, TextUtilities.getDefaultLineDelimiter(document), getPreferences());
+
+					TextEdit jspEdit = translationUtil.getTranslation().getJspEdit(textEdit);
+					if (jspEdit != null && jspEdit.hasChildren())
+						jspEdit.apply(document);
+				}
+
+			}
+			catch (MalformedTreeException exception) {
+				Logger.logException(exception);
+			}
+			catch (BadLocationException exception) {
+				// Can only happen on concurrent document modification - log
+				// and bail out
+				Logger.logException(exception);
+			}
+			catch (JavaModelException exception) {
+				Logger.logException(exception);
+			}
+		}
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStarts(org.eclipse.jface.text.formatter.IFormattingContext)
+	 */
+	public void formatterStarts(final IFormattingContext context) {
+		super.formatterStarts(context);
+
+		fPartitions.addLast(context.getProperty(FormattingContextProperties.CONTEXT_PARTITION));
+		fDocuments.addLast(context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM));
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStops()
+	 */
+	public void formatterStops() {
+		super.formatterStops();
+
+		fPartitions.clear();
+		fDocuments.clear();
+	}
+
+	public TextEdit formatString(int kind, String string, int indentationLevel, String lineSeparator, Map options) {
+		return ToolFactory.createCodeFormatter(options).format(kind, string, 0, string.length(), indentationLevel, lineSeparator);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/handlers/JSPFindOccurrencesHandler.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/handlers/JSPFindOccurrencesHandler.java
new file mode 100644
index 0000000..207266c
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/handlers/JSPFindOccurrencesHandler.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.handlers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jst.jsp.ui.internal.java.search.JSPFindOccurrencesProcessor;
+import org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesProcessor;
+import org.eclipse.wst.sse.ui.internal.handlers.FindOccurrencesHandler;
+
+public class JSPFindOccurrencesHandler extends FindOccurrencesHandler {
+	private List fProcessors;
+	
+	protected List getProcessors() {
+		if (fProcessors == null) {
+			fProcessors = new ArrayList();
+			HTMLFindOccurrencesProcessor htmlProcessor = new HTMLFindOccurrencesProcessor();
+			fProcessors.add(htmlProcessor);
+			JSPFindOccurrencesProcessor jspProcessor = new JSPFindOccurrencesProcessor();
+			fProcessors.add(jspProcessor);
+		}
+		return fProcessors;
+	}
+
+	
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileEditorInput.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileEditorInput.java
new file mode 100644
index 0000000..4b50266
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileEditorInput.java
@@ -0,0 +1,160 @@
+package org.eclipse.jst.jsp.ui.internal.hyperlink;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPathEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.editors.text.ILocationProvider;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+
+/**
+ * EditorInput for external files. Copied from
+ * org.eclipse.ui.internal.editors.text.JavaFileEditorInput
+ */
+class ExternalFileEditorInput implements IEditorInput, ILocationProvider {
+	// copies of this class exist in:
+	// org.eclipse.wst.xml.ui.internal.hyperlink
+	// org.eclipse.wst.html.ui.internal.hyperlink
+	// org.eclipse.jst.jsp.ui.internal.hyperlink
+	
+	/**
+	 * The workbench adapter which simply provides the label.
+	 * 
+	 * @see  Eclipse 3.1
+	 */
+	private class WorkbenchAdapter implements IWorkbenchAdapter {
+		/*
+		 * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
+		 */
+		public Object[] getChildren(Object o) {
+			return null;
+		}
+
+		/*
+		 * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
+		 */
+		public ImageDescriptor getImageDescriptor(Object object) {
+			return null;
+		}
+
+		/*
+		 * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
+		 */
+		public String getLabel(Object o) {
+			return ((ExternalFileEditorInput) o).getName();
+		}
+
+		/*
+		 * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
+		 */
+		public Object getParent(Object o) {
+			return null;
+		}
+	}
+
+	private File fFile;
+	private WorkbenchAdapter fWorkbenchAdapter = new WorkbenchAdapter();
+
+	public ExternalFileEditorInput(File file) {
+		super();
+		fFile = file;
+		fWorkbenchAdapter = new WorkbenchAdapter();
+	}
+
+	/*
+	 * @see org.eclipse.ui.IEditorInput#exists()
+	 */
+	public boolean exists() {
+		return fFile.exists();
+	}
+
+	/*
+	 * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+	 */
+	public ImageDescriptor getImageDescriptor() {
+		return null;
+	}
+
+	/*
+	 * @see org.eclipse.ui.IEditorInput#getName()
+	 */
+	public String getName() {
+		return fFile.getName();
+	}
+
+	/*
+	 * @see org.eclipse.ui.IEditorInput#getPersistable()
+	 */
+	public IPersistableElement getPersistable() {
+		return null;
+	}
+
+	/*
+	 * @see org.eclipse.ui.IEditorInput#getToolTipText()
+	 */
+	public String getToolTipText() {
+		return fFile.getAbsolutePath();
+	}
+
+	/*
+	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+	 */
+	public Object getAdapter(Class adapter) {
+		if (ILocationProvider.class.equals(adapter))
+			return this;
+		if (IWorkbenchAdapter.class.equals(adapter))
+			return fWorkbenchAdapter;
+		return Platform.getAdapterManager().getAdapter(this, adapter);
+	}
+
+	/*
+	 * @see org.eclipse.ui.editors.text.ILocationProvider#getPath(java.lang.Object)
+	 */
+	public IPath getPath(Object element) {
+		if (element instanceof ExternalFileEditorInput) {
+			ExternalFileEditorInput input = (ExternalFileEditorInput) element;
+			return Path.fromOSString(input.fFile.getAbsolutePath());
+		}
+		return null;
+	}
+	
+    /*
+     * @see org.eclipse.ui.IPathEditorInput#getPath()
+     * @since 3.1
+     */
+    public IPath getPath() {
+        return Path.fromOSString(fFile.getAbsolutePath());
+    }
+
+	/*
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	public boolean equals(Object o) {
+		if (o == this)
+			return true;
+
+		if (o instanceof ExternalFileEditorInput) {
+			ExternalFileEditorInput input = (ExternalFileEditorInput) o;
+			return fFile.equals(input.fFile);
+		}
+		
+        if (o instanceof IPathEditorInput) {
+            IPathEditorInput input= (IPathEditorInput)o;
+            return getPath().equals(input.getPath());
+        }
+
+		return false;
+	}
+
+	/*
+	 * @see java.lang.Object#hashCode()
+	 */
+	public int hashCode() {
+		return fFile.hashCode();
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java
new file mode 100644
index 0000000..8784305
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java
@@ -0,0 +1,66 @@
+package org.eclipse.jst.jsp.ui.internal.hyperlink;
+
+import java.io.File;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+
+/**
+ * Hyperlink for external files.
+ */
+class ExternalFileHyperlink implements IHyperlink {
+	// copies of this class exist in:
+	// org.eclipse.wst.xml.ui.internal.hyperlink
+	// org.eclipse.wst.html.ui.internal.hyperlink
+	// org.eclipse.jst.jsp.ui.internal.hyperlink
+	
+	private IRegion fHyperlinkRegion;
+	private File fHyperlinkFile;
+
+	public ExternalFileHyperlink(IRegion region, File file) {
+		fHyperlinkFile = file;
+		fHyperlinkRegion = region;
+	}
+	
+	public IRegion getHyperlinkRegion() {
+		return fHyperlinkRegion;
+	}
+
+	public String getTypeLabel() {
+		return null;
+	}
+
+	public String getHyperlinkText() {
+		String path = fHyperlinkFile.getPath();
+		if (path.length() > 60) {
+			path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+		}
+		return NLS.bind(JSPUIMessages.Open, path);
+	}
+
+	public void open() {
+		if (fHyperlinkFile != null) {
+			IEditorInput input = new ExternalFileEditorInput(fHyperlinkFile);
+			IEditorDescriptor descriptor;
+			try {
+				descriptor = IDE.getEditorDescriptor(input.getName(), true);
+				if (descriptor != null) {
+					IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+					IDE.openEditor(page, input, descriptor.getId(), true);
+				}
+			}
+			catch (PartInitException e) {
+				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java
new file mode 100644
index 0000000..aaeaeae
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java
@@ -0,0 +1,68 @@
+package org.eclipse.jst.jsp.ui.internal.hyperlink;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.ui.JavaElementLabels;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * Hyperlink for JSP Java elements
+ */
+class JSPJavaHyperlink implements IHyperlink {
+	private IRegion fRegion;
+	private IJavaElement fElement;
+
+	public JSPJavaHyperlink(IRegion region, IJavaElement element) {
+		fRegion = region;
+		fElement = element;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()
+	 */
+	public IRegion getHyperlinkRegion() {
+		return fRegion;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
+	 */
+	public String getTypeLabel() {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
+	 */
+	public String getHyperlinkText() {
+		return NLS.bind(JSPUIMessages.Open, JavaElementLabels.getElementLabel(fElement, JavaElementLabels.ALL_POST_QUALIFIED));
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
+	 */
+	public void open() {
+		try {
+			IEditorPart editor = JavaUI.openInEditor(fElement);
+			if (editor != null) {
+				JavaUI.revealInEditor(editor, fElement);
+			}
+		}
+		catch (Exception e) {
+			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java
new file mode 100644
index 0000000..846dee2
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java
@@ -0,0 +1,256 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.hyperlink;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.ILocalVariable;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.ISourceReference;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.util.URIResolver;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+/**
+ * Detects hyperlinks in JSP Java content
+ */
+public class JSPJavaHyperlinkDetector extends AbstractHyperlinkDetector {
+
+	private IHyperlink createHyperlink(IJavaElement element, IRegion region, IDocument document) {
+		IHyperlink link = null;
+		if (region != null) {
+			// open local variable in the JSP file...
+			if (element instanceof ISourceReference) {
+				IFile file = null;
+				int jspOffset = 0;
+				IStructuredModel sModel = null;
+
+				// try to locate the file in the workspace
+				try {
+					sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+					if (sModel != null) {
+						URIResolver resolver = sModel.getResolver();
+						if (resolver != null) {
+							String uriString = resolver.getFileBaseLocation();
+							file = getFile(uriString);
+						}
+					}
+				}
+				finally {
+					if (sModel != null)
+						sModel.releaseFromRead();
+				}
+
+				// get Java range, translate coordinate to JSP
+
+				try {
+					ISourceRange range = null;
+					IJSPTranslation jspTranslation = getJSPTranslation(document);
+					if (jspTranslation != null) {
+						// link to local variable definitions
+						if (element instanceof ILocalVariable) {
+							range = ((ILocalVariable) element).getNameRange();
+						}
+						// linking to fields of the same compilation unit
+						else if (element.getElementType() == IJavaElement.FIELD) {
+							Object cu = ((IField) element).getCompilationUnit();
+							if (cu != null && cu.equals(jspTranslation.getCompilationUnit()))
+								range = ((ISourceReference) element).getSourceRange();
+						}
+						// linking to methods of the same compilation unit
+						else if (element.getElementType() == IJavaElement.METHOD) {
+							Object cu = ((IMethod) element).getCompilationUnit();
+							if (cu != null && cu.equals(jspTranslation.getCompilationUnit()))
+								range = ((ISourceReference) element).getSourceRange();
+						}
+					}
+
+					if (range != null && file != null) {
+						jspOffset = jspTranslation.getJspOffset(range.getOffset());
+						if (jspOffset >= 0) {
+							link = new WorkspaceFileHyperlink(region, file, new Region(jspOffset, range.getLength()));
+						}
+					}
+				}
+				catch (JavaModelException jme) {
+					Logger.log(Logger.WARNING_DEBUG, jme.getMessage(), jme);
+				}
+			}
+			if (link == null) {
+				link = new JSPJavaHyperlink(region, element);
+			}
+		}
+		return link;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlinkDetector#detectHyperlinks(org.eclipse.jface.text.ITextViewer,
+	 *      org.eclipse.jface.text.IRegion, boolean)
+	 */
+	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
+		List hyperlinks = new ArrayList(0);
+
+		if (region != null && textViewer != null) {
+			IDocument document = textViewer.getDocument();
+
+			// check and make sure this is a valid Java type
+			JSPTranslation jspTranslation = getJSPTranslation(document);
+			if (jspTranslation != null) {
+				// check if we are in JSP Java content
+				int javaOffset = jspTranslation.getJavaOffset(region.getOffset());
+				if (javaOffset > -1) {
+					// check that we are not in indirect Java content (like
+					// included files)
+					if (!jspTranslation.isIndirect(javaOffset)) {
+						// get Java elements
+						IJavaElement[] elements = jspTranslation.getElementsFromJspRange(region.getOffset(), region.getOffset() + region.getLength());
+						if (elements != null && elements.length > 0) {
+							// create a JSPJavaHyperlink for each Java element
+							for (int i = 0; i < elements.length; ++i) {
+								IJavaElement element = elements[i];
+
+								// find hyperlink range for Java element
+								IRegion hyperlinkRegion = selectWord(document, region.getOffset());
+								IHyperlink link = createHyperlink(element, hyperlinkRegion, document);
+								if (link != null) {
+									hyperlinks.add(link);
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+
+		if (hyperlinks.size() == 0)
+			return null;
+		return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
+	}
+
+	/**
+	 * Returns an IFile from the given uri if possible, null if cannot find
+	 * file from uri.
+	 * 
+	 * @param fileString
+	 *            file system path
+	 * @return returns IFile if fileString exists in the workspace
+	 */
+	private IFile getFile(String fileString) {
+		IFile file = null;
+
+		if (fileString != null) {
+			Path filePath = new Path(fileString);
+			if (filePath.segmentCount() > 1 && ResourcesPlugin.getWorkspace().getRoot().getFile(filePath).exists()) {
+				return ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
+			}
+			IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(filePath);
+			for (int i = 0; i < files.length && file == null; i++)
+				if (files[i].exists())
+					file = files[i];
+		}
+
+		return file;
+	}
+
+	/**
+	 * Get JSP translation object
+	 * 
+	 * @return JSPTranslation if one exists, null otherwise
+	 */
+	private JSPTranslation getJSPTranslation(IDocument document) {
+		JSPTranslation translation = null;
+
+		IDOMModel xmlModel = null;
+		try {
+			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(document);
+			if (xmlModel != null) {
+				IDOMDocument xmlDoc = xmlModel.getDocument();
+				JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
+				if (adapter != null) {
+					translation = adapter.getJSPTranslation();
+				}
+			}
+		}
+		finally {
+			if (xmlModel != null)
+				xmlModel.releaseFromRead();
+		}
+		return translation;
+	}
+
+	/**
+	 * Java always selects word when defining region
+	 * 
+	 * @param document
+	 * @param anchor
+	 * @return IRegion
+	 */
+	private IRegion selectWord(IDocument document, int anchor) {
+
+		try {
+			int offset = anchor;
+			char c;
+
+			while (offset >= 0) {
+				c = document.getChar(offset);
+				if (!Character.isJavaIdentifierPart(c))
+					break;
+				--offset;
+			}
+
+			int start = offset;
+
+			offset = anchor;
+			int length = document.getLength();
+
+			while (offset < length) {
+				c = document.getChar(offset);
+				if (!Character.isJavaIdentifierPart(c))
+					break;
+				++offset;
+			}
+
+			int end = offset;
+
+			if (start == end)
+				return new Region(start, 0);
+
+			return new Region(start + 1, end - start - 1);
+
+		}
+		catch (BadLocationException x) {
+			return null;
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TLDFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TLDFileHyperlink.java
new file mode 100644
index 0000000..012b0f5
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TLDFileHyperlink.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.hyperlink;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+class TLDFileHyperlink implements IHyperlink {
+
+	private IResource fResource;
+	private IRegion fHyperlinkRegion;
+	private String fSearchName;
+	private int fSearchType;
+
+	public TLDFileHyperlink(IResource resource, int searchType, String searchName, IRegion hyperlinkRegion) {
+		super();
+		fResource = resource;
+		fSearchName = searchName;
+		fSearchType = searchType;
+		fHyperlinkRegion = hyperlinkRegion;
+	}
+
+	private IMarker createMarker(IFile file, IRegion region) throws CoreException {
+		// org.eclipse.ui.texteditor.MarkerUtilities.setCharStart(IMarker, int)
+		IMarker marker = file.createMarker(JSPUIPlugin.ID + "hyperlink"); //$NON-NLS-1$
+		marker.setAttribute(IMarker.TRANSIENT, Boolean.TRUE);
+		marker.setAttribute(IMarker.SOURCE_ID, getClass().getName());
+		marker.setAttribute(IMarker.CHAR_START, region.getOffset());
+		marker.setAttribute(IMarker.CHAR_END, region.getOffset() + region.getLength());
+		return marker;
+	}
+
+	public IRegion getHyperlinkRegion() {
+		return fHyperlinkRegion;
+	}
+
+	public String getHyperlinkText() {
+		return NLS.bind(JSPUIMessages.Open, fResource.getFullPath().toString());
+	}
+
+	public String getTypeLabel() {
+		return null;
+	}
+
+	public void open() {
+		IWorkbenchWindow window = JSPUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow();
+		if (window != null) {
+			IWorkbenchPage page = window.getActivePage();
+			if (fResource.getType() == IResource.FILE) {
+				IFile file = (IFile) fResource;
+				IMarker marker = null;
+				IDOMModel domModel = null;
+				try {
+					IStructuredModel model = StructuredModelManager.getModelManager().getModelForRead(file);
+					if (model instanceof IDOMModel) {
+						domModel = (IDOMModel) model;
+						if (domModel != null) {
+							IRegion targetRegion = TaglibHyperlinkDetector.findDefinition(domModel, fSearchName, fSearchType);
+							if (targetRegion != null) {
+								try {
+									marker = createMarker(file, targetRegion);
+								}
+								catch (CoreException e) {
+									Logger.logException(e);
+								}
+							}
+							if (marker != null) {
+								try {
+									IDE.openEditor(page, marker);
+								}
+								catch (PartInitException e1) {
+									Logger.logException(e1);
+								}
+								finally {
+									try {
+										marker.delete();
+									}
+									catch (CoreException e) {
+										Logger.logException(e);
+									}
+								}
+							}
+							else {
+								IDE.openEditor(page, file);
+							}
+						}
+					}
+				}
+				catch (IOException e2) {
+				}
+				catch (CoreException e2) {
+				}
+				finally {
+					if (domModel != null) {
+						domModel.releaseFromRead();
+					}
+				}
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
new file mode 100644
index 0000000..66d7b43
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
@@ -0,0 +1,441 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.hyperlink;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jface.text.hyperlink.URLHyperlink;
+import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMElementDeclarationImpl;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP11TLDNames;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
+import org.eclipse.jst.jsp.core.taglib.ITLDRecord;
+import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
+import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
+import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Detects hyperlinks for taglibs.
+ */
+public class TaglibHyperlinkDetector extends AbstractHyperlinkDetector {
+	private final String HTTP_PROTOCOL = "http://";//$NON-NLS-1$
+	private final String JAR_PROTOCOL = "jar:file:";//$NON-NLS-1$
+	// private String URN_TAGDIR = "urn:jsptagdir:";
+	private String URN_TLD = "urn:jsptld:";
+	private String XMLNS = "xmlns:"; //$NON-NLS-1$ 
+	
+	static final int TAG = 1;
+	static final int ATTRIBUTE = 2;
+	
+	static IRegion findDefinition(IDOMModel model, String searchName, int searchType) {
+		NodeList declarations = null;
+		if (searchType == TAG)
+			declarations = model.getDocument().getElementsByTagNameNS("*", JSP11TLDNames.TAG);
+		else if (searchType == ATTRIBUTE)
+			declarations = model.getDocument().getElementsByTagNameNS("*", JSP11TLDNames.ATTRIBUTE);
+		if (declarations == null || declarations.getLength() == 0) {
+			if (searchType == TAG)
+				declarations = model.getDocument().getElementsByTagName(JSP11TLDNames.TAG);
+			else if (searchType == ATTRIBUTE)
+				declarations = model.getDocument().getElementsByTagName(JSP11TLDNames.ATTRIBUTE);
+		}
+		for (int i = 0; i < declarations.getLength(); i++) {
+			NodeList names = model.getDocument().getElementsByTagName(JSP11TLDNames.NAME);
+			for (int j = 0; j < names.getLength(); j++) {
+				String name = getContainedText(names.item(j));
+				if (searchName.compareTo(name) == 0) {
+					int start = -1;
+					int end = -1;
+					Node caret = names.item(j).getFirstChild();
+					if (caret != null) {
+						start = ((IDOMNode) caret).getStartOffset();
+					}
+					while (caret != null) {
+						end = ((IDOMNode) caret).getEndOffset();
+						caret = caret.getNextSibling();
+					}
+					if (start > 0) {
+						return new Region(start, end - start);
+					}
+				}
+			}
+		}
+
+		return null;
+	}
+
+	private static String getContainedText(Node parent) {
+		NodeList children = parent.getChildNodes();
+		if (children.getLength() == 1) {
+			return children.item(0).getNodeValue().trim();
+		}
+		StringBuffer s = new StringBuffer();
+		Node child = parent.getFirstChild();
+		while (child != null) {
+			if (child.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
+				String reference = ((EntityReference) child).getNodeValue();
+				if (reference == null && child.getNodeName() != null) {
+					reference = "&" + child.getNodeName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
+				}
+				if (reference != null) {
+					s.append(reference.trim());
+				}
+			}
+			else {
+				s.append(child.getNodeValue().trim());
+			}
+			child = child.getNextSibling();
+		}
+		return s.toString().trim();
+	}
+
+	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
+		IHyperlink hyperlink = null;
+
+		if (textViewer != null && region != null) {
+			IDocument doc = textViewer.getDocument();
+			if (doc != null) {
+				try {
+					// check if jsp tag/directive first
+					ITypedRegion partition = TextUtilities.getPartition(doc, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, region.getOffset(), false);
+					if (partition != null && partition.getType() == IJSPPartitions.JSP_DIRECTIVE) {
+						IStructuredModel sModel = null;
+						try {
+							sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+							// check if jsp taglib directive
+							Node currentNode = getCurrentNode(sModel, region.getOffset());
+							if (currentNode != null && currentNode.getNodeType() == Node.ELEMENT_NODE) {
+								String baseLocationForTaglib = getBaseLocationForTaglib(doc);
+								if (baseLocationForTaglib != null && JSP11Namespace.ElementName.DIRECTIVE_TAGLIB.equalsIgnoreCase(currentNode.getNodeName())) {
+									/**
+									 * The taglib directive itself
+									 */
+									// get the uri attribute
+									Attr taglibURINode = ((Element) currentNode).getAttributeNode(JSP11Namespace.ATTR_NAME_URI);
+									if (taglibURINode != null) {
+										ITaglibRecord reference = TaglibIndex.resolve(baseLocationForTaglib, taglibURINode.getValue(), false);
+										// when using a tagdir
+										// (ITaglibRecord.TAGDIR),
+										// there's nothing to link to
+										if (reference != null) {
+											// handle taglibs
+											switch (reference.getRecordType()) {
+												case (ITaglibRecord.TLD) : {
+													ITLDRecord record = (ITLDRecord) reference;
+													String uriString = record.getPath().toString();
+													IRegion hyperlinkRegion = getHyperlinkRegion(taglibURINode, region);
+													if (hyperlinkRegion != null) {
+														hyperlink = createHyperlink(uriString, hyperlinkRegion, doc, null);
+													}
+												}
+													break;
+												case (ITaglibRecord.JAR) :
+												case (ITaglibRecord.URL) : {
+													IRegion hyperlinkRegion = getHyperlinkRegion(taglibURINode, region);
+													if (hyperlinkRegion != null) {
+														hyperlink = new TaglibJarUriHyperlink(hyperlinkRegion, reference);
+													}
+												}
+											}
+										}
+									}
+								}
+								else if (baseLocationForTaglib != null && JSP12Namespace.ElementName.ROOT.equalsIgnoreCase(currentNode.getNodeName())) {
+									/**
+									 * The jsp:root element
+									 */
+									NamedNodeMap attrs = currentNode.getAttributes();
+									for (int i = 0; i < attrs.getLength(); i++) {
+										Attr attr = (Attr) attrs.item(i);
+										if (attr.getNodeName().startsWith(XMLNS)) {
+											String uri = StringUtils.strip(attr.getNodeValue());
+											if (uri.startsWith(URN_TLD)) {
+												uri = uri.substring(URN_TLD.length());
+											}
+											ITaglibRecord reference = TaglibIndex.resolve(baseLocationForTaglib, uri, false);
+											// when using a tagdir
+											// (ITaglibRecord.TAGDIR),
+											// there's nothing to link to
+											if (reference != null) {
+												// handle taglibs
+												switch (reference.getRecordType()) {
+													case (ITaglibRecord.TLD) : {
+														ITLDRecord record = (ITLDRecord) reference;
+														String uriString = record.getPath().toString();
+														IRegion hyperlinkRegion = getHyperlinkRegion(attr, region);
+														if (hyperlinkRegion != null) {
+															hyperlink = createHyperlink(uriString, hyperlinkRegion, doc, null);
+														}
+													}
+														break;
+													case (ITaglibRecord.JAR) :
+													case (ITaglibRecord.URL) : {
+														IRegion hyperlinkRegion = getHyperlinkRegion(attr, region);
+														if (hyperlinkRegion != null) {
+															hyperlink = new TaglibJarUriHyperlink(hyperlinkRegion, reference);
+														}
+													}
+												}
+											}
+										}
+									}
+								}
+								else {
+									/**
+									 * Hyperlink custom tag to its TLD or tag file
+									 */
+									TLDCMDocumentManager documentManager = TaglibController.getTLDCMDocumentManager(doc);
+									if (documentManager != null) {
+										List documentTrackers = documentManager.getCMDocumentTrackers(currentNode.getPrefix(), region.getOffset());
+										for (int i = 0; i < documentTrackers.size(); i++) {
+											TaglibTracker tracker = (TaglibTracker) documentTrackers.get(i);
+											CMElementDeclaration decl = (CMElementDeclaration) tracker.getElements().getNamedItem(currentNode.getNodeName());
+											if (decl != null) {
+												decl = (CMElementDeclaration) ((CMNodeWrapper) decl).getOriginNode();
+												if (decl instanceof CMElementDeclarationImpl) {
+													String base = ((CMElementDeclarationImpl) decl).getLocationString();
+													IRegion hyperlinkRegion = getHyperlinkRegion(currentNode, region);
+													if (hyperlinkRegion != null) {
+														hyperlink = createHyperlink(base, hyperlinkRegion, doc, currentNode);
+													}
+												}
+											}
+										}
+									}
+								}
+							}
+						}
+						finally {
+							if (sModel != null)
+								sModel.releaseFromRead();
+						}							
+					}
+				}
+				catch (BadLocationException e) {
+					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+				}
+			}
+		}
+		if (hyperlink != null)
+			return new IHyperlink[]{hyperlink};
+		return null;
+	}
+
+	/**
+	 * Get the base location from the current model (if within workspace,
+	 * location is relative to workspace, otherwise, file system path)
+	 */
+	private String getBaseLocationForTaglib(IDocument document) {
+		String baseLoc = null;
+
+		// get the base location from the current model
+		IStructuredModel sModel = null;
+		try {
+			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+			if (sModel != null) {
+				baseLoc = sModel.getBaseLocation();
+			}
+		}
+		finally {
+			if (sModel != null) {
+				sModel.releaseFromRead();
+			}
+		}
+		return baseLoc;
+	}
+
+	// the below methods were copied from URIHyperlinkDetector
+
+	private IRegion getHyperlinkRegion(Node node, IRegion boundingRegion) {
+		IRegion hyperRegion = null;
+
+		if (node != null) {
+			short nodeType = node.getNodeType();
+			if (nodeType == Node.DOCUMENT_TYPE_NODE) {
+				// handle doc type node
+				IDOMNode docNode = (IDOMNode) node;
+				hyperRegion = new Region(docNode.getStartOffset(), docNode.getEndOffset() - docNode.getStartOffset());
+			}
+			else if (nodeType == Node.ATTRIBUTE_NODE) {
+				// handle attribute nodes
+				IDOMAttr att = (IDOMAttr) node;
+				// do not include quotes in attribute value region
+				int regOffset = att.getValueRegionStartOffset();
+				ITextRegion valueRegion = att.getValueRegion();
+				if (valueRegion != null) {
+					int regLength = valueRegion.getTextLength();
+					String attValue = att.getValueRegionText();
+					if (StringUtils.isQuoted(attValue)) {
+						++regOffset;
+						regLength = regLength - 2;
+					}
+					hyperRegion = new Region(regOffset, regLength);
+				}
+			}
+			if (nodeType == Node.ELEMENT_NODE) {
+				// Handle doc type node
+				IDOMNode docNode = (IDOMNode) node;
+				hyperRegion = getNameRegion(docNode.getFirstStructuredDocumentRegion());
+				if (hyperRegion == null) {
+					hyperRegion = new Region(docNode.getStartOffset(), docNode.getFirstStructuredDocumentRegion().getTextLength());
+				}
+			}
+		}
+		/**
+		 * Only return a hyperlink region that overlaps the search region.
+		 * This will help us to not underline areas not under the cursor.
+		 */
+		if (hyperRegion != null && intersects(hyperRegion, boundingRegion))
+			return hyperRegion;
+		return null;
+	}
+
+	private boolean intersects(IRegion hyperlinkRegion, IRegion detectionRegion) {
+		int hyperLinkStart = hyperlinkRegion.getOffset();
+		int hyperLinkEnd = hyperlinkRegion.getOffset() + hyperlinkRegion.getLength();
+		int detectionStart = detectionRegion.getOffset();
+		int detectionEnd = detectionRegion.getOffset() + detectionRegion.getLength();
+		return (hyperLinkStart <= detectionStart && detectionStart < hyperLinkEnd) || (hyperLinkStart <= detectionEnd && detectionEnd <= hyperLinkEnd);// ||
+	}
+
+	private IRegion getNameRegion(ITextRegionCollection containerRegion) {
+		ITextRegionList regions = containerRegion.getRegions();
+		ITextRegion nameRegion = null;
+		for (int i = 0; i < regions.size(); i++) {
+			ITextRegion r = regions.get(i);
+			if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
+				nameRegion = r;
+				break;
+			}
+		}
+		if (nameRegion != null)
+			return new Region(containerRegion.getStartOffset(nameRegion), nameRegion.getTextLength());
+		return null;
+	}
+
+	/**
+	 * Create the appropriate hyperlink
+	 * 
+	 * @param uriString
+	 * @param hyperlinkRegion
+	 * @return IHyperlink
+	 */
+	private IHyperlink createHyperlink(String uriString, IRegion hyperlinkRegion, IDocument document, Node node) {
+		IHyperlink link = null;
+
+		if (uriString != null) {
+			String temp = uriString.toLowerCase();
+			if (temp.startsWith(HTTP_PROTOCOL)) {
+				// this is a URLHyperlink since this is a web address
+				link = new URLHyperlink(hyperlinkRegion, uriString);
+			}
+			else if (temp.startsWith(JAR_PROTOCOL)) {
+				// this is a URLFileHyperlink since this is a local address
+				try {
+					link = new URLFileRegionHyperlink(hyperlinkRegion, TAG, node.getLocalName(), new URL(uriString)) {
+						public String getHyperlinkText() {
+							return JSPUIMessages.CustomTagHyperlink_hyperlinkText;
+						}
+					};
+				}
+				catch (MalformedURLException e) {
+					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+				}
+			}
+			else {
+				// try to locate the file in the workspace
+				IPath path = new Path(uriString);
+				if (path.segmentCount() > 1) {
+					IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+					if (file.getType() == IResource.FILE && file.isAccessible()) {
+						if (node != null) {
+							link = new TLDFileHyperlink(file, TAG, node.getLocalName(), hyperlinkRegion) {
+								public String getHyperlinkText() {
+									return JSPUIMessages.CustomTagHyperlink_hyperlinkText;
+								}
+							};
+						}
+						else {
+							link = new WorkspaceFileHyperlink(hyperlinkRegion, file);
+						}
+					}
+				}
+			}
+			if (link == null) {
+				// this is an ExternalFileHyperlink since file does not exist
+				// in workspace
+				File externalFile = new File(uriString);
+				link = new ExternalFileHyperlink(hyperlinkRegion, externalFile);
+			}
+		}
+
+		return link;
+	}
+
+	private Node getCurrentNode(IStructuredModel model, int offset) {
+		// get the current node at the offset (returns either: element,
+		// doctype, text)
+		IndexedRegion inode = null;
+		if (model != null) {
+			inode = model.getIndexedRegion(offset);
+			if (inode == null) {
+				inode = model.getIndexedRegion(offset - 1);
+			}
+		}
+
+		if (inode instanceof Node) {
+			return (Node) inode;
+		}
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java
new file mode 100644
index 0000000..3652adc
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java
@@ -0,0 +1,113 @@
+package org.eclipse.jst.jsp.ui.internal.hyperlink;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+
+/**
+ * Hyperlink for taglib files in jars.
+ */
+class TaglibJarHyperlink implements IHyperlink {
+	static class ZipStorage implements IStorage {
+		File fFile = null;
+		String fEntryName = null;
+
+		ZipStorage(File file, String entryName) {
+			fFile = file;
+			fEntryName = entryName;
+		}
+
+		public InputStream getContents() throws CoreException {
+			InputStream stream = null;
+			try {
+				ZipFile file = new ZipFile(fFile);
+				ZipEntry entry = file.getEntry(fEntryName);
+				stream = file.getInputStream(entry);
+			}
+			catch (Exception e) {
+				throw new CoreException(new Status(IStatus.ERROR, JSPUIPlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, getFullPath().toString(), e));
+			}
+			return stream;
+		}
+
+		public IPath getFullPath() {
+			return new Path(fFile.getAbsolutePath() + IPath.SEPARATOR + fEntryName);
+		}
+
+		public String getName() {
+			return fEntryName;
+		}
+
+		public boolean isReadOnly() {
+			return true;
+		}
+
+		public Object getAdapter(Class adapter) {
+			return null;
+		}
+	}
+
+	private IRegion fRegion;
+	private IPath fZipFilePath;
+
+	public TaglibJarHyperlink(IRegion region, IPath zipFilePath) {
+		fRegion = region;
+		fZipFilePath = zipFilePath;
+	}
+
+	public IRegion getHyperlinkRegion() {
+		return fRegion;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
+	 */
+	public String getTypeLabel() {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
+	 */
+	public String getHyperlinkText() {
+		return JSPUIMessages.TLDHyperlink_hyperlinkText;
+	}
+
+	public void open() {
+		IEditorInput input = new URLFileHyperlink.StorageEditorInput(new ZipStorage(fZipFilePath.toFile(), "META-INF/taglib.tld")); //$NON-NLS-1$
+		IEditorDescriptor descriptor;
+		try {
+			descriptor = IDE.getEditorDescriptor(input.getName());
+			if (descriptor != null) {
+				IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+				IDE.openEditor(page, input, descriptor.getId(), true);
+			}
+		}
+		catch (PartInitException e) {
+			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java
new file mode 100644
index 0000000..ff4072e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java
@@ -0,0 +1,74 @@
+package org.eclipse.jst.jsp.ui.internal.hyperlink;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.core.taglib.IJarRecord;
+import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
+import org.eclipse.jst.jsp.core.taglib.IURLRecord;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+
+/**
+ * Hyperlink for taglib files in jars or specified by urls.
+ */
+class TaglibJarUriHyperlink implements IHyperlink {
+	private IRegion fRegion;
+	private ITaglibRecord fTaglibRecord;
+	private IHyperlink fHyperlink;
+
+	public TaglibJarUriHyperlink(IRegion region, ITaglibRecord record) {
+		fRegion = region;
+		fTaglibRecord = record;
+	}
+
+	private IHyperlink getHyperlink() {
+		if (fHyperlink == null && fTaglibRecord != null) {
+			switch (fTaglibRecord.getRecordType()) {
+				case (ITaglibRecord.JAR) : {
+					IJarRecord record = (IJarRecord) fTaglibRecord;
+					fHyperlink = new TaglibJarHyperlink(fRegion, record.getLocation());
+				}
+					break;
+				case (ITaglibRecord.URL) : {
+					IURLRecord record = (IURLRecord) fTaglibRecord;
+					fHyperlink = new URLFileHyperlink(fRegion, record.getURL());
+				}
+			}
+		}
+		return fHyperlink;
+	}
+
+	public IRegion getHyperlinkRegion() {
+		IRegion region = null;
+
+		IHyperlink link = getHyperlink();
+		if (link != null) {
+			region = link.getHyperlinkRegion();
+		}
+		return region;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
+	 */
+	public String getTypeLabel() {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
+	 */
+	public String getHyperlinkText() {
+		return JSPUIMessages.TLDHyperlink_hyperlinkText;
+	}
+
+	public void open() {
+		IHyperlink link = getHyperlink();
+		if (link != null) {
+			link.open();
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java
new file mode 100644
index 0000000..df8d5a9
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java
@@ -0,0 +1,178 @@
+package org.eclipse.jst.jsp.ui.internal.hyperlink;
+
+import java.io.InputStream;
+import java.net.URL;
+
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.sse.core.internal.util.JarUtilities;
+
+/**
+ * Hyperlink for URLs (opens in read-only mode)
+ */
+class URLFileHyperlink implements IHyperlink {
+	// copies of this class exist in:
+	// org.eclipse.wst.xml.ui.internal.hyperlink
+	// org.eclipse.wst.html.ui.internal.hyperlink
+	// org.eclipse.jst.jsp.ui.internal.hyperlink
+
+	static class StorageEditorInput implements IStorageEditorInput {
+		IStorage fStorage = null;
+
+		StorageEditorInput(IStorage storage) {
+			fStorage = storage;
+		}
+
+		public IStorage getStorage() throws CoreException {
+			return fStorage;
+		}
+
+		public boolean exists() {
+			return fStorage != null;
+		}
+
+		public boolean equals(Object obj) {
+			if (obj instanceof StorageEditorInput) {
+				return fStorage.equals(((StorageEditorInput) obj).fStorage);
+			}
+			return super.equals(obj);
+		}
+
+		public ImageDescriptor getImageDescriptor() {
+			return null;
+		}
+
+		public String getName() {
+			return fStorage.getName();
+		}
+
+		public IPersistableElement getPersistable() {
+			return null;
+		}
+
+		public String getToolTipText() {
+			return fStorage.getFullPath() != null ? fStorage.getFullPath().toString() : fStorage.getName();
+		}
+
+		public Object getAdapter(Class adapter) {
+			return null;
+		}
+	}
+
+	static class URLStorage implements IStorage {
+		URL fURL = null;
+
+		URLStorage(URL url) {
+			fURL = url;
+		}
+
+		public boolean equals(Object obj) {
+			if (obj instanceof URLStorage) {
+				return fURL.equals(((URLStorage) obj).fURL);
+			}
+			return super.equals(obj);
+		}
+
+		public InputStream getContents() throws CoreException {
+			InputStream stream = null;
+			try {
+				stream = JarUtilities.getInputStream(fURL);
+			}
+			catch (Exception e) {
+				throw new CoreException(new Status(IStatus.ERROR, JSPUIPlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, fURL.toString(), e));
+			}
+			return stream;
+		}
+
+		public IPath getFullPath() {
+			return new Path(fURL.toString());
+		}
+
+		public String getName() {
+			return new Path(fURL.getFile()).lastSegment();
+		}
+
+		public boolean isReadOnly() {
+			return true;
+		}
+
+		public Object getAdapter(Class adapter) {
+			return null;
+		}
+
+	}
+
+	private IRegion fRegion;
+	private URL fURL;
+
+	public URLFileHyperlink(IRegion region, URL url) {
+		fRegion = region;
+		fURL = url;
+	}
+
+	public IRegion getHyperlinkRegion() {
+		return fRegion;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
+	 */
+	public String getTypeLabel() {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
+	 */
+	public String getHyperlinkText() {
+		String path = fURL.getPath();
+		if (path.length() > 0)
+			return NLS.bind(JSPUIMessages.Open, new Path(path).lastSegment());
+		return NLS.bind(JSPUIMessages.TLDHyperlink_hyperlinkText, fURL.toString());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
+	 */
+	public void open() {
+		if (fURL != null) {
+			IEditorInput input = new StorageEditorInput(new URLStorage(fURL));
+			IEditorDescriptor descriptor;
+			try {
+				descriptor = IDE.getEditorDescriptor(input.getName());
+				if (descriptor != null) {
+					IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+					IDE.openEditor(page, input, descriptor.getId(), true);
+				}
+			}
+			catch (PartInitException e) {
+				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileRegionHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileRegionHyperlink.java
new file mode 100644
index 0000000..2b383c9
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileRegionHyperlink.java
@@ -0,0 +1,218 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.hyperlink;
+
+import java.io.InputStream;
+import java.net.URL;
+
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+/**
+ * Hyperlink for URLs (opens in read-only mode)
+ */
+class URLFileRegionHyperlink implements IHyperlink {
+	// copies of this class exist in:
+	// org.eclipse.wst.xml.ui.internal.hyperlink
+	// org.eclipse.wst.html.ui.internal.hyperlink
+	// org.eclipse.jst.jsp.ui.internal.hyperlink
+
+	static class StorageEditorInput implements IStorageEditorInput {
+		IStorage fStorage = null;
+
+		StorageEditorInput(IStorage storage) {
+			fStorage = storage;
+		}
+
+		public IStorage getStorage() throws CoreException {
+			return fStorage;
+		}
+
+		public boolean exists() {
+			return fStorage != null;
+		}
+
+		public boolean equals(Object obj) {
+			if (obj instanceof StorageEditorInput) {
+				return fStorage.equals(((StorageEditorInput) obj).fStorage);
+			}
+			return super.equals(obj);
+		}
+
+		public ImageDescriptor getImageDescriptor() {
+			return null;
+		}
+
+		public String getName() {
+			return fStorage.getName();
+		}
+
+		public IPersistableElement getPersistable() {
+			return null;
+		}
+
+		public String getToolTipText() {
+			return fStorage.getFullPath() != null ? fStorage.getFullPath().toString() : fStorage.getName();
+		}
+
+		public Object getAdapter(Class adapter) {
+			return null;
+		}
+	}
+
+	static class URLStorage implements IStorage {
+		URL fURL = null;
+
+		URLStorage(URL url) {
+			fURL = url;
+		}
+
+		public boolean equals(Object obj) {
+			if (obj instanceof URLStorage) {
+				return fURL.equals(((URLStorage) obj).fURL);
+			}
+			return super.equals(obj);
+		}
+
+		public InputStream getContents() throws CoreException {
+			InputStream stream = null;
+			try {
+				stream = fURL.openStream();
+			}
+			catch (Exception e) {
+				throw new CoreException(new Status(IStatus.ERROR, JSPUIPlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, fURL.toString(), e));
+			}
+			return stream;
+		}
+
+		public IPath getFullPath() {
+			return new Path(fURL.toString());
+		}
+
+		public String getName() {
+			return new Path(fURL.getFile()).lastSegment();
+		}
+
+		public boolean isReadOnly() {
+			return true;
+		}
+
+		public Object getAdapter(Class adapter) {
+			return null;
+		}
+
+	}
+
+	private IRegion fRegion;
+	private URL fURL;
+	private int fSearchType;
+	private String fSearchName;
+
+	public URLFileRegionHyperlink(IRegion region, int searchType, String searchName, URL url) {
+		fRegion = region;
+		fURL = url;
+		fSearchName = searchName;
+		fSearchType = searchType;
+	}
+
+	public IRegion getHyperlinkRegion() {
+		return fRegion;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
+	 */
+	public String getTypeLabel() {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
+	 */
+	public String getHyperlinkText() {
+		return NLS.bind(JSPUIMessages.Open, fURL.toString());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
+	 */
+	public void open() {
+		if (fURL != null) {
+			IEditorInput input = new StorageEditorInput(new URLStorage(fURL));
+			IEditorDescriptor descriptor;
+			try {
+				descriptor = IDE.getEditorDescriptor(input.getName(), true);
+				if (descriptor != null) {
+					IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+					IEditorPart openedEditor = IDE.openEditor(page, input, descriptor.getId(), true);
+					IRegion definitionRegion = findDefinitionRegion(new URLStorage(fURL));
+					if (definitionRegion != null) {
+						openedEditor.getSite().getSelectionProvider().setSelection(new TextSelection(definitionRegion.getOffset(), definitionRegion.getLength()));
+					}
+				}
+			}
+			catch (PartInitException e) {
+				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+			}
+		}
+	}
+
+	/**
+	 * @return
+	 */
+	private IRegion findDefinitionRegion(IStorage storage) {
+		IRegion definition = null;
+		IStructuredModel model = null;
+		try {
+			model = StructuredModelManager.getModelManager().getModelForRead(storage.getName(), storage.getContents(), null);
+		}
+		catch (Exception e) {
+			Logger.logException(e);
+		}
+		if (model != null) {
+			if (model instanceof IDOMModel) {
+				definition = TaglibHyperlinkDetector.findDefinition((IDOMModel) model, fSearchName, fSearchType);
+			}
+			model.releaseFromRead();
+		}
+		return definition;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
new file mode 100644
index 0000000..20b2579
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
@@ -0,0 +1,83 @@
+package org.eclipse.jst.jsp.ui.internal.hyperlink;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+/**
+ * Hyperlink for files within the workspace. (As long as there is an IFile,
+ * this can be used) Opens the default editor for the file.
+ */
+class WorkspaceFileHyperlink implements IHyperlink {
+	// copies of this class exist in:
+	// org.eclipse.wst.xml.ui.internal.hyperlink
+	// org.eclipse.wst.html.ui.internal.hyperlink
+	// org.eclipse.jst.jsp.ui.internal.hyperlink
+
+	private IRegion fRegion;
+	private IFile fFile;
+	private IRegion fHighlightRange;
+
+	public WorkspaceFileHyperlink(IRegion region, IFile file) {
+		fRegion = region;
+		fFile = file;
+	}
+
+	public WorkspaceFileHyperlink(IRegion region, IFile file, IRegion range) {
+		fRegion = region;
+		fFile = file;
+		fHighlightRange = range;
+	}
+
+	public IRegion getHyperlinkRegion() {
+		return fRegion;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
+	 */
+	public String getTypeLabel() {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
+	 */
+	public String getHyperlinkText() {
+		String path = fFile.getFullPath().toString();
+		if (path.length() > 60) {
+			path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+		}
+		return NLS.bind(JSPUIMessages.Open, path);
+	}
+
+	public void open() {
+		if (fFile != null && fFile.exists()) {
+			try {
+				IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+				IEditorPart editor = IDE.openEditor(page, fFile, true);
+				// highlight range in editor if possible
+				if (fHighlightRange != null && editor instanceof ITextEditor) {
+					((ITextEditor) editor).setHighlightRange(fHighlightRange.getOffset(), fHighlightRange.getLength(), true);
+				}
+			}
+			catch (PartInitException pie) {
+				Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
+			}
+		}
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java
new file mode 100644
index 0000000..e690dfe
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java
@@ -0,0 +1,241 @@
+/*******************************************************************************

+ * Copyright (c) 2008 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+package org.eclipse.jst.jsp.ui.internal.hyperlink;

+

+import org.eclipse.core.resources.IProject;

+import org.eclipse.core.resources.ResourcesPlugin;

+import org.eclipse.core.runtime.CoreException;

+import org.eclipse.core.runtime.IPath;

+import org.eclipse.core.runtime.Path;

+import org.eclipse.jdt.core.IJavaElement;

+import org.eclipse.jdt.core.IJavaProject;

+import org.eclipse.jdt.core.IPackageFragmentRoot;

+import org.eclipse.jdt.core.JavaCore;

+import org.eclipse.jdt.core.JavaModelException;

+import org.eclipse.jdt.ui.JavaElementLabels;

+import org.eclipse.jdt.ui.JavaUI;

+import org.eclipse.jface.text.BadLocationException;

+import org.eclipse.jface.text.IDocument;

+import org.eclipse.jface.text.IRegion;

+import org.eclipse.jface.text.ITextViewer;

+import org.eclipse.jface.text.Region;

+import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;

+import org.eclipse.jface.text.hyperlink.IHyperlink;

+import org.eclipse.jst.jsp.core.internal.Logger;

+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;

+import org.eclipse.osgi.util.NLS;

+import org.eclipse.ui.PartInitException;

+import org.eclipse.wst.sse.core.StructuredModelManager;

+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;

+import org.eclipse.wst.sse.core.utils.StringUtils;

+

+/**

+ * Detects hyper-links in Tag Library Descriptors

+ */

+public class XMLJavaHyperlinkDetector extends AbstractHyperlinkDetector {

+

+	/**

+	 * 

+	 */

+	private static final String JAR_FILE_PROTOCOL = "jar:file:"; //$NON-NLS-1$

+

+	/**

+	 * Based on org.eclipse.jdt.internal.ui.javaeditor.JavaElementHyperlink

+	 */

+	static class JavaElementHyperlink implements IHyperlink {

+

+		private final IJavaElement fElement;

+		private final IRegion fRegion;

+

+

+		/**

+		 * Creates a new Java element hyperlink.

+		 * 

+		 * @param region

+		 *            the region of the link

+		 * @param element

+		 *            the java element to open

+		 * @param qualify

+		 *            <code>true</code> if the hyper-link text should show a

+		 *            qualified name for element.

+		 */

+		JavaElementHyperlink(IRegion region, IJavaElement element) {

+			fRegion = region;

+			fElement = element;

+		}

+

+		public IRegion getHyperlinkRegion() {

+			return fRegion;

+		}

+

+		public String getHyperlinkText() {

+			String elementLabel = JavaElementLabels.getElementLabel(fElement, JavaElementLabels.ALL_POST_QUALIFIED);

+			return NLS.bind(JSPUIMessages.Open, elementLabel);

+		}

+

+		public String getTypeLabel() {

+			return null;

+		}

+

+		public void open() {

+			try {

+				JavaUI.openInEditor(fElement);

+			}

+			catch (PartInitException e) {

+			}

+			catch (JavaModelException e) {

+			}

+		}

+	}

+

+

+	private IHyperlink createHyperlink(String elementName, IRegion region, IDocument document) {

+		IStructuredModel model = null;

+		try {

+			model = StructuredModelManager.getModelManager().getExistingModelForRead(document);

+			if (model != null) {

+				String baseLocation = model.getBaseLocation();

+				// URL fixup from the taglib index record

+				if (baseLocation.startsWith("jar:/file:")) { //$NON-NLS-1$

+					baseLocation = StringUtils.replace(baseLocation, "jar:/", "jar:"); //$NON-NLS-1$ //$NON-NLS-2$

+				}

+				/*

+				 * Handle opened TLD files from JARs on the Java Build Path by

+				 * finding a package fragment root for the same .jar file and

+				 * opening the class from there. Note that this might be from

+				 * a different Java project's build path than the TLD.

+				 */

+				if (baseLocation.startsWith(JAR_FILE_PROTOCOL) && baseLocation.indexOf('!') > JAR_FILE_PROTOCOL.length()) {

+					String baseFile = baseLocation.substring(JAR_FILE_PROTOCOL.length(), baseLocation.indexOf('!'));

+					IPath basePath = new Path(baseFile);

+					IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();

+					for (int i = 0; i < projects.length; i++) {

+						try {

+							if (projects[i].isAccessible() && projects[i].hasNature(JavaCore.NATURE_ID)) {

+								IJavaProject javaProject = JavaCore.create(projects[i]);

+								if (javaProject.exists()) {

+									IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(basePath);

+									if (root != null) {

+										return createJavaElementHyperlink(javaProject, elementName, region);

+									}

+								}

+							}

+						}

+						catch (CoreException e) {

+							Logger.logException(e);

+						}

+					}

+				}

+				else {

+					IPath basePath = new Path(baseLocation);

+					if (basePath.segmentCount() > 1) {

+						return createJavaElementHyperlink(JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0))), elementName, region);

+					}

+				}

+			}

+

+		}

+		finally {

+			if (model != null)

+				model.releaseFromRead();

+		}

+		return null;

+	}

+

+	private IHyperlink createJavaElementHyperlink(IJavaProject javaProject, String elementName, IRegion region) {

+		if (javaProject != null && javaProject.exists()) {

+			try {

+				IJavaElement element = javaProject.findType(elementName);

+				if (element != null && element.exists()) {

+					return new JavaElementHyperlink(region, element);

+				}

+			}

+			catch (JavaModelException e) {

+				// bad name, no link

+			}

+		}

+		return null;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see

+	 * org.eclipse.jface.text.hyperlink.IHyperlinkDetector#detectHyperlinks

+	 * (org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion,

+	 * boolean)

+	 */

+	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {

+		if (region != null && textViewer != null) {

+			IDocument document = textViewer.getDocument();

+			// find hyperlink range for Java element

+			IRegion hyperlinkRegion = region.getLength() > 0 ? region : selectQualifiedName(document, region.getOffset());

+			String name = null;

+			try {

+				name = document.get(hyperlinkRegion.getOffset(), hyperlinkRegion.getLength()).trim();

+			}

+			catch (BadLocationException e) {

+			}

+			if (name != null) {

+				IHyperlink link = createHyperlink(name, hyperlinkRegion, document);

+				if (link != null)

+					return new IHyperlink[]{link};

+			}

+		}

+

+		return null;

+	}

+

+	/**

+	 * Java always selects word when defining region

+	 * 

+	 * @param document

+	 * @param anchor

+	 * @return IRegion

+	 */

+	private IRegion selectQualifiedName(IDocument document, int anchor) {

+

+		try {

+			int offset = anchor;

+			char c;

+

+			while (offset >= 0) {

+				c = document.getChar(offset);

+				if (!Character.isJavaIdentifierPart(c) && c != '.')

+					break;

+				--offset;

+			}

+

+			int start = offset;

+

+			offset = anchor;

+			int length = document.getLength();

+

+			while (offset < length) {

+				c = document.getChar(offset);

+				if (!Character.isJavaIdentifierPart(c) && c != '.')

+					break;

+				++offset;

+			}

+

+			int end = offset;

+

+			if (start == end)

+				return new Region(start, 0);

+

+			return new Region(start + 1, end - start - 1);

+

+		}

+		catch (BadLocationException x) {

+			return null;

+		}

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
new file mode 100644
index 0000000..a057ed5
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
@@ -0,0 +1,274 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.search.SearchDocument;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.text.edits.MalformedTreeException;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.text.edits.TextEditGroup;
+
+/**
+ * <p>After a search is run with this {@link SearchRequestor} {@link #getChanges(RefactoringParticipant)}
+ * can be called to get any new {@link Change}s that need to be created as a result of the search.  If
+ * {@link Change}s are already existing for the documents found then new {@link Change}s will not be
+ * created for them, but the needed {@link TextEdit}s will be added to the existing {@link Change}s.</p>
+ */
+public class BasicRefactorSearchRequestor extends SearchRequestor {
+	/** The type being renamed (the old type)*/
+	IJavaElement fElement = null;
+	/** The new name of the type being renamed*/
+	private String fNewName = ""; //$NON-NLS-1$
+	/** maps a JSPSearchDocument path -> MultiTextEdit for the java file*/
+	private HashMap fSearchDocPath2JavaEditMap = null;
+	
+	public BasicRefactorSearchRequestor(IJavaElement element, String newName) {
+		this.fNewName = newName;
+		this.fElement = element;
+		this.fSearchDocPath2JavaEditMap = new HashMap();
+	}
+	
+	public IJavaElement getElement() {
+		return this.fElement;
+	}
+
+	/**
+	 * @return the new name for the Type
+	 */
+	public String getNewName() {
+		return this.fNewName;
+	}
+	
+	/**
+	 * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch)
+	 */
+	public void acceptSearchMatch(SearchMatch javaMatch) throws CoreException {
+		
+		String matchDocumentPath = javaMatch.getResource().getFullPath().toString();
+		SearchDocument searchDoc = JSPSearchSupport.getInstance().getSearchDocument(matchDocumentPath);
+	
+		if (searchDoc != null && searchDoc instanceof JavaSearchDocumentDelegate) {
+	
+			String renameText = getRenameText((JavaSearchDocumentDelegate)searchDoc, javaMatch);
+			
+			//if rename text is null then don't create an edit for it
+			if(renameText != null) {
+				// add it for the correct document
+				addJavaEdit(searchDoc.getPath(), new ReplaceEdit(javaMatch.getOffset(), javaMatch.getLength(), renameText));
+			}
+		}
+	}
+	
+	/**
+	 * @param searchDoc
+	 * @return the rename text or <code>null</code> if no edit should be created for the given match.
+	 * Such a case would be a match where nothing needs to be edited.
+	 */
+	protected String getRenameText(JavaSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
+		return getNewName();
+	}
+
+	/**
+	 * Adds to the multi edit for a give java document.
+	 * @param javaDocument
+	 * @param javaEdit
+	 */
+	private void addJavaEdit(String searchDocPath, ReplaceEdit javaEdit) {
+		
+		Object o = this.fSearchDocPath2JavaEditMap.get(searchDocPath);
+		if(o != null) {
+
+			MultiTextEdit multi = (MultiTextEdit)o;
+			multi.addChild(javaEdit);
+		}
+		else {
+			// use a multi edit so doc position offsets get updated automatically
+			// when adding multiple child edits
+			MultiTextEdit multi = new MultiTextEdit();
+			multi.addChild(javaEdit);
+			this.fSearchDocPath2JavaEditMap.put(searchDocPath, multi);
+		}
+	}
+	
+	/**
+	 * <p>This function is not safe because it does not check for existing {@link Change}s that
+	 * new {@link Change}s created by this method may conflict with.  These conflicts can
+	 * cause indeterminate results when applied to documents.  Long story short, don't
+	 * use this method any more.</p>
+	 * 
+	 * @return all JSP changes for the search matches for the given Type, they may conflict
+	 * with already existing {@link Change}s
+	 * 
+	 * @see #getChanges(RefactoringParticipant)
+	 * 
+	 * @deprecated
+	 */
+	public Change[] getChanges() {
+		
+		JSPSearchSupport support = JSPSearchSupport.getInstance();
+		List changes = new ArrayList();
+		Iterator keys = fSearchDocPath2JavaEditMap.keySet().iterator();
+		String searchDocPath = null;
+		SearchDocument delegate = null;
+		
+		while(keys.hasNext()) {
+			// create on the fly
+			searchDocPath = (String)keys.next();
+			MultiTextEdit javaEdit = (MultiTextEdit)fSearchDocPath2JavaEditMap.get(searchDocPath);
+			delegate = support.getSearchDocument(searchDocPath);
+			
+			if(delegate != null && delegate instanceof JavaSearchDocumentDelegate) {
+				JavaSearchDocumentDelegate javaDelegate = (JavaSearchDocumentDelegate)delegate;
+				changes.add(createChange(javaDelegate, javaDelegate.getJspTranslation().getJspEdit(javaEdit)));
+			}
+		}
+		return (Change[])changes.toArray(new Change[changes.size()]);
+	}
+	
+	/**
+	 * Gets new {@link Change}s created as a result of this {@link SearchRequestor}.
+	 * Any existing {@link TextChange}s that had new edits added to them will not be
+	 * returned.
+	 * 
+	 * @param participant {@link RefactoringParticipant} to determine if there are already existing
+	 * {@link TextChange}s for the documents that this {@link SearchRequestor} found.
+	 * If existing
+	 * {@link TextChange}s are found then they will be used for any new edits, else new {@link TextChange}s
+	 * will be created.
+	 * 
+	 * @return Any new {@link TextChange}s created by this {@link SearchRequestor}.  If edits were
+	 * added to existing {@link TextChange}s then those existing {@link TextChange}s will not be
+	 * returned in this array.
+	 */
+	public Change[] getChanges(RefactoringParticipant participant) {
+		
+		JSPSearchSupport support = JSPSearchSupport.getInstance();
+		List changes = new ArrayList();
+		Iterator keys = fSearchDocPath2JavaEditMap.keySet().iterator();
+		String searchDocPath = null;
+		SearchDocument delegate = null;
+		
+		while(keys.hasNext()) {
+			// create on the fly
+			searchDocPath = (String)keys.next();
+			MultiTextEdit javaEdit = (MultiTextEdit)fSearchDocPath2JavaEditMap.get(searchDocPath);
+			delegate = support.getSearchDocument(searchDocPath);
+			
+			if(delegate != null && delegate instanceof JavaSearchDocumentDelegate) {
+				JavaSearchDocumentDelegate javaDelegate = (JavaSearchDocumentDelegate)delegate;
+				Change change = createChange(javaDelegate, javaDelegate.getJspTranslation().getJspEdit(javaEdit), participant);
+				changes.add(change);
+			}
+		}
+		return (Change[])changes.toArray(new Change[changes.size()]);
+	}
+	
+	/**
+	 * <p>This method is not safe because it does not take into consideration already existing
+	 * {@link Change}s and thus conflicts could occur that when applied create indeterminate
+	 * results in the target documents</p>
+	 * 
+	 * @see #createChange(JavaSearchDocumentDelegate, TextEdit, RefactoringParticipant)
+	 * 
+	 * @deprecated
+	 */
+	private Change createChange(JavaSearchDocumentDelegate searchDoc, TextEdit edit) {
+		
+		IDocument doc = searchDoc.getJspTranslation().getJspDocument();
+		String file = searchDoc.getFile().getName();
+		String description = getDescription();
+		try {
+			// document lines are 0 based
+			String lineNumber = Integer.toString(doc.getLineOfOffset(edit.getOffset()) + 1);
+			description += " " + NLS.bind(JSPUIMessages.BasicRefactorSearchRequestor_1, new String[]{file, lineNumber}); //$NON-NLS-1$
+		} 
+		catch (BadLocationException e) {
+			Logger.logException(e);
+		}
+		return new JSPRenameChange(searchDoc.getFile(), doc, edit, description);
+	}
+	
+	/**
+	 * </p>If a {@link TextChange} does not already exist for the given {@link JavaSearchDocumentDelegate}
+	 * then a new one will be created with the given {@link TextEdit}.  Otherwise the given {@link TextEdit}
+	 * will be added to a new group and added to the existing change and <code>null</code> will be returned.</p>
+	 * 
+	 * @param searchDoc the {@link JavaSearchDocumentDelegate} that the <code>edit</code> will be applied to
+	 * @param edit the {@link TextEdit} that needs to be added to a new {@link TextChange} or appended to an
+	 * existing one
+	 * @param participant the {@link RefactoringParticipant} that knows about the existing {@link TextChange}s
+	 * @return a new {@link Change} if there was not one already existing for the document in question,
+	 * else <code>null</code>
+	 */
+	private Change createChange(JavaSearchDocumentDelegate searchDoc, TextEdit edit, RefactoringParticipant participant) {
+		IDocument doc = searchDoc.getJspTranslation().getJspDocument();
+		String description = getDescription();
+		
+		TextChange existingChange = participant.getTextChange(searchDoc.getFile());
+		TextChange change = null;
+		if(existingChange != null) {
+			try {
+				existingChange.addEdit(edit);
+			}catch (MalformedTreeException e) {
+				Logger.logException("MalformedTreeException while adding edit " + //$NON-NLS-1$
+						edit + " to existing change " + change, e); //$NON-NLS-1$
+			}
+			
+			TextEditGroup group = new TextEditGroup(description, edit);
+			existingChange.addTextEditGroup(group);
+		} else {
+			change = new JSPRenameChange(searchDoc.getFile(), doc, edit, searchDoc.getFile().getName());
+			TextEditGroup group = new TextEditGroup(description, edit);
+			change.addTextEditGroup(group);
+		}
+		
+		return change; 
+	}
+	
+	// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3205
+	// only relevant for IType refactorings
+	protected boolean isFullyQualified(String matchText) {
+		if(getElement() instanceof IType) {
+			String pkg = ((IType)getElement()).getPackageFragment().getElementName();
+			return matchText.startsWith(pkg);
+		}
+		return false;
+	}
+
+	/**
+	 * Subclasses should override to better describe the change.
+	 * @return
+	 */
+	protected String getDescription() {
+		return ""; //$NON-NLS-1$
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
new file mode 100644
index 0000000..08b6c96
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+class JSPJavaSelectionProvider {
+	static IJavaElement[] getSelection(ITextEditor textEditor) {
+		IJavaElement[] elements = null;
+
+		IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
+		ISelection selection = textEditor.getSelectionProvider().getSelection();
+		if (selection instanceof ITextSelection) {
+			ITextSelection textSelection = (ITextSelection) selection;
+			// get the JSP translation object for this editor's document
+			IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document); 
+			try {
+				if (model instanceof IDOMModel) {
+					IDOMModel xmlModel = (IDOMModel)model;
+					IDOMDocument xmlDoc = xmlModel.getDocument();
+
+					JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
+					if (adapter != null) {
+						JSPTranslation translation = adapter.getJSPTranslation();
+						elements = translation.getElementsFromJspRange(textSelection.getOffset(), textSelection.getOffset() + textSelection.getLength());
+					}
+				}
+			}
+			finally {
+				if (model != null)
+					model.releaseFromRead();
+			}
+		}
+		if (elements == null) {
+			elements = new IJavaElement[0];
+		}
+		return elements;
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameChange.java
new file mode 100644
index 0000000..a9a7097
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameChange.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+
+/**
+ * <p><b>Note:</b> This class is not used internally any longer and will
+ * be removed at some point.</p>
+ * 
+ * @deprecated
+ */
+public class JSPMethodRenameChange extends Change {
+
+	/**
+	 * @deprecated
+	 */
+	public static Change[] createChangesFor(IMethod method, String newName) {
+		JSPSearchSupport support = JSPSearchSupport.getInstance();
+		
+		// should be handled by JSPIndexManager
+		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
+		// support.indexWorkspaceAndWait();
+		
+		BasicRefactorSearchRequestor requestor = new JSPMethodRenameRequestor(method, newName);
+		support.searchRunnable(method, new JSPSearchScope(), requestor);
+
+		return requestor.getChanges();
+	}
+
+	public String getName() {
+		return JSPUIMessages.JSP_changes; //$NON-NLS-1$
+	}
+
+	public void initializeValidationData(IProgressMonitor pm) {
+		// pa_TODO implement
+		// must be implemented to decide correct value of isValid
+	}
+
+	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
+		// pa_TODO implement
+		// This method must ensure that the change object is still valid.
+		// This is in particular interesting when performing an undo change
+		// since the workspace could have changed since the undo change has
+		// been created.
+		return new RefactoringStatus();
+	}
+
+	public Change perform(IProgressMonitor pm) throws CoreException {
+		// pa_TODO return the "undo" change here
+		return null;
+	}
+
+	public Object getModifiedElement() {
+		// pa_TODO Auto-generated method stub
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
new file mode 100644
index 0000000..f422113
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+
+/**
+ * {@link JSPRenameParticipant} used to update JSP documents when a Java method is renamed
+ */
+public class JSPMethodRenameParticipant extends JSPRenameParticipant {
+	/**
+	 * Initializes the name of this participant to the source of the given {@link IMethod}
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
+	 */
+	protected boolean initialize(Object element) {
+		boolean success = false;
+		try {
+			if(element instanceof IMethod) {
+				super.fName = ((IMethod) element).getSource();
+				success = true;
+			}
+		} catch (JavaModelException e) {
+			Logger.logException(e);
+		}
+		return success;
+	}
+
+	/**
+	 * @return a {@link JSPMethodRenameRequestor}
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#getSearchRequestor(org.eclipse.jdt.core.IJavaElement, java.lang.String)
+	 */
+	protected BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName) {
+		BasicRefactorSearchRequestor searchRequestor = null;
+		
+		if(isLegalElementType(element)) {
+			searchRequestor = new JSPMethodRenameRequestor(element, newName);
+		}
+		
+		return searchRequestor;
+	}
+
+	/**
+	 * <p>Legal types are: 
+	 * <ul><li>{@link IMethod}</li></ul></p>
+	 * 
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#isLegalElementType(org.eclipse.jdt.core.IJavaElement)
+	 */
+	protected boolean isLegalElementType(IJavaElement element) {
+		return (element instanceof IMethod);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameRequestor.java
new file mode 100644
index 0000000..428fe76
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameRequestor.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import java.text.MessageFormat;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+
+/**
+ * @author pavery
+ */
+public class JSPMethodRenameRequestor extends BasicRefactorSearchRequestor {
+	
+	public JSPMethodRenameRequestor(IJavaElement element, String newName) {
+		super(element, newName);
+	}
+	
+	protected String getRenameText(JavaSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
+		
+		String javaText = searchDoc.getJspTranslation().getJavaText();
+		String methodText = javaText.substring(javaMatch.getOffset(), javaMatch.getOffset() + javaMatch.getLength());
+		String methodSuffix = methodText.substring(methodText.indexOf("(")); //$NON-NLS-1$
+		return getNewName() + methodSuffix;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
+	 */
+	protected String getDescription() {
+		
+		String methodName = getElement().getElementName();
+		String newName = getNewName();
+		String description = MessageFormat.format(JSPUIMessages.BasicRefactorSearchRequestor_3, new String[]{methodName, newName}); //$NON-NLS-1$
+		return description;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
new file mode 100644
index 0000000..e273dbd
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IActionDelegate2;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
+
+/**
+ * An action delegate that launches JDT move element wizard
+ * 
+ * Still relies heavily on internal API
+ * will change post 3.0 with public move support
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=61817 
+ */
+public class JSPMoveElementActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
+	//private IEditorPart fEditor;
+
+	public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+		//fEditor = targetEditor;
+	}
+
+	public void dispose() {
+		// nulling out just in case
+		//fEditor = null;
+	}
+
+	public void init(IAction action) {
+		if (action != null) {
+			action.setText(JSPUIMessages.MoveElement_label);
+			action.setToolTipText(JSPUIMessages.MoveElement_label);
+		}
+	}
+
+	public void runWithEvent(IAction action, Event event) {
+		run(action);
+	}
+
+	public void run(IAction action) {
+		
+		// no-op until we know how we're supposed to use this 
+		// eclipse 3.2M5
+		// public move support: https://bugs.eclipse.org/bugs/show_bug.cgi?id=61817
+		
+//		IJavaElement[] elements = getSelectedElements();
+//		if (elements.length > 0) {
+//
+//			// need to check if it's movable
+//			try {
+//				JavaMoveProcessor processor = JavaMoveProcessor.create(getResources(elements), elements);
+//				
+//				Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+//				MoveRefactoring refactoring = new MoveRefactoring(processor);
+//
+//				RefactoringWizard wizard = createWizard(refactoring);
+//
+//				/*
+//				 * We want to get the shell from the refactoring dialog but
+//				 * it's not known at this point, so we pass the wizard and
+//				 * then, once the dialog is open, we will have access to its
+//				 * shell.
+//				 */
+//
+//				processor.setCreateTargetQueries(new CreateTargetQueries(wizard));
+//				processor.setReorgQueries(new ReorgQueries(wizard));
+//				// String openRefactoringWizMsg =
+//				// RefactoringMessages.getString("OpenRefactoringWizardAction.refactoring");
+//				// //$NON-NLS-1$
+//				String openRefactoringWizMsg = JSPUIMessages.MoveElementWizard; // "Move
+//																				// the
+//																				// selected
+//																				// elements";
+//																				// //$NON-NLS-1$
+//				new RefactoringStarter().activate(refactoring, wizard, parent, openRefactoringWizMsg, true);
+//
+//				PlatformStatusLineUtil.clearStatusLine();
+//
+//			}
+//			catch (JavaModelException e) {
+//				Logger.logException(e);
+//			}
+//		}
+//		else {
+//			PlatformStatusLineUtil.displayErrorMessage(JSPUIMessages.JSPMoveElementAction_0); //$NON-NLS-1$
+//		}
+		
+	}
+
+	public void selectionChanged(IAction action, ISelection selection) {
+		PlatformStatusLineUtil.clearStatusLine();
+	}
+
+	public void init(IViewPart view) {
+		// do nothing
+	}
+
+
+	
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveParticipant.java
new file mode 100644
index 0000000..e7e94e5
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveParticipant.java
@@ -0,0 +1,253 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.ISharableParticipant;
+import org.eclipse.ltk.core.refactoring.participants.MoveArguments;
+import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringArguments;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
+import org.eclipse.text.edits.TextEdit;
+
+/**
+ * Abstract {@link ISharableParticipant} {@link MoveParticipant} for editing JSP documents
+ */
+public abstract class JSPMoveParticipant extends MoveParticipant implements ISharableParticipant {
+	
+	/**
+	 * The name of this participant.
+	 * Should be initialized by implementers in {@link #initialize(Object)}
+	 */
+	protected String fName;
+	
+	/**
+	 * A map of {@link IJavaElement} names to pairs of {@link IJavaElement}s
+	 * and their associated {@link MoveArguments} that have been added to
+	 * this {@link ISharableParticipant}.
+	 * 
+	 * key: {@link String} - Element name<br/>
+	 * value: {@link ElementAndArgumentsPair}
+	 */
+	private Map fElementAndArgumentPairs;
+	
+	/**
+	 * When new changes are being safely created {@link #getTextChange(Object)}
+	 * is called first to check for existing {@link TextChange}s, but those
+	 * results do not usually include the changes that have been created thus far
+	 * locally by this {@link MoveParticipant}.  This is to keep track of those
+	 * changes so the overridden version of {@link #getTextChange(Object)}s will take
+	 * these local {@link TextChange}s into account.
+	 */
+	private Map fLocalTextChanges;
+	
+	/**
+	 * Groups an {@link IJavaElement} with its associated {@link MoveArguments}
+	 * that have been added to this {@link ISharableParticipant}
+	 */
+	private class ElementAndArgumentsPair {
+		protected IJavaElement fElement;
+		protected MoveArguments fArgs;
+		
+		public ElementAndArgumentsPair(IJavaElement element, MoveArguments args) {
+			this.fElement = element;
+			this.fArgs = args;
+		}
+	}
+
+	/**
+	 * <p>Do local initialization. This is done here instead of in an implementation of
+	 * {@link RefactoringParticipant#initialize(java.lang.Object)} because implementers
+	 * of this class are not expected to have to call super when they implement
+	 * {@link RefactoringParticipant#initialize(java.lang.Object)}</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(
+	 * 	org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor, java.lang.Object,
+	 * 	org.eclipse.ltk.core.refactoring.participants.RefactoringArguments)
+	 */
+	public boolean initialize(RefactoringProcessor processor, Object element,
+			RefactoringArguments arguments) {
+		
+		this.fElementAndArgumentPairs = new HashMap();
+		this.addElement(element, arguments);
+		this.fLocalTextChanges = new HashMap();
+		this.fName = ""; //$NON-NLS-1$
+		
+		return super.initialize(processor, element, arguments);
+	}
+
+	/**
+	 * <p>When an element is added to this {@link ISharableParticipant} it must be
+	 * a {@link IJavaElement} and be a legal element type ({@link #isLegalElementType(IJavaElement)}
+	 * and the given arguments must be {@link MoveArguments}.  Also the new <code>element</code>
+	 * will not be added if and {@link IJavaElement} of that name has already been added to
+	 * this {@link ISharableParticipant}.  This protects against elements being added more
+	 * then once.</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.ISharableParticipant#addElement(java.lang.Object,
+	 * 	org.eclipse.ltk.core.refactoring.participants.RefactoringArguments)
+	 */
+	public void addElement(Object element, RefactoringArguments arguments) {
+		if(element instanceof IJavaElement &&
+				isLegalElementType((IJavaElement)element) &&
+				arguments instanceof MoveArguments) {
+			
+			//don't add elements that have already been added
+			String elementName = ((IJavaElement)element).getElementName();
+			if(!this.fElementAndArgumentPairs.containsKey(elementName)) {
+				this.fElementAndArgumentPairs.put(elementName,
+						new ElementAndArgumentsPair((IJavaElement)element, (MoveArguments)arguments));
+			}
+		}
+	}
+	
+	/**
+	 * <p>As of now the conditions are always {@link RefactoringStatus#OK}</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(
+	 * 	org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+	 */
+	public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
+		return new RefactoringStatus();
+	}
+	
+	/**
+	 * 
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(
+	 * 	org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public Change createChange(IProgressMonitor pm) throws CoreException {
+		this.getTextChange(""); //$NON-NLS-1$
+		
+		//create one multi change to contain all new created changes
+		CompositeChange multiChange = new CompositeChange(JSPUIMessages.JSP_changes);
+		
+		//for each element get the changes for it and add it to the multi change
+		Iterator iter = fElementAndArgumentPairs.values().iterator();
+		while(iter.hasNext()) {
+			ElementAndArgumentsPair elemArgsPair = (ElementAndArgumentsPair)iter.next();
+			
+			Object dest = elemArgsPair.fArgs.getDestination();
+			
+			if(dest instanceof IPackageFragment) {	
+				Change[] changes = createChangesFor(elemArgsPair.fElement, ((IPackageFragment)dest).getElementName());
+				
+				/* add all new text changes to the local list of text changes so that
+				 * future iterations through the while loop will be aware of already
+				 * existing changes
+				 */
+				for(int i = 0; i < changes.length; ++i) {
+					if(changes[i] instanceof TextChange) {
+						fLocalTextChanges.put(((TextChange)changes[i]).getModifiedElement(), changes[i]);
+					}
+				}
+				
+				if(changes.length > 0) {
+					multiChange.addAll(changes);
+				}
+			}
+		}
+
+		//unless there are actually new changes return null
+		Change result = null;
+		if(multiChange.getChildren().length > 0) {
+			result = multiChange;
+		}
+		
+		return result;
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
+	 */
+	public String getName() {
+		return fName;
+	}
+	
+	/**
+	 * <p>Overridden to include locally created {@link TextChange}s that have not yet be returned by
+	 * {@link #createChange(IProgressMonitor)}.</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getTextChange(java.lang.Object)
+	 */
+	public TextChange getTextChange(Object element) {
+		TextChange existingChange = (TextChange)fLocalTextChanges.get(element);
+		if(existingChange == null) {
+			existingChange = super.getTextChange(element);
+		}
+		
+		return existingChange;
+	}
+	
+	/**
+	 * Using a {@link SearchRequestor} create new changes.
+	 * 
+	 * @param element the {@link IJavaElement} to create new changes for
+	 * @param newName the new name of the given {@link IJavaElement}
+	 * 
+	 * @return any newly created {@link Change}s.  It is important to note
+	 * that while no NEW {@link Change}s maybe returned it is possible that
+	 * new {@link TextEdit}s will still added to existing {@link Change}s.
+	 */
+	protected Change[] createChangesFor(IJavaElement element, String newName) {
+		Change[] changes;
+		BasicRefactorSearchRequestor requestor = getSearchRequestor(element, newName);
+		if(requestor != null) {
+			JSPSearchSupport support = JSPSearchSupport.getInstance();
+			support.searchRunnable(element, new JSPSearchScope(), requestor);
+			changes = requestor.getChanges(this);
+		} else {
+			changes = new Change[0];
+		}
+		
+		return changes;
+	}
+	
+	/**
+	 * <p>Should be implemented to return the {@link BasicRefactorSearchRequestor} associated
+	 * with the implementers {@link JSPMoveParticipant}.</p>
+	 * 
+	 * @param element the {@link IJavaElement} to create the {@link BasicRefactorSearchRequestor} from
+	 * @param newName the new name of the {@link IJavaElement} to use when
+	 * creating the {@link BasicRefactorSearchRequestor}
+	 * 
+	 * @return a new {@link BasicRefactorSearchRequestor} based on the given parameters
+	 */
+	protected abstract BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName);
+	
+	/**
+	 * @param element check that this {@link IJavaElement} is of the type the
+	 * implementers {@link JSPMoveParticipant} is configured to deal with.
+	 * 
+	 * @return <code>true</code> if the given {@link IJavaElement} is of a type
+	 * the implementers {@link JSPMoveParticipant} is configured to deal with,
+	 * <code>false</code> otherwise.
+	 */
+	protected abstract boolean isLegalElementType(IJavaElement element);
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java
new file mode 100644
index 0000000..bd96a25
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+
+/**
+ * <p><b>Note:</b> This class is not used internally any longer and will
+ * be removed at some point.</p>
+ * 
+ * @deprecated
+ */
+public class JSPPackageRenameChange extends Change {
+
+	/**
+	 * @deprecated
+	 */
+	public static Change[] createChangesFor(IPackageFragment pkg, String newName) {
+		JSPSearchSupport support = JSPSearchSupport.getInstance();
+		
+		// should be handled by JSPIndexManager
+		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
+		//support.indexWorkspaceAndWait();
+		
+		BasicRefactorSearchRequestor requestor = new JSPPackageRenameRequestor(pkg, newName);
+		support.searchRunnable(pkg, new JSPSearchScope(), requestor);
+
+		return requestor.getChanges();
+	}
+
+	public String getName() {
+		return JSPUIMessages.JSP_changes; //$NON-NLS-1$
+	}
+
+	public void initializeValidationData(IProgressMonitor pm) {
+		// pa_TODO implement
+		// must be implemented to decide correct value of isValid
+	}
+
+	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
+		// pa_TODO implement
+		// This method must ensure that the change object is still valid.
+		// This is in particular interesting when performing an undo change
+		// since the workspace could have changed since the undo change has
+		// been created.
+		return new RefactoringStatus();
+	}
+
+	public Change perform(IProgressMonitor pm) throws CoreException {
+		// TODO return the "undo" change here
+		return null;
+	}
+
+	public Object getModifiedElement() {
+		
+		//return this.pkg;
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
new file mode 100644
index 0000000..e322ba4
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IPackageFragment;
+
+/**
+ * {@link JSPRenameParticipant} used to update JSP documents when a Java package is renamed
+ */
+public class JSPPackageRenameParticipant extends JSPRenameParticipant {
+	/**
+	 *  Initializes the name of this participant to the name of the {@link IPackageFragment}
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
+	 */
+	protected boolean initialize(Object element) {
+		boolean success = false;
+		if(element instanceof IPackageFragment) {
+			super.fName = ((IPackageFragment)element).getElementName();
+			success = true;
+		}
+		return success;
+	}
+	
+	/**
+	 * @return a {@link JSPPackageRenameRequestor}
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#getSearchRequestor(org.eclipse.jdt.core.IJavaElement, java.lang.String)
+	 */
+	protected BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName) {
+		BasicRefactorSearchRequestor searchRequestor = null;
+		
+		if(isLegalElementType(element)) {
+			searchRequestor = new JSPPackageRenameRequestor(element, newName);
+		}
+		
+		return searchRequestor;
+	}
+	
+	/**
+	 * <p>Legal types are: 
+	 * <ul><li>{@link IPackageFragment}</li></ul></p>
+	 * 
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#isLegalElementType(java.lang.Object)
+	 */
+	protected boolean isLegalElementType(IJavaElement element) {
+		return (element instanceof IPackageFragment);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameRequestor.java
new file mode 100644
index 0000000..da211bb
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameRequestor.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Overrides get description
+ * @author pavery
+ */
+public class JSPPackageRenameRequestor extends BasicRefactorSearchRequestor {
+	
+	/**
+	 * Element is the old package.  newName is the new package name.
+	 * @param element
+	 * @param newName
+	 */
+	public JSPPackageRenameRequestor(IJavaElement element, String newName) {
+		super(element, newName);
+	}
+	
+	/*
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
+	 */
+	protected String getDescription() {
+		String packageName = getElement().getElementName();
+		String newName = getNewName();
+		String description = NLS.bind(JSPUIMessages.BasicRefactorSearchRequestor_5, (new String[]{packageName, newName})); //$NON-NLS-1$
+		return description;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameChange.java
new file mode 100644
index 0000000..7032c21
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameChange.java
@@ -0,0 +1,298 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.DocumentChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.text.edits.MalformedTreeException;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.core.internal.document.DocumentReader;
+import org.eclipse.wst.sse.core.internal.encoding.CodedStreamCreator;
+
+/**
+ * {@link DocumentChange} implementation for JSP Documents
+ */
+public class JSPRenameChange extends DocumentChange {
+
+	/**
+	 * The JSP file this {@link Change} will change
+	 */
+	protected IFile fJSPFile = null;
+	
+	/**
+	 * The description of this change
+	 */
+	private String fDescription;
+	
+	/**
+	 * Create a new {@link JSPRenameChange}
+	 * 
+	 * @param jspFile
+	 * @param jspDoc
+	 * @param edit
+	 * @param description
+	 */
+	public JSPRenameChange(IFile jspFile, IDocument jspDoc, TextEdit edit, String description) {
+		super(JSPUIMessages.BasicRefactorSearchRequestor_6, jspDoc);
+		MultiTextEdit parentEdit = new MultiTextEdit();
+		parentEdit.addChild(edit);
+		super.setEdit(parentEdit);
+		this.fJSPFile = jspFile;
+		this.fDescription = description;
+	}
+	
+	/**
+	 * Create a new {@link JSPRenameChange} by shallow copying the given
+	 * original {@link JSPRenameChange}.
+	 * 
+	 * @param originalChange the {@link JSPRenameChange} to shallow copy to create
+	 * a new {@link JSPRenameChange}
+	 */
+	public JSPRenameChange(JSPRenameChange originalChange) {
+		super(JSPUIMessages.BasicRefactorSearchRequestor_6, originalChange.getJSPDoc());
+		super.setEdit(originalChange.getEdit());
+		this.fJSPFile = originalChange.fJSPFile;
+		this.fDescription = originalChange.fDescription;
+	}
+	
+	/**
+	 * <p>Currently will always be {@link RefactoringStatus#OK}</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.DocumentChange#isValid(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public RefactoringStatus isValid(IProgressMonitor pm)throws CoreException {
+		return new RefactoringStatus();
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.TextChange#getPreviewDocument(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public IDocument getPreviewDocument(IProgressMonitor pm) throws CoreException {
+		IDocument copyDoc = new Document(this.getJSPDoc().get());
+		try {
+			super.getEdit().apply(copyDoc);
+		}
+		catch (MalformedTreeException e) {
+			// ignore
+		}
+		catch (BadLocationException e) {
+			// ignore
+		}
+		return copyDoc;
+	}
+	
+	/**
+	 * Performs this change and returns a {@link JSPRenameUndoChange} to undo the change.
+	 * 
+	 * @return a {@link JSPRenameUndoChange} to undo this performed {@link Change}
+	 * @see org.eclipse.ltk.core.refactoring.TextChange#perform(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public Change perform(IProgressMonitor pm) throws CoreException {
+		Change undoChange = null;
+		try {
+			//apply edit
+			undoChange = super.perform(pm);
+			undoChange = new JSPRenameUndoChange(this, undoChange);
+			
+			//save the model
+			saveJSPFile(this.fJSPFile, this.getJSPDoc());
+			
+		} catch (MalformedTreeException e) {
+			Logger.logException(e);
+		}
+		return undoChange;
+	}
+
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.TextEditBasedChange#getName()
+	 */
+	public String getName() {
+		return this.fDescription;
+	}
+	
+	/**
+	 * <p>The modified element is the JSP {@link IFile} that this {@link Change}
+	 * changes.</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.DocumentChange#getModifiedElement()
+	 */
+	public Object getModifiedElement() {
+		return this.fJSPFile;
+	}
+	
+	/**
+	 * <p>Convenience method to get the JSP {@link IDocument} that this {@link Change}
+	 * edits.</p>
+	 * 
+	 * @return the JSP {@link IDocument} that this {@link Change} edits
+	 */
+	protected IDocument getJSPDoc() {
+		IDocument doc = null;
+		try {
+			doc = this.acquireDocument(null);
+		} catch(CoreException e) {
+			//ignore, DocumentChange.acquireDocument will never throw it
+		}
+		
+		return doc;
+	}
+	
+	/**
+	 * <p>Saves a JSP file.  If the file is not open in an editor then modifies the file directly, else
+	 * if the file is open an editor then run the save method on the open editor.</p>
+	 * 
+	 * @param jspFile the {@link IFile} to save
+	 * @param jspDoc the {@link IDocument} with the new content for the given {@link IFile}
+	 */
+	protected static void saveJSPFile(IFile jspFile, IDocument jspDoc) {
+		//if not open then save model
+		final ITextEditor editor = findOpenEditor(jspDoc);
+		try {
+			/* if no open editor then save the document to the file
+			 * else save the open editor
+			 */
+			if(editor == null) {
+				SaveJspFileOp op  = new SaveJspFileOp(jspFile, jspDoc);
+				op.run(JSPSearchSupport.getInstance().getProgressMonitor());
+			} else {
+				//editor save must be done on UI thread
+				IRunnableWithProgress runnable= new IRunnableWithProgress() {
+					public void run(IProgressMonitor pm) throws InterruptedException {
+						editor.doSave(pm);
+					}
+				};
+				PlatformUI.getWorkbench().getProgressService().runInUI(editor.getSite().getWorkbenchWindow(), runnable, null);
+			}
+		} catch (InvocationTargetException e) {
+			Logger.logException(e);
+		} catch (InterruptedException e) {
+			Logger.logException(e);
+		}
+	}
+	
+	/**
+	 * <p>Checks if a document is open in an editor and returns it if it is</p>
+	 * 
+	 * @param jspDoc check to see if this {@link IDocument} is currently open in an editor
+	 * @return the open {@link ITextEditor} associated with the given {@link IDocument} or
+	 * <code>null</code> if none can be found.
+	 */
+	private static ITextEditor findOpenEditor(IDocument jspDoc) {
+		IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+		IWorkbenchWindow w = null;
+		for (int i = 0; i < windows.length; i++) {
+
+			w = windows[i];
+			IWorkbenchPage page = w.getActivePage();
+			if (page != null) {
+
+				IEditorReference[] references = page.getEditorReferences();
+				IEditorPart editor = null;
+				Object o = null;
+				IDocument doc = null;
+				for (int j = 0; j < references.length; j++) {
+
+					editor = references[j].getEditor(false);
+					// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3764
+					// use adapter to get ITextEditor (for things like
+					// page designer)
+					o = editor.getAdapter(ITextEditor.class);
+					if (o != null && o instanceof ITextEditor) {
+
+						doc = ((ITextEditor) o).getDocumentProvider().getDocument(editor.getEditorInput());
+						if (doc != null && doc.equals(jspDoc)) {
+							return (ITextEditor) o;
+						}
+					}
+				}
+			}
+		}
+		return null;
+	}
+	
+	/**
+	 * Workspace operation to perform save on model for updated documents.
+	 * Should only be done on models not open in an editor.
+	 */
+	private static class SaveJspFileOp extends WorkspaceModifyOperation {
+		
+		private IDocument fJSPDoc = null;
+		private IFile fJSPFile = null;
+		
+		public SaveJspFileOp(IFile jspFile, IDocument jspDoc) {
+			this.fJSPDoc = jspDoc;
+			this.fJSPFile = jspFile;
+		}
+		
+		protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
+			
+			// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3765
+			// save file w/ no intermediate model creation
+			
+			CodedStreamCreator codedStreamCreator = new CodedStreamCreator();
+			Reader reader = new DocumentReader(this.fJSPDoc);
+			codedStreamCreator.set(this.fJSPFile, reader);
+			
+			ByteArrayOutputStream codedByteStream = null;
+			InputStream codedStream = null;
+			try {
+				codedByteStream = codedStreamCreator.getCodedByteArrayOutputStream();
+				codedStream = new ByteArrayInputStream(codedByteStream.toByteArray());
+				if (this.fJSPFile.exists())
+					this.fJSPFile.setContents(codedStream, true, true, null);
+				else
+					this.fJSPFile.create(codedStream, false, null);
+				
+			} catch (CoreException e) {
+				Logger.logException(e);
+			} catch (IOException e) {
+				Logger.logException(e);
+			}
+			finally {
+				try {
+					if(codedByteStream != null)
+						codedByteStream.close();
+					if(codedStream != null)
+						codedStream.close();
+				}
+				catch (IOException e){
+					// unlikely
+				}
+			}
+		}
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java
new file mode 100644
index 0000000..f487fc5
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.ui.refactoring.RenameSupport;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IActionDelegate2;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
+
+/**
+ * An action delegate that launches JDT rename element wizard
+ */
+public class JSPRenameElementActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
+	private IEditorPart fEditor;
+	
+	public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+		fEditor = targetEditor;
+	}
+
+	public void dispose() {
+		// nulling out just in case
+		fEditor = null;
+	}
+
+	public void init(IAction action) {
+		if (action != null) {
+			action.setText(JSPUIMessages.RenameElement_label);
+			action.setToolTipText(JSPUIMessages.RenameElement_label);
+		}
+	}
+
+	public void runWithEvent(IAction action, Event event) {
+		run(action);
+	}
+	
+	public void run(IAction action) {
+		IJavaElement element = getSelectedElement();
+		if(element != null) {
+			RenameSupport renameSupport = null;
+			try {
+				switch(element.getElementType()) {
+					case IJavaElement.TYPE:
+						renameSupport= RenameSupport.create((IType)element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
+						break;
+					case IJavaElement.METHOD:
+						renameSupport= RenameSupport.create((IMethod)element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
+						break;
+					case IJavaElement.PACKAGE_FRAGMENT:
+						renameSupport= RenameSupport.create((IPackageFragment)element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
+						break;
+				}
+				if(renameSupport != null) {
+					renameSupport.openDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+					PlatformStatusLineUtil.clearStatusLine();
+				}
+			}
+			catch (CoreException e) {
+				Logger.logException(e);
+			}
+		}
+		else  {
+			PlatformStatusLineUtil.displayErrorMessage(JSPUIMessages.JSPRenameElementAction_0); //$NON-NLS-1$
+			PlatformStatusLineUtil.addOneTimeClearListener();
+		}
+	}
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		PlatformStatusLineUtil.clearStatusLine();
+	}
+
+	public void init(IViewPart view) {
+		// do nothing
+	}
+
+	private IJavaElement getSelectedElement() {
+		IJavaElement element = null;
+		if (fEditor instanceof ITextEditor) {
+			IJavaElement[] elements = JSPJavaSelectionProvider.getSelection((ITextEditor)fEditor);
+			if (elements.length == 1)
+				element = elements[0];
+		}
+		return element;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameParticipant.java
new file mode 100644
index 0000000..d11ec67
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameParticipant.java
@@ -0,0 +1,245 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.ISharableParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringArguments;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
+import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+import org.eclipse.text.edits.TextEdit;
+
+/**
+ * Abstract {@link ISharableParticipant} {@link RenameParticipant} for editing JSP documents
+ */
+public abstract class JSPRenameParticipant extends RenameParticipant implements ISharableParticipant {
+	/**
+	 * The name of this participant.
+	 * Should be initialized by implementers in {@link #initialize(Object)}
+	 */
+	protected String fName;
+	
+	/**
+	 * A map of {@link IJavaElement} names to pairs of {@link IJavaElement}s
+	 * and their associated {@link RenameArguments} that have been added to
+	 * this {@link ISharableParticipant}.
+	 * 
+	 * key: {@link String} - Element name<br/>
+	 * value: {@link ElementAndArgumentsPair}
+	 */
+	private Map fElementAndArgumentPairs;
+	
+	/**
+	 * When new changes are being safely created {@link #getTextChange(Object)}
+	 * is called first to check for existing {@link TextChange}s, but those
+	 * results do not usually include the changes that have been created thus far
+	 * locally by this {@link RenameParticipant}.  This is to keep track of those
+	 * changes so the overridden version of {@link #getTextChange(Object)}s will take
+	 * these local {@link TextChange}s into account.
+	 */
+	private Map fLocalTextChanges;
+	
+	/**
+	 * Groups an {@link IJavaElement} with its associated {@link RenameArguments}
+	 * that have been added to this {@link ISharableParticipant}
+	 */
+	private class ElementAndArgumentsPair {
+		protected IJavaElement fElement;
+		protected RenameArguments fArgs;
+		
+		public ElementAndArgumentsPair(IJavaElement element, RenameArguments args) {
+			this.fElement = element;
+			this.fArgs = args;
+		}
+	}
+
+	/**
+	 * <p>Do local initialization. This is done here instead of in an implementation of
+	 * {@link RefactoringParticipant#initialize(java.lang.Object)} because implementers
+	 * of this class are not expected to have to call super when they implement
+	 * {@link RefactoringParticipant#initialize(java.lang.Object)}</p>
+	 * 
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(
+	 * 	org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor, java.lang.Object,
+	 * 	org.eclipse.ltk.core.refactoring.participants.RefactoringArguments)
+	 */
+	public boolean initialize(RefactoringProcessor processor, Object element,
+			RefactoringArguments arguments) {
+		
+		this.fElementAndArgumentPairs = new HashMap();
+		this.addElement(element, arguments);
+		this.fLocalTextChanges = new HashMap();
+		this.fName = ""; //$NON-NLS-1$
+		
+		return super.initialize(processor, element, arguments);
+	}
+
+	/**
+	 * <p>When an element is added to this {@link ISharableParticipant} it must be
+	 * a {@link IJavaElement} and be a legal element type ({@link #isLegalElementType(IJavaElement)}
+	 * and the given arguments must be {@link RenameArguments}.  Also the new <code>element</code>
+	 * will not be added if and {@link IJavaElement} of that name has already been added to
+	 * this {@link ISharableParticipant}.  This protects against elements being added more
+	 * then once.</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.ISharableParticipant#addElement(java.lang.Object,
+	 * 	org.eclipse.ltk.core.refactoring.participants.RefactoringArguments)
+	 */
+	public void addElement(Object element, RefactoringArguments arguments) {
+		if(element instanceof IJavaElement &&
+				isLegalElementType((IJavaElement)element) &&
+				arguments instanceof RenameArguments) {
+			
+			//don't add elements that have already been added
+			String elementName = ((IJavaElement)element).getElementName();
+			if(!this.fElementAndArgumentPairs.containsKey(elementName)) {
+				this.fElementAndArgumentPairs.put(elementName,
+						new ElementAndArgumentsPair((IJavaElement)element, (RenameArguments)arguments));
+			}
+		}
+	}
+	
+	/**
+	 * <p>As of now the conditions are always {@link RefactoringStatus#OK}</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(
+	 * 	org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+	 */
+	public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
+		return new RefactoringStatus();
+	}
+	
+	/**
+	 * 
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(
+	 * 	org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public Change createChange(IProgressMonitor pm) throws CoreException {
+		this.getTextChange(""); //$NON-NLS-1$
+		
+		//create one multi change to contain all new created changes
+		CompositeChange multiChange = new CompositeChange(JSPUIMessages.JSP_changes);
+		
+		//for each element get the changes for it and add it to the multi change
+		Iterator iter = fElementAndArgumentPairs.values().iterator();
+		while(iter.hasNext()) {
+			ElementAndArgumentsPair elemArgsPair = (ElementAndArgumentsPair)iter.next();
+			Change[] changes = createChangesFor(elemArgsPair.fElement, elemArgsPair.fArgs.getNewName());
+			
+			/* add all new text changes to the local list of text changes so that
+			 * future iterations through the while loop will be aware of already
+			 * existing changes
+			 */
+			for(int i = 0; i < changes.length; ++i) {
+				if(changes[i] instanceof TextChange) {
+					fLocalTextChanges.put(((TextChange)changes[i]).getModifiedElement(), changes[i]);
+				}
+			}
+			
+			if(changes.length > 0) {
+				multiChange.addAll(changes);
+			}
+		}
+
+		//unless there are actually new changes return null
+		Change result = null;
+		if(multiChange.getChildren().length > 0) {
+			result = multiChange;
+		}
+		
+		return result;
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
+	 */
+	public String getName() {
+		return fName;
+	}
+	
+	/**
+	 * <p>Overridden to include locally created {@link TextChange}s that have not yet be returned by
+	 * {@link #createChange(IProgressMonitor)}.</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getTextChange(java.lang.Object)
+	 */
+	public TextChange getTextChange(Object element) {
+		TextChange existingChange = (TextChange)fLocalTextChanges.get(element);
+		if(existingChange == null) {
+			existingChange = super.getTextChange(element);
+		}
+		
+		return existingChange;
+	}
+	
+	/**
+	 * 
+	 * @param element the {@link IJavaElement} to create new changes for
+	 * @param newName the new name of the given {@link IJavaElement}
+	 * 
+	 * @return any newly created {@link Change}s.  It is important to note
+	 * that while no NEW {@link Change}s maybe returned it is possible that
+	 * new {@link TextEdit}s will still added to existing {@link Change}s.
+	 */
+	protected Change[] createChangesFor(IJavaElement element, String newName) {
+		Change[] changes;
+		BasicRefactorSearchRequestor requestor = getSearchRequestor(element, newName);
+		if(requestor != null) {
+			JSPSearchSupport support = JSPSearchSupport.getInstance();
+			support.searchRunnable(element, new JSPSearchScope(), requestor);
+			changes = requestor.getChanges(this);
+		} else {
+			changes = new Change[0];
+		}
+		
+		return changes;
+	}
+	
+	/**
+	 * <p>Should be implemented to return the {@link BasicRefactorSearchRequestor} associated
+	 * with the implementers {@link JSPRenameParticipantParticipant}.</p>
+	 * 
+	 * @param element the {@link IJavaElement} to create the {@link BasicRefactorSearchRequestor} from
+	 * @param newName the new name of the {@link IJavaElement} to use when
+	 * creating the {@link BasicRefactorSearchRequestor}
+	 * 
+	 * @return a new {@link BasicRefactorSearchRequestor} based on the given parameters
+	 */
+	protected abstract BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName);
+	
+	/**
+	 * @param element check that this {@link IJavaElement} is of the type the
+	 * implementers {@link JSPRenameParticipant} is configured to deal with.
+	 * 
+	 * @return <code>true</code> if the given {@link IJavaElement} is of a type
+	 * the implementers {@link JSPRenameParticipant} is configured to deal with,
+	 * <code>false</code> otherwise.
+	 */
+	protected abstract boolean isLegalElementType(IJavaElement element);
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameUndoChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameUndoChange.java
new file mode 100644
index 0000000..a34e67d
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameUndoChange.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+/**
+ * <p>When undoing {@link JSPRenameChange}s need to be sure not only to perform
+ * the UndoDocumentChange but to also save the JSP file otherwise one of two
+ * unwanted things could happen:
+ * <ul><li>an open editor with the file could be marked dirty</li>
+ * <li>or if the changed file is not open in an editor then the changes will
+ * not be saved to the file and thus not persist.</li></ul></p>
+ * 
+ * <p>Therefore a {@link JSPRenameUndoChange} wraps another {@link Change} which
+ * is considered the "undo change".  When a perform is called on {@link JSPRenameUndoChange}
+ * the perform is called on the wrapped "undo change", another {@link JSPRenameUndoChange}
+ * is created as the "redo change" from the return of the perform on the "undo change"
+ * and then most importantly the updated {@link IDocument} is saved to the {@link IFile}
+ * if the JSP file is not open in an editor, or a save is called on the open {@link ITextEditor}
+ * that is editing the changed JSP file.</p>
+ */
+public class JSPRenameUndoChange extends JSPRenameChange {
+	/**
+	 * The "undo change" being wrapped
+	 */
+	private Change fUndoChange;
+	
+	/**
+	 * <p>Create the {@link JSPRenameUndoChange} from the {@link JSPRenameChange}
+	 * that created the undo change and the undo change itself.</p>
+	 * 
+	 * @param originalChange the {@link JSPRenameChange} that created the <code>undoChange</code>
+	 * @param undoChange the undo change to be wrapped by this {@link JSPRenameUndoChange}
+	 */
+	public JSPRenameUndoChange(JSPRenameChange originalChange, Change undoChange) {
+		super(originalChange);
+		fUndoChange = undoChange;
+	}
+	
+	/**
+	 * <p>See {@link JSPRenameUndoChange} class description for more details.</p>
+	 * 
+	 * @return a {@link JSPRenameUndoChange} wrapping the "redo change" returned by the
+	 * call to {@link Change#perform(IProgressMonitor)} on the wrapped "undo change".
+	 * 
+	 * @see JSPRenameUndoChange
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameChange#perform(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public Change perform(IProgressMonitor pm) throws CoreException {
+		//apply edit
+		Change redoChange = fUndoChange.perform(pm);
+		redoChange = new JSPRenameUndoChange(this, redoChange);
+		
+		//save the file
+		saveJSPFile(this.fJSPFile, this.getJSPDoc());
+		
+		return redoChange;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java
new file mode 100644
index 0000000..b60baad
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+
+/**
+ * <p><b>Note:</b> This class is not used internally any longer and will
+ * be removed at some point.</p>
+ * 
+ * @deprecated
+ */
+public class JSPTypeMoveChange extends Change {
+
+	/**
+	 * @deprecated
+	 */
+	public static Change[] createChangesFor(IType type, String newName) {
+		
+		JSPSearchSupport support = JSPSearchSupport.getInstance();
+		// should be handled by JSPIndexManager
+		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
+		// support.indexWorkspaceAndWait();
+		
+		JSPTypeMoveRequestor requestor = new JSPTypeMoveRequestor(type, newName);
+		support.searchRunnable(type, new JSPSearchScope(), requestor);
+
+		return requestor.getChanges();
+	}
+
+	public String getName() {
+		return JSPUIMessages.JSP_changes; //$NON-NLS-1$
+	}
+
+	public void initializeValidationData(IProgressMonitor pm) {
+		// pa_TODO implement
+		// must be implemented to decide correct value of isValid
+	}
+
+	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
+		// pa_TODO implement
+		// This method must ensure that the change object is still valid.
+		// This is in particular interesting when performing an undo change
+		// since the workspace could have changed since the undo change has
+		// been created.
+		return new RefactoringStatus();
+	}
+
+	public Change perform(IProgressMonitor pm) throws CoreException {
+		// TODO return the "undo" change here
+		return null;
+	}
+
+	public Object getModifiedElement() {
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
new file mode 100644
index 0000000..4ac0bb0
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IType;
+
+/**
+ * {@link JSPMoveParticipant} used to update JSP documents when a Java type is moved.
+ */
+public class JSPTypeMoveParticipant extends JSPMoveParticipant {
+	
+	/**
+	 * Initializes the name of this participant to the name of the {@link IType}
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
+	 */
+	protected boolean initialize(Object element) {
+		boolean success = false;
+		if(element instanceof IType) {
+			super.fName =((IType)element).getElementName();
+			success = true;
+		}
+		return success;
+	}
+
+	/**
+	 * @return a {@link JSPTypeMoveRequestor}
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPMoveParticipant#getSearchRequestor(org.eclipse.jdt.core.IJavaElement, java.lang.String)
+	 */
+	protected BasicRefactorSearchRequestor getSearchRequestor(
+			IJavaElement element, String newName) {
+		
+		BasicRefactorSearchRequestor searchRequestor = null;
+		
+		if(isLegalElementType(element)) {
+			searchRequestor = new JSPTypeMoveRequestor(element, newName);
+		}
+		
+		return searchRequestor;
+	}
+
+	/**
+	 * <p>Legal types are: 
+	 * <ul><li>{@link IType}</li></ul></p>
+	 * 
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#isLegalElementType(org.eclipse.jdt.core.IJavaElement)
+	 */
+	protected boolean isLegalElementType(IJavaElement element) {
+		return (element instanceof IType);
+	}
+	
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
new file mode 100644
index 0000000..bd9c8c0
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import java.text.MessageFormat;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+
+/**
+ * @author pavery
+ */
+public class JSPTypeMoveRequestor extends BasicRefactorSearchRequestor {
+
+	/**
+	 * @param element
+	 * @param newName
+	 */
+	public JSPTypeMoveRequestor(IJavaElement element, String newPackage) {
+		super(element, newPackage);
+	}
+	
+	/**
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getRenameText(org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate, org.eclipse.jdt.core.search.SearchMatch)
+	 */
+	protected String getRenameText(JavaSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
+		
+		String renameText = getElement().getElementName();
+
+		JSPTranslation trans = searchDoc.getJspTranslation();
+		String matchText = trans.getJavaText().substring(javaMatch.getOffset(), javaMatch.getOffset() + javaMatch.getLength());
+		
+		// if it's an import or jsp:useBean, we need to add the package name as well
+		if(trans.isImport(javaMatch.getOffset()) || trans.isUseBean(javaMatch.getOffset()) || isFullyQualified(matchText)) {
+			if(!getNewName().equals("")) //$NON-NLS-1$
+				// getNewName() is the pkg name
+				renameText = getNewName() + "." + renameText; //$NON-NLS-1$
+		}
+
+		//if the rename text is the same as the match text then, don't want to bother renaming anything
+		if(renameText.equals(matchText)) {
+			renameText = null;
+		} 
+
+		return renameText;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
+	 */
+	protected String getDescription() {
+		
+		String typeName = getElement().getElementName();
+		String newName = getNewName();
+		String description = MessageFormat.format(JSPUIMessages.BasicRefactorSearchRequestor_2, new String[]{typeName, newName}); //$NON-NLS-1$
+		return description;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java
new file mode 100644
index 0000000..e5ea96c
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+
+/**
+ * <p><b>Note:</b> This class is not used internally any longer and will
+ * be removed at some point.</p>
+ * 
+ * @deprecated
+ */
+public class JSPTypeRenameChange extends Change {
+
+	/**
+	 * @deprecated
+	 */
+	public static Change[] createChangesFor(IType type, String newName) {
+		JSPSearchSupport support = JSPSearchSupport.getInstance();
+		
+		// should be handled by JSPIndexManager
+		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
+		// support.indexWorkspaceAndWait();
+	
+		
+		JSPTypeRenameRequestor requestor = new JSPTypeRenameRequestor(type, newName);
+		support.searchRunnable(type, new JSPSearchScope(), requestor);
+
+		return requestor.getChanges();
+	}
+
+	public String getName() {
+		return JSPUIMessages.JSP_changes; //$NON-NLS-1$
+	}
+
+	public void initializeValidationData(IProgressMonitor pm) {
+		// pa_TODO implement
+		// must be implemented to decide correct value of isValid
+	}
+
+	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
+		// pa_TODO implement
+		// This method must ensure that the change object is still valid.
+		// This is in particular interesting when performing an undo change
+		// since the workspace could have changed since the undo change has
+		// been created.
+		return new RefactoringStatus();
+	}
+
+	public Change perform(IProgressMonitor pm) throws CoreException {
+		// TODO return the "undo" change here
+		return null;
+	}
+
+	public Object getModifiedElement() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
new file mode 100644
index 0000000..db2e95b
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IType;
+
+/**
+ * {@link JSPRenameParticipant} used to update JSP documents when a Java type is renamed
+ */
+public class JSPTypeRenameParticipant extends JSPRenameParticipant {
+
+	
+	/**
+	 * Initializes the name of this participant to the name of the {@link IType}
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
+	 */
+	protected boolean initialize(Object element) {
+		boolean success = false;
+		if(element instanceof IType) {
+			super.fName = ((IType)element).getElementName();
+			success = true;
+		}
+		return success;
+	}
+
+	/**
+	 * @return a {@link JSPTypeRenameRequestor}
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#getSearchRequestor(org.eclipse.jdt.core.IJavaElement, java.lang.String)
+	 */
+	protected BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName) {
+		
+		BasicRefactorSearchRequestor searchRequestor = null;
+		
+		if(isLegalElementType(element)) {
+			searchRequestor = new JSPTypeRenameRequestor((IType)element, newName);
+		}
+		
+		return searchRequestor;
+	}
+
+	/**
+	 * <p>Legal types are: 
+	 * <ul><li>{@link IType}</li></ul></p>
+
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#isLegalElementType(org.eclipse.jdt.core.IJavaElement)
+	 */
+	protected boolean isLegalElementType(IJavaElement element) {
+		return (element instanceof IType);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
new file mode 100644
index 0000000..a341753
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import java.text.MessageFormat;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+
+/**
+ * Creates document change(s) for a type rename.
+ * Changes are created for every type "match" in the workspace
+ * @author pavery
+ */
+public class JSPTypeRenameRequestor extends BasicRefactorSearchRequestor {
+
+	public JSPTypeRenameRequestor(IType type, String newName) {
+		super(type, newName);
+	}
+	
+	private IType getType() {
+		return (IType)getElement();
+	}
+	
+	protected String getRenameText(JavaSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
+		
+		String renameText = getNewName();
+		
+		String pkg = getType().getPackageFragment().getElementName();
+		IJavaElement parent = getType().getParent();
+		String parentName = (parent != null) ? parent.getElementName() : null;
+		JSPTranslation trans = searchDoc.getJspTranslation();
+		String matchText = trans.getJavaText().substring(javaMatch.getOffset(), javaMatch.getOffset() + javaMatch.getLength());
+		
+		// if it's an import or jsp:useBean or fully qualified type, we need to add the package name as well
+		// else if starts with parent name such as "MyClass.Enum" then need to add the parent name as well
+		if(trans.isImport(javaMatch.getOffset()) || isFullyQualified(matchText)) {
+			if(!pkg.equals("")) //$NON-NLS-1$
+				renameText = pkg + "." + renameText; //$NON-NLS-1$
+		} else if(parentName != null && matchText.startsWith(parentName)) {
+			renameText = parentName + "." + renameText; //$NON-NLS-1$
+		}
+		return renameText;
+	}
+	
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
+	 */
+	protected String getDescription() {
+		
+		String typeName = getElement().getElementName();
+		String newName = getNewName();
+		String description = MessageFormat.format(JSPUIMessages.BasicRefactorSearchRequestor_4, new String[]{typeName, newName}); //$NON-NLS-1$
+		return description;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/MoveElementHandler.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/MoveElementHandler.java
new file mode 100644
index 0000000..21abbf0
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/MoveElementHandler.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+
+/**
+ * A handler that launches JDT move element wizard
+ * 
+ * Still relies heavily on internal API
+ * will change post 3.0 with public move support
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=61817 
+ */
+public class MoveElementHandler extends AbstractHandler {
+//	private IEditorPart fEditor;
+
+	public Object execute(ExecutionEvent arg0) throws ExecutionException {
+		// no-op until we know how we're supposed to use this 
+		// eclipse 3.2M5
+		// public move support: https://bugs.eclipse.org/bugs/show_bug.cgi?id=61817
+		
+//		IJavaElement[] elements = getSelectedElements();
+//		if (elements.length > 0) {
+//
+//			// need to check if it's movable
+//			try {
+//				JavaMoveProcessor processor = JavaMoveProcessor.create(getResources(elements), elements);
+//				
+//				Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+//				MoveRefactoring refactoring = new MoveRefactoring(processor);
+//
+//				RefactoringWizard wizard = createWizard(refactoring);
+//
+//				/*
+//				 * We want to get the shell from the refactoring dialog but
+//				 * it's not known at this point, so we pass the wizard and
+//				 * then, once the dialog is open, we will have access to its
+//				 * shell.
+//				 */
+//
+//				processor.setCreateTargetQueries(new CreateTargetQueries(wizard));
+//				processor.setReorgQueries(new ReorgQueries(wizard));
+//				// String openRefactoringWizMsg =
+//				// RefactoringMessages.getString("OpenRefactoringWizardAction.refactoring");
+//				// //$NON-NLS-1$
+//				String openRefactoringWizMsg = JSPUIMessages.MoveElementWizard; // "Move
+//																				// the
+//																				// selected
+//																				// elements";
+//																				// //$NON-NLS-1$
+//				new RefactoringStarter().activate(refactoring, wizard, parent, openRefactoringWizMsg, true);
+//
+//				PlatformStatusLineUtil.clearStatusLine();
+//
+//			}
+//			catch (JavaModelException e) {
+//				Logger.logException(e);
+//			}
+//		}
+//		else {
+//			PlatformStatusLineUtil.displayErrorMessage(JSPUIMessages.JSPMoveElementAction_0); //$NON-NLS-1$
+//		}
+		return null;
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameElementHandler.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameElementHandler.java
new file mode 100644
index 0000000..1c1b962
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameElementHandler.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.ui.refactoring.RenameSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
+
+public class RenameElementHandler extends AbstractHandler {
+	private IEditorPart fEditor;
+	
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		fEditor = HandlerUtil.getActiveEditor(event);
+		
+		IJavaElement element = getSelectedElement();
+		if(element != null) {
+			RenameSupport renameSupport = null;
+			try {
+				switch(element.getElementType()) {
+					case IJavaElement.TYPE:
+						renameSupport= RenameSupport.create((IType)element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
+						break;
+					case IJavaElement.METHOD:
+						renameSupport= RenameSupport.create((IMethod)element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
+						break;
+					case IJavaElement.PACKAGE_FRAGMENT:
+						renameSupport= RenameSupport.create((IPackageFragment)element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
+						break;
+				}
+				if(renameSupport != null) {
+					renameSupport.openDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+					PlatformStatusLineUtil.clearStatusLine();
+				}
+			}
+			catch (CoreException e) {
+				Logger.logException(e);
+			}
+		}
+		else  {
+			PlatformStatusLineUtil.displayErrorMessage(JSPUIMessages.JSPRenameElementAction_0); //$NON-NLS-1$
+			PlatformStatusLineUtil.addOneTimeClearListener();
+		}
+		
+		return null;
+	}
+	
+	private IJavaElement getSelectedElement() {
+		IJavaElement element = null;
+		if (fEditor != null) {
+			ITextEditor editor = (ITextEditor) ((fEditor instanceof ITextEditor) ? fEditor : fEditor.getAdapter(ITextEditor.class));
+			if (editor != null) {
+				IJavaElement[] elements = JSPJavaSelectionProvider.getSelection(editor);
+				if (elements.length == 1)
+					element = elements[0];
+			}
+		}
+		return element;
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/BasicJSPSearchRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/BasicJSPSearchRequestor.java
new file mode 100644
index 0000000..1acb7be
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/BasicJSPSearchRequestor.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.search;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.search.SearchDocument;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jdt.core.search.SearchParticipant;
+import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate;
+
+/**
+ * Accepts matches from JSPSearchSupport.search(...) request.
+ * Adapts the results from java to JSP and displays in the SearchResultView.
+ * 
+ * @author pavery
+ */
+public class BasicJSPSearchRequestor extends SearchRequestor {
+
+	// for debugging
+	private static final boolean DEBUG;
+	static {
+		String value= Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspsearch"); //$NON-NLS-1$
+		DEBUG= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+	
+	/**
+	 * Maps java search coordinates to corresponding JSP coordinates.
+	 * Adds the matches to the Search Results view.
+	 * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch)
+	 */
+	public void acceptSearchMatch(SearchMatch match) throws CoreException {
+
+		if(JSPSearchSupport.getInstance().isCanceled())
+			return;
+				
+		String matchDocumentPath = match.getResource().getFullPath().toString();
+		SearchDocument searchDoc = JSPSearchSupport.getInstance().getSearchDocument(matchDocumentPath);
+		
+		if (searchDoc != null && searchDoc instanceof JavaSearchDocumentDelegate) {
+			JavaSearchDocumentDelegate javaSearchDoc = (JavaSearchDocumentDelegate)searchDoc;
+			int jspStart = javaSearchDoc.getJspOffset(match.getOffset());
+			int jspEnd = javaSearchDoc.getJspOffset(match.getOffset() + match.getLength());
+
+			JSPTranslation trans = javaSearchDoc.getJspTranslation();
+			String jspText = trans.getJspText();
+			String javaText = javaSearchDoc.getJavaText();
+
+			if (DEBUG) 
+				displayDebugInfo(match, jspStart, jspEnd, jspText, javaText);
+		
+			if (jspStart > -1 && jspEnd > -1)
+				addSearchMatch(new Document(trans.getJspText()), javaSearchDoc.getFile(), jspStart, jspEnd, jspText);
+		}
+	}
+
+	/**
+	 * @param searchDoc
+	 * @param jspStart
+	 * @param jspEnd
+	 * @param jspTranslation
+	 * @param jspText
+	 * @throws CoreException
+	 */
+	protected void addSearchMatch(IDocument jspDocument, IFile jspFile, int jspStart, int jspEnd, String jspText) {
+		// implement in subclass
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jdt.core.search.SearchRequestor#beginReporting()
+	 */
+	public void beginReporting() {
+
+		if (DEBUG)
+			System.out.println("JSP Search requestor: beginReporting()"); //$NON-NLS-1$
+	}
+
+	/**
+	 * @see org.eclipse.jdt.core.search.SearchRequestor#endReporting()
+	 */
+	public void endReporting() {
+
+		if (DEBUG)
+			System.out.println("JSP Search requestor: endReporting()"); //$NON-NLS-1$
+	}
+
+	/**
+	 * @see org.eclipse.jdt.core.search.SearchRequestor#enterParticipant(org.eclipse.jdt.core.search.SearchParticipant)
+	 */
+	public void enterParticipant(SearchParticipant participant) {
+
+		if (DEBUG)
+			System.out.println("JSP Search requestor: enterParticipant()"); //$NON-NLS-1$
+	}
+
+	/**
+	 * @see org.eclipse.jdt.core.search.SearchRequestor#exitParticipant(org.eclipse.jdt.core.search.SearchParticipant)
+	 */
+	public void exitParticipant(SearchParticipant participant) {
+
+		if (DEBUG)
+			System.out.println("JSP Search requestor: exitParticipant()"); //$NON-NLS-1$
+	}
+
+	/**
+	 * For debug.
+	 * @param origMatch
+	 * @param jspStart
+	 * @param jspEnd
+	 * @param jspText
+	 * @param javaText
+	 */
+	private void displayDebugInfo(SearchMatch origMatch, int jspStart, int jspEnd, String jspText, String javaText) {
+
+		if (origMatch == null || jspStart == -1 || jspEnd == -1 || jspEnd < jspStart || jspText == null || javaText == null)
+			return;
+
+		System.out.println("+-----------------------------------------+"); //$NON-NLS-1$
+		System.out.println("accept possible match [jspDoc: " + origMatch.getResource().getFullPath().toOSString() + " " + origMatch.getOffset() + ":" + origMatch.getOffset() + origMatch.getLength() + "]?"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		System.out.println("match info:"); //$NON-NLS-1$
+		System.out.println("the java text is:" + javaText.substring(origMatch.getOffset(), origMatch.getOffset() + origMatch.getLength())); //$NON-NLS-1$
+		System.out.println("java search match translates to jsp coords [start: " + jspStart + " end:" + jspEnd + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		System.out.println(" the jsp text is:" + jspText.substring(jspStart, jspEnd)); //$NON-NLS-1$
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesActionDelegate.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesActionDelegate.java
new file mode 100644
index 0000000..8897deb
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesActionDelegate.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+
+package org.eclipse.jst.jsp.ui.internal.java.search;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesProcessor;
+import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionDelegate;
+
+/**
+ * Sets up FindOccurrencesActionDelegate for jsp find occurrences processors
+ */
+public class JSPFindOccurrencesActionDelegate extends FindOccurrencesActionDelegate {
+	private List fProcessors;
+
+	protected List getProcessors() {
+		if (fProcessors == null) {
+			fProcessors = new ArrayList();
+			HTMLFindOccurrencesProcessor htmlProcessor = new HTMLFindOccurrencesProcessor();
+			fProcessors.add(htmlProcessor);
+			JSPFindOccurrencesProcessor jspProcessor = new JSPFindOccurrencesProcessor();
+			fProcessors.add(jspProcessor);
+		}
+		return fProcessors;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java
new file mode 100644
index 0000000..50fff8f
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+
+package org.eclipse.jst.jsp.ui.internal.java.search;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.search.ui.ISearchQuery;
+import org.eclipse.search.ui.NewSearchUI;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+
+/**
+ * Configures a FindOccurrencesProcessor with JSP partitions and regions
+ */
+public class JSPFindOccurrencesProcessor extends FindOccurrencesProcessor {
+
+	public boolean findOccurrences(IDocument document, ITextSelection textSelection, IFile file) {
+		boolean findOccurrences = false;
+
+		// determine if action should be enabled or not
+		if (document instanceof IStructuredDocument) {
+			IStructuredDocument structuredDocument = (IStructuredDocument) document;
+			IStructuredDocumentRegion sdRegion = structuredDocument.getRegionAtCharacterOffset(textSelection.getOffset());
+			if (sdRegion != null) {
+				ITextRegion r = sdRegion.getRegionAtCharacterOffset(textSelection.getOffset());
+				if (r != null) {
+					String type = r.getType();
+					if (enabledForRegionType(type)) {
+						String matchText = sdRegion.getText(r);
+
+						if (matchText != null && type != null) {
+							JSPSearchQuery searchQuery = (JSPSearchQuery) getSearchQuery(file, structuredDocument, matchText, type, textSelection);
+							findOccurrences = true;
+							if (searchQuery != null) {
+								if(searchQuery.getSearchText() == null || searchQuery.getSearchText().length() == 0)
+									findOccurrences = false;
+								else
+								{
+									// first of all activate the view
+									NewSearchUI.activateSearchResultView();
+									
+									if (searchQuery.canRunInBackground())
+										NewSearchUI.runQueryInBackground(searchQuery);
+									else
+										NewSearchUI.runQueryInForeground(null, searchQuery);
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+		return findOccurrences;
+	}
+	
+	protected String[] getPartitionTypes() {
+		return new String[]{IJSPPartitions.JSP_DEFAULT, IJSPPartitions.JSP_CONTENT_JAVA};
+	}
+
+	protected String[] getRegionTypes() {
+		return new String[]{DOMRegionContext.BLOCK_TEXT, DOMJSPRegionContexts.JSP_CONTENT};
+	}
+
+	protected ISearchQuery getSearchQuery(IFile file, IStructuredDocument document, String regionText, String regionType, ITextSelection textSelection) {
+		return new JSPSearchQuery(file, getJavaElement(document, textSelection));
+	}
+
+	private IJavaElement getJavaElement(IDocument document, ITextSelection textSelection) {
+		IJavaElement[] elements = getJavaElementsForCurrentSelection(document, textSelection);
+		return elements.length > 0 ? elements[0] : null;
+	}
+
+	/**
+	 * uses JSPTranslation to get currently selected Java elements.
+	 * 
+	 * @return currently selected IJavaElements
+	 */
+	private IJavaElement[] getJavaElementsForCurrentSelection(IDocument document, ITextSelection selection) {
+		IJavaElement[] elements = new IJavaElement[0];
+		// get JSP translation object for this viewer's document
+		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+		try {
+			if (model != null && model instanceof IDOMModel) {
+				IDOMDocument xmlDoc = ((IDOMModel) model).getDocument();
+				JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
+				if (adapter != null) {
+					JSPTranslation translation = adapter.getJSPTranslation();
+
+					// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102211
+					elements = translation.getElementsFromJspRange(selection.getOffset(), selection.getOffset() + selection.getLength());
+				}
+			}
+		}
+		finally {
+			if (model != null)
+				model.releaseFromRead();
+		}
+		return elements;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPOccurrencesSearchResult.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPOccurrencesSearchResult.java
new file mode 100644
index 0000000..e39e4be
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPOccurrencesSearchResult.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.search;
+
+import org.eclipse.search.ui.ISearchQuery;
+import org.eclipse.search.ui.text.Match;
+import org.eclipse.wst.sse.ui.internal.search.OccurrencesSearchResult;
+
+/**
+ * @author pavery
+ */
+public class JSPOccurrencesSearchResult extends OccurrencesSearchResult {
+	
+	public JSPOccurrencesSearchResult(ISearchQuery query) {
+		super(query);
+	}
+	
+	public Match[] getMatches() {
+		return super.getMatches();
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchQuery.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchQuery.java
new file mode 100644
index 0000000..15ef838
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchQuery.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.search;
+
+import java.text.MessageFormat;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.search.SearchDocument;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery;
+
+/**
+ * Implementation of <code>ISearchQuery</code> for <code>IJavaElement</code>s in JSP files.
+ * 
+ * @author pavery
+ */
+public class JSPSearchQuery extends BasicSearchQuery {
+	
+	/** the IJavaElement we are searching for in the file **/
+	private IJavaElement fElement = null;
+	
+	public JSPSearchQuery(IFile file, IJavaElement element) {
+		super(file);
+		super.setResult(new JSPOccurrencesSearchResult(this));
+		this.fElement = element;
+	}
+	
+	public IJavaElement getJavaElement() {
+		return this.fElement;
+	}
+	
+	// for access by inner class
+	public JSPSearchQuery getInstance() {
+		return this;
+	}
+	
+	protected IStatus doQuery() {
+		IStatus status = Status.OK_STATUS;
+		try {
+			JSPSearchSupport support = JSPSearchSupport.getInstance();
+			// index the file
+			SearchDocument delegate =  support.addJspFile(getFile());
+			
+			String scopePath = delegate.getPath();
+			JSPSearchScope singleFileScope = new JSPSearchScope(new String[]{getFile().getFullPath().toString(), scopePath});
+			
+			// perform a searchs
+			// by passing in this jsp search query, requstor can add matches
+			support.searchRunnable(getJavaElement(), singleFileScope, new JSPSingleFileSearchRequestor(getInstance()));
+		}
+		catch (Exception e){
+			status = new Status(IStatus.ERROR, "org.eclipse.wst.sse.ui", IStatus.OK, "", null); //$NON-NLS-1$	//$NON-NLS-2$
+		}
+		return status;
+	}
+	
+	/**
+	 * @see org.eclipse.search.ui.ISearchQuery#getLabel()
+	 */
+	public String getLabel() {
+		String label = JSPUIMessages.OccurrencesSearchQuery_0; //$NON-NLS-1$
+		String[] args = {getSearchText(), "" + super.getMatchCount(), getFilename()};
+		return MessageFormat.format(label, args);
+	}
+
+	private String getFilename() {
+		String filename = JSPUIMessages.OccurrencesSearchQuery_2;
+		if(getFile() != null)
+			filename = getFile().getName();
+		return filename;
+	}
+
+	protected String getSearchText() {
+		if(fElement != null)
+			return fElement.getElementName();
+		return "";
+	}
+	
+	public boolean canRerun() {
+		
+		return false;
+	}
+
+	/**
+	 * @see org.eclipse.search.ui.ISearchQuery#canRunInBackground()
+	 */
+	public boolean canRunInBackground() {
+		return true;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchRequestor.java
new file mode 100644
index 0000000..2cb4ae1
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchRequestor.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.search;
+
+import java.util.HashMap;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.ui.search.ISearchRequestor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.search.ui.NewSearchUI;
+import org.eclipse.search.ui.text.Match;
+
+
+/**
+ * @author pavery
+ */
+public class JSPSearchRequestor extends BasicJSPSearchRequestor {
+	
+	private ISearchRequestor fJavaRequestor = null;
+	
+	public JSPSearchRequestor() {
+		super();
+	}
+	
+	public JSPSearchRequestor(ISearchRequestor javaRequestor) {
+		// need to report matches to javaRequestor
+		this.fJavaRequestor = javaRequestor;
+	}
+	
+
+	protected void addSearchMatch(IDocument jspDocument, IFile jspFile, int jspStart, int jspEnd, String jspText) {
+		
+		if(!jspFile.exists())
+			return;
+
+		int lineNumber = -1;
+		try {
+			lineNumber = jspDocument.getLineOfOffset(jspStart);
+		} catch (BadLocationException e) {
+			Logger.logException("offset: " + Integer.toString(jspStart), e); //$NON-NLS-1$
+		}
+		createSearchMarker(jspFile, jspStart, jspEnd, lineNumber);
+		
+		if(this.fJavaRequestor != null) {
+			Match match = new Match(jspFile, jspStart, jspEnd - jspStart);
+			this.fJavaRequestor.reportMatch(match);
+		}
+	}
+
+	/**
+	 * @param jspFile
+	 * @param jspStart
+	 * @param jspEnd
+	 */
+	private void createSearchMarker(IFile jspFile, int jspStart, int jspEnd, int lineNumber) {
+		
+		try {
+			IMarker marker = jspFile.createMarker(NewSearchUI.SEARCH_MARKER);
+			HashMap attributes = new HashMap(4);
+			attributes.put(IMarker.CHAR_START, new Integer(jspStart));
+			attributes.put(IMarker.CHAR_END, new Integer(jspEnd));
+			attributes.put(IMarker.LINE_NUMBER, new Integer(lineNumber));
+			marker.setAttributes(attributes);
+			
+		} catch (CoreException e) {
+			Logger.logException(e);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSingleFileSearchRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSingleFileSearchRequestor.java
new file mode 100644
index 0000000..ce0792b
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSingleFileSearchRequestor.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.search;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.IDocument;
+
+
+/**
+ * <p>
+ * Special requestor that adds search results for single file search
+ * (Used for JSPFindOccurrences action).
+ * It groups each match as it's own result.
+ * </p>
+ * 
+ * @author pavery
+ */
+public class JSPSingleFileSearchRequestor extends BasicJSPSearchRequestor {
+
+	private JSPSearchQuery fQuery = null;
+	
+	public JSPSingleFileSearchRequestor(JSPSearchQuery query) {
+		this.fQuery = query;
+	}
+	
+	protected void addSearchMatch(IDocument jspDocument, IFile jspFile, int jspStart, int jspEnd, String jspText) {
+		// add match to JSP query...
+		this.fQuery.addMatch(jspDocument, jspStart, jspEnd);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPMatchPresentation.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPMatchPresentation.java
new file mode 100644
index 0000000..74b1a26
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPMatchPresentation.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.search.ui;
+
+import org.eclipse.jdt.ui.search.IMatchPresentation;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.search.ui.text.Match;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.wst.sse.ui.internal.search.BasicSearchLabelProvider;
+
+/**
+ * @author pavery
+ */
+public class JSPMatchPresentation implements IMatchPresentation {
+
+	/**
+	 * @see org.eclipse.jdt.ui.search.IMatchPresentation#createLabelProvider()
+	 */
+	public ILabelProvider createLabelProvider() {
+		return new BasicSearchLabelProvider();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jdt.ui.search.IMatchPresentation#showMatch(org.eclipse.search.ui.text.Match, int, int, boolean)
+	 */
+	public void showMatch(Match match, int currentOffset, int currentLength, boolean activate) throws PartInitException {
+		// pa_TODO implement
+//		Object obj = match.getElement();
+		// show match in JSP editor
+		if(activate) {
+			// use show in target?
+		}
+		else {
+			// just select
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPQueryParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPQueryParticipant.java
new file mode 100644
index 0000000..399f27a
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPQueryParticipant.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.search.ui;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.search.SearchPattern;
+import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jdt.ui.search.ElementQuerySpecification;
+import org.eclipse.jdt.ui.search.IMatchPresentation;
+import org.eclipse.jdt.ui.search.IQueryParticipant;
+import org.eclipse.jdt.ui.search.ISearchRequestor;
+import org.eclipse.jdt.ui.search.PatternQuerySpecification;
+import org.eclipse.jdt.ui.search.QuerySpecification;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.java.search.JSPSearchRequestor;
+import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
+
+/**
+ * @author pavery 
+ */
+public class JSPQueryParticipant implements IQueryParticipant {
+
+	// for debugging
+	private static final boolean DEBUG;
+	static {
+		String value= Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspsearch"); //$NON-NLS-1$
+		DEBUG= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+	/**
+	 * @see org.eclipse.jdt.ui.search.IQueryParticipant#search(org.eclipse.jdt.ui.search.ISearchRequestor, org.eclipse.jdt.ui.search.QuerySpecification, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public void search(ISearchRequestor requestor, QuerySpecification querySpecification, IProgressMonitor monitor) throws CoreException {
+		
+		if(shouldSupplyJSPSearchResultsToJavaSearch()) {
+			//indexIfNeeded();
+			
+			// do search based on the particular Java query
+			if(querySpecification instanceof ElementQuerySpecification) {
+				// element search (eg. from global find references in Java file)
+				ElementQuerySpecification elementQuery = (ElementQuerySpecification)querySpecification;
+				IJavaElement element = elementQuery.getElement();
+				
+				if(DEBUG)
+					System.out.println("JSP Query Participant searching on ELEMENT: " + element); //$NON-NLS-1$
+				
+				SearchRequestor jspRequestor = new JSPSearchRequestor(requestor);
+				
+				// pa_TODO need to adapt JavaSearchScope to a JSPSearchScope
+				JSPSearchSupport.getInstance().search(element, new JSPSearchScope(), jspRequestor);
+				
+			}
+			else if(querySpecification instanceof PatternQuerySpecification) {
+				
+				// pattern search (eg. from Java search page)
+				PatternQuerySpecification patternQuery = (PatternQuerySpecification)querySpecification;
+				String pattern = patternQuery.getPattern();
+				
+				if(DEBUG)
+					System.out.println("JSP Query Participant searching on PATTERN: " + pattern); //$NON-NLS-1$
+				
+				SearchRequestor jspRequestor = new JSPSearchRequestor(requestor);
+				
+				JSPSearchSupport.getInstance().search(pattern, 
+														new JSPSearchScope(), 
+														patternQuery.getSearchFor(), 
+														patternQuery.getLimitTo(), 
+														SearchPattern.R_PATTERN_MATCH, 
+														false, 
+														jspRequestor);
+			}
+		}
+	}
+
+	/**
+	 * @see org.eclipse.jdt.ui.search.IQueryParticipant#estimateTicks(org.eclipse.jdt.ui.search.QuerySpecification)
+	 */
+	public int estimateTicks(QuerySpecification data) {
+		// pa_TODO use project file counter from JSPSearchSupport...
+		return 0;
+	}
+
+	/**
+	 * @see org.eclipse.jdt.ui.search.IQueryParticipant#getUIParticipant()
+	 */
+	public IMatchPresentation getUIParticipant() {
+		return new JSPMatchPresentation();
+	}
+	
+	private boolean shouldSupplyJSPSearchResultsToJavaSearch() {
+		return JSPUIPlugin.getDefault().getPreferenceStore().getBoolean(JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH);
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPCompletionProposalCategoriesConfiguration.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPCompletionProposalCategoriesConfiguration.java
new file mode 100644
index 0000000..24b57c4
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPCompletionProposalCategoriesConfiguration.java
@@ -0,0 +1,78 @@
+package org.eclipse.jst.jsp.ui.internal.preferences;
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration;
+
+/**
+ * <p>The readable and writable completion proposal categories configuration
+ * for the JSP content type</p>
+ */
+public class JSPCompletionProposalCategoriesConfiguration extends AbstractCompletionProposalCategoriesConfiguration {
+
+	/** the ID of the preference page where users can change the preferences */
+	private static final String PREFERENCES_PAGE_ID = "org.eclipse.wst.sse.ui.preferences.jsp.contentassist"; //$NON-NLS-1$
+	
+	/**
+	 * <p>Creates the configuration</p>
+	 */
+	public JSPCompletionProposalCategoriesConfiguration() {
+		//nothing to do.
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPreferenceStore()
+	 */
+	protected IPreferenceStore getPreferenceStore() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#hasAssociatedPropertiesPage()
+	 */
+	public boolean hasAssociatedPropertiesPage() {
+		return true;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#getPropertiesPageID()
+	 */
+	public String getPropertiesPageID() {
+		return PREFERENCES_PAGE_ID;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnDefaultPagePrefKey()
+	 */
+	protected String getShouldNotDisplayOnDefaultPagePrefKey() {
+		return JSPUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnOwnPagePrefKey()
+	 */
+	protected String getShouldNotDisplayOnOwnPagePrefKey() {
+		return JSPUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE;
+	}
+
+	protected String getPageSortOrderPrefKey() {
+		return JSPUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getDefaultPageSortOrderPrefKey()
+	 */
+	protected String getDefaultPageSortOrderPrefKey() {
+		return JSPUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java
new file mode 100644
index 0000000..e3c663d
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java
@@ -0,0 +1,104 @@
+package org.eclipse.jst.jsp.ui.internal.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
+import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
+
+/**
+ * Sets default values for JSP UI preferences
+ */
+public class JSPUIPreferenceInitializer extends AbstractPreferenceInitializer {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+	 */
+	public void initializeDefaultPreferences() {
+		IPreferenceStore store = JSPUIPlugin.getDefault().getPreferenceStore();
+		ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
+
+		// setting the same as HTML
+		store.setDefault(JSPUIPreferenceNames.AUTO_PROPOSE, true);
+		store.setDefault(JSPUIPreferenceNames.AUTO_PROPOSE_CODE, "<=");//$NON-NLS-1$
+
+		// JSP Style Preferences
+		String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
+		String JUSTITALIC = " | null | false | true"; //$NON-NLS-1$
+		String styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_ATTRIBUTE_NAME, 127, 0, 127) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, 42, 0, 255) + JUSTITALIC;
+		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, styleValue);
+
+		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
+
+		// specified value is black; leaving as widget default
+		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.COMMENT_BORDER, 63, 95, 191) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.COMMENT_BORDER, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.COMMENT_TEXT, 63, 95, 191) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.COMMENT_TEXT, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.TAG_BORDER, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_NAME, 63, 127, 127) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.TAG_NAME, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsHTML.SCRIPT_AREA_BORDER, 191, 95, 63) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsHTML.SCRIPT_AREA_BORDER, styleValue);
+
+		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
+		store.setDefault(IStyleConstantsJSP.JSP_CONTENT, styleValue);
+		
+		// set default new jsp file template to use in new file wizard
+		/*
+		 * Need to find template name that goes with default template id (name
+		 * may change for different language)
+		 */
+		store.setDefault(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_ID, "org.eclipse.jst.jsp.ui.templates.jsphtml"); //$NON-NLS-1$
+		
+		// set default new jsp tag file template to use in new tag file wizard
+		store.setDefault(JSPUIPreferenceNames.NEW_TAG_FILE_TEMPLATE_ID, "org.eclipse.jst.jsp.ui.templates.simpletag"); //$NON-NLS-1$
+		
+		store.setDefault(JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES, true);
+		store.setDefault(JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS, true);
+		store.setDefault(JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS, true);
+		store.setDefault(JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH, true);
+		store.setDefault(JSPUIPreferenceNames.TYPING_CLOSE_STRINGS, true);
+		store.setDefault(JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS, true);
+		
+		// Defaults for Content Assist preference page
+		store.setDefault(JSPUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE, "");
+		store.setDefault(JSPUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE, "");
+		store.setDefault(JSPUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER,
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTags\0" +
+				"org.eclipse.wst.xml.ui.proposalCategory.xmlTags\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.css\0" +
+				"org.eclipse.jst.jsp.ui.proposalCategory.jsp\0" +
+				"org.eclipse.jst.jsp.ui.proposalCategory.jspJava\0" +
+				"org.eclipse.jst.jsp.ui.proposalCategory.jspTemplates\0" +
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTemplates\0" +
+				"org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.cssTemplates");
+		store.setDefault(JSPUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER,
+				"org.eclipse.jst.jsp.ui.proposalCategory.jspTemplates\0" +
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTemplates\0" +
+				"org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.cssTemplates\0" +
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTags\0" +
+				"org.eclipse.wst.xml.ui.proposalCategory.xmlTags\0" +
+				"org.eclipse.jst.jsp.ui.proposalCategory.jsp\0" +
+				"org.eclipse.jst.jsp.ui.proposalCategory.jspJava\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.css");
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java
new file mode 100644
index 0000000..f0c1788
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.preferences;
+
+/**
+ * Preference keys for JSP UI
+ */
+public class JSPUIPreferenceNames {
+	/**
+	 * A named preference that controls if code assist gets auto activated.
+	 * <p>
+	 * Value is of type <code>Boolean</code>.
+	 * </p>
+	 */
+	public static final String AUTO_PROPOSE = getAutoProposeKey();
+
+	private static String getAutoProposeKey() {
+		return "autoPropose";//$NON-NLS-1$
+	}
+
+	/**
+	 * A named preference that holds the characters that auto activate code
+	 * assist.
+	 * <p>
+	 * Value is of type <code>String</code>. All characters that trigger
+	 * auto code assist.
+	 * </p>
+	 */
+	public static final String AUTO_PROPOSE_CODE = getAutoProposeCodeKey();
+
+	private static String getAutoProposeCodeKey() {
+		return "autoProposeCode";//$NON-NLS-1$
+	}
+
+	/**
+	 * The key to store customized templates.
+	 * <p>
+	 * Value is of type <code>String</code>.
+	 * </p>
+	 */
+	public static final String TEMPLATES_KEY = getTemplatesKey();
+
+	private static String getTemplatesKey() {
+		return "org.eclipse.wst.sse.ui.custom_templates"; //$NON-NLS-1$
+	}
+
+	/**
+	 * The key to store the last template name used in new JSP file wizard.
+	 * Template name is stored instead of template id because user-created
+	 * templates do not have template ids.
+	 * <p>
+	 * Value is of type <code>String</code>.
+	 * </p>
+	 */
+	public static final String NEW_FILE_TEMPLATE_NAME = "newFileTemplateName"; //$NON-NLS-1$
+
+	/**
+	 * The initial template ID to be used in the new JSP file wizard. In the absence
+	 * of {@link NEW_FILE_TEMPLATE_NAME}, this ID is used to find a template name
+	 */
+	public static final String NEW_FILE_TEMPLATE_ID = "newFileTemplateId"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the last template name used in new JSP Tag file wizard.
+	 * Template name is stored instead of template id because user-created
+	 * templates do not have template ids.
+	 * <p>
+	 * Value is of type <code>String</code>.
+	 * </p>
+	 */
+	public static final String NEW_TAG_FILE_TEMPLATE_NAME = "newTagFileTemplateName"; //$NON-NLS-1$
+
+	/**
+	 * The initial template ID to be used in the new JSP file wizard. In the absence
+	 * of {@link NEW_FILE_TEMPLATE_NAME}, this ID is used to find a template name
+	 */
+	public static final String NEW_TAG_FILE_TEMPLATE_ID = "newTagFileTemplateId"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the option for auto-completing EL braces after entering
+	 * <code>${</code>
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_COMPLETE_EL_BRACES = "typingCompleteElBraces"; //$NON-NLS-1$
+	
+	/**
+	 * The key to store the option for auto-completing scriptlets after entering
+	 * <code>&lt;%</code>
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_COMPLETE_SCRIPTLETS = "typingCompleteScriptlets"; //$NON-NLS-1$
+	
+	/**
+	 * The key to store the option for auto-completing JSP comments after entering
+	 * <code>&lt;%--</code>
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_COMPLETE_COMMENTS = "typingCompleteComments"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the option for auto-completing strings (" and ') while
+	 * typing.
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_CLOSE_STRINGS = "closeStrings"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the option for auto-completing brackets ([ and () while
+	 * typing.
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_CLOSE_BRACKETS = "closeBrackets"; //$NON-NLS-1$
+
+	public static final String SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH = "supplyJSPSearchResultsToJavaSearch"; //$NON-NLS-1$
+
+	/**
+	 * <p>preference key used for saving which categories should not display on the default page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>), ordered is ignored</p>
+	 */
+	public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE = "jsp_content_assist_display_on_default_page"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key used for saving which categories should not display on their own page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>), order is ignored</p>
+	 */
+	public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE = "jsp_content_assist_display_on_own_page"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key for saving the sort order of the categories when displaying them on their own page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>) in the desired sort order.</p>
+	 */
+	public static final String CONTENT_ASSIST_OWN_PAGE_SORT_ORDER= "jsp_content_assist_own_page_sort_order"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key for saving the sort order of the categories when displaying them on the default page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>) in the desired sort order.</p>
+	 */
+	public static final String CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER= "jsp_content_assist_default_page_sort_order"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractPropertyPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractPropertyPreferencePage.java
new file mode 100644
index 0000000..3d9615b
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractPropertyPreferencePage.java
@@ -0,0 +1,299 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.preferences.ui;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.dialogs.ControlEnableState;
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.dialogs.ListDialog;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.dialogs.PropertyPage;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.ui.views.navigator.ResourceSorter;
+import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+
+/**
+ * Based loosely on org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage
+ */
+abstract class AbstractPropertyPreferencePage extends PropertyPage implements IWorkbenchPreferencePage {
+	private static final boolean _debugPreferences = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/preferences-properties")); //$NON-NLS-1$ //$NON-NLS-2$
+	/*
+	 * Disable link data, prevents the display of a "workspace" or "project"
+	 * settings link to prevent recursive dialog launching
+	 */
+	private static final Object DISABLE_LINK = "DISABLE_LINK"; //$NON-NLS-1$
+
+	private Map fData = null;
+
+	private Button fEnableProjectSettings;
+
+	private Link fProjectSettingsLink;
+	
+	private Control fCommon;
+	
+	private ControlEnableState fEnablements;
+
+	public AbstractPropertyPreferencePage() {
+		super();
+	}
+
+	public final void applyData(Object data) {
+		super.applyData(data);
+		if (data instanceof Map) {
+			fData = (Map) data;
+			updateLinkEnablement();
+		}
+	}
+
+	protected abstract Control createCommonContents(Composite composite);
+
+	public final Control createContents(Composite parent) {
+		Composite composite = new Composite(parent, SWT.NULL);
+
+		GridLayout layout = new GridLayout();
+		composite.setLayout(layout);
+		GridData data = new GridData(GridData.FILL_BOTH);
+		composite.setLayoutData(data);
+
+		Composite checkLinkComposite = new Composite(composite, SWT.NONE);
+		checkLinkComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+		checkLinkComposite.setLayout(new GridLayout(2, false));
+
+		if (getProject() != null) {
+			fEnableProjectSettings = new Button(checkLinkComposite, SWT.CHECK);
+			fEnableProjectSettings.setText(SSEUIMessages.EnableProjectSettings);
+			fEnableProjectSettings.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
+			boolean enabledForProject = createPreferenceScopes()[0].getNode(getPreferenceNodeQualifier()).getBoolean(getProjectSettingsKey(), false);
+			fEnableProjectSettings.setSelection(enabledForProject);
+		}
+		else {
+			Label spacer = new Label(checkLinkComposite, SWT.CHECK);
+			spacer.setLayoutData(new GridData());
+		}
+
+		fProjectSettingsLink = new Link(checkLinkComposite, SWT.NONE);
+		fProjectSettingsLink.setLayoutData(new GridData(SWT.END, SWT.BEGINNING, true, false));
+
+		/*
+		 * "element" should be a project, if null, link to per-project
+		 * properties
+		 */
+		if (getProject() != null) {
+			fProjectSettingsLink.setText("<a>" + SSEUIMessages.ConfigureWorkspaceSettings + "</a>"); //$NON-NLS-1$//$NON-NLS-2$
+		}
+		else {
+			fProjectSettingsLink.setText("<a>" + SSEUIMessages.ConfigureProjectSettings + "</a>"); //$NON-NLS-1$//$NON-NLS-2$
+		}
+
+		updateLinkEnablement();
+
+		fProjectSettingsLink.addSelectionListener(new SelectionListener() {
+			public void widgetDefaultSelected(SelectionEvent e) {
+				widgetSelected(e);
+			}
+
+			public void widgetSelected(SelectionEvent e) {
+				if (getProject() == null) {
+					openProjectSettings();
+				}
+				else {
+					openWorkspaceSettings();
+				}
+			}
+
+		});
+
+		if (getProject() != null) {
+			Label line = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
+			line.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
+		}
+
+//		final Control common = createCommonContents(composite);
+		fCommon = createCommonContents(composite);
+		
+		fCommon.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+		if (fEnableProjectSettings != null) {
+			SelectionAdapter selectionAdapter = new SelectionAdapter() {
+				public void widgetSelected(SelectionEvent e) {
+					super.widgetSelected(e);
+					enablePreferenceContent(fEnableProjectSettings.getSelection());
+				}
+			};
+			selectionAdapter.widgetSelected(null);
+			fEnableProjectSettings.addSelectionListener(selectionAdapter);
+		}
+		
+		applyDialogFont(composite);
+		return composite;
+	}
+
+	protected IScopeContext[] createPreferenceScopes() {
+		IProject project = getProject();
+		if (project != null) {
+			return new IScopeContext[]{new ProjectScope(project), new InstanceScope(), new DefaultScope()};
+		}
+		return new IScopeContext[]{new InstanceScope(), new DefaultScope()};
+	}
+
+	protected abstract String getPreferenceNodeQualifier();
+
+	protected abstract String getPreferencePageID();
+
+	protected IProject getProject() {
+		if (getElement() != null) {
+			if (getElement() instanceof IProject) {
+				return (IProject) getElement();
+			}
+			Object adapter = getElement().getAdapter(IProject.class);
+			if (adapter instanceof IProject) {
+				return (IProject) adapter;
+			}
+			adapter = getElement().getAdapter(IResource.class);
+			if (adapter instanceof IProject) {
+				return (IProject) adapter;
+			}
+		}
+		return null;
+	}
+
+	protected abstract String getProjectSettingsKey();
+
+	protected abstract String getPropertyPageID();
+
+	protected boolean isElementSettingsEnabled() {
+		return fEnableProjectSettings != null && fEnableProjectSettings.getSelection();
+	}
+
+	void openProjectSettings() {
+		ListDialog dialog = new ListDialog(getShell()) {
+
+			protected Control createDialogArea(Composite container) {
+				Control area = super.createDialogArea(container);
+				getTableViewer().setSorter(new ResourceSorter(ResourceSorter.NAME));
+				return area;
+			}
+		};
+		dialog.setMessage(SSEUIMessages.PropertyPreferencePage_02);
+		dialog.setContentProvider(new IStructuredContentProvider() {
+			public void dispose() {
+			}
+
+			public Object[] getElements(Object inputElement) {
+				return ((IWorkspace) inputElement).getRoot().getProjects();
+			}
+
+			public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+			}
+		});
+		dialog.setLabelProvider(new DecoratingLabelProvider(new WorkbenchLabelProvider(), SSEUIPlugin.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
+		dialog.setInput(ResourcesPlugin.getWorkspace());
+		dialog.setTitle(SSEUIMessages.PropertyPreferencePage_01);
+		if (dialog.open() == Window.OK) {
+			Object[] result = dialog.getResult();
+			if (result.length > 0) {
+				IProject project = (IProject) dialog.getResult()[0];
+				Map data = new HashMap();
+				data.put(DISABLE_LINK, Boolean.TRUE);
+				PreferencesUtil.createPropertyDialogOn(getShell(), project, getPropertyPageID(), new String[]{getPropertyPageID()}, data).open();
+			}
+		}
+	}
+
+	void openWorkspaceSettings() {
+		Map data = new HashMap();
+		data.put(DISABLE_LINK, Boolean.TRUE);
+		PreferencesUtil.createPreferenceDialogOn(getShell(), getPreferencePageID(), new String[]{getPreferencePageID()}, data).open();
+	}
+
+	public boolean performOk() {
+		boolean ok = super.performOk();
+		IScopeContext[] preferenceScopes = createPreferenceScopes();
+		if (getProject() != null) {
+			if (isElementSettingsEnabled()) {
+				if (_debugPreferences) {
+					System.out.println(getClass().getName() + " setting " + getProjectSettingsKey() + " (" + true + ") in scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$  
+				}
+				preferenceScopes[0].getNode(getPreferenceNodeQualifier()).putBoolean(getProjectSettingsKey(), fEnableProjectSettings.getSelection());
+			}
+			else {
+				if (_debugPreferences) {
+					System.out.println(getClass().getName() + " removing " + getProjectSettingsKey() + " from scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+				}
+				preferenceScopes[0].getNode(getPreferenceNodeQualifier()).remove(getProjectSettingsKey());
+			}
+		}
+		return ok;
+	}
+	
+	protected void performDefaults() {
+		if(getProject() != null && fEnableProjectSettings != null) {
+			fEnableProjectSettings.setSelection(false);
+			enablePreferenceContent(false);
+		}
+		super.performDefaults();
+	}
+
+	private void updateLinkEnablement() {
+		if (fData != null && fProjectSettingsLink != null) {
+			fProjectSettingsLink.setEnabled(!Boolean.TRUE.equals(fData.get(DISABLE_LINK)));
+		}
+	}
+	
+	/**
+	 * Controls the enablement of the common content region
+	 * of a property or preference page
+	 * 
+	 * @param enable the enabled state of the common content
+	 * area
+	 */
+	protected void enablePreferenceContent(boolean enable) {
+		if(enable) {
+			if(fEnablements != null) {
+				fEnablements.restore();
+				fEnablements = null;
+			}
+		}
+		else {
+			if(fEnablements == null)
+				fEnablements = ControlEnableState.disable(fCommon);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractValidationSettingsPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
new file mode 100644
index 0000000..3d7d962
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
@@ -0,0 +1,424 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.preferences.ui;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IPreferencesService;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.ScrolledPageContent;
+import org.eclipse.wst.validation.ValidationFramework;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ * Based on org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock
+ */
+abstract class AbstractValidationSettingsPage extends AbstractPropertyPreferencePage {
+
+	private List fCombos;
+	private List fExpandables;
+
+	private SelectionListener fSelectionListener;
+
+	private IPreferencesService fPreferencesService = null;
+
+	private static final String SETTINGS_EXPANDED = "expanded"; //$NON-NLS-1$
+
+	private ValidationFramework fValidation;
+
+	private class ComboData {
+		private String fKey;
+		private int[] fSeverities;
+		private int fIndex;
+		int originalSeverity = -2;
+
+		public ComboData(String key, int[] severities, int index) {
+			fKey = key;
+			fSeverities = severities;
+			fIndex = index;
+		}
+
+		public String getKey() {
+			return fKey;
+		}
+
+		public void setIndex(int index) {
+			fIndex = index;
+		}
+
+		public int getIndex() {
+			return fIndex;
+		}
+
+		/**
+		 * Sets the severity index based on <code>severity</code>.
+		 * If the severity doesn't exist, the index is set to -1.
+		 * 
+		 * @param severity the severity level
+		 */
+		public void setSeverity(int severity) {
+			for (int i = 0; fSeverities != null && i < fSeverities.length; i++) {
+				if (fSeverities[i] == severity) {
+					setIndex(i);
+					return;
+				}
+			}
+
+			setIndex(-1);
+		}
+
+		public int getSeverity() {
+			return (fIndex >= 0 && fSeverities != null && fIndex < fSeverities.length) ? fSeverities[fIndex] : -1;
+		}
+
+		boolean isChanged() {
+			return fSeverities[fIndex] != originalSeverity;
+		}
+	}
+
+	public AbstractValidationSettingsPage() {
+		super();
+		fCombos = new ArrayList();
+		fExpandables = new ArrayList();
+		fPreferencesService = Platform.getPreferencesService();
+		fValidation = ValidationFramework.getDefault();
+	}
+
+	/**
+	 * Creates a Combo widget in the composite <code>parent</code>. The data
+	 * in the Combo is associated with <code>key</code>. The Combo data is
+	 * generated based on the integer <code>values</code> where the index
+	 * of <code>values</code> corresponds to the index of <code>valueLabels</code>
+	 * 
+	 * @param parent the composite to create the combo box in
+	 * @param label the label to give the combo box
+	 * @param key the unique key to identify the combo box
+	 * @param values the values represented by the combo options
+	 * @param valueLabels the calues displayed in the combo box
+	 * @param indent how far to indent the combo box label
+	 * 
+	 * @return the generated combo box
+	 */
+	protected Combo addComboBox(Composite parent, String label, String key, int[] values, String[] valueLabels, int indent) {
+		GridData gd = new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1);
+		gd.horizontalIndent = indent;
+
+		Label labelControl = new Label(parent, SWT.LEFT);
+		labelControl.setFont(JFaceResources.getDialogFont());
+		labelControl.setText(label);
+		labelControl.setLayoutData(gd);
+
+		Combo comboBox = newComboControl(parent, key, values, valueLabels);
+		comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
+
+		return comboBox;
+	}
+
+	/**
+	 * Creates a combo box and associates the combo data with the
+	 * combo box.
+	 * 
+	 * @param composite the composite to create the combo box in
+	 * @param key the unique key to identify the combo box
+	 * @param values the values represented by the combo options
+	 * @param valueLabels the values displayed in the combo box
+	 * 
+	 * @return the generated combo box
+	 */
+	protected Combo newComboControl(Composite composite, String key, int[] values, String[] valueLabels) {
+		ComboData data = new ComboData(key, values, -1);
+
+		Combo comboBox = new Combo(composite, SWT.READ_ONLY);
+		comboBox.setItems(valueLabels);
+		comboBox.setData(data);
+		comboBox.addSelectionListener(getSelectionListener());
+		comboBox.setFont(JFaceResources.getDialogFont());
+
+		makeScrollableCompositeAware(comboBox);
+
+		int severity = -1;
+		if (key != null)
+			severity = fPreferencesService.getInt(getPreferenceNodeQualifier(), key, ValidationMessage.WARNING, createPreferenceScopes());
+
+		if (severity == ValidationMessage.ERROR || severity == ValidationMessage.WARNING || severity == ValidationMessage.IGNORE) {
+			data.setSeverity(severity);
+			data.originalSeverity = severity;
+		}
+
+		if (data.getIndex() >= 0)
+			comboBox.select(data.getIndex());
+
+		fCombos.add(comboBox);
+		return comboBox;
+	}
+
+	protected SelectionListener getSelectionListener() {
+		if (fSelectionListener == null) {
+			fSelectionListener = new SelectionListener() {
+				public void widgetDefaultSelected(SelectionEvent e) {}
+	
+				public void widgetSelected(SelectionEvent e) {
+					controlChanged(e.widget);
+				}
+			};
+		}
+		return fSelectionListener;
+	}
+
+	protected void controlChanged(Widget widget) {
+		ComboData data = (ComboData) widget.getData();
+		if (widget instanceof Combo) {
+			data.setIndex(((Combo) widget).getSelectionIndex());
+		}
+		else {
+			return;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSettingsPage#storeValues()
+	 */
+	protected void storeValues() {
+		if (fCombos == null || fCombos.size() == 0)
+			return;
+
+		Iterator it = fCombos.iterator();
+
+		IScopeContext[] contexts = createPreferenceScopes();
+
+		while (it.hasNext()) {
+			ComboData data = (ComboData) ((Combo) it.next()).getData();
+			if (data.getKey() != null) {
+				contexts[0].getNode(getPreferenceNodeQualifier()).putInt(data.getKey(), data.getSeverity());
+			}
+		}
+
+		for (int i = 0; i < contexts.length; i++) {
+			try {
+				contexts[i].getNode(getPreferenceNodeQualifier()).flush();
+			}
+			catch (BackingStoreException e) {
+
+			}
+		}
+	}
+
+	protected ExpandableComposite getParentExpandableComposite(Control control) {
+		Control parent = control.getParent();
+		while (!(parent instanceof ExpandableComposite) && parent != null) {
+			parent = parent.getParent();
+		}
+		if (parent instanceof ExpandableComposite) {
+			return (ExpandableComposite) parent;
+		}
+		return null;
+	}
+
+	protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) {
+		ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
+		excomposite.setText(label);
+		excomposite.setExpanded(false);
+		excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
+		excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1));
+		excomposite.addExpansionListener(new ExpansionAdapter() {
+			public void expansionStateChanged(ExpansionEvent e) {
+				expandedStateChanged((ExpandableComposite) e.getSource());
+			}
+		});
+		fExpandables.add(excomposite);
+		makeScrollableCompositeAware(excomposite);
+		return excomposite;
+	}
+
+	protected Composite createStyleSectionWithContentComposite(Composite parent, String label, int nColumns) {
+		ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
+		excomposite.setText(label);
+		excomposite.setExpanded(false);
+		excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
+		excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1));
+		excomposite.addExpansionListener(new ExpansionAdapter() {
+			public void expansionStateChanged(ExpansionEvent e) {
+				expandedStateChanged((ExpandableComposite) e.getSource());
+			}
+		});
+		fExpandables.add(excomposite);
+		makeScrollableCompositeAware(excomposite);
+
+		Composite inner = new Composite(excomposite, SWT.NONE);
+		inner.setFont(excomposite.getFont());
+		inner.setLayout(new GridLayout(nColumns, false));
+		excomposite.setClient(inner);
+		return inner;
+	}
+
+	protected final void expandedStateChanged(ExpandableComposite expandable) {
+		ScrolledPageContent parentScrolledComposite = getParentScrolledComposite(expandable);
+		if (parentScrolledComposite != null) {
+			parentScrolledComposite.reflow(true);
+		}
+	}
+
+	private void makeScrollableCompositeAware(Control control) {
+		ScrolledPageContent parentScrolledComposite = getParentScrolledComposite(control);
+		if (parentScrolledComposite != null) {
+			parentScrolledComposite.adaptChild(control);
+		}
+	}
+
+	protected ScrolledPageContent getParentScrolledComposite(Control control) {
+		Control parent = control.getParent();
+		while (!(parent instanceof ScrolledPageContent) && parent != null) {
+			parent = parent.getParent();
+		}
+		if (parent instanceof ScrolledPageContent) {
+			return (ScrolledPageContent) parent;
+		}
+		return null;
+	}
+
+	protected void storeSectionExpansionStates(IDialogSettings section) {
+		for (int i = 0; i < fExpandables.size(); i++) {
+			ExpandableComposite comp = (ExpandableComposite) fExpandables.get(i);
+			section.put(SETTINGS_EXPANDED + String.valueOf(i), comp.isExpanded());
+		}
+	}
+
+	protected void restoreSectionExpansionStates(IDialogSettings settings) {
+		for (int i= 0; i < fExpandables.size(); i++) {
+			ExpandableComposite excomposite= (ExpandableComposite) fExpandables.get(i);
+			if (settings == null) {
+				excomposite.setExpanded(i == 0); // only expand the first node by default
+			} else {
+				excomposite.setExpanded(settings.getBoolean(SETTINGS_EXPANDED + String.valueOf(i)));
+			}
+		}
+	}
+
+	protected void resetSeverities() {
+		IEclipsePreferences defaultContext = new DefaultScope().getNode(getPreferenceNodeQualifier());
+		for (int i = 0; i < fCombos.size(); i++) {
+			ComboData data = (ComboData) ((Combo) fCombos.get(i)).getData();
+			int severity = defaultContext.getInt(data.getKey(), ValidationMessage.WARNING);
+			data.setSeverity(severity);
+			((Combo) fCombos.get(i)).select(data.getIndex());
+		}
+	}
+
+	protected boolean shouldRevalidateOnSettingsChange() {
+		Iterator it = fCombos.iterator();
+
+		while (it.hasNext()) {
+			ComboData data = (ComboData) ((Combo) it.next()).getData();
+			if (data.isChanged())
+				return true;
+		}
+		return false;
+	}
+
+	public boolean performOk() {
+		if(super.performOk() && shouldRevalidateOnSettingsChange()) {
+			MessageBox mb = new MessageBox(this.getShell(), SWT.APPLICATION_MODAL | SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_INFORMATION | SWT.RIGHT);
+			mb.setText(HTMLUIMessages.Validation_Title);
+			/* Choose which message to use based on if its project or workspace settings */
+			String msg = (getProject() == null) ? HTMLUIMessages.Validation_Workspace : HTMLUIMessages.Validation_Project;
+			mb.setMessage(msg);
+			switch(mb.open()) {
+				case SWT.CANCEL:
+					return false;
+				case SWT.YES:
+					storeValues();
+					ValidateJob job = new ValidateJob(HTMLUIMessages.Validation_jobName);
+					job.schedule();
+				case SWT.NO:
+					storeValues();
+				default:
+					return true;
+			}
+		}
+		return true;
+	}
+
+	/**
+	 * Performs validation after validation preferences have been modified.
+	 */
+	private class ValidateJob extends Job {
+
+		public ValidateJob(String name) {
+			super(name);
+		}
+
+		protected IStatus run(IProgressMonitor monitor) {
+			IStatus status = Status.OK_STATUS;
+			try {
+				IProject[] projects = null;
+				/* Changed preferences for a single project, only validate it */
+				if (getProject() != null)
+					projects = new IProject[]{getProject()};
+				/* Workspace-wide preferences changed */
+				else {
+					/* Get all of the projects in the workspace */
+					projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+					IEclipsePreferences prefs = null;
+					List projectList = new ArrayList();
+
+					/* Filter out projects that use project-specific settings or have been closed */
+					for (int i = 0; i < projects.length; i++) {
+						prefs = new ProjectScope(projects[i]).getNode(getPreferenceNodeQualifier());
+						if (projects[i].isAccessible() && !prefs.getBoolean(getProjectSettingsKey(), false))
+							projectList.add(projects[i]);
+					}
+					projects = (IProject[]) projectList.toArray(new IProject[projectList.size()]);
+				}
+				fValidation.validate(projects, true, false, monitor);
+			}
+			catch (CoreException ce) {
+				status = Status.CANCEL_STATUS;
+			}
+
+			return status;
+		}
+
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java
new file mode 100644
index 0000000..2dd5a4c
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2004,2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.preferences.ui;
+
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
+import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
+import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.preferences.XMLColorPage;
+import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
+
+/**
+ * @deprecated
+ */
+public class JSPColorPage extends XMLColorPage {
+
+	/**
+	 * Overridden to set up StyledTextColorPicker differently
+	 */
+	protected void createContentsForPicker(Composite parent) {
+		// create the color picker
+		fPicker = new JSPStyledTextColorPicker(parent, SWT.NULL);
+		GridData data = new GridData(GridData.FILL_BOTH);
+		fPicker.setLayoutData(data);
+
+		fPicker.setPreferenceStore(fOverlayStore);
+		setupPicker(fPicker);
+
+		fPicker.setText(getSampleText());
+	}
+	
+	/**
+	 * Set up all the style preference keys in the overlay store
+	 */
+	protected OverlayKey[] createOverlayStoreKeys() {
+		ArrayList overlayKeys = new ArrayList();
+		
+		ArrayList styleList = new ArrayList();
+		initStyleList(styleList);
+		Iterator i = styleList.iterator();
+		while (i.hasNext()) {
+			overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, (String)i.next()));	
+		}
+
+		OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
+		overlayKeys.toArray(keys);
+		return keys;
+	}
+
+	public String getSampleText() {
+		return JSPUIMessages.Sample_JSP_doc; //$NON-NLS-1$ = "<%@ page \n\tlanguage=\"java\" \n\tcontentType=\"text/html; charset=ISO-8859-1\"\n%>\n<jsp:include flush=\"true\" page=\"titleBar.jsp\"/>\n\n<%-- Use below tags ONLY for JSP 1.1 --%>\n<%\n\tSystem.out.println(\"Welcome!\");\n%>\n<%-- Use below tags ONLY for JSP 1.2 --%>\n<jsp:scriptlet>\n\tSystem.out.println(\"Welcome!\");\n</jsp:scriptlet>"
+	}
+
+	protected void initContextStyleMap(Dictionary contextStyleMap) {
+
+		initCommonContextStyleMap(contextStyleMap);
+		contextStyleMap.remove(DOMRegionContext.XML_CONTENT); // leave content between tags alone
+		contextStyleMap.remove(DOMRegionContext.XML_DECLARATION_OPEN); // xml/html specific
+		contextStyleMap.remove(DOMRegionContext.XML_DECLARATION_CLOSE); // xml/html specific
+		contextStyleMap.remove(DOMRegionContext.XML_ELEMENT_DECLARATION); // xml/html specific
+		contextStyleMap.remove(DOMRegionContext.XML_ELEMENT_DECL_CLOSE); // xml/html specific
+
+		//	contextStyleMap.put(XMLJSPRegionContexts.JSP_CONTENT, HTMLColorManager.SCRIPT_AREA);
+		//	contextStyleMap.put(XMLJSPRegionContexts.BLOCK_TEXT, HTMLColorManager.SCRIPT_AREA);
+		contextStyleMap.put(DOMJSPRegionContexts.JSP_DECLARATION_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		contextStyleMap.put(DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		contextStyleMap.put(DOMJSPRegionContexts.JSP_EXPRESSION_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		contextStyleMap.put(DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		contextStyleMap.put(DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		contextStyleMap.put(DOMJSPRegionContexts.JSP_CLOSE, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		
+		contextStyleMap.put(DOMJSPRegionContexts.JSP_CONTENT, IStyleConstantsJSP.JSP_CONTENT);
+		
+		contextStyleMap.put(DOMJSPRegionContexts.JSP_DIRECTIVE_NAME, IStyleConstantsXML.TAG_NAME);
+		contextStyleMap.put(DOMJSPRegionContexts.JSP_ROOT_TAG_NAME, IStyleConstantsXML.TAG_NAME);
+		contextStyleMap.put(DOMJSPRegionContexts.JSP_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
+		contextStyleMap.put(DOMJSPRegionContexts.JSP_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
+		contextStyleMap.put(DOMJSPRegionContexts.JSP_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
+		
+		contextStyleMap.put(DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+		contextStyleMap.put(DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+	}
+
+	protected void initDescriptions(Dictionary descriptions) {
+		initCommonDescriptions(descriptions);
+		descriptions.remove(IStyleConstantsXML.XML_CONTENT); // leave content between tags alone
+		descriptions.remove(IStyleConstantsXML.DECL_BORDER); // xml/html specific
+		descriptions.put(IStyleConstantsHTML.SCRIPT_AREA_BORDER, JSPUIMessages.JSP_Delimiters_UI_); //$NON-NLS-1$ = "JSP Delimiters"
+		descriptions.put(IStyleConstantsJSP.JSP_CONTENT, JSPUIMessages.JSPColorPage_jsp_content);
+	}
+
+	protected void initStyleList(ArrayList list) {
+		initCommonStyleList(list);
+		list.remove(IStyleConstantsXML.XML_CONTENT); // leave content between tags alone
+		list.remove(IStyleConstantsXML.DECL_BORDER); // xml/html specific
+		list.add(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		list.add(IStyleConstantsJSP.JSP_CONTENT);
+	}
+
+	protected void setupPicker(StyledTextColorPicker picker) {
+		IModelManager mmanager = StructuredModelManager.getModelManager();
+		picker.setParser(mmanager.createStructuredDocumentFor(ContentTypeIdForJSP.ContentTypeID_JSP).getParser());
+
+		// create descriptions for highlighting types
+		Dictionary descriptions = new Hashtable();
+		initDescriptions(descriptions);
+
+		// map region types to highlighting types
+		Dictionary contextStyleMap = new Hashtable();
+		initContextStyleMap(contextStyleMap);
+
+		ArrayList styleList = new ArrayList();
+		initStyleList(styleList);
+
+		picker.setContextStyleMap(contextStyleMap);
+		picker.setDescriptions(descriptions);
+		picker.setStyleList(styleList);
+
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	protected Control createContents(Composite parent) {
+		
+		Control c = super.createContents(parent);
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.JSP_PREFWEBX_STYLES_HELPID);
+		return c;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
+	 */
+	protected IPreferenceStore doGetPreferenceStore() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractColorPage#savePreferences()
+	 */
+	protected void savePreferences() {
+		JSPUIPlugin.getDefault().savePluginPreferences();
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPContentAssistPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPContentAssistPreferencePage.java
new file mode 100644
index 0000000..a4d2dcf
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPContentAssistPreferencePage.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.preferences.ui;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposoalCatigoriesConfigurationRegistry;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
+import org.eclipse.wst.sse.ui.preferences.CodeAssistCyclingConfigurationBlock;
+import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
+
+/**
+ * <p>Defines the preference page for allowing the user to change the content
+ * assist preferences</p>
+ */
+public class JSPContentAssistPreferencePage extends AbstractPreferencePage implements
+		IWorkbenchPreferencePage {
+
+	private static final String JSP_CONTENT_TYPE_ID = "org.eclipse.jst.jsp.core.jspsource"; //$NON-NLS-1$
+	
+	/** configuration block for changing preference having to do with the content assist categories */
+	private CodeAssistCyclingConfigurationBlock fConfigurationBlock;
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	protected Control createContents(Composite parent) {
+		final Composite composite = super.createComposite(parent, 1);
+		
+		createContentsForCyclingGroup(composite);
+		
+		setSize(composite);
+		loadPreferences();
+		
+		return composite;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#performDefaults()
+	 */
+	protected void performDefaults() {
+		performDefaultsForCyclingGroup();
+
+		validateValues();
+		enableValues();
+
+		super.performDefaults();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#initializeValues()
+	 */
+	protected void initializeValues() {
+		initializeValuesForCyclingGroup();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#storeValues()
+	 */
+	protected void storeValues() {
+		storeValuesForCyclingGroup();
+	}
+	
+	/**
+	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
+	 */
+	protected IPreferenceStore doGetPreferenceStore() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+	
+	/**
+	 * <p>Create the contents for the content assist cycling preference group</p>
+	 * @param parent {@link Composite} parent of the group
+	 */
+	private void createContentsForCyclingGroup(Composite parent) {
+		ICompletionProposalCategoriesConfigurationWriter configurationWriter = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getWritableConfiguration(JSP_CONTENT_TYPE_ID);
+		
+		if(configurationWriter != null) {
+			fConfigurationBlock = new CodeAssistCyclingConfigurationBlock(JSP_CONTENT_TYPE_ID, configurationWriter);
+			fConfigurationBlock.createContents(parent, null);
+		} else {
+			Logger.log(Logger.ERROR, "There should be an ICompletionProposalCategoriesConfigurationWriter" + //$NON-NLS-1$
+					" specified for the JSP content type, but can't fine it, thus can't create user" + //$NON-NLS-1$
+					" preference block for editing proposal categories preferences."); //$NON-NLS-1$
+		}
+	}
+	
+	/**
+	 * <p>Store the values for the cycling group</p>
+	 */
+	private void storeValuesForCyclingGroup() {
+		if (fConfigurationBlock != null) {
+			fConfigurationBlock.storeValues();
+		}
+	}
+	
+	/**
+	 * <p>Initialize the values for the cycling group</p>
+	 */
+	private void initializeValuesForCyclingGroup() {
+		if(fConfigurationBlock != null) {
+			fConfigurationBlock.initializeValues();
+		}
+	}
+	
+	/**
+	 * <p>Load the defaults of the cycling group</p>
+	 */
+	private void performDefaultsForCyclingGroup() {
+		if(fConfigurationBlock != null) {
+			fConfigurationBlock.performDefaults();
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
new file mode 100644
index 0000000..1dd0425
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.preferences.ui;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
+import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage;
+
+public class JSPFilesPreferencePage extends XMLFilesPreferencePage {
+	private Button fJSPSearchToJavaSearchButton;
+	
+	/**
+	 * <p><b>NOTE: </b>originally copied from {@link XMLFilesPreferencePage#createControl(Composite)}</p>
+	 * 
+	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	protected Control createContents(Composite parent) {
+		Composite scrolledComposite = createScrolledComposite(parent);
+		createContentsForCreatingGroup(scrolledComposite);
+		createContentsForSearchGroup(scrolledComposite);
+
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(scrolledComposite, IHelpContextIds.JSP_PREFWEBX_FILES_HELPID);
+
+		setSize(scrolledComposite);
+		loadPreferences();
+
+		return scrolledComposite;
+	}
+	
+	/**
+	 * @param parent
+	 */
+	private void createContentsForSearchGroup(Composite parent) {
+		Group group = createGroup(parent, 1);
+		group.setText(JSPUIMessages.JSPFilesPreferencePage_Search_group);
+		fJSPSearchToJavaSearchButton = createCheckBox(group, JSPUIMessages.JSPFilesPreferencePage_Supply_JSP_search_to_Java_search);
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#initializeValues()
+	 */
+	protected void initializeValues() {
+		super.initializeValues();
+		initCheckbox(fJSPSearchToJavaSearchButton, JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH);
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#performDefaults()
+	 */
+	protected void performDefaults() {
+		super.performDefaults();
+		defaultCheckbox(fJSPSearchToJavaSearchButton, JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH);
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#storeValues()
+	 */
+	protected void storeValues() {
+		super.storeValues();
+		getPreferenceStore().setValue(JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH,
+				(fJSPSearchToJavaSearchButton != null) ? fJSPSearchToJavaSearchButton.getSelection() : false);
+	}
+
+	/**
+	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
+	 */
+	protected IPreferenceStore doGetPreferenceStore() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#getContentType()
+	 */
+	protected IContentType getContentType() {
+		return Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#doSavePreferenceStore()
+	 */
+	protected void doSavePreferenceStore() {
+		JSPCorePlugin.getDefault().savePluginPreferences(); // model
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#getModelPreferences()
+	 */
+	protected Preferences getModelPreferences() {
+		return JSPCorePlugin.getDefault().getPluginPreferences();
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSourcePreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSourcePreferencePage.java
new file mode 100644
index 0000000..6176b4d
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSourcePreferencePage.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.preferences.ui;
+
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.dialogs.PreferenceLinkArea;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+
+public class JSPSourcePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+	public void init(IWorkbench workbench) {
+		// do nothing
+	}
+
+	protected Control createContents(Composite parent) {
+		Composite composite = createComposite(parent, 1);
+
+		new PreferenceLinkArea(composite, SWT.WRAP | SWT.MULTI, "org.eclipse.wst.sse.ui.preferences.editor", JSPUIMessages._UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK,//$NON-NLS-1$
+					(IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().indent(5, 0).hint(150, SWT.DEFAULT).create());
+		new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
+
+		Text label = new Text(composite, SWT.READ_ONLY);
+		label.setText(JSPUIMessages.JSPSourcePreferencePage_0);
+		GridData data = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
+		data.horizontalIndent = 0;
+		label.setLayoutData(data);
+		
+		PreferenceLinkArea fileEditorsArea = new PreferenceLinkArea(composite, SWT.NONE, "org.eclipse.wst.html.ui.preferences.source", JSPUIMessages.JSPSourcePreferencePage_1,//$NON-NLS-1$
+					(IWorkbenchPreferenceContainer) getContainer(), null);
+
+		data = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
+		data.horizontalIndent = 5;
+		fileEditorsArea.getControl().setLayoutData(data);
+
+		PreferenceLinkArea contentTypeArea = new PreferenceLinkArea(composite, SWT.NONE, "org.eclipse.wst.sse.ui.preferences.xml.source", JSPUIMessages.JSPSourcePreferencePage_2,//$NON-NLS-1$
+					(IWorkbenchPreferenceContainer) getContainer(), null);
+
+		data = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
+		data.horizontalIndent = 5;
+		contentTypeArea.getControl().setLayoutData(data);
+		return composite;
+	}
+
+	private Composite createComposite(Composite parent, int numColumns) {
+		Composite composite = new Composite(parent, SWT.NULL);
+
+		//GridLayout
+		GridLayout layout = new GridLayout();
+		layout.numColumns = numColumns;
+		composite.setLayout(layout);
+
+		//GridData
+		GridData data = new GridData(GridData.FILL);
+		data.horizontalIndent = 0;
+		data.verticalAlignment = GridData.FILL;
+		data.horizontalAlignment = GridData.FILL;
+		composite.setLayoutData(data);
+
+		return composite;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPStyledTextColorPicker.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPStyledTextColorPicker.java
new file mode 100644
index 0000000..19bd809
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPStyledTextColorPicker.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.preferences.ui;
+
+import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;
+
+/**
+* Overrides StyledTextColorPicker for special enablement behavior 
+* for JSPContent (only background settable)
+**/
+public class JSPStyledTextColorPicker extends StyledTextColorPicker {
+	
+	public JSPStyledTextColorPicker(Composite parent, int style) {
+		super(parent, style);
+	}
+	
+	/**
+	 * Activate controls based on the given local color type.
+	 * Overridden to disable foreground color, bold.
+	 */
+	protected void activate(String namedStyle) {
+		super.activate(namedStyle);
+		
+		if(namedStyle == IStyleConstantsJSP.JSP_CONTENT) {
+			fForeground.setEnabled(false);
+			fBold.setEnabled(false);
+			if (showItalic)
+				fItalic.setEnabled(false);
+			fForegroundLabel.setEnabled(false);	
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSyntaxColoringPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSyntaxColoringPage.java
new file mode 100644
index 0000000..f2d7556
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSyntaxColoringPage.java
@@ -0,0 +1,857 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.preferences.ui;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.preference.ColorSelector;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
+import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
+import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
+import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
+
+import com.ibm.icu.text.Collator;
+
+/**
+ * A preference page to configure our XML syntax color. It resembles the JDT
+ * and CDT pages far more than our original color page while retaining the
+ * extra "click-to-find" functionality.
+ */
+public final class JSPSyntaxColoringPage extends PreferencePage implements IWorkbenchPreferencePage {
+
+	private Button fBold;
+	private Label fForegroundLabel;
+	private Label fBackgroundLabel;
+	private Button fClearStyle;
+	private Map fContextToStyleMap;
+	private Color fDefaultForeground = null;
+	private Color fDefaultBackground = null;
+	private IStructuredDocument fDocument;
+	private ColorSelector fForegroundColorEditor;
+	private ColorSelector fBackgroundColorEditor;
+	private Button fItalic;
+	private OverlayPreferenceStore fOverlayStore;
+	private Button fStrike;
+	private Collection fStylePreferenceKeys;
+	private StructuredViewer fStylesViewer = null;
+	private Map fStyleToDescriptionMap;
+	private StyledText fText;
+	private Button fUnderline;
+
+
+	// activate controls based on the given local color type
+	private void activate(String namedStyle) {
+		Color foreground = fDefaultForeground;
+		Color background = fDefaultBackground;
+		if (namedStyle == null) {
+			fClearStyle.setEnabled(false);
+			fBold.setEnabled(false);
+			fItalic.setEnabled(false);
+			fStrike.setEnabled(false);
+			fUnderline.setEnabled(false);
+			fForegroundLabel.setEnabled(false);
+			fBackgroundLabel.setEnabled(false);
+			fForegroundColorEditor.setEnabled(false);
+			fBackgroundColorEditor.setEnabled(false);
+			fBold.setSelection(false);
+			fItalic.setSelection(false);
+			fStrike.setSelection(false);
+			fUnderline.setSelection(false);
+		}
+		else {
+			TextAttribute attribute = getAttributeFor(namedStyle);
+			fClearStyle.setEnabled(true);
+			boolean enableBackgroundOnly = IStyleConstantsJSP.JSP_CONTENT.equals(namedStyle);
+			fBold.setEnabled(!enableBackgroundOnly);
+			fItalic.setEnabled(!enableBackgroundOnly);
+			fStrike.setEnabled(!enableBackgroundOnly);
+			fUnderline.setEnabled(!enableBackgroundOnly);
+			fForegroundLabel.setEnabled(!enableBackgroundOnly);
+			fForegroundColorEditor.setEnabled(!enableBackgroundOnly);
+			fBackgroundLabel.setEnabled(true);
+			fBackgroundColorEditor.setEnabled(true);
+			fBold.setSelection((attribute.getStyle() & SWT.BOLD) != 0);
+			fItalic.setSelection((attribute.getStyle() & SWT.ITALIC) != 0);
+			fStrike.setSelection((attribute.getStyle() & TextAttribute.STRIKETHROUGH) != 0);
+			fUnderline.setSelection((attribute.getStyle() & TextAttribute.UNDERLINE) != 0);
+			if (attribute.getForeground() != null) {
+				foreground = attribute.getForeground();
+			}
+			if (attribute.getBackground() != null) {
+				background = attribute.getBackground();
+			}
+		}
+
+		fForegroundColorEditor.setColorValue(foreground.getRGB());
+		fBackgroundColorEditor.setColorValue(background.getRGB());
+	}
+
+	/**
+	 * Color the text in the sample area according to the current preferences
+	 */
+	void applyStyles() {
+		if (fText == null || fText.isDisposed())
+			return;
+		IStructuredDocumentRegion documentRegion = fDocument.getFirstStructuredDocumentRegion();
+		while (documentRegion != null) {
+			ITextRegionList regions = documentRegion.getRegions();
+			for (int i = 0; i < regions.size(); i++) {
+				ITextRegion currentRegion = regions.get(i);
+				// lookup the local coloring type and apply it
+				String namedStyle = (String) fContextToStyleMap.get(currentRegion.getType());
+				if (namedStyle == null)
+					continue;
+				TextAttribute attribute = getAttributeFor(namedStyle);
+				if (attribute == null)
+					continue;
+				StyleRange style = new StyleRange(documentRegion.getStartOffset(currentRegion), currentRegion.getTextLength(), attribute.getForeground(), attribute.getBackground(), attribute.getStyle());
+				style.strikeout = (attribute.getStyle() & TextAttribute.STRIKETHROUGH) != 0;
+				style.underline = (attribute.getStyle() & TextAttribute.UNDERLINE) != 0;
+				fText.setStyleRange(style);
+			}
+			documentRegion = documentRegion.getNext();
+		}
+	}
+
+	Button createCheckbox(Composite parent, String label) {
+		Button button = new Button(parent, SWT.CHECK);
+		button.setText(label);
+		button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+		return button;
+	}
+
+	/**
+	 * Creates composite control and sets the default layout data.
+	 */
+	private Composite createComposite(Composite parent, int numColumns) {
+		Composite composite = new Composite(parent, SWT.NULL);
+
+		// GridLayout
+		GridLayout layout = new GridLayout();
+		layout.numColumns = numColumns;
+		layout.makeColumnsEqualWidth = false;
+		layout.marginHeight = 0;
+		layout.marginWidth = 0;
+		composite.setLayout(layout);
+
+		// GridData
+		GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
+		composite.setLayoutData(data);
+		return composite;
+	}
+
+	protected Control createContents(final Composite parent) {
+		initializeDialogUnits(parent);
+
+		fDefaultForeground = parent.getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
+		fDefaultBackground = parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
+		Composite pageComponent = createComposite(parent, 2);
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.JSP_PREFWEBX_STYLES_HELPID);
+
+		Link link = new Link(pageComponent, SWT.WRAP);
+		link.setText(SSEUIMessages.SyntaxColoring_Link);
+		link.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				PreferencesUtil.createPreferenceDialogOn(parent.getShell(), e.text, null, null);
+			}
+		});
+
+		GridData linkData= new GridData(SWT.FILL, SWT.BEGINNING, true, false, 2, 1);
+		linkData.widthHint= 150; // only expand further if anyone else requires it
+		link.setLayoutData(linkData);
+
+		new Label(pageComponent, SWT.NONE).setLayoutData(new GridData());
+		new Label(pageComponent, SWT.NONE).setLayoutData(new GridData());
+
+		SashForm editor = new SashForm(pageComponent, SWT.VERTICAL);
+		GridData gridData2 = new GridData(SWT.FILL, SWT.FILL, true, true);
+		gridData2.horizontalSpan = 2;
+		editor.setLayoutData(gridData2);
+		SashForm top = new SashForm(editor, SWT.HORIZONTAL);
+		Composite styleEditor = createComposite(top, 1);
+		((GridLayout) styleEditor.getLayout()).marginRight = 5;
+		((GridLayout) styleEditor.getLayout()).marginLeft = 0;
+		createLabel(styleEditor, JSPUIMessages.SyntaxColoringPage_0);
+		fStylesViewer = createStylesViewer(styleEditor);
+		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+		gridData.horizontalIndent = 0;
+		Iterator iterator = fStyleToDescriptionMap.values().iterator();
+		while (iterator.hasNext()) {
+			gridData.widthHint = Math.max(gridData.widthHint, convertWidthInCharsToPixels(iterator.next().toString().length()));
+		}
+		gridData.heightHint = convertHeightInCharsToPixels(5);
+		fStylesViewer.getControl().setLayoutData(gridData);
+
+		Composite editingComposite = createComposite(top, 1);
+		((GridLayout) styleEditor.getLayout()).marginLeft = 5;
+		createLabel(editingComposite, ""); //$NON-NLS-1$
+		Button enabler = createCheckbox(editingComposite, JSPUIMessages.SyntaxColoringPage_2);
+		enabler.setEnabled(false);
+		enabler.setSelection(true);
+		Composite editControls = createComposite(editingComposite, 2);
+		((GridLayout) editControls.getLayout()).marginLeft = 20;
+
+		fForegroundLabel = createLabel(editControls, SSEUIMessages.Foreground_UI_);
+		((GridData) fForegroundLabel.getLayoutData()).verticalAlignment = SWT.CENTER;
+		fForegroundLabel.setEnabled(false);
+
+		fForegroundColorEditor = new ColorSelector(editControls);
+		Button fForegroundColor = fForegroundColorEditor.getButton();
+		GridData gd = new GridData(SWT.BEGINNING, SWT.FILL, false, false);
+		fForegroundColor.setLayoutData(gd);
+		fForegroundColorEditor.setEnabled(false);
+
+		fBackgroundLabel = createLabel(editControls, SSEUIMessages.Background_UI_);
+		((GridData) fBackgroundLabel.getLayoutData()).verticalAlignment = SWT.CENTER;
+		fBackgroundLabel.setEnabled(false);
+
+		fBackgroundColorEditor = new ColorSelector(editControls);
+		Button fBackgroundColor = fBackgroundColorEditor.getButton();
+		gd = new GridData(SWT.BEGINNING, SWT.FILL, false, false);
+		fBackgroundColor.setLayoutData(gd);
+		fBackgroundColorEditor.setEnabled(false);
+
+		fBold = createCheckbox(editControls, JSPUIMessages.SyntaxColoringPage_3);
+		fBold.setEnabled(false);
+		((GridData) fBold.getLayoutData()).horizontalSpan = 2;
+		fItalic = createCheckbox(editControls, JSPUIMessages.SyntaxColoringPage_4);
+		fItalic.setEnabled(false);
+		((GridData) fItalic.getLayoutData()).horizontalSpan = 2;
+		fStrike = createCheckbox(editControls, JSPUIMessages.SyntaxColoringPage_5);
+		fStrike.setEnabled(false);
+		((GridData) fStrike.getLayoutData()).horizontalSpan = 2;
+		fUnderline = createCheckbox(editControls, JSPUIMessages.SyntaxColoringPage_6);
+		fUnderline.setEnabled(false);
+		((GridData) fUnderline.getLayoutData()).horizontalSpan = 2;
+		fClearStyle = new Button(editingComposite, SWT.PUSH);
+		fClearStyle.setText(SSEUIMessages.Restore_Default_UI_); //$NON-NLS-1$ = "Restore Default"
+		fClearStyle.setLayoutData(new GridData(SWT.BEGINNING));
+		((GridData) fClearStyle.getLayoutData()).horizontalIndent = 20;
+		fClearStyle.setEnabled(false);
+
+		Composite sampleArea = createComposite(editor, 1);
+
+		((GridLayout) sampleArea.getLayout()).marginLeft = 5;
+		((GridLayout) sampleArea.getLayout()).marginTop = 5;
+		createLabel(sampleArea, SSEUIMessages.Sample_text__UI_); //$NON-NLS-1$ = "&Sample text:"
+		SourceViewer viewer = new SourceViewer(sampleArea, null, SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY);
+		fText = viewer.getTextWidget();
+		GridData gridData3 = new GridData(SWT.FILL, SWT.FILL, true, true);
+		gridData3.widthHint = convertWidthInCharsToPixels(20);
+		gridData3.heightHint = convertHeightInCharsToPixels(5);
+		gridData3.horizontalSpan = 2;
+		fText.setLayoutData(gridData3);
+		fText.setEditable(false);
+		fText.setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		fText.addKeyListener(getTextKeyListener());
+		fText.addSelectionListener(getTextSelectionListener());
+		fText.addMouseListener(getTextMouseListener());
+		fText.addTraverseListener(getTraverseListener());
+		setAccessible(fText, SSEUIMessages.Sample_text__UI_);
+		fDocument = StructuredModelManager.getModelManager().createStructuredDocumentFor(ContentTypeIdForJSP.ContentTypeID_JSP);
+		fDocument.set(getExampleText());
+		viewer.setDocument(fDocument);
+
+		top.setWeights(new int[]{1, 1});
+		editor.setWeights(new int[]{1, 1});
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.JSP_PREFWEBX_STYLES_HELPID);
+
+		fStylesViewer.setInput(getStylePreferenceKeys());
+
+		applyStyles();
+
+		fStylesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+			public void selectionChanged(SelectionChangedEvent event) {
+				if (!event.getSelection().isEmpty()) {
+					Object o = ((IStructuredSelection) event.getSelection()).getFirstElement();
+					String namedStyle = o.toString();
+					activate(namedStyle);
+					if (namedStyle == null)
+						return;
+				}
+			}
+		});
+
+		fForegroundColorEditor.addListener(new IPropertyChangeListener() {
+			public void propertyChange(PropertyChangeEvent event) {
+				if (event.getProperty().equals(ColorSelector.PROP_COLORCHANGE)) {
+					Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
+					String namedStyle = o.toString();
+					String prefString = getOverlayStore().getString(namedStyle);
+					String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+					if (stylePrefs != null) {
+						String oldValue = stylePrefs[0];
+						// open color dialog to get new color
+						String newValue = ColorHelper.toRGBString(fForegroundColorEditor.getColorValue());
+
+						if (!newValue.equals(oldValue)) {
+							stylePrefs[0] = newValue;
+							String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
+							getOverlayStore().setValue(namedStyle, newPrefString);
+							applyStyles();
+							fText.redraw();
+						}
+					}
+				}
+			}
+		});
+
+		fBackgroundColorEditor.addListener(new IPropertyChangeListener() {
+			public void propertyChange(PropertyChangeEvent event) {
+				if (event.getProperty().equals(ColorSelector.PROP_COLORCHANGE)) {
+					Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
+					String namedStyle = o.toString();
+					String prefString = getOverlayStore().getString(namedStyle);
+					String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+					if (stylePrefs != null) {
+						String oldValue = stylePrefs[1];
+						// open color dialog to get new color
+						String newValue = ColorHelper.toRGBString(fBackgroundColorEditor.getColorValue());
+
+						if (!newValue.equals(oldValue)) {
+							stylePrefs[1] = newValue;
+							String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
+							getOverlayStore().setValue(namedStyle, newPrefString);
+							applyStyles();
+							fText.redraw();
+							activate(namedStyle);
+						}
+					}
+				}
+			}
+		});
+
+		fBold.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				super.widgetSelected(e);
+				// get current (newly old) style
+				Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
+				String namedStyle = o.toString();
+				String prefString = getOverlayStore().getString(namedStyle);
+				String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+				if (stylePrefs != null) {
+					String oldValue = stylePrefs[2];
+					String newValue = String.valueOf(fBold.getSelection());
+					if (!newValue.equals(oldValue)) {
+						stylePrefs[2] = newValue;
+						String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
+						getOverlayStore().setValue(namedStyle, newPrefString);
+						applyStyles();
+						fText.redraw();
+					}
+				}
+			}
+		});
+
+		fItalic.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				super.widgetSelected(e);
+				// get current (newly old) style
+				Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
+				String namedStyle = o.toString();
+				String prefString = getOverlayStore().getString(namedStyle);
+				String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+				if (stylePrefs != null) {
+					String oldValue = stylePrefs[3];
+					String newValue = String.valueOf(fItalic.getSelection());
+					if (!newValue.equals(oldValue)) {
+						stylePrefs[3] = newValue;
+						String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
+						getOverlayStore().setValue(namedStyle, newPrefString);
+						applyStyles();
+						fText.redraw();
+					}
+				}
+			}
+		});
+
+		fStrike.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				super.widgetSelected(e);
+				// get current (newly old) style
+				Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
+				String namedStyle = o.toString();
+				String prefString = getOverlayStore().getString(namedStyle);
+				String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+				if (stylePrefs != null) {
+					String oldValue = stylePrefs[4];
+					String newValue = String.valueOf(fStrike.getSelection());
+					if (!newValue.equals(oldValue)) {
+						stylePrefs[4] = newValue;
+						String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
+						getOverlayStore().setValue(namedStyle, newPrefString);
+						applyStyles();
+						fText.redraw();
+					}
+				}
+			}
+		});
+
+		fUnderline.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				super.widgetSelected(e);
+				// get current (newly old) style
+				Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
+				String namedStyle = o.toString();
+				String prefString = getOverlayStore().getString(namedStyle);
+				String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+				if (stylePrefs != null) {
+					String oldValue = stylePrefs[5];
+					String newValue = String.valueOf(fUnderline.getSelection());
+					if (!newValue.equals(oldValue)) {
+						stylePrefs[5] = newValue;
+						String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
+						getOverlayStore().setValue(namedStyle, newPrefString);
+						applyStyles();
+						fText.redraw();
+					}
+				}
+			}
+		});
+
+		fClearStyle.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				if (fStylesViewer.getSelection().isEmpty())
+					return;
+				String namedStyle = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement().toString();
+				getOverlayStore().setToDefault(namedStyle);
+				applyStyles();
+				fText.redraw();
+				activate(namedStyle);
+			}
+		});
+
+		return pageComponent;
+	}
+
+	private Label createLabel(Composite parent, String text) {
+		Label label = new Label(parent, SWT.WRAP);
+		label.setText(text);
+		GridData data = new GridData(SWT.FILL, SWT.FILL, false, false);
+		label.setLayoutData(data);
+		label.setBackground(parent.getBackground());
+		return label;
+	}
+
+	// protected Label createDescriptionLabel(Composite parent) {
+	// return null;
+	// }
+
+	/**
+	 * Set up all the style preference keys in the overlay store
+	 */
+	private OverlayKey[] createOverlayStoreKeys() {
+		List overlayKeys = new ArrayList();
+
+		Iterator i = getStylePreferenceKeys().iterator();
+		while (i.hasNext()) {
+			overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, (String) i.next()));
+		}
+
+		OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
+		overlayKeys.toArray(keys);
+		return keys;
+	}
+
+	/**
+	 * Creates the List viewer where we see the various syntax element display
+	 * names--would it ever be a Tree like JDT's?
+	 * 
+	 * @param parent
+	 * @return
+	 */
+	private StructuredViewer createStylesViewer(Composite parent) {
+		StructuredViewer stylesViewer = new ListViewer(parent, SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
+		stylesViewer.setComparator(new ViewerComparator(Collator.getInstance()));
+		stylesViewer.setLabelProvider(new LabelProvider() {
+			public String getText(Object element) {
+				Object description = fStyleToDescriptionMap.get(element);
+				if (description != null)
+					return description.toString();
+				return super.getText(element);
+			}
+		});
+		stylesViewer.setContentProvider(new ITreeContentProvider() {
+			public void dispose() {
+			}
+
+			public Object[] getChildren(Object parentElement) {
+				return getStylePreferenceKeys().toArray();
+			}
+
+			public Object[] getElements(Object inputElement) {
+				return getChildren(inputElement);
+			}
+
+			public Object getParent(Object element) {
+				return getStylePreferenceKeys();
+			}
+
+			public boolean hasChildren(Object element) {
+				return false;
+			}
+
+			public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+			}
+		});
+		return stylesViewer;
+	}
+
+	public void dispose() {
+		if (fOverlayStore != null) {
+			fOverlayStore.stop();
+		}
+		super.dispose();
+	}
+
+	protected IPreferenceStore doGetPreferenceStore() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+
+	private TextAttribute getAttributeFor(String namedStyle) {
+		TextAttribute ta = new TextAttribute(fDefaultForeground, fDefaultBackground, SWT.NORMAL);
+
+		if (namedStyle != null && fOverlayStore != null) {
+			// note: "namedStyle" *is* the preference key
+			String prefString = getOverlayStore().getString(namedStyle);
+			String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+			if (stylePrefs != null) {
+				RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
+				RGB background = ColorHelper.toRGB(stylePrefs[1]);
+
+				int fontModifier = SWT.NORMAL;
+
+				if (stylePrefs.length > 2) {
+					boolean on = Boolean.valueOf(stylePrefs[2]).booleanValue();
+					if (on)
+						fontModifier = fontModifier | SWT.BOLD;
+				}
+				if (stylePrefs.length > 3) {
+					boolean on = Boolean.valueOf(stylePrefs[3]).booleanValue();
+					if (on)
+						fontModifier = fontModifier | SWT.ITALIC;
+				}
+				if (stylePrefs.length > 4) {
+					boolean on = Boolean.valueOf(stylePrefs[4]).booleanValue();
+					if (on)
+						fontModifier = fontModifier | TextAttribute.STRIKETHROUGH;
+				}
+				if (stylePrefs.length > 5) {
+					boolean on = Boolean.valueOf(stylePrefs[5]).booleanValue();
+					if (on)
+						fontModifier = fontModifier | TextAttribute.UNDERLINE;
+				}
+
+				ta = new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, fontModifier);
+			}
+		}
+		return ta;
+	}
+
+	private String getExampleText() {
+		return JSPUIMessages.Sample_JSP_doc;
+	}
+
+	private String getNamedStyleAtOffset(int offset) {
+		// ensure the offset is clean
+		if (offset >= fDocument.getLength())
+			return getNamedStyleAtOffset(fDocument.getLength() - 1);
+		else if (offset < 0)
+			return getNamedStyleAtOffset(0);
+		IStructuredDocumentRegion documentRegion = fDocument.getFirstStructuredDocumentRegion();
+		while (documentRegion != null && !documentRegion.containsOffset(offset)) {
+			documentRegion = documentRegion.getNext();
+		}
+		if (documentRegion != null) {
+			// find the ITextRegion's Context at this offset
+			ITextRegion interest = documentRegion.getRegionAtCharacterOffset(offset);
+			if (interest == null)
+				return null;
+			if (offset > documentRegion.getTextEndOffset(interest))
+				return null;
+			String regionContext = interest.getType();
+			if (regionContext == null)
+				return null;
+			// find the named style (internal/selectable name) for that
+			// context
+			String namedStyle = (String) fContextToStyleMap.get(regionContext);
+			if (namedStyle != null) {
+				return namedStyle;
+			}
+		}
+		return null;
+	}
+
+	private OverlayPreferenceStore getOverlayStore() {
+		return fOverlayStore;
+	}
+
+	private Collection getStylePreferenceKeys() {
+		if (fStylePreferenceKeys == null) {
+			List styles = new ArrayList();
+			styles.add(IStyleConstantsXML.TAG_BORDER);
+			styles.add(IStyleConstantsXML.TAG_NAME);
+			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
+			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+			styles.add(IStyleConstantsXML.COMMENT_BORDER);
+			styles.add(IStyleConstantsXML.COMMENT_TEXT);
+			styles.add(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+			styles.add(IStyleConstantsJSP.JSP_CONTENT);
+			fStylePreferenceKeys = styles;
+		}
+		return fStylePreferenceKeys;
+	}
+
+	private KeyListener getTextKeyListener() {
+		return new KeyListener() {
+			public void keyPressed(KeyEvent e) {
+				if (e.widget instanceof StyledText) {
+					int x = ((StyledText) e.widget).getCaretOffset();
+					selectColorAtOffset(x);
+				}
+			}
+
+			public void keyReleased(KeyEvent e) {
+				if (e.widget instanceof StyledText) {
+					int x = ((StyledText) e.widget).getCaretOffset();
+					selectColorAtOffset(x);
+				}
+			}
+		};
+	}
+
+	private MouseListener getTextMouseListener() {
+		return new MouseListener() {
+			public void mouseDoubleClick(MouseEvent e) {
+			}
+
+			public void mouseDown(MouseEvent e) {
+			}
+
+			public void mouseUp(MouseEvent e) {
+				if (e.widget instanceof StyledText) {
+					int x = ((StyledText) e.widget).getCaretOffset();
+					selectColorAtOffset(x);
+				}
+			}
+		};
+	}
+
+	private SelectionListener getTextSelectionListener() {
+		return new SelectionListener() {
+			public void widgetDefaultSelected(SelectionEvent e) {
+				selectColorAtOffset(e.x);
+				if (e.widget instanceof StyledText) {
+					((StyledText) e.widget).setSelection(e.x);
+				}
+			}
+
+			public void widgetSelected(SelectionEvent e) {
+				selectColorAtOffset(e.x);
+				if (e.widget instanceof StyledText) {
+					((StyledText) e.widget).setSelection(e.x);
+				}
+			}
+		};
+	}
+
+	private TraverseListener getTraverseListener() {
+		return new TraverseListener() {
+			/**
+			 * @see org.eclipse.swt.events.TraverseListener#keyTraversed(TraverseEvent)
+			 */
+			public void keyTraversed(TraverseEvent e) {
+				if (e.widget instanceof StyledText) {
+					if ((e.detail == SWT.TRAVERSE_TAB_NEXT) || (e.detail == SWT.TRAVERSE_TAB_PREVIOUS))
+						e.doit = true;
+				}
+			}
+		};
+	}
+
+	public void init(IWorkbench workbench) {
+		setDescription(SSEUIMessages.SyntaxColoring_Description);
+
+		fStyleToDescriptionMap = new HashMap();
+		fContextToStyleMap = new HashMap();
+
+		initStyleToDescriptionMap();
+		initRegionContextToStyleMap();
+
+		fOverlayStore = new OverlayPreferenceStore(getPreferenceStore(), createOverlayStoreKeys());
+		fOverlayStore.load();
+		fOverlayStore.start();
+	}
+
+	private void initRegionContextToStyleMap() {
+		fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
+		fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
+		fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
+
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
+		fContextToStyleMap.put(DOMRegionContext.XML_END_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_NAME, IStyleConstantsXML.TAG_NAME);
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS, IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
+		fContextToStyleMap.put(DOMRegionContext.XML_EMPTY_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
+
+		fContextToStyleMap.put(DOMRegionContext.XML_CHAR_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
+		fContextToStyleMap.put(DOMRegionContext.XML_ENTITY_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
+		fContextToStyleMap.put(DOMRegionContext.XML_PE_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
+
+		fContextToStyleMap.put(DOMJSPRegionContexts.JSP_DECLARATION_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		fContextToStyleMap.put(DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		fContextToStyleMap.put(DOMJSPRegionContexts.JSP_EXPRESSION_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		fContextToStyleMap.put(DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		fContextToStyleMap.put(DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		fContextToStyleMap.put(DOMJSPRegionContexts.JSP_CLOSE, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+
+		fContextToStyleMap.put(DOMJSPRegionContexts.JSP_CONTENT, IStyleConstantsJSP.JSP_CONTENT);
+
+		fContextToStyleMap.put(DOMJSPRegionContexts.JSP_DIRECTIVE_NAME, IStyleConstantsXML.TAG_NAME);
+		fContextToStyleMap.put(DOMJSPRegionContexts.JSP_ROOT_TAG_NAME, IStyleConstantsXML.TAG_NAME);
+		fContextToStyleMap.put(DOMJSPRegionContexts.JSP_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
+		fContextToStyleMap.put(DOMJSPRegionContexts.JSP_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
+		fContextToStyleMap.put(DOMJSPRegionContexts.JSP_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
+
+		fContextToStyleMap.put(DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+		fContextToStyleMap.put(DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+	}
+
+	private void initStyleToDescriptionMap() {
+		fStyleToDescriptionMap.put(IStyleConstantsXML.COMMENT_BORDER, XMLUIMessages.Comment_Delimiters_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.COMMENT_TEXT, XMLUIMessages.Comment_Content_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_BORDER, XMLUIMessages.Tag_Delimiters_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_NAME, XMLUIMessages.Tag_Names_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, XMLUIMessages.Attribute_Names_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, XMLUIMessages.Attribute_Equals_UI_);
+		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, XMLUIMessages.Attribute_Values_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.ENTITY_REFERENCE, XMLUIMessages.Entity_Reference_UI_); //$NON-NLS-1$ = "Entity References"
+		fStyleToDescriptionMap.put(IStyleConstantsHTML.SCRIPT_AREA_BORDER, JSPUIMessages.JSP_Delimiters_UI_); //$NON-NLS-1$ = "JSP Delimiters"
+		fStyleToDescriptionMap.put(IStyleConstantsJSP.JSP_CONTENT, JSPUIMessages.JSPColorPage_jsp_content);
+	}
+
+	protected void performDefaults() {
+		super.performDefaults();
+		getOverlayStore().loadDefaults();
+		applyStyles();
+		fStylesViewer.setSelection(StructuredSelection.EMPTY);
+		activate(null);
+		fText.redraw();
+	}
+
+	public boolean performOk() {
+		getOverlayStore().propagate();
+
+		JSPUIPlugin.getDefault().savePluginPreferences();
+		SSEUIPlugin.getDefault().savePluginPreferences();
+		return true;
+	}
+
+	private void selectColorAtOffset(int offset) {
+		String namedStyle = getNamedStyleAtOffset(offset);
+		if (namedStyle != null) {
+			fStylesViewer.setSelection(new StructuredSelection(namedStyle));
+			fStylesViewer.reveal(namedStyle);
+		}
+		else {
+			fStylesViewer.setSelection(StructuredSelection.EMPTY);
+		}
+		activate(namedStyle);
+	}
+
+	/**
+	 * Specifically set the reporting name of a control for accessibility
+	 */
+	private void setAccessible(Control control, String name) {
+		if (control == null)
+			return;
+		final String n = name;
+		control.getAccessible().addAccessibleListener(new AccessibleAdapter() {
+			public void getName(AccessibleEvent e) {
+				if (e.childID == ACC.CHILDID_SELF)
+					e.result = n;
+			}
+		});
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java
new file mode 100644
index 0000000..e5537ee
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.preferences.ui;
+
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+
+
+/**
+ * Preference page for JSP templates
+ */
+public class JSPTemplatePreferencePage extends TemplatePreferencePage {
+	class JSPEditTemplateDialog extends EditTemplateDialog {
+		public JSPEditTemplateDialog(Shell parent, Template template, boolean edit, boolean isNameModifiable, ContextTypeRegistry registry) {
+			super(parent, template, edit, isNameModifiable, registry);
+		}
+
+		protected SourceViewer createViewer(Composite parent) {			SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
+			StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationJSP();
+
+			public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+				return baseConfiguration.getConfiguredContentTypes(sourceViewer);
+			}
+
+			public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
+				return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
+			}
+
+			public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
+				ContentAssistant assistant = new ContentAssistant();
+				assistant.enableAutoActivation(true);
+				assistant.enableAutoInsert(true);
+				assistant.setContentAssistProcessor(getTemplateProcessor(), IDocument.DEFAULT_CONTENT_TYPE);
+				return assistant;
+			}
+		};
+		return doCreateViewer(parent, sourceViewerConfiguration);
+}
+	}
+
+	public JSPTemplatePreferencePage() {
+		JSPUIPlugin jspEditorPlugin = JSPUIPlugin.getDefault();
+
+		setPreferenceStore(jspEditorPlugin.getPreferenceStore());
+		setTemplateStore(jspEditorPlugin.getTemplateStore());
+		setContextTypeRegistry(jspEditorPlugin.getTemplateContextRegistry());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.preference.IPreferencePage#performOk()
+	 */
+	public boolean performOk() {
+		boolean ok = super.performOk();
+		JSPUIPlugin.getDefault().savePluginPreferences();
+		return ok;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.texteditor.templates.TemplatePreferencePage#isShowFormatterSetting()
+	 */
+	protected boolean isShowFormatterSetting() {
+		// template formatting has not been implemented
+		return false;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	protected Control createContents(Composite ancestor) {
+		Control c = super.createContents(ancestor);
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.JSP_PREFWEBX_TEMPLATES_HELPID);
+		return c;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.texteditor.templates.TemplatePreferencePage#createViewer(org.eclipse.swt.widgets.Composite)
+	 */
+	protected SourceViewer createViewer(Composite parent) {
+		SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
+			StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationJSP();
+
+			public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+				return baseConfiguration.getConfiguredContentTypes(sourceViewer);
+			}
+
+			public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
+				return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
+			}
+		};
+		return doCreateViewer(parent, sourceViewerConfiguration);
+	}
+
+	SourceViewer doCreateViewer(Composite parent, SourceViewerConfiguration viewerConfiguration) {
+		SourceViewer viewer = null;
+		String contentTypeID = ContentTypeIdForJSP.ContentTypeID_JSP;
+		viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(contentTypeID);
+		IDocument document = scratchModel.getStructuredDocument();
+		viewer.configure(viewerConfiguration);
+		viewer.setDocument(document);
+		return viewer;
+	}
+
+	/**
+	 * Creates the edit dialog. Subclasses may override this method to provide
+	 * a custom dialog.
+	 * 
+	 * @param template
+	 *            the template being edited
+	 * @param edit
+	 *            whether the dialog should be editable
+	 * @param isNameModifiable
+	 *            whether the template name may be modified
+	 * @return the created or modified template, or <code>null</code> if the
+	 *         edition failed
+	 * @since 3.1
+	 */
+	protected Template editTemplate(Template template, boolean edit, boolean isNameModifiable) {
+		EditTemplateDialog dialog = new JSPEditTemplateDialog(getShell(), template, edit, isNameModifiable, getContextTypeRegistry());
+		if (dialog.open() == Window.OK) {
+			return dialog.getTemplate();
+		}
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTypingPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTypingPreferencePage.java
new file mode 100644
index 0000000..4605944
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTypingPreferencePage.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.preferences.ui;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
+
+public class JSPTypingPreferencePage extends AbstractPreferencePage {
+
+	private Button fCloseBraces;
+	private Button fCloseScriptlets;
+	private Button fCloseComments;
+	private Button fCloseStrings;
+	private Button fCloseBrackets;
+	
+	protected Control createContents(Composite parent) {
+		Composite composite = super.createComposite(parent, 1);
+		
+		createAutoComplete(composite);
+		createJavaGroup(composite);
+
+		setSize(composite);
+		loadPreferences();
+		
+		return composite;
+	}
+	
+	private void createAutoComplete(Composite parent) {
+		Group group = createGroup(parent, 2);
+		
+		group.setText(JSPUIMessages.JSPTyping_Auto_Complete);
+		
+		fCloseBraces = createCheckBox(group, JSPUIMessages.JSPTyping_Complete_Braces);
+		((GridData) fCloseBraces.getLayoutData()).horizontalSpan = 2;
+		
+		fCloseComments = createCheckBox(group, JSPUIMessages.JSPTyping_Complete_Comments);
+		((GridData) fCloseComments.getLayoutData()).horizontalSpan = 2;
+		
+		fCloseScriptlets = createCheckBox(group, JSPUIMessages.JSPTyping_Complete_Scriptlets);
+		((GridData) fCloseScriptlets.getLayoutData()).horizontalSpan = 2;
+	}
+
+	private void createJavaGroup(Composite parent) {
+		Group group = createGroup(parent, 2);
+
+		group.setText(JSPUIMessages.JSPTyping_Java_Code);
+
+		fCloseStrings = createCheckBox(group, JSPUIMessages.JSPTyping_Close_Strings);
+		((GridData) fCloseStrings.getLayoutData()).horizontalSpan = 2;
+
+		fCloseBrackets = createCheckBox(group, JSPUIMessages.JSPTyping_Close_Brackets);
+		((GridData) fCloseBrackets.getLayoutData()).horizontalSpan = 2;
+	}
+
+	public boolean performOk() {
+		boolean result = super.performOk();
+		
+		JSPUIPlugin.getDefault().savePluginPreferences();
+		
+		return result;
+	}
+	
+	protected void initializeValues() {
+		initCheckbox(fCloseBraces, JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES);
+		initCheckbox(fCloseScriptlets, JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS);
+		initCheckbox(fCloseComments, JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
+		initCheckbox(fCloseStrings, JSPUIPreferenceNames.TYPING_CLOSE_STRINGS);
+		initCheckbox(fCloseBrackets, JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS);
+	}
+	
+	protected void performDefaults() {
+		defaultCheckbox(fCloseBraces, JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES);
+		defaultCheckbox(fCloseScriptlets, JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS);
+		defaultCheckbox(fCloseComments, JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
+		defaultCheckbox(fCloseStrings, JSPUIPreferenceNames.TYPING_CLOSE_STRINGS);
+		defaultCheckbox(fCloseBrackets, JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS);
+	}
+	
+	protected void storeValues() {
+		getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES, (fCloseBraces != null) ? fCloseBraces.getSelection() : false);
+		getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS, (fCloseScriptlets != null) ? fCloseScriptlets.getSelection() : false);
+		getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS, (fCloseComments != null) ? fCloseComments.getSelection() : false);
+		getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_CLOSE_STRINGS, (fCloseStrings != null) ? fCloseStrings.getSelection() : false);
+		getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS, (fCloseBrackets != null) ? fCloseBrackets.getSelection() : false);
+	}
+	
+	protected IPreferenceStore doGetPreferenceStore() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPValidationPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPValidationPreferencePage.java
new file mode 100644
index 0000000..01a27c9
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPValidationPreferencePage.java
@@ -0,0 +1,270 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.preferences.ui;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.PixelConverter;
+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
+import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferenceLinkArea;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.ScrolledPageContent;
+
+public class JSPValidationPreferencePage extends AbstractValidationSettingsPage {
+
+	/**
+	 * 
+	 */
+	private static final String PREFERENCE_NODE_QUALIFIER = JSPCorePlugin.getDefault().getBundle().getSymbolicName();
+
+	private static final String SETTINGS_SECTION_NAME = "JSPValidationSeverities";//$NON-NLS-1$
+
+	private static final int[] SEVERITIES = {ValidationMessage.ERROR, ValidationMessage.WARNING, ValidationMessage.IGNORE};
+
+	// Should equal org.eclipse.jdt.internal.ui.preferences.ProblemSeveritiesPreferencePage.PREF_ID
+	public static final String JAVA_SEVERITY_PREFERENCE_PAGE = "org.eclipse.jdt.ui.preferences.ProblemSeveritiesPreferencePage";
+	// Should equal org.eclipse.jdt.internal.ui.preferences.ProblemSeveritiesPreferencePage.PROP_ID
+	public static final String JAVA_SEVERITY_PROPERTY_PAGE = "org.eclipse.jdt.ui.propertyPages.ProblemSeveritiesPreferencePage";
+	// Should equal org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage.DATA_NO_LINK
+	public static final String DATA_NO_LINK= "PropertyAndPreferencePage.nolink"; //$NON-NLS-1$
+
+	private PixelConverter fPixelConverter;
+	private Button fValidateFragments;
+
+	private boolean fOriginalValidateFragments;
+
+	public JSPValidationPreferencePage() {
+		super();
+	}
+
+	/**
+	 * @param parent
+	 * @param text
+	 * @return
+	 */
+	private Button createCheckBox(Composite parent, String text) {
+		Button c = new Button(parent, SWT.CHECK);
+		c.setText(text);
+		c.setLayoutData(GridDataFactory.fillDefaults().create());
+		return c;
+	}
+
+	protected Control createCommonContents(Composite parent) {
+		final Composite page = new Composite(parent, SWT.NULL);
+
+		// GridLayout
+		GridLayout layout = new GridLayout();
+		layout.numColumns = 1;
+		page.setLayout(layout);
+
+		fPixelConverter = new PixelConverter(parent);
+		
+		Group filesGroup = new Group(page, SWT.NONE);
+		filesGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
+		filesGroup.setLayout(new GridLayout(1, false));
+		filesGroup.setText(JSPUIMessages.JSPFilesPreferencePage_0);
+		createFilesSection(filesGroup);
+
+		// spacer
+//		new Label(page, SWT.NONE).setLayoutData(GridDataFactory.fillDefaults().create());
+
+		Group severitiesGroup = new Group(page, SWT.NONE);
+		severitiesGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
+		severitiesGroup.setLayout(new GridLayout(1, false));
+		severitiesGroup.setText(JSPUIMessages.JSPValidationPreferencePage_0);
+		final Composite content = createValidationSection(severitiesGroup);
+
+		GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
+		gridData.heightHint = fPixelConverter.convertHeightInCharsToPixels(20);
+		content.setLayoutData(gridData);
+
+		return page;
+	}
+
+	/**
+	 * @param fragmentGroup
+	 */
+	private void createFilesSection(Group fragmentGroup) {
+		fValidateFragments = createCheckBox(fragmentGroup, JSPUIMessages.JSPFilesPreferencePage_1);
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(fValidateFragments, IHelpContextIds.JSP_PREFWEBX_FILES_HELPID);
+		IScopeContext[] contexts = createPreferenceScopes();
+		fOriginalValidateFragments = contexts[0].getNode(getPreferenceNodeQualifier()).getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, contexts[1].getNode(getPreferenceNodeQualifier()).getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true));
+		fValidateFragments.setSelection(fOriginalValidateFragments);
+	}
+
+	private Composite createValidationSection(Composite page) {
+		int nColumns = 3;
+
+		final ScrolledPageContent spContent = new ScrolledPageContent(page);
+
+		Composite composite = spContent.getBody();
+
+		GridLayout layout = new GridLayout(nColumns, false);
+		layout.marginHeight = 0;
+		layout.marginWidth = 0;
+		composite.setLayout(layout);
+
+		Label description = new Label(composite, SWT.NONE);
+		description.setText(JSPUIMessages.Validation_description);
+		description.setFont(page.getFont());
+
+		String[] errorWarningIgnoreLabels = new String[]{JSPUIMessages.Validation_Error, JSPUIMessages.Validation_Warning, JSPUIMessages.Validation_Ignore};
+		Composite section;
+
+		// begin directives section
+		section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_DIRECTIVE, nColumns);
+		addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_UNRESOLVABLE_URI_OR_TAGDIR, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_UNRESOLVABLE_URI_OR_TAGDIR, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_DIFFERENT_URIS, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_DIFFERENT_URIS, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_SAME_URIS, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_SAME_URIS, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_MISSING_PREFIX, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_MISSING_PREFIX, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_MISSING_URI_OR_TAGDIR, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_MISSING_URI_OR_TAGDIR, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_INCLUDE_FILE_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_INCLUDE_FILE_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_INCLUDE_NO_FILE_SPECIFIED, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_INCLUDE_NO_FILE_SPECIFIED, SEVERITIES, errorWarningIgnoreLabels, 0);
+//		addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_PAGE_SUPERCLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_PAGE_SUPERCLASS_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabels, 0);
+		// end directives section
+
+		// begin custom actions section
+		section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_CUSTOM_ACTIONS, nColumns);
+		addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_CLASS_NOT_INSTANTIATED, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_NOT_INSTANTIATED, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_CLASS_RUNTIME_EXCEPTION, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_RUNTIME_EXCEPTION, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabels, 0);
+		// end custom actions section
+
+		// begin standard actions section
+		section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_STANDARD_ACTIONS, nColumns);
+		addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_USEBEAN_INVALID_ID, JSPCorePreferenceNames.VALIDATION_TRANSLATION_USEBEAN_INVALID_ID, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_USBEAN_MISSING_TYPE_INFO, JSPCorePreferenceNames.VALIDATION_TRANSLATION_USBEAN_MISSING_TYPE_INFO, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_USEBEAN_AMBIGUOUS_TYPE_INFO, JSPCorePreferenceNames.VALIDATION_TRANSLATION_USEBEAN_AMBIGUOUS_TYPE_INFO, SEVERITIES, errorWarningIgnoreLabels, 0);
+		// end standard actions section
+
+		// begin Java severity override section
+		section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_JAVA, nColumns);
+		if (getProject() == null) {
+			new PreferenceLinkArea(section, SWT.WRAP | SWT.MULTI | SWT.LEFT_TO_RIGHT, JAVA_SEVERITY_PREFERENCE_PAGE, JSPUIMessages.VALIDATION_JAVA_NOTICE, (IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().span(2, 1).indent(0, 0).hint(150, SWT.DEFAULT).create());
+		}
+		else {
+			Map data = new HashMap();
+			data.put(DATA_NO_LINK, Boolean.TRUE);
+			new PreferenceLinkArea(section, SWT.WRAP | SWT.MULTI | SWT.LEFT_TO_RIGHT, JAVA_SEVERITY_PROPERTY_PAGE, JSPUIMessages.VALIDATION_JAVA_NOTICE, (IWorkbenchPreferenceContainer) getContainer(), data).getControl().setLayoutData(GridDataFactory.fillDefaults().span(2, 1).indent(0, 0).hint(150, SWT.DEFAULT).create());
+			// open in same shell?
+			// PreferencesUtil.createPropertyDialogOn(getShell(), getProject(), JAVA_SEVERITY_PROPERTY_PAGE, new String[] { JAVA_SEVERITY_PROPERTY_PAGE }, data).open();
+		}
+		int sectionIndent = convertWidthInCharsToPixels(2);
+		addComboBox(section, JSPUIMessages.VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED, JSPCorePreferenceNames.VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
+		addComboBox(section, JSPUIMessages.VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED, JSPCorePreferenceNames.VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
+		addComboBox(section, JSPUIMessages.VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE, JSPCorePreferenceNames.VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
+		addComboBox(section, JSPUIMessages.VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE, JSPCorePreferenceNames.VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
+		addComboBox(section, JSPUIMessages.VALIDATION_JAVA_UNUSED_IMPORT, JSPCorePreferenceNames.VALIDATION_JAVA_UNUSED_IMPORT, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
+		// end Java severity override section
+
+		// begin EL section
+		section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_EL, nColumns);
+		addComboBox(section, JSPUIMessages.VALIDATION_EL_SYNTAX, JSPCorePreferenceNames.VALIDATION_EL_SYNTAX, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_EL_LEXER, JSPCorePreferenceNames.VALIDATION_EL_LEXER, SEVERITIES, errorWarningIgnoreLabels, 0);
+		// end EL section
+
+		restoreSectionExpansionStates(getDialogSettings().getSection(SETTINGS_SECTION_NAME));
+
+		return spContent;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.dialogs.DialogPage#dispose()
+	 */
+	public void dispose() {
+		storeSectionExpansionStates(getDialogSettings().addNewSection(SETTINGS_SECTION_NAME));
+		super.dispose();
+	}
+
+	protected IDialogSettings getDialogSettings() {
+		return JSPUIPlugin.getDefault().getDialogSettings();
+	}
+
+	protected String getPreferenceNodeQualifier() {
+		return PREFERENCE_NODE_QUALIFIER;
+	}
+
+	protected String getPreferencePageID() {
+		return "org.eclipse.jst.jsp.ui.preferences.validation";//$NON-NLS-1$
+	}
+
+	protected String getProjectSettingsKey() {
+		return JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS;
+	}
+
+	protected String getPropertyPageID() {
+		return "org.eclipse.jst.jsp.ui.propertyPage.project.validation";//$NON-NLS-1$
+	}
+
+	public void init(IWorkbench workbench) {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+	 */
+	protected void performDefaults() {
+		resetSeverities();
+
+		IEclipsePreferences defaultContext = new DefaultScope().getNode(getPreferenceNodeQualifier());
+		boolean validateFragments = defaultContext.getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true);
+		fValidateFragments.setSelection(validateFragments);
+
+		super.performDefaults();
+	}
+
+	protected boolean shouldRevalidateOnSettingsChange() {
+		return fOriginalValidateFragments != fValidateFragments.getSelection() || super.shouldRevalidateOnSettingsChange();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jst.jsp.ui.internal.preferences.ui.AbstractValidationSettingsPage#storeValues()
+	 */
+	protected void storeValues() {
+		super.storeValues();
+
+		IScopeContext[] contexts = createPreferenceScopes();
+		boolean validateFragments = fValidateFragments.getSelection();
+		contexts[0].getNode(getPreferenceNodeQualifier()).putBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, validateFragments);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/registry/AdapterFactoryProviderForJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/registry/AdapterFactoryProviderForJSP.java
new file mode 100644
index 0000000..0ad8b15
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/registry/AdapterFactoryProviderForJSP.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.registry;
+
+import org.eclipse.jst.jsp.core.internal.modelhandler.ModelHandlerForJSP;
+import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterFactoryForHTML;
+import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
+import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
+import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
+import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
+import org.eclipse.wst.sse.ui.internal.util.Assert;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+public class AdapterFactoryProviderForJSP implements AdapterFactoryProvider {
+
+	/*
+	 * @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
+	 */
+	public void addAdapterFactories(IStructuredModel structuredModel) {
+		// these are the main factories, on model's factory registry
+		addContentBasedFactories(structuredModel);
+		// -------
+		// Must update/add to propagating adapters here too
+		addPropagatingAdapters(structuredModel);
+	}
+
+	protected void addContentBasedFactories(IStructuredModel structuredModel) {
+		FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
+		Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
+		INodeAdapterFactory factory = null;
+		factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
+		if (factory == null) {
+			factory = new JFaceNodeAdapterFactoryForHTML(IJFaceNodeAdapter.class, true);
+			factoryRegistry.addFactory(factory);
+		}
+
+		ModelHandlerForJSP.ensureTranslationAdapterFactory(structuredModel);
+	}
+
+	protected void addPropagatingAdapters(IStructuredModel structuredModel) {
+
+		if (structuredModel instanceof IDOMModel) {
+			IDOMModel xmlModel = (IDOMModel) structuredModel;
+			IDOMDocument document = xmlModel.getDocument();
+			PropagatingAdapter propagatingAdapter = (PropagatingAdapter) document.getAdapterFor(PropagatingAdapter.class);
+			if (propagatingAdapter != null) {
+				// what to do?
+			}
+		}
+	}
+
+	/*
+	 * @see AdapterFactoryProvider#isFor(ContentTypeDescription)
+	 */
+	public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
+		return (contentTypeDescription instanceof ModelHandlerForJSP);
+	}
+
+	public void reinitializeFactories(IStructuredModel structuredModel) {
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/IStyleConstantsJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/IStyleConstantsJSP.java
new file mode 100644
index 0000000..2b81bf8
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/IStyleConstantsJSP.java
@@ -0,0 +1,5 @@
+package org.eclipse.jst.jsp.ui.internal.style;
+
+public interface IStyleConstantsJSP {
+	public static final String JSP_CONTENT = "jsp_content"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/LineStyleProviderForJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/LineStyleProviderForJSP.java
new file mode 100644
index 0000000..d3c52ad
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/LineStyleProviderForJSP.java
@@ -0,0 +1,227 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Frits Jalvingh - contributions for bug 150794
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.style;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
+
+public class LineStyleProviderForJSP extends AbstractLineStyleProvider implements LineStyleProvider{
+
+	private String fLanguage = null;
+
+	//    private static final String JAVA = "java"; //$NON-NLS-1$
+	//    private static final String[] JAVASCRIPT_LANGUAGE_KEYS = new String[] {
+	// "javascript", "javascript1.0", "javascript1.1_3", "javascript1.2",
+	// "javascript1.3", "javascript1.4", "javascript1.5", "javascript1.6",
+	// "jscript", "sashscript" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+	// //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
+	// //$NON-NLS-9$ //$NON-NLS-10$
+
+	public LineStyleProviderForJSP() {
+		super();
+	}
+
+	protected TextAttribute getAttributeFor(ITextRegion region) {
+		/**
+		 * a method to centralize all the "sytle rules" for regions
+		 */
+		TextAttribute result = null;
+		// not sure why this is coming through null, but just to catch it
+		if (region == null) {
+			result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_TEXT);
+		}
+		else {
+
+			if (result == null) {
+				String type = region.getType();
+				if ((type == DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN) || (type == DOMJSPRegionContexts.JSP_DECLARATION_OPEN) || (type == DOMJSPRegionContexts.JSP_EXPRESSION_OPEN) || (type == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN) || (type == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE) || (type == DOMJSPRegionContexts.JSP_CLOSE)) {
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+				}
+				else if (type == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME || type == DOMJSPRegionContexts.JSP_ROOT_TAG_NAME) {
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_NAME);
+				}
+				else if ((type == DOMJSPRegionContexts.JSP_COMMENT_OPEN) || (type == DOMJSPRegionContexts.JSP_COMMENT_CLOSE)) {
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.COMMENT_BORDER);
+				}
+				else if (type == DOMJSPRegionContexts.JSP_COMMENT_TEXT) {
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.COMMENT_TEXT);
+				}
+				// ============ These are in common with XML --- (for XML form
+				// of tags)
+				//              Note: this assume's this provider is only called for
+				//              true JSP Nodes. If its called for others, then this will
+				//              cause their tag names to be highlighted too!
+				//              Further checks could be done to prevent that, but doesn't
+				//              seem worth it, since if adpaters factories are working
+				// right,
+				//              then wouldn't be needed.
+				else if (type == DOMRegionContext.XML_TAG_NAME) {
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_NAME);
+				}
+				else if ((type == DOMRegionContext.XML_TAG_OPEN) || (type == DOMRegionContext.XML_END_TAG_OPEN) || (type == DOMRegionContext.XML_TAG_CLOSE) || (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_BORDER);
+				}
+				else if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+				}
+				else if ((type == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) || (type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE) || (type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE)|| (type == DOMJSPRegionContexts.JSP_TAG_ATTRIBUTE_VALUE_DQUOTE) || (type == DOMJSPRegionContexts.JSP_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+				}
+				else if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
+				}
+
+				// DMW: added 9/1/2002 Undefined color may need addjustment :)
+				else if (type == DOMRegionContext.UNDEFINED)
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
+
+				else if (type == DOMRegionContext.WHITE_SPACE)
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
+				// DMW added 8/30/2002 -- should provide JSP specific
+				// preference for "custom tag content" (both tag dependent,
+				// BLOCKED_TEXT, and not, XML CONTENT)
+				else if (type == DOMRegionContext.XML_CONTENT)
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
+				else if (type == DOMRegionContext.BLOCK_TEXT)
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_TEXT);
+				else if (type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE||type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE)
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+			}
+		}
+		// default, return null to signal "not handled"
+		// in which case, other factories should be tried
+		return result;
+	}
+
+
+	protected IPreferenceStore getColorPreferences() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+
+	protected void loadColors() {
+		addTextAttribute(IStyleConstantsXML.TAG_NAME);
+		addTextAttribute(IStyleConstantsXML.TAG_BORDER);
+		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
+		addTextAttribute(IStyleConstantsXML.COMMENT_BORDER);
+		addTextAttribute(IStyleConstantsXML.COMMENT_TEXT);
+		addTextAttribute(IStyleConstantsXML.CDATA_BORDER);
+		addTextAttribute(IStyleConstantsXML.CDATA_TEXT);
+		addTextAttribute(IStyleConstantsXML.DECL_BORDER);
+		addTextAttribute(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
+		addTextAttribute(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
+		addTextAttribute(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
+		addTextAttribute(IStyleConstantsXML.DOCTYPE_NAME);
+		addTextAttribute(IStyleConstantsXML.PI_CONTENT);
+		addTextAttribute(IStyleConstantsXML.PI_BORDER);
+		addTextAttribute(IStyleConstantsXML.XML_CONTENT);
+		addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+	}
+
+	protected void handlePropertyChange(PropertyChangeEvent event) {
+		String styleKey = null;
+
+		if (event != null) {
+			String prefKey = event.getProperty();
+			// check if preference changed is a style preference
+			if (IStyleConstantsXML.TAG_NAME.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.TAG_NAME;
+			}
+			else if (IStyleConstantsXML.TAG_BORDER.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.TAG_BORDER;
+			}
+			else if (IStyleConstantsXML.TAG_ATTRIBUTE_NAME.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_NAME;
+			}
+			else if (IStyleConstantsXML.TAG_ATTRIBUTE_VALUE.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_VALUE;
+			}
+			else if (IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS;
+			}
+			else if (IStyleConstantsXML.COMMENT_BORDER.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.COMMENT_BORDER;
+			}
+			else if (IStyleConstantsXML.COMMENT_TEXT.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.COMMENT_TEXT;
+			}
+			else if (IStyleConstantsXML.CDATA_BORDER.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.CDATA_BORDER;
+			}
+			else if (IStyleConstantsXML.CDATA_TEXT.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.CDATA_TEXT;
+			}
+			else if (IStyleConstantsXML.DECL_BORDER.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.DECL_BORDER;
+			}
+			else if (IStyleConstantsXML.DOCTYPE_EXTERNAL_ID.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.DOCTYPE_EXTERNAL_ID;
+			}
+			else if (IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF;
+			}
+			else if (IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF;
+			}
+			else if (IStyleConstantsXML.DOCTYPE_NAME.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.DOCTYPE_NAME;
+			}
+			else if (IStyleConstantsXML.PI_CONTENT.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.PI_CONTENT;
+			}
+			else if (IStyleConstantsXML.PI_BORDER.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.PI_BORDER;
+			}
+			else if (IStyleConstantsXML.XML_CONTENT.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.XML_CONTENT;
+			}
+			else if (IStyleConstantsHTML.SCRIPT_AREA_BORDER.equals(prefKey)) {
+				styleKey = IStyleConstantsHTML.SCRIPT_AREA_BORDER;
+			}
+		}
+
+		if (styleKey != null) {
+			// overwrite style preference with new value
+			addTextAttribute(styleKey);
+			super.handlePropertyChange(event);
+		}
+	}
+
+	/**
+	 * Returns the language.
+	 * 
+	 * @return String
+	 */
+	public String getLanguage() {
+		return fLanguage;
+	}
+
+	/**
+	 * Sets the language.
+	 * 
+	 * @param language
+	 *            The language to set
+	 */
+	public void setLanguage(String language) {
+		this.fLanguage = language;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/DoubleQuotedStringRule.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/DoubleQuotedStringRule.java
new file mode 100644
index 0000000..eabb960
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/DoubleQuotedStringRule.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Frits Jalvingh and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Frits Jalvingh - initial version (bugfix for 150794)
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.style.java;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IPredicateRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+
+/**
+ * This rule matches the double-quoted strings present in JSP tag attributes. A double-quoted
+ * strings starts with \" (two characters!) and ends with \" (two characters!) too. The sequence
+ * \" is escaped by the horror \\\" (4 chars!?) as per the JSP spec.
+ *
+ * @author <a href="mailto:jal@etc.to">Frits Jalvingh</a>
+ * Created on Aug 5, 2007
+ */
+public class DoubleQuotedStringRule implements IPredicateRule {
+	private IToken	fToken;
+	private int		m_qc;
+
+	public DoubleQuotedStringRule(IToken tok) {
+		fToken = tok;
+	}
+	public IToken evaluate(ICharacterScanner scanner, boolean resume) {
+		if(resume) {
+			if(findEnd(scanner, m_qc))
+				return fToken;
+		} else {
+			int c= scanner.read();
+			if(c == '\\') {
+				c = scanner.read();
+				if(c == '"' || c == '\'') {
+					if(findEnd(scanner, c))
+						return fToken;
+				}
+				scanner.unread();
+			}
+			scanner.unread();
+		}
+		return Token.UNDEFINED;
+	}
+
+	private boolean findEnd(ICharacterScanner scanner, int qc) {
+		m_qc = qc;
+		int count = 0;
+		int c;
+		int nsl = 0;
+		while((c= scanner.read()) != ICharacterScanner.EOF) {
+			count++;
+			if(c == '\\') {
+				nsl++;
+				if(nsl >= 4)
+					nsl = 0;
+			} else if(c == qc) {
+				if(nsl == 1)
+					return true;
+				nsl = 0;
+			} else
+				nsl= 0;
+		}
+		while(--count >= 0)
+			scanner.unread();
+		return false;
+	}
+
+	public IToken getSuccessToken() {
+		return fToken;
+	}
+
+	public IToken evaluate(ICharacterScanner scanner) {
+		return evaluate(scanner, false);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/IStyleConstantsJSPJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/IStyleConstantsJSPJava.java
new file mode 100644
index 0000000..8ff7724
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/IStyleConstantsJSPJava.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *******************************************************************************/
+
+package org.eclipse.jst.jsp.ui.internal.style.java;
+
+public interface IStyleConstantsJSPJava {
+	String JAVA_KEYWORD = "keyword"; //$NON-NLS-1$
+	String JAVA_SINGLE_LINE_COMMENT = "single_line_comment"; //$NON-NLS-1$
+	String JAVA_STRING = "string"; //$NON-NLS-1$
+	String JAVA_DEFAULT = "default"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaCodeScanner.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaCodeScanner.java
new file mode 100644
index 0000000..4e05aef
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaCodeScanner.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Frits Jalvingh - contributions for bug 150794
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.style.java;
+
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.MultiLineRule;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WordRule;
+
+/**
+ * A Java code scanner.
+ */
+class JavaCodeScanner extends org.eclipse.jface.text.rules.RuleBasedScanner {
+	private IToken fKeywordToken;
+	private IToken fTypeToken;
+	private IToken fStringToken;
+	private IToken fSingleLineCommentToken;
+	private IToken fDefaultToken;
+
+	private static String[] fgKeywords = {"abstract", //$NON-NLS-1$
+				"break", //$NON-NLS-1$
+				"case", "catch", "class", "continue", //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
+				"default", "do", //$NON-NLS-2$//$NON-NLS-1$
+				"else", "extends", //$NON-NLS-2$//$NON-NLS-1$
+				"final", "finally", "for", //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
+				"if", "implements", "import", "instanceof", "interface", //$NON-NLS-5$//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
+				"native", "new", //$NON-NLS-2$//$NON-NLS-1$
+				"package", "private", "protected", "public", //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
+				"return", //$NON-NLS-1$
+				"static", "super", "switch", "synchronized", //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
+				"this", "throw", "throws", "transient", "try", //$NON-NLS-5$//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
+				"volatile", //$NON-NLS-1$
+				"while", //$NON-NLS-1$
+				"strictfp",//$NON-NLS-1$
+	};
+	private static String[] fgTypes = {"void", "boolean", "char", "byte", "short", "int", "long", "float", "double"};//$NON-NLS-9$//$NON-NLS-8$//$NON-NLS-7$//$NON-NLS-6$//$NON-NLS-5$//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
+	private static String[] fgConstants = {"false", "null", "true"};//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
+
+	/**
+	 * Creates a Java code scanner
+	 */
+	public JavaCodeScanner() {
+		super();
+	}
+	
+	public void initializeRules() {
+		List rules = new ArrayList();
+
+		// Add rule for multiple line comments.
+		rules.add(new MultiLineRule("/*", "*/", fSingleLineCommentToken));//$NON-NLS-1$ //$NON-NLS-2$
+
+		// Add rule for single line comments.
+		rules.add(new EndOfLineRule("//", fSingleLineCommentToken));//$NON-NLS-1$
+
+		// Add rule for strings and character constants.
+		rules.add(new SingleLineRule("\"", "\"", fStringToken, '\\'));//$NON-NLS-2$//$NON-NLS-1$
+		rules.add(new SingleLineRule("'", "'", fStringToken, '\\'));//$NON-NLS-2$//$NON-NLS-1$
+
+		// Add generic whitespace rule.
+		//rules.add(new WhitespaceRule(new JavaWhitespaceDetector()));
+
+		// Add word rule for keywords, types, and constants.
+		WordRule wordRule = new WordRule(new JavaWordDetector(), fDefaultToken);
+		for (int i = 0; i < fgKeywords.length; i++)
+			wordRule.addWord(fgKeywords[i], fKeywordToken);
+		for (int i = 0; i < fgTypes.length; i++)
+			wordRule.addWord(fgTypes[i], fTypeToken);
+		for (int i = 0; i < fgConstants.length; i++)
+			wordRule.addWord(fgConstants[i], fTypeToken);
+		rules.add(wordRule);
+
+		// Add the double-quoted string rule
+		rules.add(new DoubleQuotedStringRule(fStringToken));
+
+		IRule[] result = new IRule[rules.size()];
+		rules.toArray(result);
+		setRules(result);
+	}
+	
+	public void setTokenData(String tokenKey, Object data) {
+		if (tokenKey == IStyleConstantsJSPJava.JAVA_KEYWORD) {
+			fKeywordToken = new Token(data);
+			fTypeToken = new Token(data);
+		} else if (tokenKey == IStyleConstantsJSPJava.JAVA_STRING) {
+			fStringToken = new Token(data);
+		} else if (tokenKey == IStyleConstantsJSPJava.JAVA_SINGLE_LINE_COMMENT) {
+			fSingleLineCommentToken = new Token(data);
+		} else if (tokenKey == IStyleConstantsJSPJava.JAVA_DEFAULT) {
+			fDefaultToken = new Token(data);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaColorProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaColorProvider.java
new file mode 100644
index 0000000..d0a2386
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaColorProvider.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.style.java;
+
+import org.eclipse.jdt.ui.PreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.RGB;
+
+/**
+ * Colors used in the Java editor
+ */
+public class JavaColorProvider {
+	
+	// people should not be setting these, even though they are currently not final
+	public static RGB MULTI_LINE_COMMENT = new RGB(128, 0, 0);
+	public static RGB SINGLE_LINE_COMMENT = new RGB(128, 128, 0);
+	public static RGB KEYWORD = new RGB(0, 0, 128);
+	public static RGB TYPE = new RGB(0, 0, 128);
+	public static RGB STRING = new RGB(0, 128, 0);
+	public static RGB DEFAULT = new RGB(0, 0, 0);
+	public static RGB JAVADOC_KEYWORD = new RGB(0, 128, 0);
+	public static RGB JAVADOC_TAG = new RGB(128, 128, 128);
+	public static RGB JAVADOC_LINK = new RGB(128, 128, 128);
+	public static RGB JAVADOC_DEFAULT = new RGB(0, 128, 128);
+	
+	public static int MULTI_LINE_COMMENT_BOLD = SWT.NORMAL;
+	public static int SINGLE_LINE_COMMENT_BOLD = SWT.NORMAL;
+	public static int KEYWORD_BOLD = SWT.BOLD;
+	public static int TYPE_BOLD = SWT.BOLD;
+	public static int STRING_BOLD = SWT.NORMAL;
+	public static int DEFAULT_BOLD = SWT.NORMAL;
+	public static int JAVADOC_KEYWORD_BOLD = SWT.BOLD;
+	public static int JAVADOC_TAG_BOLD = SWT.NORMAL;
+	public static int JAVADOC_LINK_BOLD = SWT.NORMAL;
+	public static int JAVADOC_DEFAULT_BOLD = SWT.NORMAL;
+	
+	private static JavaColorProvider fInstance = null;
+	
+	public static JavaColorProvider getInstance() {
+		if (fInstance == null) {
+			fInstance = new JavaColorProvider();
+		}
+		return fInstance;
+	}
+	
+	/**
+	 * Use colors from JDT plugin
+	 */
+	public void loadJavaColors() {
+		IPreferenceStore jdtStore = PreferenceConstants.getPreferenceStore();
+		MULTI_LINE_COMMENT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_COLOR);
+		SINGLE_LINE_COMMENT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR);
+		KEYWORD = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR);
+		TYPE = KEYWORD;
+		STRING = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_STRING_COLOR);
+		DEFAULT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR);
+		JAVADOC_KEYWORD = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_KEYWORD_COLOR);
+		JAVADOC_TAG = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_TAG_COLOR);
+		JAVADOC_LINK = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_LINKS_COLOR);
+		JAVADOC_DEFAULT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_DEFAULT_COLOR);
+		
+		MULTI_LINE_COMMENT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		SINGLE_LINE_COMMENT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		KEYWORD_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		TYPE_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		STRING_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_STRING_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		DEFAULT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		JAVADOC_TAG_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVADOC_TAG_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		JAVADOC_LINK_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVADOC_LINKS_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		JAVADOC_DEFAULT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVADOC_DEFAULT_BOLD) ? SWT.BOLD : SWT.NORMAL;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWhitespaceDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWhitespaceDetector.java
new file mode 100644
index 0000000..663c81a
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWhitespaceDetector.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.style.java;
+
+
+
+/**
+ * A java aware white space detector.
+ */
+public class JavaWhitespaceDetector implements org.eclipse.jface.text.rules.IWhitespaceDetector {
+
+	/**
+	 * @see org.eclipse.jface.text.rules.IWhitespaceDetector#isWhitespace
+	 */
+	public boolean isWhitespace(char c) {
+		return Character.isWhitespace(c);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWordDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWordDetector.java
new file mode 100644
index 0000000..80f6378
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWordDetector.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.style.java;
+
+
+/**
+ * A Java aware word detector.
+ */
+public class JavaWordDetector implements org.eclipse.jface.text.rules.IWordDetector {
+
+	/**
+	 * @see org.eclipse.jface.text.rules.IWordDetector#isWordIdentifierPart
+	 */
+	public boolean isWordPart(char c) {
+		return Character.isJavaIdentifierPart(c);
+	}
+
+	/**
+	 * @see org.eclipse.jface.text.rules.IWordDetector#isWordIdentifierStart
+	 */
+	public boolean isWordStart(char c) {
+		return Character.isJavaIdentifierStart(c);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/LineStyleProviderForJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/LineStyleProviderForJava.java
new file mode 100644
index 0000000..853af7c
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/LineStyleProviderForJava.java
@@ -0,0 +1,324 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Frits Jalvingh - contributions for bug 150794
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.style.java;
+
+import java.util.Collection;
+
+import org.eclipse.jdt.ui.PreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
+
+// Note: many of the methods in this class were based on (or copied from) those
+// found in the example Java Editor
+public class LineStyleProviderForJava extends AbstractLineStyleProvider implements LineStyleProvider{
+
+	/** The scanner it uses */
+	private JavaCodeScanner fScanner;
+
+	public LineStyleProviderForJava() {
+		super();
+		fScanner = new JavaCodeScanner();
+		loadColors();		// Make sure we have rules before we start parsing
+	}
+
+	/**
+	 * Adds style information to the given text presentation.
+	 *
+	 * @param presentation the text presentation to be extended
+	 * @param offset the offset of the range to be styled
+	 * @param length the length of the range to be styled
+	 * @param attr the attribute describing the style of the range to be styled
+	 */
+	private void addRange(Collection presentation, int offset, int length, TextAttribute attr) {
+		// support for user defined backgroud for JSP scriptlet regions
+		TextAttribute ta = (TextAttribute)getTextAttributes().get(IStyleConstantsJSP.JSP_CONTENT);
+		Color bgColor = ta.getBackground();
+		if (bgColor == null)
+			bgColor = attr.getBackground();
+		StyleRange result = new StyleRange(offset, length, attr.getForeground(), bgColor, attr.getStyle());
+		if((attr.getStyle() & TextAttribute.STRIKETHROUGH) != 0) {
+			result.strikeout = true;
+		}
+		if((attr.getStyle() & TextAttribute.UNDERLINE) != 0) {
+			result.underline = true;
+		}
+		presentation.add(result);
+	}
+
+	/**
+	 * Looks up the colorKey in the preference store and adds the style
+	 * information to list of TextAttributes
+	 * 
+	 * @param colorKey
+	 */
+	private void addJavaTextAttribute(String colorKey) {
+		IPreferenceStore store = getJavaColorPreferences();
+		if (store != null && colorKey != null) { 
+			TextAttribute ta = null;
+			if (colorKey == IStyleConstantsJSPJava.JAVA_KEYWORD) {
+				// keyword
+				RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR);
+				boolean bold = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD);
+				boolean italics = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC);
+				boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_STRIKETHROUGH);
+				boolean underline = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_UNDERLINE);
+				int style = SWT.NORMAL;
+				if (bold) {
+					style = style | SWT.BOLD;
+				}
+				if (italics) {
+					style = style | SWT.ITALIC;
+				}
+				if (strikethrough) {
+					style = style | TextAttribute.STRIKETHROUGH;
+				}
+				if (underline) {
+					style = style | TextAttribute.UNDERLINE;
+				}
+
+				ta = createTextAttribute(foreground, null, style);
+			} else if (colorKey == IStyleConstantsJSPJava.JAVA_STRING) {
+				// string
+				RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_STRING_COLOR);
+				boolean bold = store.getBoolean(PreferenceConstants.EDITOR_STRING_BOLD);
+				boolean italics = store.getBoolean(PreferenceConstants.EDITOR_STRING_ITALIC);
+				boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_STRING_STRIKETHROUGH);
+				boolean underline = store.getBoolean(PreferenceConstants.EDITOR_STRING_UNDERLINE);
+				int style = SWT.NORMAL;
+				if (bold) {
+					style = style | SWT.BOLD;
+				}
+				if (italics) {
+					style = style | SWT.ITALIC;
+				}
+				if (strikethrough) {
+					style = style | TextAttribute.STRIKETHROUGH;
+				}
+				if (underline) {
+					style = style | TextAttribute.UNDERLINE;
+				}
+
+				ta = createTextAttribute(foreground, null, style);
+			} else if (colorKey == IStyleConstantsJSPJava.JAVA_SINGLE_LINE_COMMENT) {
+				// single line comment
+				RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR);
+				boolean bold = store.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD);
+				boolean italics = store.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_ITALIC);
+				boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_STRIKETHROUGH);
+				boolean underline = store.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_UNDERLINE);
+				int style = SWT.NORMAL;
+				if (bold) {
+					style = style | SWT.BOLD;
+				}
+				if (italics) {
+					style = style | SWT.ITALIC;
+				}
+				if (strikethrough) {
+					style = style | TextAttribute.STRIKETHROUGH;
+				}
+				if (underline) {
+					style = style | TextAttribute.UNDERLINE;
+				}
+
+				ta = createTextAttribute(foreground, null, style);
+			} else if (colorKey == IStyleConstantsJSPJava.JAVA_DEFAULT) {
+				// default
+				RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR);
+				boolean bold = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD);
+				boolean italics = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_ITALIC);
+				boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_STRIKETHROUGH);
+				boolean underline = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_UNDERLINE);
+				int style = SWT.NORMAL;
+				if (bold) {
+					style = style | SWT.BOLD;
+				}
+				if (italics) {
+					style = style | SWT.ITALIC;
+				}
+				if (strikethrough) {
+					style = style | TextAttribute.STRIKETHROUGH;
+				}
+				if (underline) {
+					style = style | TextAttribute.UNDERLINE;
+				}
+
+				ta = createTextAttribute(foreground, null, style);
+			}
+			if (ta != null) {
+				getTextAttributes().put(colorKey, ta);
+				fScanner.setTokenData(colorKey, ta);
+			}
+		}
+	}
+	
+	/**
+	 * Returns a text attribute encoded in the given token. If the token's
+	 * data is not <code>null</code> and a text attribute it is assumed that
+	 * it is the encoded text attribute. It returns the default text attribute
+	 * if there is no encoded text attribute found.
+	 *
+	 * @param token the token whose text attribute is to be determined
+	 * @return the token's text attribute
+	 */
+	private TextAttribute getTokenTextAttribute(IToken token) {
+		TextAttribute ta = null;
+		
+		Object data = token.getData();
+		if (data instanceof TextAttribute)
+			ta = (TextAttribute)data;
+		else {
+			ta = (TextAttribute)getTextAttributes().get(IStyleConstantsJSPJava.JAVA_DEFAULT);
+		}
+		return ta; 
+	}
+	
+	protected void loadColors() {
+		addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+		addTextAttribute(IStyleConstantsJSP.JSP_CONTENT);
+		
+		addJavaTextAttribute(IStyleConstantsJSPJava.JAVA_KEYWORD);
+		addJavaTextAttribute(IStyleConstantsJSPJava.JAVA_STRING);
+		addJavaTextAttribute(IStyleConstantsJSPJava.JAVA_SINGLE_LINE_COMMENT);
+		addJavaTextAttribute(IStyleConstantsJSPJava.JAVA_DEFAULT);
+		
+		fScanner.initializeRules();
+	}
+
+	protected void handlePropertyChange(PropertyChangeEvent event) {
+		String styleKey = null;
+		String javaStyleKey = null;
+
+		if (event != null) {
+			String prefKey = event.getProperty();
+			// check if preference changed is a style preference
+			if (IStyleConstantsHTML.SCRIPT_AREA_BORDER.equals(prefKey)) {
+				styleKey = IStyleConstantsHTML.SCRIPT_AREA_BORDER;
+			}
+			else if (IStyleConstantsXML.TAG_ATTRIBUTE_NAME.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_NAME;
+			}
+			else if (IStyleConstantsXML.TAG_ATTRIBUTE_VALUE.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_VALUE;
+			} else if (IStyleConstantsJSP.JSP_CONTENT.equals(prefKey)) {
+				styleKey = IStyleConstantsJSP.JSP_CONTENT;
+			} else if (PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD.equals(prefKey))|| (PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC.equals(prefKey))) {
+				javaStyleKey = IStyleConstantsJSPJava.JAVA_KEYWORD;
+			} else if (PreferenceConstants.EDITOR_STRING_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_STRING_BOLD.equals(prefKey))|| (PreferenceConstants.EDITOR_STRING_ITALIC.equals(prefKey))) {
+				javaStyleKey = IStyleConstantsJSPJava.JAVA_STRING;
+			} else if (PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD.equals(prefKey))|| (PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_ITALIC.equals(prefKey))) {
+				javaStyleKey = IStyleConstantsJSPJava.JAVA_SINGLE_LINE_COMMENT;
+			} else if (PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD.equals(prefKey))|| (PreferenceConstants.EDITOR_JAVA_DEFAULT_ITALIC.equals(prefKey))) {
+				javaStyleKey = IStyleConstantsJSPJava.JAVA_DEFAULT;
+			}
+		}
+
+		if (styleKey != null) {
+			// overwrite style preference with new value
+			addTextAttribute(styleKey);
+		}
+		if (javaStyleKey != null) {
+			// overwrite style preference with new value
+			addJavaTextAttribute(javaStyleKey);
+			fScanner.initializeRules();
+		}
+		if (styleKey != null || javaStyleKey != null) {
+			// force a full update of the text viewer
+			fRecHighlighter.refreshDisplay();
+		}
+	}
+
+	public boolean prepareRegions(ITypedRegion typedRegion, int ssssrequestedStart, int ssssrequestedLength, Collection holdResults) {
+		boolean result = true;
+		/* Initialize the text attributes. Also load the colors and initialize the rules of the scanner */
+		getTextAttributes();
+		try {
+			// ideally, eventually, we'll have a "virtualDocument" we can
+			// refer to, but for now ... we'll simple rescan the one region.
+			// use simple adjustment (since "sub-content" starts at 0
+			int lastStart = typedRegion.getOffset();
+			int length = 0;
+			IToken lastToken = Token.UNDEFINED;
+			fScanner.setRange(getDocument(), lastStart, typedRegion.getLength());
+			while (true) {
+				IToken token = fScanner.nextToken();
+				if (token.isEOF()) {
+					if (!lastToken.isUndefined() && length != 0) {
+						addRange(holdResults, lastStart, length, getTokenTextAttribute(lastToken));
+					}
+					break;
+				}
+				if (token.isWhitespace()) {
+					length += fScanner.getTokenLength();
+					continue;
+				}
+				if (lastToken.isUndefined()) {
+					lastToken = token;
+					length += fScanner.getTokenLength();
+					continue;
+				}
+				if (token != lastToken) {
+					addRange(holdResults, lastStart, length, getTokenTextAttribute(lastToken));
+					lastToken = token;
+					lastStart = fScanner.getTokenOffset();
+					length = fScanner.getTokenLength();
+					continue;
+				}
+				length += fScanner.getTokenLength();
+			}
+		} catch (Exception e) {
+			// shouldn't happen, but we don't want it to stop other
+			// highlighting, if it does.
+			result = false;
+		}
+		return result;
+	}
+	
+	protected IPreferenceStore getColorPreferences() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+	
+	private IPreferenceStore getJavaColorPreferences() {
+		return PreferenceConstants.getPreferenceStore();
+	}
+	
+	protected void registerPreferenceManager() {
+		getColorPreferences().addPropertyChangeListener(fPreferenceListener);
+		getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
+	}
+	
+	protected void unRegisterPreferenceManager() {
+		getColorPreferences().removePropertyChangeListener(fPreferenceListener);
+		getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
+	}
+
+	protected TextAttribute getAttributeFor(ITextRegion region) {
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/IStyleConstantsJSPEL.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/IStyleConstantsJSPEL.java
new file mode 100644
index 0000000..b2c4829
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/IStyleConstantsJSPEL.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *******************************************************************************/
+
+package org.eclipse.jst.jsp.ui.internal.style.jspel;
+
+public interface IStyleConstantsJSPEL {
+	String EL_KEYWORD = "keyword"; //$NON-NLS-1$
+	String EL_DEFAULT = "default"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELCodeScanner.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELCodeScanner.java
new file mode 100644
index 0000000..7534b9b
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELCodeScanner.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.style.jspel;
+
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WhitespaceRule;
+import org.eclipse.jface.text.rules.WordRule;
+
+/**
+ * A Java code scanner.
+ */
+public class JSPELCodeScanner extends org.eclipse.jface.text.rules.RuleBasedScanner {
+	private IToken fKeywordToken;
+	private IToken fTypeToken;
+	private IToken fDefaultToken;
+	
+	private static String[] fgKeywords = {
+				"and", //$NON-NLS-1$
+				"did", //$NON-NLS-1$
+				"div", //$NON-NLS-1$
+				"empty", //$NON-NLS-1$
+				"eq", //$NON-NLS-1$
+				"ge", //$NON-NLS-1$
+				"gt", //$NON-NLS-1$
+				"or", //$NON-NLS-1$
+				"le", //$NON-NLS-1$
+				"lt", //$NON-NLS-1$
+				"mod", //$NON-NLS-1$
+ 				"ne", //$NON-NLS-1$
+ 				"not"  //$NON-NLS-1$
+	};
+	private static String[] fgConstants = {"false", "true"};//$NON-NLS-2$//$NON-NLS-1$
+
+	/**
+	 * Creates a Java code scanner
+	 */
+	public JSPELCodeScanner() {
+		super();
+	}
+	
+	public void initializeRules() {
+		List rules = new ArrayList();
+
+		// Add generic whitespace rule.
+		rules.add(new WhitespaceRule(new JSPELWhitespaceDetector()));
+
+		// Add word rule for keywords, types, and constants.
+		WordRule wordRule = new WordRule(new JSPELWordDetector(), fDefaultToken);
+		for (int i = 0; i < fgKeywords.length; i++)
+			wordRule.addWord(fgKeywords[i], fKeywordToken);
+		for (int i = 0; i < fgConstants.length; i++)
+			wordRule.addWord(fgConstants[i], fTypeToken);
+		rules.add(wordRule);
+
+		IRule[] result = new IRule[rules.size()];
+		rules.toArray(result);
+		setRules(result);
+	}
+	
+	public void setTokenData(String tokenKey, Object data) {
+		if (tokenKey == IStyleConstantsJSPEL.EL_KEYWORD) {
+			fKeywordToken = new Token(data);
+			fTypeToken = new Token(data);
+		} else if (tokenKey == IStyleConstantsJSPEL.EL_DEFAULT) {
+			fDefaultToken = new Token(data);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELColorProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELColorProvider.java
new file mode 100644
index 0000000..01178a2
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELColorProvider.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.style.jspel;
+
+import org.eclipse.jdt.ui.PreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.RGB;
+
+/**
+ * Colors used in the Java editor
+ */
+public class JSPELColorProvider {
+	
+	// people should not be setting these, even though they are currently not final
+	public static RGB MULTI_LINE_COMMENT = new RGB(128, 0, 0);
+	public static RGB SINGLE_LINE_COMMENT = new RGB(128, 128, 0);
+	public static RGB KEYWORD = new RGB(0, 0, 128);
+	public static RGB TYPE = new RGB(0, 0, 128);
+	public static RGB STRING = new RGB(0, 128, 0);
+	public static RGB DEFAULT = new RGB(0, 0, 0);
+	public static RGB JAVADOC_KEYWORD = new RGB(0, 128, 0);
+	public static RGB JAVADOC_TAG = new RGB(128, 128, 128);
+	public static RGB JAVADOC_LINK = new RGB(128, 128, 128);
+	public static RGB JAVADOC_DEFAULT = new RGB(0, 128, 128);
+	
+	public static int MULTI_LINE_COMMENT_BOLD = SWT.NORMAL;
+	public static int SINGLE_LINE_COMMENT_BOLD = SWT.NORMAL;
+	public static int KEYWORD_BOLD = SWT.BOLD;
+	public static int TYPE_BOLD = SWT.BOLD;
+	public static int STRING_BOLD = SWT.NORMAL;
+	public static int DEFAULT_BOLD = SWT.NORMAL;
+	public static int JAVADOC_KEYWORD_BOLD = SWT.BOLD;
+	public static int JAVADOC_TAG_BOLD = SWT.NORMAL;
+	public static int JAVADOC_LINK_BOLD = SWT.NORMAL;
+	public static int JAVADOC_DEFAULT_BOLD = SWT.NORMAL;
+	
+	/**
+	 * @deprecated all editors use same
+	 */
+	public static RGB EDITOR_BACKGROUND = new RGB(255, 255, 255);
+	/**
+	 * @deprecated all editors use same
+	 */
+	public static boolean EDITOR_CURRENT_LINE = true;
+	/**
+	 * @deprecated all editors use same
+	 */
+	public static RGB EDITOR_CURRENT_LINE_COLOR = new RGB(128, 128, 128);
+	
+	private static JSPELColorProvider fInstance = null;
+	
+	public static JSPELColorProvider getInstance() {
+		if (fInstance == null) {
+			fInstance = new JSPELColorProvider();
+		}
+		return fInstance;
+	}
+	
+	/**
+	 * Use colors from JDT plugin
+	 */
+	public void loadJavaColors() {
+		
+		IPreferenceStore jdtStore = PreferenceConstants.getPreferenceStore();
+		MULTI_LINE_COMMENT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_COLOR);
+		SINGLE_LINE_COMMENT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR);
+		KEYWORD = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR);
+		TYPE = KEYWORD;
+		STRING = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_STRING_COLOR);
+		DEFAULT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR);
+		JAVADOC_KEYWORD = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_KEYWORD_COLOR);
+		JAVADOC_TAG = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_TAG_COLOR);
+		JAVADOC_LINK = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_LINKS_COLOR);
+		JAVADOC_DEFAULT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_DEFAULT_COLOR);
+		
+		MULTI_LINE_COMMENT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		SINGLE_LINE_COMMENT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		KEYWORD_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		TYPE_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		STRING_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_STRING_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		DEFAULT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		JAVADOC_TAG_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVADOC_TAG_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		JAVADOC_LINK_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVADOC_LINKS_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		JAVADOC_DEFAULT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVADOC_DEFAULT_BOLD) ? SWT.BOLD : SWT.NORMAL;
+		
+//		EDITOR_BACKGROUND = new RGB(255, 255, 255);
+		
+//		IPreferenceStore sseStore = SSEUIPlugin.getDefault().getPreferenceStore();
+//		EDITOR_CURRENT_LINE = sseStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE);
+//		EDITOR_CURRENT_LINE_COLOR = PreferenceConverter.getColor(sseStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWhitespaceDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWhitespaceDetector.java
new file mode 100644
index 0000000..e899700
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWhitespaceDetector.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.style.jspel;
+
+
+
+/**
+ * A java aware white space detector.
+ */
+public class JSPELWhitespaceDetector implements org.eclipse.jface.text.rules.IWhitespaceDetector {
+
+	/**
+	 * @see org.eclipse.jface.text.rules.IWhitespaceDetector#isWhitespace
+	 */
+	public boolean isWhitespace(char c) {
+		return Character.isWhitespace(c);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWordDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWordDetector.java
new file mode 100644
index 0000000..a10a7ab
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWordDetector.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.style.jspel;
+
+
+/**
+ * A Java aware word detector.
+ */
+public class JSPELWordDetector implements org.eclipse.jface.text.rules.IWordDetector {
+
+	/**
+	 * @see org.eclipse.jface.text.rules.IWordDetector#isWordIdentifierPart
+	 */
+	public boolean isWordPart(char c) {
+		return Character.isJavaIdentifierPart(c);
+	}
+
+	/**
+	 * @see org.eclipse.jface.text.rules.IWordDetector#isWordIdentifierStart
+	 */
+	public boolean isWordStart(char c) {
+		return Character.isJavaIdentifierStart(c);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/LineStyleProviderForJSPEL.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/LineStyleProviderForJSPEL.java
new file mode 100644
index 0000000..3be6356
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/LineStyleProviderForJSPEL.java
@@ -0,0 +1,283 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.style.jspel;
+
+import java.util.Collection;
+
+import org.eclipse.jdt.ui.PreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
+import org.eclipse.jst.jsp.ui.internal.style.java.IStyleConstantsJSPJava;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
+import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
+
+// Note: many of the methods in this class were based on (or copied from)
+// those
+// found in the example Java Editor
+public class LineStyleProviderForJSPEL extends AbstractLineStyleProvider implements LineStyleProvider {
+
+	/** The scanner it uses */
+	private JSPELCodeScanner fScanner;
+
+	public LineStyleProviderForJSPEL() {
+		super();
+		fScanner = new JSPELCodeScanner();
+	}
+
+	/**
+	 * Adds style information to the given text presentation.
+	 * 
+	 * @param presentation
+	 *            the text presentation to be extended
+	 * @param offset
+	 *            the offset of the range to be styled
+	 * @param length
+	 *            the length of the range to be styled
+	 * @param attr
+	 *            the attribute describing the style of the range to be styled
+	 */
+	private void addRange(Collection presentation, int offset, int length, TextAttribute attr) {
+		// support for user defined backgroud for JSP scriptlet regions
+		String styleString = JSPUIPlugin.getDefault().getPreferenceStore().getString(IStyleConstantsJSP.JSP_CONTENT);
+		String[] prefs = ColorHelper.unpackStylePreferences(styleString);
+		Color bgColor = (prefs != null && prefs.length == 3 && prefs[1].startsWith("#") && Display.getCurrent() != null) //$NON-NLS-1$
+					? new Color(Display.getCurrent(), ColorHelper.toRGB(prefs[1])) : attr.getBackground();
+
+		presentation.add(new StyleRange(offset, length, attr.getForeground(), bgColor, attr.getStyle()));
+	}
+
+	/**
+	 * Looks up the colorKey in the preference store and adds the style
+	 * information to list of TextAttributes
+	 * 
+	 * @param colorKey
+	 */
+	private void addJavaTextAttribute(String colorKey) {
+		IPreferenceStore store = getJavaColorPreferences();
+		if (store != null && colorKey != null) {
+			TextAttribute ta = null;
+			if (colorKey == IStyleConstantsJSPEL.EL_KEYWORD) {
+				// keyword
+				RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR);
+				boolean bold = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD);
+				boolean italics = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC);
+				boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_STRIKETHROUGH);
+				boolean underline = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_UNDERLINE);
+				int style = SWT.NORMAL;
+				if (bold) {
+					style = style | SWT.BOLD;
+				}
+				if (italics) {
+					style = style | SWT.ITALIC;
+				}
+				if (strikethrough) {
+					style = style | TextAttribute.STRIKETHROUGH;
+				}
+				if (underline) {
+					style = style | TextAttribute.UNDERLINE;
+				}
+
+				ta = createTextAttribute(foreground, null, style);
+			} else if (colorKey == IStyleConstantsJSPEL.EL_DEFAULT) {
+				// default
+				RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR);
+				boolean bold = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD);
+				boolean italics = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_ITALIC);
+				boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_STRIKETHROUGH);
+				boolean underline = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_UNDERLINE);
+				int style = SWT.NORMAL;
+				if (bold) {
+					style = style | SWT.BOLD;
+				}
+				if (italics) {
+					style = style | SWT.ITALIC;
+				}
+				if (strikethrough) {
+					style = style | TextAttribute.STRIKETHROUGH;
+				}
+				if (underline) {
+					style = style | TextAttribute.UNDERLINE;
+				}
+
+				ta = createTextAttribute(foreground, null, style);
+			}
+			if (ta != null) {
+				getTextAttributes().put(colorKey, ta);
+				fScanner.setTokenData(colorKey, ta);
+			}
+		}
+	}
+
+	/**
+	 * Returns a text attribute encoded in the given token. If the token's
+	 * data is not <code>null</code> and a text attribute it is assumed that
+	 * it is the encoded text attribute. It returns the default text attribute
+	 * if there is no encoded text attribute found.
+	 * 
+	 * @param token
+	 *            the token whose text attribute is to be determined
+	 * @return the token's text attribute
+	 */
+	private TextAttribute getTokenTextAttribute(IToken token) {
+		TextAttribute ta = null;
+
+		Object data = token.getData();
+		if (data instanceof TextAttribute)
+			ta = (TextAttribute) data;
+		else {
+			ta = (TextAttribute) getTextAttributes().get(IStyleConstantsJSPJava.JAVA_DEFAULT);
+		}
+		return ta;
+	}
+
+	protected void loadColors() {
+		addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+
+		addJavaTextAttribute(IStyleConstantsJSPJava.JAVA_KEYWORD);
+		addJavaTextAttribute(IStyleConstantsJSPJava.JAVA_DEFAULT);
+
+		fScanner.initializeRules();
+	}
+
+	protected void handlePropertyChange(PropertyChangeEvent event) {
+		String styleKey = null;
+		String javaStyleKey = null;
+
+		if (event != null) {
+			String prefKey = event.getProperty();
+			// check if preference changed is a style preference
+			if (IStyleConstantsHTML.SCRIPT_AREA_BORDER.equals(prefKey)) {
+				styleKey = IStyleConstantsHTML.SCRIPT_AREA_BORDER;
+			} else if (IStyleConstantsXML.TAG_ATTRIBUTE_NAME.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_NAME;
+			} else if (IStyleConstantsXML.TAG_ATTRIBUTE_VALUE.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_VALUE;
+			} else if (PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD.equals(prefKey)) || (PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC.equals(prefKey))) {
+				javaStyleKey = IStyleConstantsJSPEL.EL_KEYWORD;
+			} else if (PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD.equals(prefKey)) || (PreferenceConstants.EDITOR_JAVA_DEFAULT_ITALIC.equals(prefKey))) {
+				javaStyleKey = IStyleConstantsJSPEL.EL_DEFAULT;
+			}
+		}
+
+		if (styleKey != null) {
+			// overwrite style preference with new value
+			addTextAttribute(styleKey);
+		}
+		if (javaStyleKey != null) {
+			// overwrite style preference with new value
+			addJavaTextAttribute(javaStyleKey);
+			fScanner.initializeRules();
+		}
+		if (styleKey != null || javaStyleKey != null) {
+			// force a full update of the text viewer
+			fRecHighlighter.refreshDisplay();
+		}
+	}
+
+	public boolean prepareRegions(ITypedRegion typedRegion, int ssssrequestedStart, int ssssrequestedLength, Collection holdResults) {
+		boolean result = true;
+		try {
+			// ideally, eventually, we'll have a "virtualDocument" we can
+			// refer to, but for now ... we'll simple rescan the one region.
+			// use simple adjustment (since "sub-content" starts at 0
+			int offsetAdjustment = typedRegion.getOffset();
+			String content = fDocument.get(typedRegion.getOffset(), typedRegion.getLength());
+			IDocument document = new Document(content);
+
+			int lastStart = 0;
+			int length = 0;
+			IToken lastToken = Token.UNDEFINED;
+
+			int remainingLength = typedRegion.getLength();
+			fScanner.setRange(document, lastStart, remainingLength);
+
+			while (true) {
+
+				IToken token = fScanner.nextToken();
+
+				if (token.isEOF()) {
+					if (!lastToken.isUndefined() && length != 0)
+						addRange(holdResults, lastStart + offsetAdjustment, length, getTokenTextAttribute(lastToken));
+					break;
+				}
+
+				if (token.isWhitespace()) {
+					length += fScanner.getTokenLength();
+					continue;
+				}
+
+				if (lastToken.isUndefined()) {
+					lastToken = token;
+					length += fScanner.getTokenLength();
+					continue;
+				}
+
+				if (token != lastToken) {
+					addRange(holdResults, lastStart + offsetAdjustment, length, getTokenTextAttribute(lastToken));
+					lastToken = token;
+					lastStart = fScanner.getTokenOffset();
+					length = fScanner.getTokenLength();
+					continue;
+				}
+
+				length += fScanner.getTokenLength();
+			}
+		} catch (BadLocationException e) {
+			// shouldn't happen, but we don't want it to stop other
+			// highlighting, if it does.
+			result = false;
+		}
+		return result;
+	}
+	
+	protected IPreferenceStore getColorPreferences() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+	
+	private IPreferenceStore getJavaColorPreferences() {
+		return PreferenceConstants.getPreferenceStore();
+	}
+	
+	protected void registerPreferenceManager() {
+		getColorPreferences().addPropertyChangeListener(fPreferenceListener);
+		getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
+	}
+	
+	protected void unRegisterPreferenceManager() {
+		getColorPreferences().removePropertyChangeListener(fPreferenceListener);
+		getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
+	}
+
+	protected TextAttribute getAttributeFor(ITextRegion region) {
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPInformationProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPInformationProvider.java
new file mode 100644
index 0000000..327371b
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPInformationProvider.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.taginfo;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.information.IInformationProvider;
+import org.eclipse.jface.text.information.IInformationProviderExtension;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+
+/**
+ * Provides context help for JSP tags (Show tooltip description)
+ * 
+ * @deprecated StructuredTextViewerConfiguration creates the appropriate
+ *             information provider
+ */
+public class JSPInformationProvider implements IInformationProvider, IInformationProviderExtension {
+	private ITextHover fTextHover = null;
+
+	public JSPInformationProvider() {
+		fTextHover = SSEUIPlugin.getDefault().getTextHoverManager().createBestMatchHover(new JSPTagInfoHoverProcessor());
+	}
+
+	public IRegion getSubject(ITextViewer textViewer, int offset) {
+		return fTextHover.getHoverRegion(textViewer, offset);
+	}
+
+	public String getInformation(ITextViewer textViewer, IRegion subject) {
+		return (String) getInformation2(textViewer, subject);
+	}
+
+	public Object getInformation2(ITextViewer textViewer, IRegion subject) {
+		return fTextHover.getHoverInfo(textViewer, subject);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java
new file mode 100644
index 0000000..117ade2
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.taginfo;
+
+import java.io.Reader;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.ui.JavaElementLabels;
+import org.eclipse.jdt.ui.JavadocContentAccess;
+import org.eclipse.jface.internal.text.html.HTMLPrinter;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.ui.internal.taginfo.AbstractHoverProcessor;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+/**
+ * Provides javadoc hover help documentation for java code inside JSPs
+ */
+public class JSPJavaJavadocHoverProcessor extends AbstractHoverProcessor {
+	/*
+	 * Bulk of the work was copied from
+	 * org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover
+	 */
+	private final long LABEL_FLAGS = JavaElementLabels.ALL_FULLY_QUALIFIED | JavaElementLabels.M_PRE_RETURNTYPE | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.M_PARAMETER_NAMES | JavaElementLabels.M_EXCEPTIONS | JavaElementLabels.F_PRE_TYPE_SIGNATURE | JavaElementLabels.M_PRE_TYPE_PARAMETERS | JavaElementLabels.T_TYPE_PARAMETERS | JavaElementLabels.USE_RESOLVED;
+	private final long LOCAL_VARIABLE_FLAGS = LABEL_FLAGS & ~JavaElementLabels.F_FULLY_QUALIFIED | JavaElementLabels.F_POST_QUALIFIED;
+
+	protected String getHoverInfo(IJavaElement[] result) {
+		StringBuffer buffer = new StringBuffer();
+		int nResults = result.length;
+		if (nResults == 0)
+			return null;
+
+		if (nResults > 1) {
+
+			for (int i = 0; i < result.length; i++) {
+				HTMLPrinter.startBulletList(buffer);
+				IJavaElement curr = result[i];
+				if (curr instanceof IMember || curr.getElementType() == IJavaElement.LOCAL_VARIABLE)
+					HTMLPrinter.addBullet(buffer, getInfoText(curr));
+				HTMLPrinter.endBulletList(buffer);
+			}
+
+		}
+		else {
+
+			IJavaElement curr = result[0];
+			if (curr instanceof IMember) {
+				IMember member = (IMember) curr;
+				HTMLPrinter.addSmallHeader(buffer, getInfoText(member));
+				Reader reader;
+				try {
+					reader = JavadocContentAccess.getHTMLContentReader(member, true, true);
+				}
+				catch (JavaModelException ex) {
+					return null;
+				}
+				if (reader != null) {
+					HTMLPrinter.addParagraph(buffer, reader);
+				}
+			}
+			else if (curr.getElementType() == IJavaElement.LOCAL_VARIABLE || curr.getElementType() == IJavaElement.TYPE_PARAMETER)
+				HTMLPrinter.addSmallHeader(buffer, getInfoText(curr));
+		}
+
+		if (buffer.length() > 0) {
+			HTMLPrinter.insertPageProlog(buffer, 0);
+			HTMLPrinter.addPageEpilog(buffer);
+			return buffer.toString();
+		}
+
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer,
+	 *      org.eclipse.jface.text.IRegion)
+	 */
+	public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
+		// get JSP translation object for this viewer's document
+		IDOMModel xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(textViewer.getDocument());
+		try {
+			if (xmlModel != null) {
+				IDOMDocument xmlDoc = xmlModel.getDocument();
+				JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
+				if (adapter != null) {
+					JSPTranslation translation = adapter.getJSPTranslation();
+					
+					IJavaElement[] result = translation.getElementsFromJspRange(hoverRegion.getOffset(), hoverRegion.getOffset() + hoverRegion.getLength());
+					return translation.fixupMangledName(getHoverInfo(result));
+				}
+			}
+		}
+		finally {
+			if (xmlModel != null)
+				xmlModel.releaseFromRead();
+		}
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer,
+	 *      int)
+	 */
+	public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
+		return JavaWordFinder.findWord(textViewer.getDocument(), offset);
+	}
+
+	private String getInfoText(IJavaElement member) {
+		long flags = member.getElementType() == IJavaElement.LOCAL_VARIABLE ? LOCAL_VARIABLE_FLAGS : LABEL_FLAGS;
+		String label = JavaElementLabels.getElementLabel(member, flags);
+		StringBuffer buf = new StringBuffer();
+		for (int i = 0; i < label.length(); i++) {
+			char ch = label.charAt(i);
+			if (ch == '<') {
+				buf.append("&lt;"); //$NON-NLS-1$
+			}
+			else if (ch == '>') {
+				buf.append("&gt;"); //$NON-NLS-1$
+			}
+			else {
+				buf.append(ch);
+			}
+		}
+		return buf.toString();
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocInformationProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocInformationProvider.java
new file mode 100644
index 0000000..6aa06f1
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocInformationProvider.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.taginfo;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.information.IInformationProvider;
+import org.eclipse.jface.text.information.IInformationProviderExtension;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+
+/**
+ * Provides javadoc context information for java code inside JSPs (Shows
+ * tooltip description)
+ * 
+ * @deprecated StructuredTextViewerConfiguration creates the appropriate
+ *             information provider
+ */
+public class JSPJavaJavadocInformationProvider implements IInformationProvider, IInformationProviderExtension {
+	private ITextHover fTextHover = null;
+
+	public JSPJavaJavadocInformationProvider() {
+		fTextHover = SSEUIPlugin.getDefault().getTextHoverManager().createBestMatchHover(new JSPJavaJavadocHoverProcessor());
+	}
+
+	public IRegion getSubject(ITextViewer textViewer, int offset) {
+		return fTextHover.getHoverRegion(textViewer, offset);
+	}
+
+	public String getInformation(ITextViewer textViewer, IRegion subject) {
+		return (String) getInformation2(textViewer, subject);
+	}
+
+	public Object getInformation2(ITextViewer textViewer, IRegion subject) {
+		return fTextHover.getHoverInfo(textViewer, subject);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPTagInfoHoverProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPTagInfoHoverProcessor.java
new file mode 100644
index 0000000..9c2a7c2
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPTagInfoHoverProcessor.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.taginfo;
+
+
+
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.wst.html.ui.internal.taginfo.HTMLTagInfoHoverProcessor;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+
+/**
+ * Provides hover help documentation for JSP tags
+ */
+public class JSPTagInfoHoverProcessor extends HTMLTagInfoHoverProcessor {
+
+	protected String computeRegionHelp(IndexedRegion treeNode, IDOMNode parentNode, IStructuredDocumentRegion flatNode, ITextRegion region) {
+		String result = null;
+
+		if (region == null)
+			return null;
+
+		String regionType = region.getType();
+		if (regionType == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
+			result = computeJSPDirHelp((IDOMNode) treeNode, parentNode, flatNode, region);
+		}
+		else
+			result = super.computeRegionHelp(treeNode, parentNode, flatNode, region);
+
+		return result;
+	}
+
+	/**
+	 * Computes the hover help for the jsp directive name
+	 * for now, treat jsp directives like any other tag name
+	 */
+	protected String computeJSPDirHelp(IDOMNode xmlnode, IDOMNode parentNode, IStructuredDocumentRegion flatNode, ITextRegion region) {
+		return computeTagNameHelp(xmlnode, parentNode, flatNode, region);
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JavaWordFinder.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JavaWordFinder.java
new file mode 100644
index 0000000..2acc579
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JavaWordFinder.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.taginfo;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+
+/**
+ * Copied from org.eclipse.jdt.internal.ui.text.JavaWordFinder
+ */
+class JavaWordFinder {
+	public static IRegion findWord(IDocument document, int offset) {
+		return findWord(document, offset, false);
+	}
+	public static IRegion findWord(IDocument document, int offset, boolean searchQualified) {
+		
+		int start= -1;
+		int end= -1;
+		
+		
+		try {
+			
+			int pos= offset;
+			char c;
+			
+			while (pos >= 0) {
+				c= document.getChar(pos);
+				if (searchQualified ? !Character.isJavaIdentifierPart(c) && c != '.' : !Character.isJavaIdentifierPart(c))
+					break;
+				--pos;
+			}
+			
+			start= pos;
+			
+			pos= offset;
+			int length= document.getLength();
+			
+			while (pos < length) {
+				c= document.getChar(pos);
+				if (searchQualified ? !Character.isJavaIdentifierPart(c) && c != '.' : !Character.isJavaIdentifierPart(c))
+					break;
+				++pos;
+			}
+			
+			end= pos;
+			
+		} catch (BadLocationException x) {
+		}
+		
+		if (start > -1 && end > -1) {
+			if (start == offset && end == offset)
+				return new Region(offset, 0);
+			else if (start == offset)
+				return new Region(start, end - start);
+			else
+				return new Region(start + 1, end - start - 1);
+		}
+		
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/XMLJavadocHoverProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/XMLJavadocHoverProcessor.java
new file mode 100644
index 0000000..75d6212
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/XMLJavadocHoverProcessor.java
@@ -0,0 +1,137 @@
+/*******************************************************************************

+ * Copyright (c) 2001, 2009 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *     Jens Lukowski/Innoopract - initial renaming/restructuring

+ *     

+ *******************************************************************************/

+package org.eclipse.jst.jsp.ui.internal.taginfo;

+

+import org.eclipse.core.resources.IProject;

+import org.eclipse.core.resources.ResourcesPlugin;

+import org.eclipse.core.runtime.CoreException;

+import org.eclipse.core.runtime.IPath;

+import org.eclipse.core.runtime.Path;

+import org.eclipse.jdt.core.IJavaElement;

+import org.eclipse.jdt.core.IJavaProject;

+import org.eclipse.jdt.core.IPackageFragmentRoot;

+import org.eclipse.jdt.core.IType;

+import org.eclipse.jdt.core.JavaCore;

+import org.eclipse.jdt.core.JavaModelException;

+import org.eclipse.jface.text.BadLocationException;

+import org.eclipse.jface.text.IRegion;

+import org.eclipse.jface.text.ITextViewer;

+import org.eclipse.jst.jsp.core.internal.Logger;

+import org.eclipse.wst.sse.core.StructuredModelManager;

+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;

+import org.eclipse.wst.sse.core.utils.StringUtils;

+

+

+

+/**

+ * Provides hover help documentation for xml tags

+ * 

+ * @see org.eclipse.jface.text.ITextHover

+ */

+public class XMLJavadocHoverProcessor extends JSPJavaJavadocHoverProcessor {

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see

+	 * org.eclipse.jst.jsp.ui.internal.taginfo.JSPJavaJavadocHoverProcessor

+	 * #getHoverInfo(org.eclipse.jface.text.ITextViewer,

+	 * org.eclipse.jface.text.IRegion)

+	 */

+	public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {

+		String elementName = null;

+		try {

+			elementName = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength());

+		}

+		catch (BadLocationException e) {

+			return null;

+		}

+

+		IStructuredModel model = null;

+		try {

+			model = StructuredModelManager.getModelManager().getExistingModelForRead(textViewer.getDocument());

+			if (model != null) {

+				String baseLocation = model.getBaseLocation();

+				// URL fixup from the taglib index record

+				if (baseLocation.startsWith("jar:/file:")) {

+					baseLocation = StringUtils.replace(baseLocation, "jar:/", "jar:");

+				}

+				/*

+				 * Handle opened TLD files from JARs on the Java Build Path by

+				 * finding a package fragment root for the same .jar file and

+				 * opening the class from there. Note that this might be from

+				 * a different Java project's build path than the TLD.

+				 */

+				if (baseLocation.startsWith("jar:file:") && baseLocation.indexOf('!') > 9) {

+					String baseFile = baseLocation.substring(9, baseLocation.indexOf('!'));

+					IPath basePath = new Path(baseFile);

+					IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();

+					for (int i = 0; i < projects.length; i++) {

+						try {

+							if (projects[i].isAccessible() && projects[i].hasNature(JavaCore.NATURE_ID)) {

+								IJavaProject javaProject = JavaCore.create(projects[i]);

+								if (javaProject.exists()) {

+									IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(basePath);

+									if (root != null) {

+										// TLDs don't reference method names

+										IType type = javaProject.findType(elementName);

+										if (type != null) {

+											return getHoverInfo(new IJavaElement[]{type});

+										}

+									}

+								}

+							}

+						}

+						catch (CoreException e) {

+							Logger.logException(e);

+						}

+					}

+				}

+				else {

+					IPath basePath = new Path(baseLocation);

+					if (basePath.segmentCount() > 1) {

+						IJavaProject javaProject = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0)));

+						if (javaProject.exists()) {

+							try {

+								// TLDs don't reference method names

+								IType type = javaProject.findType(elementName);

+								if (type != null) {

+									return getHoverInfo(new IJavaElement[]{type});

+								}

+							}

+							catch (JavaModelException e) {

+								Logger.logException(e);

+							}

+						}

+					}

+				}

+			}

+

+		}

+		finally {

+			if (model != null)

+				model.releaseFromRead();

+		}

+		return null;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see

+	 * org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.

+	 * text.ITextViewer, int)

+	 */

+	public IRegion getHoverRegion(ITextViewer textViewer, int offset) {

+		return JavaWordFinder.findWord(textViewer.getDocument(), offset, true);

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/EncodingTemplateVariableResolverJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/EncodingTemplateVariableResolverJSP.java
new file mode 100644
index 0000000..23b1058
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/EncodingTemplateVariableResolverJSP.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.templates;
+
+import org.eclipse.jface.text.templates.SimpleTemplateVariableResolver;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
+
+
+public class EncodingTemplateVariableResolverJSP extends SimpleTemplateVariableResolver {
+	private static final String ENCODING_TYPE = getEncodingType();
+
+	private static String getEncodingType() {
+		return "encoding"; //$NON-NLS-1$
+	}
+
+	/**
+	 * Creates a new encoding variable
+	 */
+	public EncodingTemplateVariableResolverJSP() {
+		super(ENCODING_TYPE, JSPUIMessages.Creating_files_encoding);
+	}
+
+	protected String resolve(TemplateContext context) {
+		return JSPCorePlugin.getDefault().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeIdsJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeIdsJSP.java
new file mode 100644
index 0000000..eec77f9
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeIdsJSP.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.templates;
+
+
+public class TemplateContextTypeIdsJSP {
+
+	public static final String ALL = getAll();
+
+	public static final String ATTRIBUTE = getAttribute();
+
+	public static final String ATTRIBUTE_VALUE = getAttributeValue();
+
+	public static final String NEW = getNew();
+
+	public static final String TAG = getTag();
+
+	public static final String NEW_TAG = "tag_new";
+
+	private static String getAll() {
+		return getPrefix() + "_all"; //$NON-NLS-1$
+	}
+
+	private static String getAttribute() {
+		return getPrefix() + "_attribute"; //$NON-NLS-1$
+	}
+
+	private static String getAttributeValue() {
+		return getPrefix() + "_attribute_value"; //$NON-NLS-1$
+	}
+
+	private static String getNew() {
+		return getPrefix() + "_new"; //$NON-NLS-1$
+	}
+
+	private static String getPrefix() {
+		return "jsp"; //$NON-NLS-1$
+	}
+
+	private static String getTag() {
+		return getPrefix() + "_tag"; //$NON-NLS-1$
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeJSP.java
new file mode 100644
index 0000000..60e19e7
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeJSP.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.templates;
+
+import org.eclipse.jface.text.templates.GlobalTemplateVariables;
+import org.eclipse.jface.text.templates.TemplateContextType;
+
+/**
+ * Base class for JSP template context types. Templates of this context type
+ * apply to any place within JSP content type.
+ */
+public class TemplateContextTypeJSP extends TemplateContextType {
+	public TemplateContextTypeJSP() {
+		super();
+		addResolver(new GlobalTemplateVariables.Cursor());
+		addResolver(new GlobalTemplateVariables.Date());
+		addResolver(new GlobalTemplateVariables.Dollar());
+		addResolver(new GlobalTemplateVariables.LineSelection());
+		addResolver(new GlobalTemplateVariables.Time());
+		addResolver(new GlobalTemplateVariables.User());
+		addResolver(new GlobalTemplateVariables.WordSelection());
+		addResolver(new GlobalTemplateVariables.Year());
+		addResolver(new EncodingTemplateVariableResolverJSP());
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JSPDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JSPDocumentRegionEdgeMatcher.java
new file mode 100644
index 0000000..113c418
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JSPDocumentRegionEdgeMatcher.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.text;
+
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+
+public class JSPDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
+
+	protected final static char[] BRACKETS = {'{', '}', '(', ')', '[', ']','"','"','\'','\''};
+
+	/**
+	 * @param validContexts
+	 * @param nextMatcher
+	 */
+	public JSPDocumentRegionEdgeMatcher() {
+		super(new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_COMMENT_TEXT, DOMJSPRegionContexts.JSP_COMMENT_TEXT, DOMJSPRegionContexts.JSP_DIRECTIVE_NAME, DOMJSPRegionContexts.JSP_ROOT_TAG_NAME, DOMRegionContext.XML_CDATA_TEXT, DOMRegionContext.XML_PI_OPEN, DOMRegionContext.XML_PI_CONTENT}, new JavaPairMatcher(BRACKETS));
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCharacterPairInserter.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCharacterPairInserter.java
new file mode 100644
index 0000000..0ce823e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCharacterPairInserter.java
@@ -0,0 +1,158 @@
+/*******************************************************************************

+ * Copyright (c) 2009 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+package org.eclipse.jst.jsp.ui.internal.text;

+

+import org.eclipse.jface.preference.IPreferenceStore;

+import org.eclipse.jface.text.BadLocationException;

+import org.eclipse.jface.text.IDocument;

+import org.eclipse.jface.text.IRegion;

+import org.eclipse.jface.text.source.ISourceViewer;

+import org.eclipse.jface.util.IPropertyChangeListener;

+import org.eclipse.jface.util.PropertyChangeEvent;

+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;

+import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;

+import org.eclipse.swt.graphics.Point;

+import org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter;

+

+public class JavaCharacterPairInserter extends AbstractCharacterPairInserter implements IPropertyChangeListener {

+

+	private boolean fCloseBrackets = true;

+	private boolean fCloseStrings = true;

+

+	protected boolean shouldPair(ISourceViewer viewer, char c) {

+		IDocument document = viewer.getDocument();

+		final Point selection = viewer.getSelectedRange();

+		final int offset = selection.x;

+		final int length = selection.y;

+

+		try {

+			IRegion startLine= document.getLineInformationOfOffset(offset);

+			IRegion endLine= document.getLineInformationOfOffset(offset + length);

+	

+			JavaHeuristicScanner scanner = new JavaHeuristicScanner(document);

+			int nextToken = scanner.nextToken(offset + length, endLine.getOffset() + endLine.getLength());

+			String next = nextToken == Symbols.TokenEOF ? null : document.get(offset, scanner.getPosition() - offset).trim();

+			int prevToken = scanner.previousToken(offset - 1, startLine.getOffset());

+			int prevTokenOffset = scanner.getPosition() + 1;

+			String previous = prevToken == Symbols.TokenEOF ? null : document.get(prevTokenOffset, offset - prevTokenOffset).trim();

+			

+			switch (c) {

+				case '(':

+					if (!fCloseBrackets || nextToken == Symbols.TokenLPAREN || nextToken == Symbols.TokenIDENT	|| next != null && next.length() > 1)

+						return false;

+					break;

+	

+				case '<':

+					if (!fCloseBrackets || nextToken == Symbols.TokenLESSTHAN

+							|| 		   prevToken != Symbols.TokenLBRACE

+									&& prevToken != Symbols.TokenRBRACE

+									&& prevToken != Symbols.TokenSEMICOLON

+									&& prevToken != Symbols.TokenSYNCHRONIZED

+									&& prevToken != Symbols.TokenSTATIC

+									&& (prevToken != Symbols.TokenIDENT || !isAngularIntroducer(previous))

+									&& prevToken != Symbols.TokenEOF)

+						return false;

+					break;

+	

+				case '[':

+					if (!fCloseBrackets || nextToken == Symbols.TokenIDENT || next != null && next.length() > 1)

+						return false;

+					break;

+	

+				case '\'':

+				case '"':

+					if (!fCloseStrings || nextToken == Symbols.TokenIDENT

+							|| prevToken == Symbols.TokenIDENT

+							|| prevToken == Symbols.TokenSQUOTE

+							|| nextToken == Symbols.TokenSQUOTE

+							|| prevToken == Symbols.TokenDQUOTE

+							|| nextToken == Symbols.TokenDQUOTE

+							|| next != null && next.length() > 1

+							|| previous != null && previous.length() > 1)

+						return false;

+					break;

+	

+				default:

+					return false;

+			}

+		} catch (BadLocationException e) {

+			return false;

+		}

+		return true;

+	}

+

+	private boolean isAngularIntroducer(String identifier) {

+		return identifier.length() > 0

+				&& (Character.isUpperCase(identifier.charAt(0))

+						|| identifier.startsWith("final") //$NON-NLS-1$

+						|| identifier.startsWith("public") //$NON-NLS-1$

+						|| identifier.startsWith("public") //$NON-NLS-1$

+						|| identifier.startsWith("protected") //$NON-NLS-1$

+						|| identifier.startsWith("private")); //$NON-NLS-1$

+	}

+

+	protected char getPair(char c) {

+		switch (c) {

+			case '\'':

+			case '"':

+				return c;

+			case '(':

+				return ')';

+			case '[':

+				return ']';

+			case '<':

+				return '>';

+			default:

+				throw new IllegalArgumentException();

+		}

+	}

+

+	protected char getEscapeChar(char c) {

+		switch (c) {

+			case '\'':

+			case '"':

+				return '\\';

+			default:

+				return 0;

+		}

+	}

+

+	public boolean hasPair(char c) {

+		switch (c) {

+			case '"':

+			case '\'':

+			case '[':

+			case '(':

+			case '<':

+				return true;

+			default:

+				return false;

+		}

+	}

+

+	public void initialize() {

+		IPreferenceStore store = JSPUIPlugin.getInstance().getPreferenceStore();

+		fCloseStrings = store.getBoolean(JSPUIPreferenceNames.TYPING_CLOSE_STRINGS);

+		fCloseBrackets = store.getBoolean(JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS);

+		store.addPropertyChangeListener(this);

+	}

+

+	public void dispose() {

+		JSPUIPlugin.getInstance().getPreferenceStore().removePropertyChangeListener(this);

+	}

+

+	public void propertyChange(PropertyChangeEvent event) {

+		if (JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS.equals(event.getProperty()))

+			fCloseBrackets = ((Boolean) event.getNewValue()).booleanValue();

+		else if (JSPUIPreferenceNames.TYPING_CLOSE_STRINGS.equals(event.getProperty()))

+			fCloseStrings = ((Boolean) event.getNewValue()).booleanValue();

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCodeReader.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCodeReader.java
new file mode 100644
index 0000000..4b80238
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCodeReader.java
@@ -0,0 +1,246 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.text;
+
+import java.io.IOException;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.ui.internal.derived.SingleCharReader;
+
+
+/**
+ * Reads from a document either forwards or backwards. May be configured to
+ * skip comments and strings.
+ * 
+ * Copied from org.eclipse.jdt.internal.ui.text so we don't have to
+ * depend on the org.eclipse.jdt.ui plugin.
+ * 
+ * No modifications were made.
+ */
+class JavaCodeReader extends SingleCharReader {
+
+	/** The EOF character */
+	public static final int EOF = -1;
+
+	private boolean fSkipComments = false;
+	private boolean fSkipStrings = false;
+	private boolean fForward = false;
+
+	private IDocument fDocument;
+	private int fOffset;
+
+	private int fEnd = -1;
+	private int fCachedLineNumber = -1;
+	private int fCachedLineOffset = -1;
+
+
+	public JavaCodeReader() {
+	}
+
+	/**
+	 * Returns the offset of the last read character. Should only be called after read has been called.
+	 */
+	public int getOffset() {
+		return fForward ? fOffset - 1 : fOffset;
+	}
+
+	public void configureForwardReader(IDocument document, int offset, int length, boolean skipComments, boolean skipStrings) throws IOException {
+		fDocument = document;
+		fOffset = offset;
+		fSkipComments = skipComments;
+		fSkipStrings = skipStrings;
+
+		fForward = true;
+		fEnd = Math.min(fDocument.getLength(), fOffset + length);
+	}
+
+	public void configureBackwardReader(IDocument document, int offset, boolean skipComments, boolean skipStrings) throws IOException {
+		fDocument = document;
+		fOffset = offset;
+		fSkipComments = skipComments;
+		fSkipStrings = skipStrings;
+
+		fForward = false;
+		try {
+			fCachedLineNumber = fDocument.getLineOfOffset(fOffset);
+		}
+		catch (BadLocationException x) {
+			throw new IOException(x.getMessage());
+		}
+	}
+
+	/*
+	 * @see Reader#close()
+	 */
+	public void close() throws IOException {
+		fDocument = null;
+	}
+
+	/*
+	 * @see SingleCharReader#read()
+	 */
+	public int read() throws IOException {
+		try {
+			return fForward ? readForwards() : readBackwards();
+		}
+		catch (BadLocationException x) {
+			throw new IOException(x.getMessage());
+		}
+	}
+
+	private void gotoCommentEnd() throws BadLocationException {
+		while (fOffset < fEnd) {
+			char current = fDocument.getChar(fOffset++);
+			if (current == '*') {
+				if (fOffset < fEnd && fDocument.getChar(fOffset) == '/') {
+					++fOffset;
+					return;
+				}
+			}
+		}
+	}
+
+	private void gotoStringEnd(char delimiter) throws BadLocationException {
+		while (fOffset < fEnd) {
+			char current = fDocument.getChar(fOffset++);
+			if (current == '\\') {
+				// ignore escaped characters
+				++fOffset;
+			}
+			else if (current == delimiter) {
+				return;
+			}
+		}
+	}
+
+	private void gotoLineEnd() throws BadLocationException {
+		int line = fDocument.getLineOfOffset(fOffset);
+		fOffset = fDocument.getLineOffset(line + 1);
+	}
+
+	private int readForwards() throws BadLocationException {
+		while (fOffset < fEnd) {
+			char current = fDocument.getChar(fOffset++);
+
+			switch (current) {
+				case '/' :
+
+					if (fSkipComments && fOffset < fEnd) {
+						char next = fDocument.getChar(fOffset);
+						if (next == '*') {
+							// a comment starts, advance to the comment end
+							++fOffset;
+							gotoCommentEnd();
+							continue;
+						}
+						else if (next == '/') {
+							// '//'-comment starts, advance to the line end
+							gotoLineEnd();
+							continue;
+						}
+					}
+
+					return current;
+
+				case '"' :
+				case '\'' :
+
+					if (fSkipStrings) {
+						gotoStringEnd(current);
+						continue;
+					}
+
+					return current;
+			}
+
+			return current;
+		}
+
+		return EOF;
+	}
+
+	private void handleSingleLineComment() throws BadLocationException {
+		int line = fDocument.getLineOfOffset(fOffset);
+		if (line < fCachedLineNumber) {
+			fCachedLineNumber = line;
+			fCachedLineOffset = fDocument.getLineOffset(line);
+			int offset = fOffset;
+			while (fCachedLineOffset < offset) {
+				char current = fDocument.getChar(offset--);
+				if (current == '/' && fCachedLineOffset <= offset && fDocument.getChar(offset) == '/') {
+					fOffset = offset;
+					return;
+				}
+			}
+		}
+	}
+
+	private void gotoCommentStart() throws BadLocationException {
+		while (0 < fOffset) {
+			char current = fDocument.getChar(fOffset--);
+			if (current == '*' && 0 <= fOffset && fDocument.getChar(fOffset) == '/')
+				return;
+		}
+	}
+
+	private void gotoStringStart(char delimiter) throws BadLocationException {
+		while (0 < fOffset) {
+			char current = fDocument.getChar(fOffset);
+			if (current == delimiter) {
+				if (!(0 <= fOffset && fDocument.getChar(fOffset - 1) == '\\'))
+					return;
+			}
+			--fOffset;
+		}
+	}
+
+	private int readBackwards() throws BadLocationException {
+
+		while (0 < fOffset) {
+			--fOffset;
+
+			handleSingleLineComment();
+
+			char current = fDocument.getChar(fOffset);
+			switch (current) {
+				case '/' :
+
+					if (fSkipComments && fOffset > 1) {
+						char next = fDocument.getChar(fOffset - 1);
+						if (next == '*') {
+							// a comment ends, advance to the comment start
+							fOffset -= 2;
+							gotoCommentStart();
+							continue;
+						}
+					}
+
+					return current;
+
+				case '"' :
+				case '\'' :
+
+					if (fSkipStrings) {
+						--fOffset;
+						gotoStringStart(current);
+						continue;
+					}
+
+					return current;
+			}
+
+			return current;
+		}
+
+		return EOF;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaHeuristicScanner.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaHeuristicScanner.java
new file mode 100644
index 0000000..e113c38
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaHeuristicScanner.java
@@ -0,0 +1,956 @@
+/*******************************************************************************

+ * Copyright (c) 2009 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+package org.eclipse.jst.jsp.ui.internal.text;

+

+//taken from package org.eclipse.jdt.internal.ui.text;

+

+import java.util.Arrays;

+

+import org.eclipse.core.runtime.Assert;

+import org.eclipse.jface.text.BadLocationException;

+import org.eclipse.jface.text.IDocument;

+import org.eclipse.jface.text.IRegion;

+import org.eclipse.jface.text.ITypedRegion;

+import org.eclipse.jface.text.Region;

+import org.eclipse.jface.text.TextUtilities;

+import org.eclipse.jface.text.TypedRegion;

+import org.eclipse.jst.jsp.core.text.IJSPPartitions;

+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;

+

+class JavaHeuristicScanner implements Symbols {

+	/**

+	 * Returned by all methods when the requested position could not be found, or if a

+	 * {@link BadLocationException} was thrown while scanning.

+	 */

+	public static final int NOT_FOUND= -1;

+

+	/**

+	 * Special bound parameter that means either -1 (backward scanning) or

+	 * <code>fDocument.getLength()</code> (forward scanning).

+	 */

+	public static final int UNBOUND= -2;

+

+

+	/* character constants */

+	private static final char LBRACE= '{';

+	private static final char RBRACE= '}';

+	private static final char LPAREN= '(';

+	private static final char RPAREN= ')';

+	private static final char SEMICOLON= ';';

+	private static final char COLON= ':';

+	private static final char COMMA= ',';

+	private static final char LBRACKET= '[';

+	private static final char RBRACKET= ']';

+	private static final char QUESTIONMARK= '?';

+	private static final char EQUAL= '=';

+	private static final char LANGLE= '<';

+	private static final char RANGLE= '>';

+	private static final char SQUOTE = '\'';

+	private static final char DQUOTE = '"';

+

+	/**

+	 * Specifies the stop condition, upon which the <code>scanXXX</code> methods will decide whether

+	 * to keep scanning or not. This interface may implemented by clients.

+	 */

+	private static abstract class StopCondition {

+		/**

+		 * Instructs the scanner to return the current position.

+		 *

+		 * @param ch the char at the current position

+		 * @param position the current position

+		 * @param forward the iteration direction

+		 * @return <code>true</code> if the stop condition is met.

+		 */

+		public abstract boolean stop(char ch, int position, boolean forward);

+

+		/**

+		 * Asks the condition to return the next position to query. The default

+		 * is to return the next/previous position.

+		 * 

+		 * @param position the position 

+		 * @param forward <code>true</code> if next position should be returned

+		 * @return the next position to scan

+		 */

+		public int nextPosition(int position, boolean forward) {

+			return forward ? position + 1 : position - 1;

+		}

+	}

+

+	/**

+	 * Stops upon a non-whitespace (as defined by {@link Character#isWhitespace(char)}) character.

+	 */

+	private static class NonWhitespace extends StopCondition {

+		/*

+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)

+		 */

+		public boolean stop(char ch, int position, boolean forward) {

+			return !Character.isWhitespace(ch);

+		}

+	}

+

+	/**

+	 * Stops upon a non-whitespace character in the default partition.

+	 *

+	 * @see JavaHeuristicScanner.NonWhitespace

+	 */

+	private final class NonWhitespaceDefaultPartition extends NonWhitespace {

+		/*

+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)

+		 */

+		public boolean stop(char ch, int position, boolean forward) {

+			return super.stop(ch, position, true) && isDefaultPartition(position);

+		}

+

+		/*

+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)

+		 */

+		public int nextPosition(int position, boolean forward) {

+			ITypedRegion partition= getPartition(position);

+			if (fPartition.equals(partition.getType()))

+				return super.nextPosition(position, forward);

+

+			if (forward) {

+				int end= partition.getOffset() + partition.getLength();

+				if (position < end)

+					return end;

+			} else {

+				int offset= partition.getOffset();

+				if (position > offset)

+					return offset - 1;

+			}

+			return super.nextPosition(position, forward);

+		}

+	}

+

+	/**

+	 * Stops upon a non-java identifier (as defined by {@link Character#isJavaIdentifierPart(char)}) character.

+	 */

+	private static class NonJavaIdentifierPart extends StopCondition {

+		/*

+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)

+		 */

+		public boolean stop(char ch, int position, boolean forward) {

+			return !Character.isJavaIdentifierPart(ch);

+		}

+	}

+

+	/**

+	 * Stops upon a non-java identifier character in the default partition.

+	 *

+	 * @see JavaHeuristicScanner.NonJavaIdentifierPart

+	 */

+	private final class NonJavaIdentifierPartDefaultPartition extends NonJavaIdentifierPart {

+		/*

+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)

+		 */

+		public boolean stop(char ch, int position, boolean forward) {

+			return super.stop(ch, position, true) || !isDefaultPartition(position);

+		}

+

+		/*

+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)

+		 */

+		public int nextPosition(int position, boolean forward) {

+			ITypedRegion partition= getPartition(position);

+			if (fPartition.equals(partition.getType()))

+				return super.nextPosition(position, forward);

+

+			if (forward) {

+				int end= partition.getOffset() + partition.getLength();

+				if (position < end)

+					return end;

+			} else {

+				int offset= partition.getOffset();

+				if (position > offset)

+					return offset - 1;

+			}

+			return super.nextPosition(position, forward);

+		}

+	}

+

+	/**

+	 * Stops upon a character in the default partition that matches the given character list.

+	 */

+	private final class CharacterMatch extends StopCondition {

+		private final char[] fChars;

+

+		/**

+		 * Creates a new instance.

+		 * @param ch the single character to match

+		 */

+		public CharacterMatch(char ch) {

+			this(new char[] {ch});

+		}

+

+		/**

+		 * Creates a new instance.

+		 * @param chars the chars to match.

+		 */

+		public CharacterMatch(char[] chars) {

+			Assert.isNotNull(chars);

+			Assert.isTrue(chars.length > 0);

+			fChars= chars;

+			Arrays.sort(chars);

+		}

+

+		/*

+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char, int)

+		 */

+		public boolean stop(char ch, int position, boolean forward) {

+			return Arrays.binarySearch(fChars, ch) >= 0 && isDefaultPartition(position);

+		}

+

+		/*

+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)

+		 */

+		public int nextPosition(int position, boolean forward) {

+			ITypedRegion partition= getPartition(position);

+			if (fPartition.equals(partition.getType()))

+				return super.nextPosition(position, forward);

+

+			if (forward) {

+				int end= partition.getOffset() + partition.getLength();

+				if (position < end)

+					return end;

+			} else {

+				int offset= partition.getOffset();

+				if (position > offset)

+					return offset - 1;

+			}

+			return super.nextPosition(position, forward);

+		}

+	}

+

+	/** The document being scanned. */

+	private final IDocument fDocument;

+	/** The partitioning being used for scanning. */

+	private final String fPartitioning;

+	/** The partition to scan in. */

+	private final String fPartition;

+

+	/* internal scan state */

+

+	/** the most recently read character. */

+	private char fChar;

+	/** the most recently read position. */

+	private int fPos;

+	/**

+	 * The most recently used partition.

+	 * @since 3.2

+	 */

+	private ITypedRegion fCachedPartition= new TypedRegion(-1, 0, "__no_partition_at_all"); //$NON-NLS-1$

+

+	/* preset stop conditions */

+	private final StopCondition fNonWSDefaultPart= new NonWhitespaceDefaultPartition();

+	private final static StopCondition fNonWS= new NonWhitespace();

+	private final StopCondition fNonIdent= new NonJavaIdentifierPartDefaultPartition();

+

+	/**

+	 * Creates a new instance.

+	 *

+	 * @param document the document to scan

+	 * @param partitioning the partitioning to use for scanning

+	 * @param partition the partition to scan in

+	 */

+	public JavaHeuristicScanner(IDocument document, String partitioning, String partition) {

+		Assert.isLegal(document != null);

+		Assert.isLegal(partitioning != null);

+		Assert.isLegal(partition != null);

+		fDocument= document;

+		fPartitioning= partitioning;

+		fPartition= partition;

+	}

+

+	/**

+	 * Calls <code>this(document, IJavaPartitions.JAVA_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE)</code>.

+	 *

+	 * @param document the document to scan.

+	 */

+	public JavaHeuristicScanner(IDocument document) {

+		this(document, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, IJSPPartitions.JSP_CONTENT_JAVA);

+	}

+

+	/**

+	 * Returns the most recent internal scan position.

+	 *

+	 * @return the most recent internal scan position.

+	 */

+	public int getPosition() {

+		return fPos;

+	}

+

+	/**

+	 * Returns the next token in forward direction, starting at <code>start</code>, and not extending

+	 * further than <code>bound</code>. The return value is one of the constants defined in {@link Symbols}.

+	 * After a call, {@link #getPosition()} will return the position just after the scanned token

+	 * (i.e. the next position that will be scanned).

+	 *

+	 * @param start the first character position in the document to consider

+	 * @param bound the first position not to consider any more

+	 * @return a constant from {@link Symbols} describing the next token

+	 */

+	public int nextToken(int start, int bound) {

+		int pos= scanForward(start, bound, fNonWSDefaultPart);

+		if (pos == NOT_FOUND)

+			return TokenEOF;

+

+		fPos++;

+

+		switch (fChar) {

+			case LBRACE:

+				return TokenLBRACE;

+			case RBRACE:

+				return TokenRBRACE;

+			case LBRACKET:

+				return TokenLBRACKET;

+			case RBRACKET:

+				return TokenRBRACKET;

+			case LPAREN:

+				return TokenLPAREN;

+			case RPAREN:

+				return TokenRPAREN;

+			case SEMICOLON:

+				return TokenSEMICOLON;

+			case COMMA:

+				return TokenCOMMA;

+			case QUESTIONMARK:

+				return TokenQUESTIONMARK;

+			case EQUAL:

+				return TokenEQUAL;

+			case LANGLE:

+				return TokenLESSTHAN;

+			case RANGLE:

+				return TokenGREATERTHAN;

+			case SQUOTE:

+				return TokenSQUOTE;

+			case DQUOTE:

+				return TokenDQUOTE;

+		}

+

+		// else

+		if (Character.isJavaIdentifierPart(fChar)) {

+			// assume an identifier or keyword

+			int from= pos, to;

+			pos= scanForward(pos + 1, bound, fNonIdent);

+			if (pos == NOT_FOUND)

+				to= bound == UNBOUND ? fDocument.getLength() : bound;

+			else

+				to= pos;

+

+			String identOrKeyword;

+			try {

+				identOrKeyword= fDocument.get(from, to - from);

+			} catch (BadLocationException e) {

+				return TokenEOF;

+			}

+

+			return getToken(identOrKeyword);

+

+

+		} else {

+			// operators, number literals etc

+			return TokenOTHER;

+		}

+	}

+

+	/**

+	 * Returns the next token in backward direction, starting at <code>start</code>, and not extending

+	 * further than <code>bound</code>. The return value is one of the constants defined in {@link Symbols}.

+	 * After a call, {@link #getPosition()} will return the position just before the scanned token

+	 * starts (i.e. the next position that will be scanned).

+	 *

+	 * @param start the first character position in the document to consider

+	 * @param bound the first position not to consider any more

+	 * @return a constant from {@link Symbols} describing the previous token

+	 */

+	public int previousToken(int start, int bound) {

+		int pos= scanBackward(start, bound, fNonWSDefaultPart);

+		if (pos == NOT_FOUND)

+			return TokenEOF;

+

+		fPos--;

+

+		switch (fChar) {

+			case LBRACE:

+				return TokenLBRACE;

+			case RBRACE:

+				return TokenRBRACE;

+			case LBRACKET:

+				return TokenLBRACKET;

+			case RBRACKET:

+				return TokenRBRACKET;

+			case LPAREN:

+				return TokenLPAREN;

+			case RPAREN:

+				return TokenRPAREN;

+			case SEMICOLON:

+				return TokenSEMICOLON;

+			case COLON:

+				return TokenCOLON;

+			case COMMA:

+				return TokenCOMMA;

+			case QUESTIONMARK:

+				return TokenQUESTIONMARK;

+			case EQUAL:

+				return TokenEQUAL;

+			case LANGLE:

+				return TokenLESSTHAN;

+			case RANGLE:

+				return TokenGREATERTHAN;

+			case SQUOTE:

+				return TokenSQUOTE;

+			case DQUOTE:

+				return TokenDQUOTE;

+		}

+

+		// else

+		if (Character.isJavaIdentifierPart(fChar)) {

+			// assume an ident or keyword

+			int from, to= pos + 1;

+			pos= scanBackward(pos - 1, bound, fNonIdent);

+			if (pos == NOT_FOUND)

+				from= bound == UNBOUND ? 0 : bound + 1;

+			else

+				from= pos + 1;

+

+			String identOrKeyword;

+			try {

+				identOrKeyword= fDocument.get(from, to - from);

+			} catch (BadLocationException e) {

+				return TokenEOF;

+			}

+

+			return getToken(identOrKeyword);

+

+

+		} else {

+			// operators, number literals etc

+			return TokenOTHER;

+		}

+

+	}

+

+	/**

+	 * Returns one of the keyword constants or <code>TokenIDENT</code> for a scanned identifier.

+	 *

+	 * @param s a scanned identifier

+	 * @return one of the constants defined in {@link Symbols}

+	 */

+	private int getToken(String s) {

+		Assert.isNotNull(s);

+

+		switch (s.length()) {

+			case 2:

+				if ("if".equals(s)) //$NON-NLS-1$

+					return TokenIF;

+				if ("do".equals(s)) //$NON-NLS-1$

+					return TokenDO;

+				break;

+			case 3:

+				if ("for".equals(s)) //$NON-NLS-1$

+					return TokenFOR;

+				if ("try".equals(s)) //$NON-NLS-1$

+					return TokenTRY;

+				if ("new".equals(s)) //$NON-NLS-1$

+					return TokenNEW;

+				break;

+			case 4:

+				if ("case".equals(s)) //$NON-NLS-1$

+					return TokenCASE;

+				if ("else".equals(s)) //$NON-NLS-1$

+					return TokenELSE;

+				if ("enum".equals(s)) //$NON-NLS-1$

+					return TokenENUM;

+				if ("goto".equals(s)) //$NON-NLS-1$

+					return TokenGOTO;

+				break;

+			case 5:

+				if ("break".equals(s)) //$NON-NLS-1$

+					return TokenBREAK;

+				if ("catch".equals(s)) //$NON-NLS-1$

+					return TokenCATCH;

+				if ("class".equals(s)) //$NON-NLS-1$

+					return TokenCLASS;

+				if ("while".equals(s)) //$NON-NLS-1$

+					return TokenWHILE;

+				break;

+			case 6:

+				if ("return".equals(s)) //$NON-NLS-1$

+					return TokenRETURN;

+				if ("static".equals(s)) //$NON-NLS-1$

+					return TokenSTATIC;

+				if ("switch".equals(s)) //$NON-NLS-1$

+					return TokenSWITCH;

+				break;

+			case 7:

+				if ("default".equals(s)) //$NON-NLS-1$

+					return TokenDEFAULT;

+				if ("finally".equals(s)) //$NON-NLS-1$

+					return TokenFINALLY;

+				break;

+			case 9:

+				if ("interface".equals(s)) //$NON-NLS-1$

+					return TokenINTERFACE;

+				break;

+			case 12:

+				if ("synchronized".equals(s)) //$NON-NLS-1$

+					return TokenSYNCHRONIZED;

+				break;

+		}

+		return TokenIDENT;

+	}

+

+	/**

+	 * Returns the position of the closing peer character (forward search). Any scopes introduced by opening peers

+	 * are skipped. All peers accounted for must reside in the default partition.

+	 *

+	 * <p>Note that <code>start</code> must not point to the opening peer, but to the first

+	 * character being searched.</p>

+	 *

+	 * @param start the start position

+	 * @param openingPeer the opening peer character (e.g. '{')

+	 * @param closingPeer the closing peer character (e.g. '}')

+	 * @return the matching peer character position, or <code>NOT_FOUND</code>

+	 */

+	public int findClosingPeer(int start, final char openingPeer, final char closingPeer) {

+		return findClosingPeer(start, UNBOUND, openingPeer, closingPeer);

+	}

+

+	/**

+	 * Returns the position of the closing peer character (forward search). Any scopes introduced by opening peers

+	 * are skipped. All peers accounted for must reside in the default partition.

+	 *

+	 * <p>Note that <code>start</code> must not point to the opening peer, but to the first

+	 * character being searched.</p>

+	 *

+	 * @param start the start position

+	 * @param bound the bound

+	 * @param openingPeer the opening peer character (e.g. '{')

+	 * @param closingPeer the closing peer character (e.g. '}')

+	 * @return the matching peer character position, or <code>NOT_FOUND</code>

+	 */

+	public int findClosingPeer(int start, int bound, final char openingPeer, final char closingPeer) {

+		Assert.isLegal(start >= 0);

+

+		try {

+			CharacterMatch match= new CharacterMatch(new char[] {openingPeer, closingPeer});

+			int depth= 1;

+			start -= 1;

+			while (true) {

+				start= scanForward(start + 1, bound, match);

+				if (start == NOT_FOUND)

+					return NOT_FOUND;

+

+				if (fDocument.getChar(start) == openingPeer)

+					depth++;

+				else

+					depth--;

+

+				if (depth == 0)

+					return start;

+			}

+

+		} catch (BadLocationException e) {

+			return NOT_FOUND;

+		}

+	}

+

+	/**

+	 * Returns the position of the opening peer character (backward search). Any scopes introduced by closing peers

+	 * are skipped. All peers accounted for must reside in the default partition.

+	 *

+	 * <p>Note that <code>start</code> must not point to the closing peer, but to the first

+	 * character being searched.</p>

+	 *

+	 * @param start the start position

+	 * @param openingPeer the opening peer character (e.g. '{')

+	 * @param closingPeer the closing peer character (e.g. '}')

+	 * @return the matching peer character position, or <code>NOT_FOUND</code>

+	 */

+	public int findOpeningPeer(int start, char openingPeer, char closingPeer) {

+		return findOpeningPeer(start, UNBOUND, openingPeer, closingPeer);

+	}

+

+	/**

+	 * Returns the position of the opening peer character (backward search). Any scopes introduced by closing peers

+	 * are skipped. All peers accounted for must reside in the default partition.

+	 *

+	 * <p>Note that <code>start</code> must not point to the closing peer, but to the first

+	 * character being searched.</p>

+	 *

+	 * @param start the start position

+	 * @param bound the bound

+	 * @param openingPeer the opening peer character (e.g. '{')

+	 * @param closingPeer the closing peer character (e.g. '}')

+	 * @return the matching peer character position, or <code>NOT_FOUND</code>

+	 */

+	public int findOpeningPeer(int start, int bound, char openingPeer, char closingPeer) {

+		Assert.isLegal(start < fDocument.getLength());

+

+		try {

+			final CharacterMatch match= new CharacterMatch(new char[] {openingPeer, closingPeer});

+			int depth= 1;

+			start += 1;

+			while (true) {

+				start= scanBackward(start - 1, bound, match);

+				if (start == NOT_FOUND)

+					return NOT_FOUND;

+

+				if (fDocument.getChar(start) == closingPeer)

+					depth++;

+				else

+					depth--;

+

+				if (depth == 0)

+					return start;

+			}

+

+		} catch (BadLocationException e) {

+			return NOT_FOUND;

+		}

+	}

+

+	/**

+	 * Computes the surrounding block around <code>offset</code>. The search is started at the

+	 * beginning of <code>offset</code>, i.e. an opening brace at <code>offset</code> will not be

+	 * part of the surrounding block, but a closing brace will.

+	 *

+	 * @param offset the offset for which the surrounding block is computed

+	 * @return a region describing the surrounding block, or <code>null</code> if none can be found

+	 */

+	public IRegion findSurroundingBlock(int offset) {

+		if (offset < 1 || offset >= fDocument.getLength())

+			return null;

+

+		int begin= findOpeningPeer(offset - 1, LBRACE, RBRACE);

+		int end= findClosingPeer(offset, LBRACE, RBRACE);

+		if (begin == NOT_FOUND || end == NOT_FOUND)

+			return null;

+		return new Region(begin, end + 1 - begin);

+	}

+

+	/**

+	 * Finds the smallest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>

+	 * and &lt; <code>bound</code> and <code>Character.isWhitespace(fDocument.getChar(pos))</code> evaluates to <code>false</code>

+	 * and the position is in the default partition.

+	 *

+	 * @param position the first character position in <code>fDocument</code> to be considered

+	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>

+	 * @return the smallest position of a non-whitespace character in [<code>position</code>, <code>bound</code>) that resides in a Java partition, or <code>NOT_FOUND</code> if none can be found

+	 */

+	public int findNonWhitespaceForward(int position, int bound) {

+		return scanForward(position, bound, fNonWSDefaultPart);

+	}

+

+	/**

+	 * Finds the smallest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>

+	 * and &lt; <code>bound</code> and <code>Character.isWhitespace(fDocument.getChar(pos))</code> evaluates to <code>false</code>.

+	 *

+	 * @param position the first character position in <code>fDocument</code> to be considered

+	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>

+	 * @return the smallest position of a non-whitespace character in [<code>position</code>, <code>bound</code>), or <code>NOT_FOUND</code> if none can be found

+	 */

+	public int findNonWhitespaceForwardInAnyPartition(int position, int bound) {

+		return scanForward(position, bound, fNonWS);

+	}

+

+	/**

+	 * Finds the highest position in <code>fDocument</code> such that the position is &lt;= <code>position</code>

+	 * and &gt; <code>bound</code> and <code>Character.isWhitespace(fDocument.getChar(pos))</code> evaluates to <code>false</code>

+	 * and the position is in the default partition.

+	 *

+	 * @param position the first character position in <code>fDocument</code> to be considered

+	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>position</code>, or <code>UNBOUND</code>

+	 * @return the highest position of a non-whitespace character in (<code>bound</code>, <code>position</code>] that resides in a Java partition, or <code>NOT_FOUND</code> if none can be found

+	 */

+	public int findNonWhitespaceBackward(int position, int bound) {

+		return scanBackward(position, bound, fNonWSDefaultPart);

+	}

+

+	/**

+	 * Finds the lowest position <code>p</code> in <code>fDocument</code> such that <code>start</code> &lt;= p &lt;

+	 * <code>bound</code> and <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to <code>true</code>.

+	 *

+	 * @param start the first character position in <code>fDocument</code> to be considered

+	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>start</code>, or <code>UNBOUND</code>

+	 * @param condition the <code>StopCondition</code> to check

+	 * @return the lowest position in [<code>start</code>, <code>bound</code>) for which <code>condition</code> holds, or <code>NOT_FOUND</code> if none can be found

+	 */

+	public int scanForward(int start, int bound, StopCondition condition) {

+		Assert.isLegal(start >= 0);

+

+		if (bound == UNBOUND)

+			bound= fDocument.getLength();

+

+		Assert.isLegal(bound <= fDocument.getLength());

+

+		try {

+			fPos= start;

+			while (fPos < bound) {

+

+				fChar= fDocument.getChar(fPos);

+				if (condition.stop(fChar, fPos, true))

+					return fPos;

+

+				fPos= condition.nextPosition(fPos, true);

+			}

+		} catch (BadLocationException e) {

+		}

+		return NOT_FOUND;

+	}

+

+

+	/**

+	 * Finds the lowest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>

+	 * and &lt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code>

+	 * and the position is in the default partition.

+	 *

+	 * @param position the first character position in <code>fDocument</code> to be considered

+	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>

+	 * @param ch the <code>char</code> to search for

+	 * @return the lowest position of <code>ch</code> in (<code>bound</code>, <code>position</code>] that resides in a Java partition, or <code>NOT_FOUND</code> if none can be found

+	 */

+	public int scanForward(int position, int bound, char ch) {

+		return scanForward(position, bound, new CharacterMatch(ch));

+	}

+

+	/**

+	 * Finds the lowest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>

+	 * and &lt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code> for at least one

+	 * ch in <code>chars</code> and the position is in the default partition.

+	 *

+	 * @param position the first character position in <code>fDocument</code> to be considered

+	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>

+	 * @param chars an array of <code>char</code> to search for

+	 * @return the lowest position of a non-whitespace character in [<code>position</code>, <code>bound</code>) that resides in a Java partition, or <code>NOT_FOUND</code> if none can be found

+	 */

+	public int scanForward(int position, int bound, char[] chars) {

+		return scanForward(position, bound, new CharacterMatch(chars));

+	}

+

+	/**

+	 * Finds the highest position <code>p</code> in <code>fDocument</code> such that <code>bound</code> &lt; <code>p</code> &lt;= <code>start</code>

+	 * and <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to <code>true</code>.

+	 *

+	 * @param start the first character position in <code>fDocument</code> to be considered

+	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>start</code>, or <code>UNBOUND</code>

+	 * @param condition the <code>StopCondition</code> to check

+	 * @return the highest position in (<code>bound</code>, <code>start</code> for which <code>condition</code> holds, or <code>NOT_FOUND</code> if none can be found

+	 */

+	public int scanBackward(int start, int bound, StopCondition condition) {

+		if (bound == UNBOUND)

+			bound= -1;

+

+		Assert.isLegal(bound >= -1);

+		Assert.isLegal(start < fDocument.getLength() );

+

+		try {

+			fPos= start;

+			while (fPos > bound) {

+

+				fChar= fDocument.getChar(fPos);

+				if (condition.stop(fChar, fPos, false))

+					return fPos;

+

+				fPos= condition.nextPosition(fPos, false);

+			}

+		} catch (BadLocationException e) {

+		}

+		return NOT_FOUND;

+	}

+

+	/**

+	 * Finds the highest position in <code>fDocument</code> such that the position is &lt;= <code>position</code>

+	 * and &gt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code> for at least one

+	 * ch in <code>chars</code> and the position is in the default partition.

+	 *

+	 * @param position the first character position in <code>fDocument</code> to be considered

+	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>position</code>, or <code>UNBOUND</code>

+	 * @param ch the <code>char</code> to search for

+	 * @return the highest position of one element in <code>chars</code> in (<code>bound</code>, <code>position</code>] that resides in a Java partition, or <code>NOT_FOUND</code> if none can be found

+	 */

+	public int scanBackward(int position, int bound, char ch) {

+		return scanBackward(position, bound, new CharacterMatch(ch));

+	}

+

+	/**

+	 * Finds the highest position in <code>fDocument</code> such that the position is &lt;= <code>position</code>

+	 * and &gt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code> for at least one

+	 * ch in <code>chars</code> and the position is in the default partition.

+	 *

+	 * @param position the first character position in <code>fDocument</code> to be considered

+	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>position</code>, or <code>UNBOUND</code>

+	 * @param chars an array of <code>char</code> to search for

+	 * @return the highest position of one element in <code>chars</code> in (<code>bound</code>, <code>position</code>] that resides in a Java partition, or <code>NOT_FOUND</code> if none can be found

+	 */

+	public int scanBackward(int position, int bound, char[] chars) {

+		return scanBackward(position, bound, new CharacterMatch(chars));

+	}

+

+	/**

+	 * Checks whether <code>position</code> resides in a default (Java) partition of <code>fDocument</code>.

+	 *

+	 * @param position the position to be checked

+	 * @return <code>true</code> if <code>position</code> is in the default partition of <code>fDocument</code>, <code>false</code> otherwise

+	 */

+	public boolean isDefaultPartition(int position) {

+		return fPartition.equals(getPartition(position).getType());

+	}

+

+	/**

+	 * Returns the partition at <code>position</code>.

+	 *

+	 * @param position the position to get the partition for

+	 * @return the partition at <code>position</code> or a dummy zero-length

+	 *         partition if accessing the document fails

+	 */

+	private ITypedRegion getPartition(int position) {

+		if (!contains(fCachedPartition, position)) {

+			Assert.isTrue(position >= 0);

+			Assert.isTrue(position <= fDocument.getLength());

+

+			try {

+				fCachedPartition= TextUtilities.getPartition(fDocument, fPartitioning, position, false);

+			} catch (BadLocationException e) {

+				fCachedPartition= new TypedRegion(position, 0, "__no_partition_at_all"); //$NON-NLS-1$

+			}

+		}

+

+		return fCachedPartition;

+	}

+

+	/**

+	 * Returns <code>true</code> if <code>region</code> contains <code>position</code>.

+	 *

+	 * @param region a region

+	 * @param position an offset

+	 * @return <code>true</code> if <code>region</code> contains <code>position</code>

+	 * @since 3.2

+	 */

+	private boolean contains(IRegion region, int position) {

+		int offset= region.getOffset();

+		return offset <= position && position < offset + region.getLength();

+	}

+

+	/**

+	 * Checks if the line seems to be an open condition not followed by a block (i.e. an if, while,

+	 * or for statement with just one following statement, see example below).

+	 *

+	 * <pre>

+	 * if (condition)

+	 *     doStuff();

+	 * </pre>

+	 *

+	 * <p>Algorithm: if the last non-WS, non-Comment code on the line is an if (condition), while (condition),

+	 * for( expression), do, else, and there is no statement after that </p>

+	 *

+	 * @param position the insert position of the new character

+	 * @param bound the lowest position to consider

+	 * @return <code>true</code> if the code is a conditional statement or loop without a block, <code>false</code> otherwise

+	 */

+	public boolean isBracelessBlockStart(int position, int bound) {

+		if (position < 1)

+			return false;

+

+		switch (previousToken(position, bound)) {

+			case TokenDO:

+			case TokenELSE:

+				return true;

+			case TokenRPAREN:

+				position= findOpeningPeer(fPos, LPAREN, RPAREN);

+				if (position > 0) {

+					switch (previousToken(position - 1, bound)) {

+						case TokenIF:

+						case TokenFOR:

+						case TokenWHILE:

+							return true;

+					}

+				}

+		}

+

+		return false;

+	}

+

+	/**

+	 * Returns <code>true</code> if the document, when scanned backwards from <code>start</code>

+	 * appears to contain a class instance creation, i.e. a possibly qualified name preceded by a

+	 * <code>new</code> keyword. The <code>start</code> must be at the end of the type name, and

+	 * before any generic signature or constructor parameter list. The heuristic will return

+	 * <code>true</code> if <code>start</code> is at the following positions (|):

+	 *

+	 * <pre>

+	 *  new java.util. ArrayList|&lt;String&gt;(10)

+	 *  new ArrayList |(10)

+	 *  new  / * comment  * / ArrayList |(10)

+	 * </pre>

+	 *

+	 * but not the following:

+	 *

+	 * <pre>

+	 *  new java.util. ArrayList&lt;String&gt;(10)|

+	 *  new java.util. ArrayList&lt;String&gt;|(10)

+	 *  new ArrayList (10)|

+	 *  ArrayList |(10)

+	 * </pre>

+	 *

+	 * @param start the position where the type name of the class instance creation supposedly ends

+	 * @param bound the first position in <code>fDocument</code> to not consider any more, with

+	 *        <code>bound</code> &lt; <code>start</code>, or <code>UNBOUND</code>

+	 * @return <code>true</code> if the current position looks like after the type name of a class

+	 *         instance creation

+	 * @since 3.2

+	 */

+	public boolean looksLikeClassInstanceCreationBackward(int start, int bound) {

+		int token= previousToken(start - 1, bound);

+		if (token == Symbols.TokenIDENT) { // type name

+			token= previousToken(getPosition(), bound);

+			while (token == Symbols.TokenOTHER) { // dot of qualification

+				token= previousToken(getPosition(), bound);

+				if (token != Symbols.TokenIDENT) // qualification name

+					return false;

+				token= previousToken(getPosition(), bound);

+			}

+			return token == Symbols.TokenNEW;

+		}

+		return false;

+	}

+

+	/**

+	 * Returns <code>true</code> if <code>identifier</code> is probably a

+	 * type variable or type name, <code>false</code> if it is rather not.

+	 * This is a heuristic.

+	 *

+	 * @param identifier the identifier to check

+	 * @return <code>true</code> if <code>identifier</code> is probably a

+	 *         type variable or type name, <code>false</code> if not

+	 * @since 3.2

+	 */

+	public static boolean isGenericStarter(CharSequence identifier) {

+		/* This heuristic allows any identifiers if they start with an upper

+		 * case. This will fail when a comparison is made with constants:

+		 *

+		 * if (MAX > foo)

+		 *

+		 * will try to find the matching '<' which will never come

+		 *

+		 * Also, it will fail on lower case types and type variables

+		 */

+		int length= identifier.length();

+		if (length > 0 && Character.isUpperCase(identifier.charAt(0))) {

+			for (int i= 0; i < length; i++) {

+				if (identifier.charAt(i) == '_')

+					return false;

+			}

+			return true;

+		}

+		return false;

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaPairMatcher.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaPairMatcher.java
new file mode 100644
index 0000000..106ffdb
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaPairMatcher.java
@@ -0,0 +1,202 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.text;
+
+import java.io.IOException;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.source.ICharacterPairMatcher;
+
+
+/**
+ * Helper class for match pairs of characters.
+ *
+ * Copied from org.eclipse.jdt.internal.ui.text so we don't have to
+ * depend on the org.eclipse.jdt.ui plugin.
+ * 
+ * No modifications were made.
+ */
+class JavaPairMatcher implements ICharacterPairMatcher {
+
+	protected char[] fPairs;
+	protected IDocument fDocument;
+	protected int fOffset;
+
+	protected int fStartPos;
+	protected int fEndPos;
+	protected int fAnchor;
+
+	protected JavaCodeReader fReader = new JavaCodeReader();
+
+
+	public JavaPairMatcher(char[] pairs) {
+		fPairs = pairs;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#match(org.eclipse.jface.text.IDocument, int)
+	 */
+	public IRegion match(IDocument document, int offset) {
+
+		fOffset = offset;
+
+		if (fOffset < 0)
+			return null;
+
+		fDocument = document;
+
+		if (fDocument != null && matchPairsAt() && fStartPos != fEndPos)
+			return new Region(fStartPos, fEndPos - fStartPos + 1);
+
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#getAnchor()
+	 */
+	public int getAnchor() {
+		return fAnchor;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#dispose()
+	 */
+	public void dispose() {
+		clear();
+		fDocument = null;
+		fReader = null;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#clear()
+	 */
+	public void clear() {
+		if (fReader != null) {
+			try {
+				fReader.close();
+			}
+			catch (IOException x) {
+				// ignore
+			}
+		}
+	}
+
+	protected boolean matchPairsAt() {
+
+		int i;
+		int pairIndex1 = fPairs.length;
+		int pairIndex2 = fPairs.length;
+
+		fStartPos = -1;
+		fEndPos = -1;
+
+		// get the chars preceding and following the start position
+		try {
+
+			char prevChar = fDocument.getChar(Math.max(fOffset - 1, 0));
+			// modified behavior for http://dev.eclipse.org/bugs/show_bug.cgi?id=16879			
+			//			char nextChar= fDocument.getChar(fOffset);
+
+			// search for opening peer character next to the activation point
+			for (i = 0; i < fPairs.length; i = i + 2) {
+				//				if (nextChar == fPairs[i]) {
+				//					fStartPos= fOffset;
+				//					pairIndex1= i;
+				//				} else 
+				if (prevChar == fPairs[i]) {
+					fStartPos = fOffset - 1;
+					pairIndex1 = i;
+				}
+			}
+
+			// search for closing peer character next to the activation point
+			for (i = 1; i < fPairs.length; i = i + 2) {
+				if (prevChar == fPairs[i]) {
+					fEndPos = fOffset - 1;
+					pairIndex2 = i;
+				}
+				//				else if (nextChar == fPairs[i]) {
+				//					fEndPos= fOffset;
+				//					pairIndex2= i;
+				//				}
+			}
+
+			if (fEndPos > -1) {
+				fAnchor = RIGHT;
+				fStartPos = searchForOpeningPeer(fEndPos, fPairs[pairIndex2 - 1], fPairs[pairIndex2], fDocument);
+				if (fStartPos > -1)
+					return true;
+				else
+					fEndPos = -1;
+			}
+			else if (fStartPos > -1) {
+				fAnchor = LEFT;
+				fEndPos = searchForClosingPeer(fStartPos, fPairs[pairIndex1], fPairs[pairIndex1 + 1], fDocument);
+				if (fEndPos > -1)
+					return true;
+				else
+					fStartPos = -1;
+			}
+
+		}
+		catch (BadLocationException x) {
+		}
+		catch (IOException x) {
+		}
+
+		return false;
+	}
+
+	protected int searchForClosingPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
+
+		fReader.configureForwardReader(document, offset + 1, document.getLength(), true, true);
+
+		int stack = 1;
+		int c = fReader.read();
+		while (c != JavaCodeReader.EOF) {
+			if (c == openingPeer && c != closingPeer)
+				stack++;
+			else if (c == closingPeer)
+				stack--;
+
+			if (stack == 0)
+				return fReader.getOffset();
+
+			c = fReader.read();
+		}
+
+		return -1;
+	}
+
+	protected int searchForOpeningPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
+
+		fReader.configureBackwardReader(document, offset, true, true);
+
+		int stack = 1;
+		int c = fReader.read();
+		while (c != JavaCodeReader.EOF) {
+			if (c == closingPeer && c != openingPeer)
+				stack++;
+			else if (c == openingPeer)
+				stack--;
+
+			if (stack == 0)
+				return fReader.getOffset();
+
+			c = fReader.read();
+		}
+
+		return -1;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/Symbols.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/Symbols.java
new file mode 100644
index 0000000..171e99c
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/Symbols.java
@@ -0,0 +1,54 @@
+/*******************************************************************************

+ * Copyright (c) 2009 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+package org.eclipse.jst.jsp.ui.internal.text;

+

+//taken from package org.eclipse.jdt.internal.ui.text;

+

+interface Symbols {

+	int TokenEOF = -1;

+	int TokenLBRACE = 1;

+	int TokenRBRACE = 2;

+	int TokenLBRACKET = 3;

+	int TokenRBRACKET = 4;

+	int TokenLPAREN = 5;

+	int TokenRPAREN = 6;

+	int TokenSEMICOLON = 7;

+	int TokenOTHER = 8;

+	int TokenCOLON = 9;

+	int TokenQUESTIONMARK = 10;

+	int TokenCOMMA = 11;

+	int TokenEQUAL = 12;

+	int TokenLESSTHAN = 13;

+	int TokenGREATERTHAN = 14;

+	int TokenSQUOTE = 15;

+	int TokenDQUOTE = 16;

+	int TokenIF = 109;

+	int TokenDO = 1010;

+	int TokenFOR = 1011;

+	int TokenTRY = 1012;

+	int TokenCASE = 1013;

+	int TokenELSE = 1014;

+	int TokenBREAK = 1015;

+	int TokenCATCH = 1016;

+	int TokenWHILE = 1017;

+	int TokenRETURN = 1018;

+	int TokenSTATIC = 1019;

+	int TokenSWITCH = 1020;

+	int TokenFINALLY = 1021;

+	int TokenSYNCHRONIZED = 1022;

+	int TokenGOTO = 1023;

+	int TokenDEFAULT = 1024;

+	int TokenNEW = 1025;

+	int TokenCLASS = 1026;

+	int TokenINTERFACE = 1027;

+	int TokenENUM = 1028;

+	int TokenIDENT = 2000;

+}

diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/HTMLValidationReporter.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/HTMLValidationReporter.java
new file mode 100644
index 0000000..b0fabbb
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/HTMLValidationReporter.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.wst.html.core.internal.validate.MessageFactory;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.validate.ErrorInfo;
+import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
+import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+
+/*
+ * Copied from jsp.core's HTMLValidationReporter
+ */
+class HTMLValidationReporter implements ValidationReporter {
+	private IValidator owner = null;
+	private IReporter reporter = null;
+	private IFile file = null;
+	private IStructuredModel model = null;
+	private MessageFactory fFactory = null;
+	
+	/**
+	 */
+	public HTMLValidationReporter(IValidator owner, IReporter reporter, IFile file, IStructuredModel model) {
+		super();
+		this.owner = owner;
+		this.reporter = reporter;
+		this.file = file;
+		this.model = model;
+		fFactory = new MessageFactory(file != null ? file.getProject() : null);
+	}
+
+	/**
+	 */
+	public void clear() {
+		if (this.file == null)
+			return;
+
+		if (this.reporter != null) {
+			this.reporter.removeAllMessages(this.owner, this.file);
+		}
+		
+	}
+
+
+	/**
+	 */
+	public void report(ValidationMessage message) {
+		if (message == null || this.file == null || message.getSeverity() == ValidationMessage.IGNORE)
+			return;
+		IMessage mes = translateMessage(message);
+
+		if (this.reporter != null) {
+			this.reporter.addMessage(this.owner, mes);
+		}
+		
+	}
+
+	/**
+	 * Translate ValidationMessage to IMessage and generate result log
+	 */
+	private IMessage translateMessage(ValidationMessage message) {
+		int severity = IMessage.LOW_SEVERITY;
+		switch (message.getSeverity()) {
+			case ValidationMessage.ERROR :
+				severity = IMessage.HIGH_SEVERITY;
+				break;
+			case ValidationMessage.WARNING :
+				severity = IMessage.NORMAL_SEVERITY;
+				break;
+			case ValidationMessage.INFORMATION :
+				break;
+			default :
+				break;
+		}
+
+		IMessage mes = new LocalizedMessage(severity, message.getMessage(), this.file);
+		mes.setOffset(message.getOffset());
+		mes.setLength(message.getLength());
+		if (this.model != null) {
+			IStructuredDocument flatModel = this.model.getStructuredDocument();
+			if (flatModel != null) {
+				int line = flatModel.getLineOfOffset(message.getOffset());
+				mes.setLineNo(line + 1);
+			}
+		}
+
+		return mes;
+	}
+
+	public void report(ErrorInfo info) {
+		report(fFactory.createMessage(info));
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPActionSourceValidator.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPActionSourceValidator.java
new file mode 100644
index 0000000..0ab20f9
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPActionSourceValidator.java
@@ -0,0 +1,269 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.validation;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.filebuffers.ITextFileBuffer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.core.internal.validation.JSPActionValidator;
+import org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
+import org.eclipse.wst.validation.internal.ConfigurationManager;
+import org.eclipse.wst.validation.internal.ProjectConfiguration;
+import org.eclipse.wst.validation.internal.ValidationConfiguration;
+import org.eclipse.wst.validation.internal.ValidationRegistryReader;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+
+/**
+ * Source validator (able to check partial document) that checks for: -
+ * missing required attributes & undefined attributes in jsp action tags such
+ * as jsp directives and jsp custom tags
+ */
+public class JSPActionSourceValidator extends JSPActionValidator implements ISourceValidator {
+	private IDocument fDocument;
+	private boolean fEnableSourceValidation;
+	private IContentType fJSPFContentType = null;
+
+	public void connect(IDocument document) {
+		fDocument = document;
+
+		// special checks to see source validation should really execute
+		IFile file = null;
+		IStructuredModel model = null;
+		try {
+			model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+			if (model != null) {
+				String baseLocation = model.getBaseLocation();
+				// The baseLocation may be a path on disk or relative to the
+				// workspace root. Don't translate on-disk paths to
+				// in-workspace resources.
+				IPath basePath = new Path(baseLocation);
+				if (basePath.segmentCount() > 1) {
+					file = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
+					/*
+					 * If the IFile doesn't exist, make sure it's not returned
+					 */
+					if (!file.exists())
+						file = null;
+				}
+			}
+		}
+		finally {
+			if (model != null) {
+				model.releaseFromRead();
+			}
+		}
+		fEnableSourceValidation = (file != null && isBatchValidatorPreferenceEnabled(file) && shouldValidate(file) && fragmentCheck(file));
+	}
+
+	public void disconnect(IDocument document) {
+		fDocument = null;
+	}
+
+	public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
+		if (helper == null || fDocument == null || !fEnableSourceValidation)
+			return;
+
+		if ((reporter != null) && (reporter.isCancelled() == true)) {
+			throw new OperationCanceledException();
+		}
+
+		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
+		if (model == null)
+			return;
+
+		try {
+			ITextFileBuffer fb = FileBufferModelManager.getInstance().getBuffer(fDocument);
+			if (fb == null)
+				return;
+			IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(fb.getLocation());
+			if (file == null || !file.exists())
+				return;
+			performValidation(file, reporter, model, dirtyRegion);
+		}
+		finally {
+			if (model != null)
+				model.releaseFromRead();
+		}
+	}
+
+	/**
+	 * Gets current validation configuration based on current project (which
+	 * is based on current document) or global configuration if project does
+	 * not override
+	 * 
+	 * @return ValidationConfiguration
+	 */
+	private ValidationConfiguration getValidationConfiguration(IFile file) {
+		ValidationConfiguration configuration = null;
+		if (file != null) {
+			IProject project = file.getProject();
+			if (project != null) {
+				try {
+					ProjectConfiguration projectConfiguration = ConfigurationManager.getManager().getProjectConfiguration(project);
+					configuration = projectConfiguration;
+					if (projectConfiguration == null || projectConfiguration.useGlobalPreference()) {
+						configuration = ConfigurationManager.getManager().getGlobalConfiguration();
+					}
+				}
+				catch (InvocationTargetException e) {
+					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+				}
+			}
+		}
+
+		return configuration;
+	}
+
+	/**
+	 * Checks if validator is enabled according in Validation preferences
+	 * 
+	 * @param vmd
+	 * @return
+	 */
+	private boolean isBatchValidatorPreferenceEnabled(IFile file) {
+		if (file == null) {
+			return true;
+		}
+
+		boolean enabled = true;
+		ValidationConfiguration configuration = getValidationConfiguration(file);
+		if (configuration != null) {
+			org.eclipse.wst.validation.internal.ValidatorMetaData metadata = ValidationRegistryReader.getReader().getValidatorMetaData(JSPContentValidator.class.getName());
+			if (metadata != null) {
+				if (!configuration.isBuildEnabled(metadata) && !configuration.isManualEnabled(metadata))
+					enabled = false;
+			}
+		}
+		return enabled;
+	}
+
+	/**
+	 * Checks if file is a jsp fragment or not. If so, check if the fragment
+	 * should be validated or not.
+	 * 
+	 * @param file
+	 *            Assumes shouldValidate was already called on file so it
+	 *            should not be null and does exist
+	 * @return false if file is a fragment and it should not be validated,
+	 *         true otherwise
+	 */
+	private boolean fragmentCheck(IFile file) {
+		// copied from JSPValidator
+		boolean shouldValidate = true;
+		// quick check to see if this is possibly a jsp fragment
+		if (getJSPFContentType().isAssociatedWith(file.getName())) {
+			// get preference for validate jsp fragments
+			boolean shouldValidateFragments = Boolean.valueOf(JSPFContentProperties.getProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, file, true)).booleanValue();
+			/*
+			 * if jsp fragments should not be validated, check if file is
+			 * really jsp fragment
+			 */
+			if (!shouldValidateFragments) {
+				boolean isFragment = isFragment(file);
+				shouldValidate = !isFragment;
+			}
+		}
+		return shouldValidate;
+	}
+
+	/**
+	 * Determines if file is jsp fragment or not (does a deep, indepth check,
+	 * looking into contents of file)
+	 * 
+	 * @param file
+	 *            assumes file is not null and exists
+	 * @return true if file is jsp fragment, false otherwise
+	 */
+	private boolean isFragment(IFile file) {
+		// copied from JSPValidator
+		boolean isFragment = false;
+		InputStream is = null;
+		try {
+			IContentDescription contentDescription = file.getContentDescription();
+			// it can be null
+			if (contentDescription == null) {
+				is = file.getContents();
+				contentDescription = Platform.getContentTypeManager().getDescriptionFor(is, file.getName(), new QualifiedName[]{IContentDescription.CHARSET});
+			}
+			if (contentDescription != null) {
+				String fileCtId = contentDescription.getContentType().getId();
+				isFragment = (fileCtId != null && ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT.equals(fileCtId));
+			}
+		}
+		catch (IOException e) {
+			// ignore, assume it's invalid JSP
+		}
+		catch (CoreException e) {
+			// ignore, assume it's invalid JSP
+		}
+		finally {
+			// must close input stream in case others need it
+			if (is != null)
+				try {
+					is.close();
+				}
+				catch (Exception e) {
+					// not sure how to recover at this point
+				}
+		}
+		return isFragment;
+	}
+
+	private boolean shouldValidate(IFile file) {
+		// copied from JSPValidator
+		IResource resource = file;
+		do {
+			if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || resource.getName().charAt(0) == '.') {
+				return false;
+			}
+			resource = resource.getParent();
+		}
+		while ((resource.getType() & IResource.PROJECT) == 0);
+		return true;
+	}
+
+	/**
+	 * Returns JSP fragment content type
+	 * 
+	 * @return jspf content type
+	 */
+	private IContentType getJSPFContentType() {
+		// copied from JSPValidator
+		if (fJSPFContentType == null) {
+			fJSPFContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT);
+		}
+		return fJSPFContentType;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPContentSourceValidator.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPContentSourceValidator.java
new file mode 100644
index 0000000..bfbd890
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPContentSourceValidator.java
@@ -0,0 +1,393 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.validation;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.filebuffers.ITextFileBuffer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeConstants;
+import org.eclipse.wst.html.core.internal.validate.HTMLValidationAdapterFactory;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
+import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
+import org.eclipse.wst.validation.internal.ConfigurationManager;
+import org.eclipse.wst.validation.internal.ProjectConfiguration;
+import org.eclipse.wst.validation.internal.ValidationConfiguration;
+import org.eclipse.wst.validation.internal.ValidationRegistryReader;
+import org.eclipse.wst.validation.internal.core.Message;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.w3c.dom.Text;
+
+/**
+ * Source validator for JSP content. This validator currently only validates
+ * html content in jsp.
+ */
+public class JSPContentSourceValidator extends JSPContentValidator implements ISourceValidator {
+	/*
+	 * Most of this class was copied from the ISourceValidator aspects of
+	 * html.ui's HTMLValidator
+	 */
+	private IDocument fDocument;
+	private boolean fEnableSourceValidation;
+	private IContentType fJSPFContentType = null;
+
+	public void connect(IDocument document) {
+		fDocument = document;
+
+		// special checks to see source validation should really execute
+		IFile file = null;
+		IStructuredModel model = null;
+		try {
+			model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+			if (model != null) {
+				String baseLocation = model.getBaseLocation();
+				// The baseLocation may be a path on disk or relative to the
+				// workspace root. Don't translate on-disk paths to
+				// in-workspace resources.
+				IPath basePath = new Path(baseLocation);
+				if (basePath.segmentCount() > 1) {
+					file = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
+					/*
+					 * If the IFile doesn't exist, make sure it's not returned
+					 */
+					if (!file.exists())
+						file = null;
+				}
+			}
+		}
+		finally {
+			if (model != null) {
+				model.releaseFromRead();
+			}
+		}
+		fEnableSourceValidation = (file != null && isBatchValidatorPreferenceEnabled(file) && shouldValidate(file) && fragmentCheck(file));
+	}
+
+	public void disconnect(IDocument document) {
+		fDocument = null;
+	}
+
+	/**
+	 * This validate call is for the ISourceValidator partial document
+	 * validation approach
+	 * 
+	 * @param dirtyRegion
+	 * @param helper
+	 * @param reporter
+	 * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
+	 */
+	public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
+		if (helper == null || fDocument == null || !fEnableSourceValidation)
+			return;
+
+		if ((reporter != null) && (reporter.isCancelled() == true)) {
+			throw new OperationCanceledException();
+		}
+
+		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
+		if (model == null)
+			return; // error
+
+		try {
+
+			IDOMDocument document = null;
+			if (model instanceof IDOMModel) {
+				document = ((IDOMModel) model).getDocument();
+			}
+
+			if (document == null || !hasHTMLFeature(document))
+				return; // ignore
+
+			ITextFileBuffer fb = FileBufferModelManager.getInstance().getBuffer(fDocument);
+			if (fb == null)
+				return;
+
+			IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(fb.getLocation());
+			if (file == null || !file.exists())
+				return;
+
+			// this will be the wrong region if it's Text (instead of Element)
+			// we don't know how to validate Text
+			IndexedRegion ir = getCoveringNode(dirtyRegion); // model.getIndexedRegion(dirtyRegion.getOffset());
+			if (ir instanceof Text) {
+				while (ir != null && ir instanceof Text) {
+					// it's assumed that this gets the IndexedRegion to
+					// the right of the end offset
+					ir = model.getIndexedRegion(ir.getEndOffset());
+				}
+			}
+
+			if (ir instanceof INodeNotifier) {
+
+				INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
+				ValidationAdapter adapter = (ValidationAdapter) factory.adapt((INodeNotifier) ir);
+				if (adapter == null)
+					return; // error
+
+				if (reporter != null) {
+					HTMLValidationReporter rep = null;
+					rep = getReporter(reporter, file, (IDOMModel) model);
+					rep.clear();
+					adapter.setReporter(rep);
+
+					Message mess = new LocalizedMessage(IMessage.LOW_SEVERITY, file.getFullPath().toString().substring(1));
+					reporter.displaySubtask(this, mess);
+				}
+				adapter.validate(ir);
+			}
+		}
+		finally {
+			if (model != null)
+				model.releaseFromRead();
+		}
+	}
+
+	private IndexedRegion getCoveringNode(IRegion dirtyRegion) {
+
+		IndexedRegion largestRegion = null;
+		if (fDocument instanceof IStructuredDocument) {
+			IStructuredDocumentRegion[] regions = ((IStructuredDocument) fDocument).getStructuredDocumentRegions(dirtyRegion.getOffset(), dirtyRegion.getLength());
+			largestRegion = getLargest(regions);
+		}
+		return largestRegion;
+	}
+
+	private IndexedRegion getLargest(IStructuredDocumentRegion[] sdRegions) {
+
+		if (sdRegions == null || sdRegions.length == 0)
+			return null;
+
+		IndexedRegion currentLargest = getCorrespondingNode(sdRegions[0]);
+		for (int i = 0; i < sdRegions.length; i++) {
+			if (!sdRegions[i].isDeleted()) {
+				IndexedRegion corresponding = getCorrespondingNode(sdRegions[i]);
+
+				if (currentLargest instanceof Text)
+					currentLargest = corresponding;
+
+				if (corresponding != null) {
+					if (!(corresponding instanceof Text)) {
+						if (corresponding.getStartOffset() <= currentLargest.getStartOffset() && corresponding.getEndOffset() >= currentLargest.getEndOffset())
+							currentLargest = corresponding;
+					}
+				}
+
+			}
+		}
+		return currentLargest;
+	}
+
+	protected IndexedRegion getCorrespondingNode(IStructuredDocumentRegion sdRegion) {
+		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
+		IndexedRegion indexedRegion = null;
+		try {
+			if (sModel != null)
+				indexedRegion = sModel.getIndexedRegion(sdRegion.getStart());
+		}
+		finally {
+			if (sModel != null)
+				sModel.releaseFromRead();
+		}
+		return indexedRegion;
+	}
+
+	private boolean hasHTMLFeature(IDOMDocument document) {
+		DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
+		if (adapter == null)
+			return false;
+		return adapter.hasFeature(HTMLDocumentTypeConstants.HTML);
+	}
+
+	private HTMLValidationReporter getReporter(IReporter reporter, IFile file, IDOMModel model) {
+		return new HTMLValidationReporter(this, reporter, file, model);
+	}
+
+	/**
+	 * Gets current validation configuration based on current project (which
+	 * is based on current document) or global configuration if project does
+	 * not override
+	 * 
+	 * @return ValidationConfiguration
+	 */
+	private ValidationConfiguration getValidationConfiguration(IFile file) {
+		ValidationConfiguration configuration = null;
+		if (file != null) {
+			IProject project = file.getProject();
+			if (project != null) {
+				try {
+					ProjectConfiguration projectConfiguration = ConfigurationManager.getManager().getProjectConfiguration(project);
+					configuration = projectConfiguration;
+					if (projectConfiguration == null || projectConfiguration.useGlobalPreference()) {
+						configuration = ConfigurationManager.getManager().getGlobalConfiguration();
+					}
+				}
+				catch (InvocationTargetException e) {
+					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+				}
+			}
+		}
+
+		return configuration;
+	}
+
+	/**
+	 * Checks if validator is enabled according in Validation preferences
+	 * 
+	 * @param vmd
+	 * @return
+	 */
+	private boolean isBatchValidatorPreferenceEnabled(IFile file) {
+		if (file == null) {
+			return true;
+		}
+
+		boolean enabled = true;
+		ValidationConfiguration configuration = getValidationConfiguration(file);
+		if (configuration != null) {
+			org.eclipse.wst.validation.internal.ValidatorMetaData metadata = ValidationRegistryReader.getReader().getValidatorMetaData(JSPContentValidator.class.getName());
+			if (metadata != null) {
+				if (!configuration.isBuildEnabled(metadata) && !configuration.isManualEnabled(metadata))
+					enabled = false;
+			}
+		}
+		return enabled;
+	}
+
+	/**
+	 * Checks if file is a jsp fragment or not. If so, check if the fragment
+	 * should be validated or not.
+	 * 
+	 * @param file
+	 *            Assumes shouldValidate was already called on file so it
+	 *            should not be null and does exist
+	 * @return false if file is a fragment and it should not be validated,
+	 *         true otherwise
+	 */
+	private boolean fragmentCheck(IFile file) {
+		// copied from JSPValidator
+		boolean shouldValidate = true;
+		// quick check to see if this is possibly a jsp fragment
+		if (getJSPFContentType().isAssociatedWith(file.getName())) {
+			// get preference for validate jsp fragments
+			boolean shouldValidateFragments = Boolean.valueOf(JSPFContentProperties.getProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, file, true)).booleanValue();
+			/*
+			 * if jsp fragments should not be validated, check if file is
+			 * really jsp fragment
+			 */
+			if (!shouldValidateFragments) {
+				boolean isFragment = isFragment(file);
+				shouldValidate = !isFragment;
+			}
+		}
+		return shouldValidate;
+	}
+
+	/**
+	 * Determines if file is jsp fragment or not (does a deep, indepth check,
+	 * looking into contents of file)
+	 * 
+	 * @param file
+	 *            assumes file is not null and exists
+	 * @return true if file is jsp fragment, false otherwise
+	 */
+	private boolean isFragment(IFile file) {
+		// copied from JSPValidator
+		boolean isFragment = false;
+		InputStream is = null;
+		try {
+			IContentDescription contentDescription = file.getContentDescription();
+			// it can be null
+			if (contentDescription == null) {
+				is = file.getContents();
+				contentDescription = Platform.getContentTypeManager().getDescriptionFor(is, file.getName(), new QualifiedName[]{IContentDescription.CHARSET});
+			}
+			if (contentDescription != null) {
+				String fileCtId = contentDescription.getContentType().getId();
+				isFragment = (fileCtId != null && ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT.equals(fileCtId));
+			}
+		}
+		catch (IOException e) {
+			// ignore, assume it's invalid JSP
+		}
+		catch (CoreException e) {
+			// ignore, assume it's invalid JSP
+		}
+		finally {
+			// must close input stream in case others need it
+			if (is != null)
+				try {
+					is.close();
+				}
+				catch (Exception e) {
+					// not sure how to recover at this point
+				}
+		}
+		return isFragment;
+	}
+
+	private boolean shouldValidate(IFile file) {
+		// copied from JSPValidator
+		IResource resource = file;
+		do {
+			if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || resource.getName().charAt(0) == '.') {
+				return false;
+			}
+			resource = resource.getParent();
+		}
+		while ((resource.getType() & IResource.PROJECT) == 0);
+		return true;
+	}
+
+	/**
+	 * Returns JSP fragment content type
+	 * 
+	 * @return jspf content type
+	 */
+	private IContentType getJSPFContentType() {
+		// copied from JSPValidator
+		if (fJSPFContentType == null) {
+			fJSPFContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT);
+		}
+		return fJSPFContentType;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/LocalizedMessage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/LocalizedMessage.java
new file mode 100644
index 0000000..1686e37
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/LocalizedMessage.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.validation;
+
+import java.util.Locale;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.wst.validation.internal.core.Message;
+
+/**
+ * Simple implementation of Message all validators in package can use.
+ */
+class LocalizedMessage extends Message {
+	private String _message = null;
+
+	public LocalizedMessage(int severity, String messageText) {
+		this(severity, messageText, null);
+	}
+
+	public LocalizedMessage(int severity, String messageText, IResource targetObject) {
+		this(severity, messageText, (Object) targetObject);
+	}
+
+	public LocalizedMessage(int severity, String messageText, Object targetObject) {
+		super(null, severity, null);
+		setLocalizedMessage(messageText);
+		setTargetObject(targetObject);
+	}
+
+	public void setLocalizedMessage(String message) {
+		_message = message;
+	}
+
+	public String getLocalizedMessage() {
+		return _message;
+	}
+
+	public String getText() {
+		return getLocalizedMessage();
+	}
+
+	public String getText(ClassLoader cl) {
+		return getLocalizedMessage();
+	}
+
+	public String getText(Locale l) {
+		return getLocalizedMessage();
+	}
+
+	public String getText(Locale l, ClassLoader cl) {
+		return getLocalizedMessage();
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/views/contentoutline/TLDContentOutlineConfiguration.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/views/contentoutline/TLDContentOutlineConfiguration.java
new file mode 100644
index 0000000..4444f59
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/views/contentoutline/TLDContentOutlineConfiguration.java
@@ -0,0 +1,349 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.views.contentoutline;
+
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP11TLDNames;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP12TLDNames;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
+import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateActionContributionItem;
+import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
+import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
+import org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration;
+import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class TLDContentOutlineConfiguration extends XMLContentOutlineConfiguration {
+
+	private class ContentLabelProvider implements ILabelProvider {
+		ILabelProvider fParentProvider = null;
+
+		ContentLabelProvider(ILabelProvider parent) {
+			super();
+			fParentProvider = parent;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see
+		 * org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse
+		 * .jface.viewers.ILabelProviderListener)
+		 */
+		public void addListener(ILabelProviderListener listener) {
+			fParentProvider.addListener(listener);
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+		 */
+		public void dispose() {
+			fParentProvider.dispose();
+		}
+
+		private String firstLineOf(String text) {
+			if (text == null || text.length() < 1 || (text.indexOf('\r') < 0 && text.indexOf('\n') < 0)) {
+				return text;
+			}
+
+			int start = 0;
+			int maxLength = text.length();
+			while (start < maxLength && text.charAt(start) == '\r' || text.charAt(start) == '\n')
+				start++;
+			int endN = text.indexOf('\n', start);
+			int endR = text.indexOf('\r', start);
+			// no more line delimiters
+			if (endN < 0 && endR < 0) {
+				if (start == 0) {
+					// no leading line delimiters, return as-is
+					return text;
+				}
+				else {
+					// cut leading line delimiters
+					return text.substring(start);
+				}
+			}
+			if (endN < 0) {
+				/* no \r cut leading line delimiters up to first \r */
+				return text.substring(start, endR);
+			}
+			if (endR < 0) {
+				/* no \r cut leading line delimiters up to first \n */
+				return text.substring(start, endN);
+			}
+
+			/*
+			 * Both \n and \r, cut leading line delimiters up to whichever is
+			 * first
+			 */
+			return text.substring(start, Math.min(endN, endR));
+		}
+
+		private String getContainedText(Node parent) {
+			NodeList children = parent.getChildNodes();
+			if (children.getLength() == 1) {
+				return getValue(children.item(0));
+			}
+			StringBuffer s = new StringBuffer();
+			Node child = parent.getFirstChild();
+			while (child != null) {
+				if (child.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
+					String reference = ((EntityReference) child).getNodeValue();
+					if (reference == null && child.getNodeName() != null) {
+						reference = "&" + child.getNodeName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
+					}
+					if (reference != null) {
+						s.append(reference.trim());
+					}
+				}
+				else {
+					s.append(getValue(child));
+				}
+				child = child.getNextSibling();
+			}
+			return s.toString().trim();
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see
+		 * org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+		 */
+		public Image getImage(Object element) {
+			return fParentProvider.getImage(element);
+		}
+
+		/**
+		 * @param domElement
+		 * @return
+		 */
+		private String getNameValue(Element domElement) {
+			NodeList names = domElement.getElementsByTagName(JSP11TLDNames.NAME);
+			String name = null;
+			for (int i = 0; i < names.getLength() && (name == null || name.length() == 0); i++) {
+				name = getContainedText(names.item(i));
+			}
+			return name;
+		}
+
+		/**
+		 * @param domElement
+		 * @return
+		 */
+		private String getShortNameValue(Element domElement) {
+			NodeList names = domElement.getElementsByTagName(JSP12TLDNames.SHORT_NAME);
+			String name = null;
+			for (int i = 0; i < names.getLength() && (name == null || name.length() == 0); i++) {
+				name = getContainedText(names.item(i));
+			}
+			names = domElement.getElementsByTagName(JSP11TLDNames.SHORTNAME);
+			for (int i = 0; i < names.getLength() && (name == null || name.length() == 0); i++) {
+				name = getContainedText(names.item(i));
+			}
+			return name;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see
+		 * org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+		 */
+		public String getText(Object element) {
+			if (fShowContentValues && element instanceof Element) {
+				Element domElement = (Element) element;
+				String name = domElement.getNodeName();
+				boolean showName = JSP11TLDNames.TAG.equals(name);
+				showName = showName || JSP11TLDNames.ATTRIBUTE.equals(name);
+				if (showName) {
+					String value = getNameValue(domElement);
+					if (value != null && value.length() > 0) {
+						/**
+						 * Currently not externalized since it's analagous to
+						 * a decorator.
+						 */
+						return fParentProvider.getText(domElement) + " [" + firstLineOf(value) + "]"; //$NON-NLS-1$
+					}
+				}
+
+				boolean showContents = JSP11TLDNames.NAME.equals(name);
+				showContents = showContents || JSP11TLDNames.BODYCONTENT.equals(name);
+				showContents = showContents || JSP12TLDNames.BODY_CONTENT.equals(name);
+				showContents = showContents || JSP11TLDNames.TAGCLASS.equals(name);
+				showContents = showContents || JSP12TLDNames.TAG_CLASS.equals(name);
+				showContents = showContents || JSP11TLDNames.TEICLASS.equals(name);
+				showContents = showContents || JSP12TLDNames.TEI_CLASS.equals(name);
+				showContents = showContents || JSP11TLDNames.REQUIRED.equals(name);
+				showContents = showContents || JSP11TLDNames.RTEXPRVALUE.equals(name);
+				showContents = showContents || JSP11TLDNames.URI.equals(name);
+				showContents = showContents || JSP11TLDNames.SHORTNAME.equals(name);
+				showContents = showContents || JSP12TLDNames.SHORT_NAME.equals(name);
+				showContents = showContents || JSP12TLDNames.DISPLAY_NAME.equals(name);
+				showContents = showContents || JSP11TLDNames.JSPVERSION.equals(name);
+				showContents = showContents || JSP12TLDNames.JSP_VERSION.equals(name);
+				showContents = showContents || JSP11TLDNames.TLIBVERSION.equals(name);
+				showContents = showContents || JSP12TLDNames.TLIB_VERSION.equals(name);
+				showContents = showContents || JSP12TLDNames.LISTENER_CLASS.equals(name);
+				showContents = showContents || JSP12TLDNames.VARIABLE_SCOPE.equals(name);
+				showContents = showContents || JSP12TLDNames.VARIABLE_CLASS.equals(name);
+				showContents = showContents || JSP12TLDNames.VARIABLE_DECLARE.equals(name);
+				showContents = showContents || JSP12TLDNames.VARIABLE_NAME_FROM_ATTRIBUTE.equals(name);
+				showContents = showContents || JSP12TLDNames.VARIABLE_NAME_GIVEN.equals(name);
+				showContents = showContents || JSP12TLDNames.VALIDATOR_CLASS.equals(name);
+				showContents = showContents || JSP12TLDNames.SMALL_ICON.equals(name);
+				showContents = showContents || JSP12TLDNames.LARGE_ICON.equals(name);
+
+				if (showContents) {
+					return fParentProvider.getText(domElement) + ": " + getContainedText(domElement); //$NON-NLS-1$
+				}
+
+				if (JSP11TLDNames.TAGLIB.equals(name)) {
+					String value = getShortNameValue(domElement);
+					if (value != null && value.length() > 0) {
+						/**
+						 * Currently not externalized since it's analagous to
+						 * a decorator.
+						 */
+						return fParentProvider.getText(domElement) + " [" + value + "]"; //$NON-NLS-1$
+					}
+				}
+			}
+			return fParentProvider.getText(element);
+		}
+
+		private String getValue(Node n) {
+			if (n == null)
+				return ""; //$NON-NLS-1$
+			String value = n.getNodeValue();
+			if (value == null)
+				return ""; //$NON-NLS-1$
+			return value.trim();
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see
+		 * org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java
+		 * .lang.Object, java.lang.String)
+		 */
+		public boolean isLabelProperty(Object element, String property) {
+			return fParentProvider.isLabelProperty(element, property);
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see
+		 * org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org
+		 * .eclipse.jface.viewers.ILabelProviderListener)
+		 */
+		public void removeListener(ILabelProviderListener listener) {
+			fParentProvider.removeListener(listener);
+		}
+	}
+
+	/**
+	 * Toggle action for whether or not to display element's first attribute
+	 */
+	private class ToggleShowValueAction extends PropertyChangeUpdateAction {
+		private TreeViewer fTreeViewer;
+
+		public ToggleShowValueAction(IPreferenceStore store, String preference, TreeViewer treeViewer) {
+			super(JSPUIMessages.TLDContentOutlineConfiguration_0, store, preference, true);
+			setToolTipText(getText());
+			// TODO: image needed
+			setImageDescriptor(EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_OBJ_PROP_PS));
+			fTreeViewer = treeViewer;
+			update();
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.eclipse.ui.texteditor.IUpdate#update()
+		 */
+		public void update() {
+			super.update();
+			fShowContentValues = isChecked();
+
+			// refresh the outline view
+			fTreeViewer.refresh(true);
+		}
+	}
+
+	/*
+	 * Preference key for Show Attributes
+	 */
+	private final String OUTLINE_SHOW_VALUE_PREF = "outline-show-value"; //$NON-NLS-1$
+
+	boolean fShowContentValues = true;
+	ILabelProvider fLabelProvider = null;
+
+	public TLDContentOutlineConfiguration() {
+		super();
+	}
+
+	protected IContributionItem[] createMenuContributions(TreeViewer viewer) {
+		IContributionItem[] items;
+		IContributionItem showValueItem = new PropertyChangeUpdateActionContributionItem(new ToggleShowValueAction(getPreferenceStore(), OUTLINE_SHOW_VALUE_PREF, viewer));
+
+		items = super.createMenuContributions(viewer);
+		if (items == null) {
+			items = new IContributionItem[]{showValueItem};
+		}
+		else {
+			IContributionItem[] combinedItems = new IContributionItem[items.length + 1];
+			System.arraycopy(items, 0, combinedItems, 0, items.length);
+			combinedItems[items.length] = showValueItem;
+			items = combinedItems;
+		}
+		return items;
+	}
+
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration
+	 * #getLabelProvider(org.eclipse.jface.viewers.TreeViewer)
+	 */
+	public ILabelProvider getLabelProvider(TreeViewer viewer) {
+		if (fLabelProvider == null) {
+			fLabelProvider = new ContentLabelProvider(super.getLabelProvider(viewer));
+		}
+		return fLabelProvider;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
+	 * #getPreferenceStore()
+	 */
+	protected IPreferenceStore getPreferenceStore() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPFileWizardPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPFileWizardPage.java
new file mode 100644
index 0000000..9c36255
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPFileWizardPage.java
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2006 ,2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.wizard;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
+import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+class NewJSPFileWizardPage extends WizardNewFileCreationPage {
+
+	private IContentType fContentType;
+	private List fValidExtensions = null;
+
+	public NewJSPFileWizardPage(String pageName, IStructuredSelection selection) {
+		super(pageName, selection);
+	}
+
+	/**
+	 * This method is overriden to set the selected folder to web contents
+	 * folder if the current selection is outside the web contents folder.
+	 */
+	protected void initialPopulateContainerNameField() {
+		super.initialPopulateContainerNameField();
+
+		IPath fullPath = getContainerFullPath();
+		IProject project = getProjectFromPath(fullPath);
+		IPath webContentPath = getWebContentPath(project);
+
+		if (webContentPath != null && !webContentPath.isPrefixOf(fullPath)) {
+			setContainerFullPath(webContentPath);
+		}
+	}
+
+	/**
+	 * This method is overriden to set additional validation specific to jsp
+	 * files.
+	 */
+	protected boolean validatePage() {
+		setMessage(null);
+		setErrorMessage(null);
+
+		if (!super.validatePage()) {
+			return false;
+		}
+
+		String fileName = getFileName();
+		IPath fullPath = getContainerFullPath();
+		if ((fullPath != null) && (fullPath.isEmpty() == false) && (fileName != null)) {
+			// check that filename does not contain invalid extension
+			if (!extensionValidForContentType(fileName)) {
+				setErrorMessage(NLS.bind(JSPUIMessages._ERROR_FILENAME_MUST_END_JSP, getValidExtensions().toString()));
+				return false;
+			}
+			// no file extension specified so check adding default
+			// extension doesn't equal a file that already exists
+			if (fileName.lastIndexOf('.') == -1) {
+				String newFileName = addDefaultExtension(fileName);
+				IPath resourcePath = fullPath.append(newFileName);
+
+				IWorkspace workspace = ResourcesPlugin.getWorkspace();
+				IStatus result = workspace.validatePath(resourcePath.toString(), IResource.FOLDER);
+				if (!result.isOK()) {
+					// path invalid
+					setErrorMessage(result.getMessage());
+					return false;
+				}
+
+				if ((workspace.getRoot().getFolder(resourcePath).exists() || workspace.getRoot().getFile(resourcePath).exists())) {
+					setErrorMessage(JSPUIMessages.ResourceGroup_nameExists);
+					return false;
+				}
+			}
+
+			// get the IProject for the selection path
+			IProject project = getProjectFromPath(fullPath);
+			if (project != null) {
+				if (!isJavaProject(project)) {
+					setMessage(JSPUIMessages._WARNING_FILE_MUST_BE_INSIDE_JAVA_PROJECT, WARNING);
+				}
+				// if inside web project, check if inside webContent folder
+				if (isDynamicWebProject(project)) {
+					// check that the path is inside the webContent folder
+					IPath webContentPath = getWebContentPath(project);
+					if (!webContentPath.isPrefixOf(fullPath)) {
+						setMessage(JSPUIMessages._WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT, WARNING);
+					}
+				}
+			}
+		}
+
+		return true;
+	}
+
+	/**
+	 * Adds default extension to the filename
+	 * 
+	 * @param filename
+	 * @return
+	 */
+	String addDefaultExtension(String filename) {
+		StringBuffer newFileName = new StringBuffer(filename);
+
+		Preferences preference = JSPCorePlugin.getDefault().getPluginPreferences();
+		String ext = preference.getString(JSPCorePreferenceNames.DEFAULT_EXTENSION);
+
+		newFileName.append("."); //$NON-NLS-1$
+		newFileName.append(ext);
+
+		return newFileName.toString();
+	}
+
+	/**
+	 * Get content type associated with this new file wizard
+	 * 
+	 * @return IContentType
+	 */
+	private IContentType getContentType() {
+		if (fContentType == null)
+			fContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
+		return fContentType;
+	}
+
+	/**
+	 * Get list of valid extensions for JSP Content type
+	 * 
+	 * @return
+	 */
+	private List getValidExtensions() {
+		if (fValidExtensions == null) {
+			IContentType type = getContentType();
+			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
+		}
+		return fValidExtensions;
+	}
+
+	/**
+	 * Verifies if fileName is valid name for content type. Takes base content
+	 * type into consideration.
+	 * 
+	 * @param fileName
+	 * @return true if extension is valid for this content type
+	 */
+	private boolean extensionValidForContentType(String fileName) {
+		boolean valid = false;
+
+		IContentType type = getContentType();
+		// there is currently an extension
+		if (fileName.lastIndexOf('.') != -1) {
+			// check what content types are associated with current extension
+			IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
+			int i = 0;
+			while (i < types.length && !valid) {
+				valid = types[i].isKindOf(type);
+				++i;
+			}
+		}
+		else
+			valid = true; // no extension so valid
+		return valid;
+	}
+
+	/**
+	 * Returns the project that contains the specified path
+	 * 
+	 * @param path
+	 *            the path which project is needed
+	 * @return IProject object. If path is <code>null</code> the return
+	 *         value is also <code>null</code>.
+	 */
+	private IProject getProjectFromPath(IPath path) {
+		IWorkspace workspace = ResourcesPlugin.getWorkspace();
+		IProject project = null;
+
+		if (path != null) {
+			if (workspace.validatePath(path.toString(), IResource.PROJECT).isOK()) {
+				project = workspace.getRoot().getProject(path.toString());
+			}
+			else {
+				project = workspace.getRoot().getFile(path).getProject();
+			}
+		}
+
+		return project;
+	}
+
+	/**
+	 * Checks if the specified project is a web project.
+	 * 
+	 * @param project
+	 *            project to be checked
+	 * @return true if the project is web project, otherwise false
+	 */
+	private boolean isDynamicWebProject(IProject project) {
+		boolean is = FacetModuleCoreSupport.isDynamicWebProject(project);
+		return is;
+	}
+
+	/**
+	 * Checks if the specified project is a type of java project.
+	 * 
+	 * @param project
+	 *            project to be checked (cannot be null)
+	 * @return true if the project is a type of java project, otherwise false
+	 */
+	private boolean isJavaProject(IProject project) {
+		boolean isJava = false;
+		try {
+			isJava = project.hasNature(JavaCore.NATURE_ID);
+		}
+		catch (CoreException e) {
+			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+		}
+
+		return isJava;
+	}
+
+	/**
+	 * Returns the web contents folder of the specified project
+	 * 
+	 * @param project
+	 *            the project which web contents path is needed
+	 * @return IPath of the web contents folder
+	 */
+	private IPath getWebContentPath(IProject project) {
+		IPath path = FacetModuleCoreSupport.getWebContentRootPath(project);
+		return path;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java
new file mode 100644
index 0000000..e1b5b83
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java
@@ -0,0 +1,522 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.wizard;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.jface.text.templates.DocumentTemplateContext;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateBuffer;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
+import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
+import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+
+/**
+ * Templates page in new file wizard. Allows users to select a new file
+ * template to be applied in new file.
+ * 
+ */
+public class NewJSPTemplatesWizardPage extends WizardPage {
+
+	/**
+	 * Content provider for templates
+	 */
+	private class TemplateContentProvider implements IStructuredContentProvider {
+		/** The template store. */
+		private TemplateStore fStore;
+
+		/*
+		 * @see IContentProvider#dispose()
+		 */
+		public void dispose() {
+			fStore = null;
+		}
+
+		/*
+		 * @see IStructuredContentProvider#getElements(Object)
+		 */
+		public Object[] getElements(Object input) {
+			return fStore.getTemplates(TemplateContextTypeIdsJSP.NEW);
+		}
+
+		/*
+		 * @see IContentProvider#inputChanged(Viewer, Object, Object)
+		 */
+		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+			fStore = (TemplateStore) newInput;
+		}
+	}
+
+	/**
+	 * Label provider for templates.
+	 */
+	private class TemplateLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+		/*
+		 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object,
+		 *      int)
+		 */
+		public Image getColumnImage(Object element, int columnIndex) {
+			return null;
+		}
+
+		/*
+		 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
+		 *      int)
+		 */
+		public String getColumnText(Object element, int columnIndex) {
+			Template template = (Template) element;
+
+			switch (columnIndex) {
+				case 0 :
+					return template.getName();
+				case 1 :
+					return template.getDescription();
+				default :
+					return ""; //$NON-NLS-1$
+			}
+		}
+	}
+
+	/** Last selected template name */
+	private String fLastSelectedTemplateName;
+	/** The viewer displays the pattern of selected template. */
+	private SourceViewer fPatternViewer;
+	/** The table presenting the templates. */
+	private TableViewer fTableViewer;
+	/** Template store used by this wizard page */
+	private TemplateStore fTemplateStore;
+	/** Checkbox for using templates. */
+	private Button fUseTemplateButton;
+
+	public NewJSPTemplatesWizardPage() {
+		super("NewJSPTemplatesWizardPage", JSPUIMessages.NewJSPTemplatesWizardPage_0, null); //$NON-NLS-1$
+		setDescription(JSPUIMessages.NewJSPTemplatesWizardPage_1);
+	}
+
+	/**
+	 * Correctly resizes the table so no phantom columns appear
+	 * 
+	 * @param parent
+	 *            the parent control
+	 * @param buttons
+	 *            the buttons
+	 * @param table
+	 *            the table
+	 * @param column1
+	 *            the first column
+	 * @param column2
+	 *            the second column
+	 * @param column3
+	 *            the third column
+	 */
+	private void configureTableResizing(final Composite parent, final Table table, final TableColumn column1, final TableColumn column2) {
+		parent.addControlListener(new ControlAdapter() {
+			public void controlResized(ControlEvent e) {
+				Rectangle area = parent.getClientArea();
+				Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+				int width = area.width - 2 * table.getBorderWidth();
+				if (preferredSize.y > area.height) {
+					// Subtract the scrollbar width from the total column
+					// width
+					// if a vertical scrollbar will be required
+					Point vBarSize = table.getVerticalBar().getSize();
+					width -= vBarSize.x;
+				}
+
+				Point oldSize = table.getSize();
+				if (oldSize.x > width) {
+					// table is getting smaller so make the columns
+					// smaller first and then resize the table to
+					// match the client area width
+					column1.setWidth(width / 2);
+					column2.setWidth(width / 2);
+					table.setSize(width, area.height);
+				}
+				else {
+					// table is getting bigger so make the table
+					// bigger first and then make the columns wider
+					// to match the client area width
+					table.setSize(width, area.height);
+					column1.setWidth(width / 2);
+					column2.setWidth(width / 2);
+				}
+			}
+		});
+	}
+
+	public void createControl(Composite ancestor) {
+		Composite parent = new Composite(ancestor, SWT.NONE);
+		GridLayout layout = new GridLayout();
+		layout.numColumns = 2;
+		parent.setLayout(layout);
+
+		// create checkbox for user to use JSP Template
+		fUseTemplateButton = new Button(parent, SWT.CHECK);
+		fUseTemplateButton.setText(JSPUIMessages.NewJSPTemplatesWizardPage_4);
+		GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
+		fUseTemplateButton.setLayoutData(data);
+		fUseTemplateButton.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				enableTemplates();
+			}
+		});
+
+		// create composite for Templates table
+		Composite innerParent = new Composite(parent, SWT.NONE);
+		GridLayout innerLayout = new GridLayout();
+		innerLayout.numColumns = 2;
+		innerLayout.marginHeight = 0;
+		innerLayout.marginWidth = 0;
+		innerParent.setLayout(innerLayout);
+		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
+		innerParent.setLayoutData(gd);
+
+		Label label = new Label(innerParent, SWT.NONE);
+		label.setText(JSPUIMessages.NewJSPTemplatesWizardPage_7);
+		data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
+		label.setLayoutData(data);
+
+		// create table that displays templates
+		Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
+
+		data = new GridData(GridData.FILL_BOTH);
+		data.widthHint = convertWidthInCharsToPixels(2);
+		data.heightHint = convertHeightInCharsToPixels(10);
+		data.horizontalSpan = 2;
+		table.setLayoutData(data);
+		table.setHeaderVisible(true);
+		table.setLinesVisible(true);
+		TableLayout tableLayout = new TableLayout();
+		table.setLayout(tableLayout);
+
+		TableColumn column1 = new TableColumn(table, SWT.NONE);
+		column1.setText(JSPUIMessages.NewJSPTemplatesWizardPage_2);
+
+		TableColumn column2 = new TableColumn(table, SWT.NONE);
+		column2.setText(JSPUIMessages.NewJSPTemplatesWizardPage_3);
+
+		fTableViewer = new TableViewer(table);
+		fTableViewer.setLabelProvider(new TemplateLabelProvider());
+		fTableViewer.setContentProvider(new TemplateContentProvider());
+
+		fTableViewer.setSorter(new ViewerSorter() {
+			public int compare(Viewer viewer, Object object1, Object object2) {
+				if ((object1 instanceof Template) && (object2 instanceof Template)) {
+					Template left = (Template) object1;
+					Template right = (Template) object2;
+					int result = left.getName().compareToIgnoreCase(right.getName());
+					if (result != 0)
+						return result;
+					return left.getDescription().compareToIgnoreCase(right.getDescription());
+				}
+				return super.compare(viewer, object1, object2);
+			}
+
+			public boolean isSorterProperty(Object element, String property) {
+				return true;
+			}
+		});
+
+		fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+			public void selectionChanged(SelectionChangedEvent e) {
+				updateViewerInput();
+			}
+		});
+
+		// create viewer that displays currently selected template's contents
+		fPatternViewer = doCreateViewer(parent);
+
+		fTemplateStore = JSPUIPlugin.getDefault().getTemplateStore();
+		fTableViewer.setInput(fTemplateStore);
+
+		// Create linked text to just to templates preference page
+		Link link = new Link(parent, SWT.NONE);
+		link.setText(JSPUIMessages.NewJSPTemplatesWizardPage_6);
+		data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
+		link.setLayoutData(data);
+		link.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				linkClicked();
+			}
+		});
+
+
+		configureTableResizing(innerParent, table, column1, column2);
+		loadLastSavedPreferences();
+
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.JSP_NEWWIZARD_TEMPLATE_HELPID);
+		Dialog.applyDialogFont(parent);
+		setControl(parent);
+	}
+
+	/**
+	 * Creates, configures and returns a source viewer to present the template
+	 * pattern on the preference page. Clients may override to provide a
+	 * custom source viewer featuring e.g. syntax coloring.
+	 * 
+	 * @param parent
+	 *            the parent control
+	 * @return a configured source viewer
+	 */
+	private SourceViewer createViewer(Composite parent) {
+		SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
+			StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationJSP();
+
+			public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+				return baseConfiguration.getConfiguredContentTypes(sourceViewer);
+			}
+
+			public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
+				return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
+			}
+		};
+		SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForJSP.ContentTypeID_JSP);
+		IDocument document = scratchModel.getStructuredDocument();
+		viewer.configure(sourceViewerConfiguration);
+		viewer.setDocument(document);
+		return viewer;
+	}
+
+	private SourceViewer doCreateViewer(Composite parent) {
+		Label label = new Label(parent, SWT.NONE);
+		label.setText(JSPUIMessages.NewJSPTemplatesWizardPage_5);
+		GridData data = new GridData();
+		data.horizontalSpan = 2;
+		label.setLayoutData(data);
+
+		SourceViewer viewer = createViewer(parent);
+		viewer.setEditable(false);
+
+		Control control = viewer.getControl();
+		data = new GridData(GridData.FILL_BOTH);
+		data.horizontalSpan = 2;
+		data.heightHint = convertHeightInCharsToPixels(5);
+		// [261274] - source viewer was growing to fit the max line width of the template
+		data.widthHint = convertWidthInCharsToPixels(2);
+		control.setLayoutData(data);
+
+		return viewer;
+	}
+
+	/**
+	 * Enable/disable controls in page based on fUseTemplateButton's current
+	 * state.
+	 */
+	void enableTemplates() {
+		boolean enabled = fUseTemplateButton.getSelection();
+
+		if (!enabled) {
+			// save last selected template
+			Template template = getSelectedTemplate();
+			if (template != null)
+				fLastSelectedTemplateName = template.getName();
+			else
+				fLastSelectedTemplateName = ""; //$NON-NLS-1$
+
+			fTableViewer.setSelection(null);
+		}
+		else {
+			setSelectedTemplate(fLastSelectedTemplateName);
+		}
+
+		fTableViewer.getControl().setEnabled(enabled);
+		fPatternViewer.getControl().setEnabled(enabled);
+	}
+
+	/**
+	 * Return the template preference page id
+	 * 
+	 * @return
+	 */
+	private String getPreferencePageId() {
+		return "org.eclipse.wst.sse.ui.preferences.jsp.templates"; //$NON-NLS-1$
+	}
+
+	/**
+	 * Get the currently selected template.
+	 * 
+	 * @return
+	 */
+	private Template getSelectedTemplate() {
+		Template template = null;
+		IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
+
+		if (selection.size() == 1) {
+			template = (Template) selection.getFirstElement();
+		}
+		return template;
+	}
+
+	/**
+	 * Returns template string to insert.
+	 * 
+	 * @return String to insert or null if none is to be inserted
+	 */
+	String getTemplateString() {
+		String templateString = null;
+
+		Template template = getSelectedTemplate();
+		if (template != null) {
+			TemplateContextType contextType = JSPUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsJSP.NEW);
+			IDocument document = new Document();
+			TemplateContext context = new DocumentTemplateContext(contextType, document, 0, 0);
+			try {
+				TemplateBuffer buffer = context.evaluate(template);
+				templateString = buffer.getString();
+			}
+			catch (Exception e) {
+				Logger.log(Logger.WARNING_DEBUG, "Could not create template for new jsp", e); //$NON-NLS-1$
+			}
+		}
+
+		return templateString;
+	}
+
+	void linkClicked() {
+		String pageId = getPreferencePageId();
+		PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[]{pageId}, null);
+		dialog.open();
+		fTableViewer.refresh();
+	}
+
+	/**
+	 * Load the last template name used in New JSP File wizard.
+	 */
+	private void loadLastSavedPreferences() {
+		fLastSelectedTemplateName = ""; //$NON-NLS-1$
+		boolean setSelection = false;
+		String templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
+		if (templateName == null || templateName.length() == 0) {
+			templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_ID);
+			if (templateName != null && templateName.length() > 0) {
+				Template template = fTemplateStore.findTemplateById(templateName);
+				if (template != null) {
+					fLastSelectedTemplateName = template.getName();
+					setSelection = true;
+				}
+			}
+		}
+		else {
+			fLastSelectedTemplateName = templateName;
+			setSelection = true;
+		}
+		fUseTemplateButton.setSelection(setSelection);
+		enableTemplates();
+	}
+
+	/**
+	 * Save template name used for next call to New JSP File wizard.
+	 */
+	void saveLastSavedPreferences() {
+		String templateName = ""; //$NON-NLS-1$
+
+		Template template = getSelectedTemplate();
+		if (template != null) {
+			templateName = template.getName();
+		}
+
+		JSPUIPlugin.getDefault().getPreferenceStore().setValue(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
+		JSPUIPlugin.getDefault().savePluginPreferences();
+	}
+
+	/**
+	 * Select a template in the table viewer given the template name. If
+	 * template name cannot be found or templateName is null, just select
+	 * first item in table. If no items in table select nothing.
+	 * 
+	 * @param templateName
+	 */
+	private void setSelectedTemplate(String templateName) {
+		Object template = null;
+
+		if (templateName != null && templateName.length() > 0) {
+			// pick the last used template
+			template = fTemplateStore.findTemplate(templateName, TemplateContextTypeIdsJSP.NEW);
+		}
+
+		// no record of last used template so just pick first element
+		if (template == null) {
+			// just pick first element
+			template = fTableViewer.getElementAt(0);
+		}
+
+		if (template != null) {
+			IStructuredSelection selection = new StructuredSelection(template);
+			fTableViewer.setSelection(selection, true);
+		}
+	}
+
+	/**
+	 * Updates the pattern viewer.
+	 */
+	void updateViewerInput() {
+		Template template = getSelectedTemplate();
+		if (template != null) {
+			fPatternViewer.getDocument().set(template.getPattern());
+		}
+		else {
+			fPatternViewer.getDocument().set(""); //$NON-NLS-1$
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java
new file mode 100644
index 0000000..f4a929a
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.wizard;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStreamWriter;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+
+public class NewJSPWizard extends Wizard implements INewWizard {
+	private NewJSPFileWizardPage fNewFilePage;
+	private NewJSPTemplatesWizardPage fNewFileTemplatesPage;
+	private IStructuredSelection fSelection;
+	private Display fDisplay;
+
+	private boolean fShouldOpenEditorOnFinish = true;
+	
+	public void createPageControls(Composite pageContainer) {
+		fDisplay = pageContainer.getDisplay();
+		super.createPageControls(pageContainer);
+	}
+
+	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=248424
+	public void setOpenEditorOnFinish(boolean openEditor) {
+		this.fShouldOpenEditorOnFinish = openEditor;
+	}
+	
+	public void addPages() {
+		fNewFilePage = new NewJSPFileWizardPage("JSPWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))); //$NON-NLS-1$ 
+		fNewFilePage.setTitle(JSPUIMessages._UI_WIZARD_NEW_HEADING);
+		fNewFilePage.setDescription(JSPUIMessages._UI_WIZARD_NEW_DESCRIPTION);
+		addPage(fNewFilePage);
+
+		fNewFileTemplatesPage = new NewJSPTemplatesWizardPage();
+		addPage(fNewFileTemplatesPage);
+	}
+
+	private String applyLineDelimiter(IFile file, String text) {
+		String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, System.getProperty("line.separator"), new IScopeContext[] {new ProjectScope(file.getProject()), new InstanceScope() });//$NON-NLS-1$
+		String convertedText = StringUtils.replace(text, "\r\n", "\n");
+		convertedText = StringUtils.replace(convertedText, "\r", "\n");
+		convertedText = StringUtils.replace(convertedText, "\n", lineDelimiter);
+		return convertedText;
+	}
+
+	public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
+		fSelection = aSelection;
+		setWindowTitle(JSPUIMessages._UI_WIZARD_NEW_TITLE);
+
+		ImageDescriptor descriptor = JSPEditorPluginImageHelper.getInstance().getImageDescriptor(JSPEditorPluginImages.IMG_OBJ_WIZBAN_NEWJSPFILE);
+		setDefaultPageImageDescriptor(descriptor);
+	}
+
+	private void openEditor(final IFile file) {
+		if (file != null) {
+			fDisplay.asyncExec(new Runnable() {
+				public void run() {
+					if (!PlatformUI.isWorkbenchRunning())
+						return;
+					try {
+						IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+						IDE.openEditor(page, file, true);
+					}
+					catch (PartInitException e) {
+						Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+					}
+				}
+			});
+		}
+	}
+
+	public boolean performFinish() {
+		boolean performedOK = false;
+
+		// save user options for next use
+		fNewFileTemplatesPage.saveLastSavedPreferences();
+
+		// no file extension specified so add default extension
+		String fileName = fNewFilePage.getFileName();
+		if (fileName.lastIndexOf('.') == -1) {
+			String newFileName = fNewFilePage.addDefaultExtension(fileName);
+			fNewFilePage.setFileName(newFileName);
+		}
+
+		// create a new empty file
+		IFile file = fNewFilePage.createNewFile();
+
+		// if there was problem with creating file, it will be null, so make
+		// sure to check
+		if (file != null) {
+			// put template contents into file
+			String templateString = fNewFileTemplatesPage.getTemplateString();
+			if (templateString != null) {
+				templateString = applyLineDelimiter(file, templateString);
+				// determine the encoding for the new file
+				Preferences preference = JSPCorePlugin.getDefault().getPluginPreferences();
+				String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
+
+				try {
+					ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+					OutputStreamWriter outputStreamWriter = null;
+					if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
+						// just use default encoding
+						outputStreamWriter = new OutputStreamWriter(outputStream);
+					}
+					else {
+						outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
+					}
+					outputStreamWriter.write(templateString);
+					outputStreamWriter.flush();
+					outputStreamWriter.close();
+					ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
+					file.setContents(inputStream, true, false, null);
+					inputStream.close();
+				}
+				catch (Exception e) {
+					Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new JSP file", e); //$NON-NLS-1$
+				}
+			}
+
+			// open the file in editor
+			if (fShouldOpenEditorOnFinish)
+				openEditor(file);
+
+			// everything's fine
+			performedOK = true;
+		}
+		return performedOK;
+	}
+
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagFileWizardPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagFileWizardPage.java
new file mode 100644
index 0000000..d0bcb46
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagFileWizardPage.java
@@ -0,0 +1,256 @@
+/*******************************************************************************
+ * Copyright (c) 2006 ,2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.wizard;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+class NewTagFileWizardPage extends WizardNewFileCreationPage {
+
+	private IContentType fContentType;
+	private List fValidExtensions = null;
+
+	public NewTagFileWizardPage(String pageName, IStructuredSelection selection) {
+		super(pageName, selection);
+	}
+
+	/**
+	 * This method is overriden to set the selected folder to web contents
+	 * folder if the current selection is outside the web contents folder.
+	 */
+	protected void initialPopulateContainerNameField() {
+		super.initialPopulateContainerNameField();
+
+		IPath fullPath = getContainerFullPath();
+		IProject project = getProjectFromPath(fullPath);
+		IPath webContentPath = getWebContentPath(project);
+
+		if (webContentPath != null && !webContentPath.isPrefixOf(fullPath)) {
+			setContainerFullPath(webContentPath);
+		}
+	}
+
+	/**
+	 * This method is overriden to set additional validation specific to jsp
+	 * files.
+	 */
+	protected boolean validatePage() {
+		setMessage(null);
+		setErrorMessage(null);
+
+		if (!super.validatePage()) {
+			return false;
+		}
+
+		String fileName = getFileName();
+		IPath fullPath = getContainerFullPath();
+		if ((fullPath != null) && (fullPath.isEmpty() == false) && (fileName != null)) {
+			// check that filename does not contain invalid extension
+			if (!extensionValidForContentType(fileName)) {
+				setErrorMessage(NLS.bind(JSPUIMessages._ERROR_FILENAME_MUST_END_JSP, getValidExtensions().toString()));
+				return false;
+			}
+			// no file extension specified so check adding default
+			// extension doesn't equal a file that already exists
+			if (fileName.lastIndexOf('.') == -1) {
+				String newFileName = addDefaultExtension(fileName);
+				IPath resourcePath = fullPath.append(newFileName);
+
+				IWorkspace workspace = ResourcesPlugin.getWorkspace();
+				IStatus result = workspace.validatePath(resourcePath.toString(), IResource.FOLDER);
+				if (!result.isOK()) {
+					// path invalid
+					setErrorMessage(result.getMessage());
+					return false;
+				}
+
+				if ((workspace.getRoot().getFolder(resourcePath).exists() || workspace.getRoot().getFile(resourcePath).exists())) {
+					setErrorMessage(JSPUIMessages.ResourceGroup_nameExists);
+					return false;
+				}
+			}
+
+			// get the IProject for the selection path
+			IProject project = getProjectFromPath(fullPath);
+			if (project != null) {
+				if (!isJavaProject(project)) {
+					setMessage(JSPUIMessages._WARNING_FILE_MUST_BE_INSIDE_JAVA_PROJECT, WARNING);
+				}
+				// if inside web project, check if inside webContent folder
+				/*
+				if (isDynamicWebProject(project)) {
+					// check that the path is inside the webContent folder
+					IPath webContentPath = getWebContentPath(project).append("/WEB-INF/tags");
+					if (!webContentPath.isPrefixOf(fullPath)) {
+						setMessage(JSPUIMessages._WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT, WARNING);
+					}
+				}
+				*/
+			}
+		}
+
+		return true;
+	}
+
+	/**
+	 * Adds default extension to the filename
+	 * 
+	 * @param filename
+	 * @return
+	 */
+	String addDefaultExtension(String filename) {
+		StringBuffer newFileName = new StringBuffer(filename);
+
+//		Preferences preference = JSPCorePlugin.getDefault().getPluginPreferences();
+		String ext = "tag";//preference.getString(JSPCorePreferenceNames.DEFAULT_EXTENSION);
+
+		newFileName.append("."); //$NON-NLS-1$
+		newFileName.append(ext);
+
+		return newFileName.toString();
+	}
+
+	/**
+	 * Get content type associated with this new file wizard
+	 * 
+	 * @return IContentType
+	 */
+	private IContentType getContentType() {
+		if (fContentType == null)
+			fContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPTAG);
+		return fContentType;
+	}
+
+	/**
+	 * Get list of valid extensions for JSP Content type
+	 * 
+	 * @return
+	 */
+	private List getValidExtensions() {
+		if (fValidExtensions == null) {
+			IContentType type = getContentType();
+			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
+		}
+		return fValidExtensions;
+	}
+
+	/**
+	 * Verifies if fileName is valid name for content type. Takes base content
+	 * type into consideration.
+	 * 
+	 * @param fileName
+	 * @return true if extension is valid for this content type
+	 */
+	private boolean extensionValidForContentType(String fileName) {
+		boolean valid = false;
+
+		IContentType type = getContentType();
+		// there is currently an extension
+		if (fileName.lastIndexOf('.') != -1) {
+			// check what content types are associated with current extension
+			IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
+			int i = 0;
+			while (i < types.length && !valid) {
+				valid = types[i].isKindOf(type);
+				++i;
+			}
+		}
+		else
+			valid = true; // no extension so valid
+		return valid;
+	}
+
+	/**
+	 * Returns the project that contains the specified path
+	 * 
+	 * @param path
+	 *            the path which project is needed
+	 * @return IProject object. If path is <code>null</code> the return
+	 *         value is also <code>null</code>.
+	 */
+	private IProject getProjectFromPath(IPath path) {
+		IWorkspace workspace = ResourcesPlugin.getWorkspace();
+		IProject project = null;
+
+		if (path != null) {
+			if (workspace.validatePath(path.toString(), IResource.PROJECT).isOK()) {
+				project = workspace.getRoot().getProject(path.toString());
+			}
+			else {
+				project = workspace.getRoot().getFile(path).getProject();
+			}
+		}
+
+		return project;
+	}
+
+	/**
+	 * Checks if the specified project is a web project.
+	 * 
+	 * @param project
+	 *            project to be checked
+	 * @return true if the project is web project, otherwise false
+	 */
+	boolean isDynamicWebProject(IProject project) {
+		boolean is = FacetModuleCoreSupport.isDynamicWebProject(project);
+		return is;
+	}
+
+	/**
+	 * Checks if the specified project is a type of java project.
+	 * 
+	 * @param project
+	 *            project to be checked (cannot be null)
+	 * @return true if the project is a type of java project, otherwise false
+	 */
+	private boolean isJavaProject(IProject project) {
+		boolean isJava = false;
+		try {
+			isJava = project.hasNature(JavaCore.NATURE_ID);
+		}
+		catch (CoreException e) {
+			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+		}
+
+		return isJava;
+	}
+
+	/**
+	 * Returns the web contents folder of the specified project
+	 * 
+	 * @param project
+	 *            the project which web contents path is needed
+	 * @return IPath of the web contents folder
+	 */
+	private IPath getWebContentPath(IProject project) {
+		IPath path = FacetModuleCoreSupport.getWebContentRootPath(project);
+		return path;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagTemplatesWizardPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagTemplatesWizardPage.java
new file mode 100644
index 0000000..f5d01c8
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagTemplatesWizardPage.java
@@ -0,0 +1,521 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.wizard;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.jface.text.templates.DocumentTemplateContext;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateBuffer;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
+import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
+import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+
+/**
+ * Templates page in new file wizard. Allows users to select a new file
+ * template to be applied in new file.
+ * 
+ */
+public class NewTagTemplatesWizardPage extends WizardPage {
+
+	/**
+	 * Content provider for templates
+	 */
+	private class TemplateContentProvider implements IStructuredContentProvider {
+		/** The template store. */
+		private TemplateStore fStore;
+
+		/*
+		 * @see IContentProvider#dispose()
+		 */
+		public void dispose() {
+			fStore = null;
+		}
+
+		/*
+		 * @see IStructuredContentProvider#getElements(Object)
+		 */
+		public Object[] getElements(Object input) {
+			return fStore.getTemplates(TemplateContextTypeIdsJSP.NEW_TAG);
+		}
+
+		/*
+		 * @see IContentProvider#inputChanged(Viewer, Object, Object)
+		 */
+		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+			fStore = (TemplateStore) newInput;
+		}
+	}
+
+	/**
+	 * Label provider for templates.
+	 */
+	private class TemplateLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+		/*
+		 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object,
+		 *      int)
+		 */
+		public Image getColumnImage(Object element, int columnIndex) {
+			return null;
+		}
+
+		/*
+		 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
+		 *      int)
+		 */
+		public String getColumnText(Object element, int columnIndex) {
+			Template template = (Template) element;
+
+			switch (columnIndex) {
+				case 0 :
+					return template.getName();
+				case 1 :
+					return template.getDescription();
+				default :
+					return ""; //$NON-NLS-1$
+			}
+		}
+	}
+
+	/** Last selected template name */
+	private String fLastSelectedTemplateName;
+	/** The viewer displays the pattern of selected template. */
+	private SourceViewer fPatternViewer;
+	/** The table presenting the templates. */
+	private TableViewer fTableViewer;
+	/** Template store used by this wizard page */
+	private TemplateStore fTemplateStore;
+	/** Checkbox for using templates. */
+	private Button fUseTemplateButton;
+
+	public NewTagTemplatesWizardPage() {
+		super("NewJSPTemplatesWizardPage", JSPUIMessages.NewTagTemplatesWizardPage_0, null); //$NON-NLS-1$
+		setDescription(JSPUIMessages.NewTagTemplatesWizardPage_1);
+	}
+
+	/**
+	 * Correctly resizes the table so no phantom columns appear
+	 * 
+	 * @param parent
+	 *            the parent control
+	 * @param buttons
+	 *            the buttons
+	 * @param table
+	 *            the table
+	 * @param column1
+	 *            the first column
+	 * @param column2
+	 *            the second column
+	 * @param column3
+	 *            the third column
+	 */
+	private void configureTableResizing(final Composite parent, final Table table, final TableColumn column1, final TableColumn column2) {
+		parent.addControlListener(new ControlAdapter() {
+			public void controlResized(ControlEvent e) {
+				Rectangle area = parent.getClientArea();
+				Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+				int width = area.width - 2 * table.getBorderWidth();
+				if (preferredSize.y > area.height) {
+					// Subtract the scrollbar width from the total column
+					// width
+					// if a vertical scrollbar will be required
+					Point vBarSize = table.getVerticalBar().getSize();
+					width -= vBarSize.x;
+				}
+
+				Point oldSize = table.getSize();
+				if (oldSize.x > width) {
+					// table is getting smaller so make the columns
+					// smaller first and then resize the table to
+					// match the client area width
+					column1.setWidth(width / 2);
+					column2.setWidth(width / 2);
+					table.setSize(width, area.height);
+				}
+				else {
+					// table is getting bigger so make the table
+					// bigger first and then make the columns wider
+					// to match the client area width
+					table.setSize(width, area.height);
+					column1.setWidth(width / 2);
+					column2.setWidth(width / 2);
+				}
+			}
+		});
+	}
+
+	public void createControl(Composite ancestor) {
+		Composite parent = new Composite(ancestor, SWT.NONE);
+		GridLayout layout = new GridLayout();
+		layout.numColumns = 2;
+		parent.setLayout(layout);
+
+		// create checkbox for user to use JSP Template
+		fUseTemplateButton = new Button(parent, SWT.CHECK);
+		fUseTemplateButton.setText(JSPUIMessages.NewTagTemplatesWizardPage_4);
+		GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
+		fUseTemplateButton.setLayoutData(data);
+		fUseTemplateButton.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				enableTemplates();
+			}
+		});
+
+		// create composite for Templates table
+		Composite innerParent = new Composite(parent, SWT.NONE);
+		GridLayout innerLayout = new GridLayout();
+		innerLayout.numColumns = 2;
+		innerLayout.marginHeight = 0;
+		innerLayout.marginWidth = 0;
+		innerParent.setLayout(innerLayout);
+		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
+		innerParent.setLayoutData(gd);
+
+		Label label = new Label(innerParent, SWT.NONE);
+		label.setText(JSPUIMessages.NewTagTemplatesWizardPage_7);
+		data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
+		label.setLayoutData(data);
+
+		// create table that displays templates
+		Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
+
+		data = new GridData(GridData.FILL_BOTH);
+		data.widthHint = convertWidthInCharsToPixels(2);
+		data.heightHint = convertHeightInCharsToPixels(10);
+		data.horizontalSpan = 2;
+		table.setLayoutData(data);
+		table.setHeaderVisible(true);
+		table.setLinesVisible(true);
+		TableLayout tableLayout = new TableLayout();
+		table.setLayout(tableLayout);
+
+		TableColumn column1 = new TableColumn(table, SWT.NONE);
+		column1.setText(JSPUIMessages.NewTagTemplatesWizardPage_2);
+
+		TableColumn column2 = new TableColumn(table, SWT.NONE);
+		column2.setText(JSPUIMessages.NewTagTemplatesWizardPage_3);
+
+		fTableViewer = new TableViewer(table);
+		fTableViewer.setLabelProvider(new TemplateLabelProvider());
+		fTableViewer.setContentProvider(new TemplateContentProvider());
+
+		fTableViewer.setSorter(new ViewerSorter() {
+			public int compare(Viewer viewer, Object object1, Object object2) {
+				if ((object1 instanceof Template) && (object2 instanceof Template)) {
+					Template left = (Template) object1;
+					Template right = (Template) object2;
+					int result = left.getName().compareToIgnoreCase(right.getName());
+					if (result != 0)
+						return result;
+					return left.getDescription().compareToIgnoreCase(right.getDescription());
+				}
+				return super.compare(viewer, object1, object2);
+			}
+
+			public boolean isSorterProperty(Object element, String property) {
+				return true;
+			}
+		});
+
+		fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+			public void selectionChanged(SelectionChangedEvent e) {
+				updateViewerInput();
+			}
+		});
+
+		// create viewer that displays currently selected template's contents
+		fPatternViewer = doCreateViewer(parent);
+
+		fTemplateStore = JSPUIPlugin.getDefault().getTemplateStore();
+		fTableViewer.setInput(fTemplateStore);
+
+		// Create linked text to just to templates preference page
+		Link link = new Link(parent, SWT.NONE);
+		link.setText(JSPUIMessages.NewTagTemplatesWizardPage_6);
+		data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
+		link.setLayoutData(data);
+		link.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				linkClicked();
+			}
+		});
+
+		configureTableResizing(innerParent, table, column1, column2);
+		loadLastSavedPreferences();
+
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.JSP_NEWWIZARD_TEMPLATE_HELPID);
+		Dialog.applyDialogFont(parent);
+		setControl(parent);
+	}
+
+	/**
+	 * Creates, configures and returns a source viewer to present the template
+	 * pattern on the preference page. Clients may override to provide a
+	 * custom source viewer featuring e.g. syntax coloring.
+	 * 
+	 * @param parent
+	 *            the parent control
+	 * @return a configured source viewer
+	 */
+	private SourceViewer createViewer(Composite parent) {
+		SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
+			StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationJSP();
+
+			public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+				return baseConfiguration.getConfiguredContentTypes(sourceViewer);
+			}
+
+			public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
+				return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
+			}
+		};
+		SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForJSP.ContentTypeID_JSPTAG);
+		IDocument document = scratchModel.getStructuredDocument();
+		viewer.configure(sourceViewerConfiguration);
+		viewer.setDocument(document);
+		return viewer;
+	}
+
+	private SourceViewer doCreateViewer(Composite parent) {
+		Label label = new Label(parent, SWT.NONE);
+		label.setText(JSPUIMessages.NewTagTemplatesWizardPage_5);
+		GridData data = new GridData();
+		data.horizontalSpan = 2;
+		label.setLayoutData(data);
+
+		SourceViewer viewer = createViewer(parent);
+		viewer.setEditable(false);
+
+		Control control = viewer.getControl();
+		data = new GridData(GridData.FILL_BOTH);
+		data.horizontalSpan = 2;
+		data.heightHint = convertHeightInCharsToPixels(5);
+		// [261274] - source viewer was growing to fit the max line width of the template
+		data.widthHint = convertWidthInCharsToPixels(2);
+		control.setLayoutData(data);
+
+		return viewer;
+	}
+
+	/**
+	 * Enable/disable controls in page based on fUseTemplateButton's current
+	 * state.
+	 */
+	void enableTemplates() {
+		boolean enabled = fUseTemplateButton.getSelection();
+
+		if (!enabled) {
+			// save last selected template
+			Template template = getSelectedTemplate();
+			if (template != null)
+				fLastSelectedTemplateName = template.getName();
+			else
+				fLastSelectedTemplateName = ""; //$NON-NLS-1$
+
+			fTableViewer.setSelection(null);
+		}
+		else {
+			setSelectedTemplate(fLastSelectedTemplateName);
+		}
+
+		fTableViewer.getControl().setEnabled(enabled);
+		fPatternViewer.getControl().setEnabled(enabled);
+	}
+
+	/**
+	 * Return the template preference page id
+	 * 
+	 * @return
+	 */
+	private String getPreferencePageId() {
+		return "org.eclipse.wst.sse.ui.preferences.jsp.templates"; //$NON-NLS-1$
+	}
+
+	/**
+	 * Get the currently selected template.
+	 * 
+	 * @return
+	 */
+	private Template getSelectedTemplate() {
+		Template template = null;
+		IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
+
+		if (selection.size() == 1) {
+			template = (Template) selection.getFirstElement();
+		}
+		return template;
+	}
+
+	/**
+	 * Returns template string to insert.
+	 * 
+	 * @return String to insert or null if none is to be inserted
+	 */
+	String getTemplateString() {
+		String templateString = null;
+
+		Template template = getSelectedTemplate();
+		if (template != null) {
+			TemplateContextType contextType = JSPUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsJSP.NEW_TAG);
+			IDocument document = new Document();
+			TemplateContext context = new DocumentTemplateContext(contextType, document, 0, 0);
+			try {
+				TemplateBuffer buffer = context.evaluate(template);
+				templateString = buffer.getString();
+			}
+			catch (Exception e) {
+				Logger.log(Logger.WARNING_DEBUG, "Could not create template for new jsp tag", e); //$NON-NLS-1$
+			}
+		}
+
+		return templateString;
+	}
+
+	void linkClicked() {
+		String pageId = getPreferencePageId();
+		PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[]{pageId}, null);
+		dialog.open();
+		fTableViewer.refresh();
+	}
+
+	/**
+	 * Load the last template name used in New JSP File wizard.
+	 */
+	private void loadLastSavedPreferences() {
+		fLastSelectedTemplateName = ""; //$NON-NLS-1$
+		boolean setSelection = false;
+		String templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_TAG_FILE_TEMPLATE_NAME);
+		if (templateName == null || templateName.length() == 0) {
+			templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_TAG_FILE_TEMPLATE_ID);
+			if (templateName != null && templateName.length() > 0) {
+				Template template = fTemplateStore.findTemplateById(templateName);
+				if (template != null) {
+					fLastSelectedTemplateName = template.getName();
+					setSelection = true;
+				}
+			}
+		}
+		else {
+			fLastSelectedTemplateName = templateName;
+			setSelection = true;
+		}
+		fUseTemplateButton.setSelection(setSelection);
+		enableTemplates();
+	}
+
+	/**
+	 * Save template name used for next call to New JSP File wizard.
+	 */
+	void saveLastSavedPreferences() {
+		String templateName = ""; //$NON-NLS-1$
+
+		Template template = getSelectedTemplate();
+		if (template != null) {
+			templateName = template.getName();
+		}
+
+		JSPUIPlugin.getDefault().getPreferenceStore().setValue(JSPUIPreferenceNames.NEW_TAG_FILE_TEMPLATE_NAME, templateName);
+		JSPUIPlugin.getDefault().savePluginPreferences();
+	}
+
+	/**
+	 * Select a template in the table viewer given the template name. If
+	 * template name cannot be found or templateName is null, just select
+	 * first item in table. If no items in table select nothing.
+	 * 
+	 * @param templateName
+	 */
+	private void setSelectedTemplate(String templateName) {
+		Object template = null;
+
+		if (templateName != null && templateName.length() > 0) {
+			// pick the last used template
+			template = fTemplateStore.findTemplate(templateName, TemplateContextTypeIdsJSP.NEW_TAG);
+		}
+
+		// no record of last used template so just pick first element
+		if (template == null) {
+			// just pick first element
+			template = fTableViewer.getElementAt(0);
+		}
+
+		if (template != null) {
+			IStructuredSelection selection = new StructuredSelection(template);
+			fTableViewer.setSelection(selection, true);
+		}
+	}
+
+	/**
+	 * Updates the pattern viewer.
+	 */
+	void updateViewerInput() {
+		Template template = getSelectedTemplate();
+		if (template != null) {
+			fPatternViewer.getDocument().set(template.getPattern());
+		}
+		else {
+			fPatternViewer.getDocument().set(""); //$NON-NLS-1$
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagWizard.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagWizard.java
new file mode 100644
index 0000000..382714c
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagWizard.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.wizard;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStreamWriter;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+
+public class NewTagWizard extends Wizard implements INewWizard {
+	private NewTagFileWizardPage fNewFilePage;
+	private NewTagTemplatesWizardPage fNewFileTemplatesPage;
+	private IStructuredSelection fSelection;
+
+	public void addPages() {
+		fNewFilePage = new NewTagFileWizardPage("TagWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))); //$NON-NLS-1$ 
+		fNewFilePage.setTitle(JSPUIMessages._UI_WIZARD_TAG_NEW_HEADING);
+		fNewFilePage.setDescription(JSPUIMessages._UI_WIZARD_TAG_NEW_DESCRIPTION);
+		addPage(fNewFilePage);
+
+		fNewFileTemplatesPage = new NewTagTemplatesWizardPage();
+		addPage(fNewFileTemplatesPage);
+	}
+
+	private String applyLineDelimiter(IFile file, String text) {
+		String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, System.getProperty("line.separator"), new IScopeContext[] {new ProjectScope(file.getProject()), new InstanceScope() });//$NON-NLS-1$
+		String convertedText = StringUtils.replace(text, "\r\n", "\n");
+		convertedText = StringUtils.replace(convertedText, "\r", "\n");
+		convertedText = StringUtils.replace(convertedText, "\n", lineDelimiter);
+		return convertedText;
+	}
+
+	public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
+		fSelection = aSelection;
+		setWindowTitle(JSPUIMessages._UI_WIZARD_TAG_NEW_TITLE);
+
+		ImageDescriptor descriptor = JSPEditorPluginImageHelper.getInstance().getImageDescriptor(JSPEditorPluginImages.IMG_OBJ_WIZBAN_NEWTAGFILE);
+		setDefaultPageImageDescriptor(descriptor);
+	}
+
+	private void openEditor(final IFile file) {
+		if (file != null) {
+			getShell().getDisplay().asyncExec(new Runnable() {
+				public void run() {
+					try {
+						IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+						IDE.openEditor(page, file, true);
+					}
+					catch (PartInitException e) {
+						Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+					}
+				}
+			});
+		}
+	}
+
+	public boolean performFinish() {
+		boolean performedOK = false;
+
+		// save user options for next use
+		fNewFileTemplatesPage.saveLastSavedPreferences();
+
+		// no file extension specified so add default extension
+		String fileName = fNewFilePage.getFileName();
+		if (fileName.lastIndexOf('.') == -1) {
+			String newFileName = fNewFilePage.addDefaultExtension(fileName);
+			fNewFilePage.setFileName(newFileName);
+		}
+
+		// create a new empty file
+		IFile file = fNewFilePage.createNewFile();
+
+		// if there was problem with creating file, it will be null, so make
+		// sure to check
+		if (file != null) {
+			// put template contents into file
+			String templateString = fNewFileTemplatesPage.getTemplateString();
+			if (templateString != null) {
+				templateString = applyLineDelimiter(file, templateString);
+				// determine the encoding for the new file
+				Preferences preference = JSPCorePlugin.getDefault().getPluginPreferences();
+				String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
+
+				try {
+					ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+					OutputStreamWriter outputStreamWriter = null;
+					if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
+						// just use default encoding
+						outputStreamWriter = new OutputStreamWriter(outputStream);
+					}
+					else {
+						outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
+					}
+					outputStreamWriter.write(templateString);
+					outputStreamWriter.flush();
+					outputStreamWriter.close();
+					ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
+					file.setContents(inputStream, true, false, null);
+					inputStream.close();
+				}
+				catch (Exception e) {
+					Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new Tag file", e); //$NON-NLS-1$
+				}
+			}
+
+			// open the file in editor
+			openEditor(file);
+
+			// everything's fine
+			performedOK = true;
+		}
+		return performedOK;
+	}
+
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPContentOutlineConfiguration.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPContentOutlineConfiguration.java
new file mode 100644
index 0000000..aaee92b
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPContentOutlineConfiguration.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.views.contentoutline;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.actions.JSPNodeActionManager;
+import org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
+
+/**
+ * Configuration for outline view page which shows JSP content.
+ * 
+ * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
+ * @since 1.0
+ */
+public class JSPContentOutlineConfiguration extends HTMLContentOutlineConfiguration {
+
+	// private static final String ATT_CLASS = "class"; //$NON-NLS-1$
+
+	// TODO: Automate the loading of a real configuration based on the model
+	// type at
+	// creation time; clear on unConfigure so that a new embedded
+	// configuration can
+	// be used
+	// private StructuredContentOutlineConfiguration fEmbeddedConfiguration =
+	// null;
+
+	/**
+	 * Create new instance of JSPContentOutlineConfiguration
+	 */
+	public JSPContentOutlineConfiguration() {
+		// Must have empty constructor to createExecutableExtension
+		super();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getPreferenceStore()
+	 */
+	protected IPreferenceStore getPreferenceStore() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+	
+	protected XMLNodeActionManager createNodeActionManager(TreeViewer treeViewer) {
+		return new JSPNodeActionManager((IStructuredModel) treeViewer.getInput(), treeViewer);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties b/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties
new file mode 100644
index 0000000..c629a8b
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties
@@ -0,0 +1,60 @@
+###############################################################################
+# Copyright (c) 2004, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+Templates.jspscriptlet.name=JSP scriptlet
+Templates.jspscriptlet.desc=JSP scriptlet <%..%>
+Templates.jspscriptlet.content=<% ${cursor} %>
+Templates.jsphiddencomment.name=JSP hidden comment
+Templates.jsphiddencomment.desc=JSP hidden comment <%-- --%>
+Templates.jsphiddencomment.content=<%-- ${cursor} --%>
+Templates.jspdeclaration.name=JSP declaration(s)
+Templates.jspdeclaration.desc=JSP declaration(s) <%!..%>
+Templates.jspdeclaration.content=<%! ${cursor} %>
+Templates.jspexpression.name=JSP expression
+Templates.jspexpression.desc=JSP expression <%=..%>
+Templates.jspexpression.content=<%= ${cursor} %>
+Templates.jspincludedirective.name=JSP include directive
+Templates.jspincludedirective.desc=JSP include directive
+Templates.jspincludedirective.content=<%@ include file="${cursor}" %>
+Templates.jsppagedirective.name=JSP page directive
+Templates.jsppagedirective.desc=JSP page directive
+Templates.jsppagedirective.content=<%@ page contentType="text/html; charset=${encoding}" %>
+Templates.jsptaglibdirective.name=JSP taglib directive
+Templates.jsptaglibdirective.desc=JSP taglib directive
+Templates.jsptaglibdirective.content=<%@ taglib uri="${cursor}" prefix="" %>
+Templates.jsphtml.name=New JSP File (html)
+Templates.jsphtml.desc=JSP with html markup
+Templates.jsphtml.content=<%@ page language="java" contentType="text/html; charset=${encoding}"\n    pageEncoding="${encoding}"%>\n<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}">\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
+Templates.jspxhtml.name=New JSP File (xhtml)
+Templates.jspxhtml.desc=JSP with xhtml markup
+Templates.jspxhtml.content=<?xml version="1.0" encoding="${encoding}" ?>\n<%@ page language="java" contentType="text/html; charset=${encoding}"\n    pageEncoding="${encoding}"%>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}" />\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
+Templates.jspxhtmlxml.name=New JSP File (xhtml, xml syntax)
+Templates.jspxhtmlxml.desc=JSP with xhtml markup and xml style syntax
+Templates.jspxhtmlxml.content=<?xml version="1.0" encoding="${encoding}" ?>\n<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">\n    <jsp:directive.page language="java"\n        contentType="text/html; charset=${encoding}" pageEncoding="${encoding}" />\n    <jsp:text>\n        <![CDATA[ <?xml version="1.0" encoding="${encoding}" ?> ]]>\n    </jsp:text>\n    <jsp:text>\n        <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ]]>\n    </jsp:text>\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}" />\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>\n</jsp:root>
+
+Templates.jsptagdirective.name=Tag file tag directive
+Templates.jsptagdirective.desc=Tag file tag directive
+Templates.jsptagdirective.content=<%@ tag display-name="${cursor}" description="" small-icon="" %>
+
+Templates.jspvariabledirective.name=Tag variable directive
+Templates.jspvariabledirective.desc=Tag variable directive
+Templates.jspvariabledirective.content=<%@ variable variable-class="${cursor}" description="" %>
+
+Templates.jspattributedirective.name=Tag attribute directive
+Templates.jspattributedirective.desc=Tag attribute directive
+Templates.jspattributedirective.content=<%@ attribute name="${cursor}" description="" required="false" type="" %>
+
+Templates.simpletag.name=New Tag File
+Templates.simpletag.desc=New JSP Tag File
+Templates.simpletag.content=<%@ tag language="java" pageEncoding="${encoding}"%>\n
+
+Templates.simpletagx.name=New TagX File
+Templates.simpletagx.desc=New JSP TagX File
+Templates.simpletagx.content=<jsp:directive.tag language="java" pageEncoding="${encoding}"/>\n
diff --git a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml b/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml
new file mode 100644
index 0000000..d318d24
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+ -->
+<templates>
+
+<template name="%Templates.jspscriptlet.name" description="%Templates.jspscriptlet.desc" id="org.eclipse.jst.jsp.ui.templates.jspscriptlet" context="jsp_tag" enabled="true">%Templates.jspscriptlet.content</template>
+
+<template name="%Templates.jsphiddencomment.name" description="%Templates.jsphiddencomment.desc" id="org.eclipse.jst.jsp.ui.templates.jsphiddencomment" context="jsp_tag" enabled="true">%Templates.jsphiddencomment.content</template>
+
+<template name="%Templates.jspdeclaration.name" description="%Templates.jspdeclaration.desc" id="org.eclipse.jst.jsp.ui.templates.jspdeclaration" context="jsp_tag" enabled="true">%Templates.jspdeclaration.content</template>
+
+<template name="%Templates.jspexpression.name" description="%Templates.jspexpression.desc" id="org.eclipse.jst.jsp.ui.templates.jspexpression" context="jsp_all" enabled="true">%Templates.jspexpression.content</template>
+
+<template name="%Templates.jspincludedirective.name" description="%Templates.jspincludedirective.desc" id="org.eclipse.jst.jsp.ui.templates.jspincludedirective" context="jsp_tag" enabled="true">%Templates.jspincludedirective.content</template>
+
+<template name="%Templates.jsppagedirective.name" description="%Templates.jsppagedirective.desc" id="org.eclipse.jst.jsp.ui.templates.jsppagedirective" context="jsp_tag" enabled="true">%Templates.jsppagedirective.content</template>
+
+<template name="%Templates.jsptaglibdirective.name" description="%Templates.jsptaglibdirective.desc" id="org.eclipse.jst.jsp.ui.templates.jsptaglibdirective" context="jsp_tag" enabled="true">%Templates.jsptaglibdirective.content</template>
+
+<template name="%Templates.jsphtml.name" description="%Templates.jsphtml.desc" id="org.eclipse.jst.jsp.ui.templates.jsphtml" context="jsp_new" enabled="true">%Templates.jsphtml.content</template>
+
+<template name="%Templates.jspxhtml.name" description="%Templates.jspxhtml.desc" id="org.eclipse.jst.jsp.ui.templates.jspxhtml" context="jsp_new" enabled="true">%Templates.jspxhtml.content</template>
+
+<template name="%Templates.jspxhtmlxml.name" description="%Templates.jspxhtmlxml.desc" id="org.eclipse.jst.jsp.ui.templates.jspxhtmlxml" context="jsp_new" enabled="true">%Templates.jspxhtmlxml.content</template>
+
+<template name="%Templates.jsptagdirective.name" description="%Templates.jsptagdirective.desc" id="org.eclipse.jst.jsp.ui.templates.jsptagdirective" context="jsp_tag" enabled="true">%Templates.jsptagdirective.content</template>
+
+<template name="%Templates.jspvariabledirective.name" description="%Templates.jspvariabledirective.desc" id="org.eclipse.jst.jsp.ui.templates.jspvariabledirective" context="jsp_tag" enabled="true">%Templates.jspvariabledirective.content</template>
+
+<template name="%Templates.jspattributedirective.name" description="%Templates.jspattributedirective.desc" id="org.eclipse.jst.jsp.ui.templates.jspattributedirective" context="jsp_tag" enabled="true">%Templates.jspattributedirective.content</template>
+
+<template name="%Templates.simpletag.name" description="%Templates.simpletag.desc" id="org.eclipse.jst.jsp.ui.templates.simpletag" context="tag_new" enabled="true">%Templates.simpletag.content</template>
+
+<template name="%Templates.simpletagx.name" description="%Templates.simpletagx.desc" id="org.eclipse.jst.jsp.ui.templates.simpletagx" context="tag_new" enabled="true">%Templates.simpletagx.content</template>
+
+</templates>
diff --git a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..e44f0b5
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
@@ -0,0 +1,40 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.wst.html.core; singleton:=true
+Bundle-Version: 1.1.402.qualifier
+Bundle-Activator: org.eclipse.wst.html.core.internal.HTMLCorePlugin
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Export-Package: org.eclipse.wst.html.core.internal;x-internal:=true,
+ org.eclipse.wst.html.core.internal.cleanup;x-internal:=true,
+ org.eclipse.wst.html.core.internal.commentelement.handlers;x-internal:=true,
+ org.eclipse.wst.html.core.internal.contentmodel;x-internal:=true,
+ org.eclipse.wst.html.core.internal.contentmodel.chtml;x-internal:=true,
+ org.eclipse.wst.html.core.internal.contentmodel.ssi;x-internal:=true,
+ org.eclipse.wst.html.core.internal.contentproperties;x-internal:=true,
+ org.eclipse.wst.html.core.internal.contenttype;x-internal:=true,
+ org.eclipse.wst.html.core.internal.document;x-internal:=true,
+ org.eclipse.wst.html.core.internal.encoding;x-internal:=true,
+ org.eclipse.wst.html.core.internal.format;x-internal:=true,
+ org.eclipse.wst.html.core.internal.htmlcss;x-internal:=true,
+ org.eclipse.wst.html.core.internal.modelhandler;x-internal:=true,
+ org.eclipse.wst.html.core.internal.modelquery;x-internal:=true,
+ org.eclipse.wst.html.core.internal.preferences;x-internal:=true,
+ org.eclipse.wst.html.core.internal.provisional;x-internal:=true,
+ org.eclipse.wst.html.core.internal.provisional.contenttype;x-internal:=true,
+ org.eclipse.wst.html.core.internal.provisional.text;x-internal:=true,
+ org.eclipse.wst.html.core.internal.text;x-internal:=true,
+ org.eclipse.wst.html.core.internal.validate;x-internal:=true,
+ org.eclipse.wst.html.core.text
+Import-Package: com.ibm.icu.util; version="3.8"
+Require-Bundle: org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.css.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.core.filebuffers;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.common.modulecore;bundle-version="[1.2.0,2.0.0)";resolution:=optional
+Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.html.core.internal.contenttype,org.eclipse.wst.html.core.internal.provisional.contenttype"
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.html.core/build.properties b/bundles/org.eclipse.wst.html.core/build.properties
index 7ea2b7e..5c655fd 100644
--- a/bundles/org.eclipse.wst.html.core/build.properties
+++ b/bundles/org.eclipse.wst.html.core/build.properties
@@ -18,6 +18,5 @@
 bin.excludes = bin/**,\
                @dot/**,\
                temp.folder/**
-src.includes = component.xml,\
-               build.properties
+src.includes = component.xml
 source.. = src/
diff --git a/bundles/org.eclipse.wst.html.core/plugin.properties b/bundles/org.eclipse.wst.html.core/plugin.properties
index 7ba2487..14b6fdc 100644
--- a/bundles/org.eclipse.wst.html.core/plugin.properties
+++ b/bundles/org.eclipse.wst.html.core/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 pluginName=Structured Source HTML Model
 Structured_HTML_Document_Factory_Extension.name=Structured HTML Document Factory Extension
 HTML_Content_Type_Extension_Element.name=HTML
diff --git a/bundles/org.eclipse.wst.html.core/plugin.xml b/bundles/org.eclipse.wst.html.core/plugin.xml
index 0bd5628..6c0bae8 100644
--- a/bundles/org.eclipse.wst.html.core/plugin.xml
+++ b/bundles/org.eclipse.wst.html.core/plugin.xml
@@ -121,7 +121,7 @@
 		</annotationFile>
 	</extension>
 
-	<extension point="org.eclipse.core.runtime.contentTypes">
+	<extension point="org.eclipse.core.contenttype.contentTypes">
 		<content-type
 			file-extensions="html,htm,xhtml,htpl,wml,shtml,shtm"
 			priority="high"
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
index 92f6df1..f2f93b1 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -50,6 +50,9 @@
 	public static String _ERROR_Attribute_value___0___not_closed__1;
 	public static String HTMLContentPropertiesManager_Updating;
 	public static String HTMLContentPropertiesManager_Problems_Updating;
+	public static String _ERROR_Resource_not_found_0;
+	public static String Obsolete_attribute_name___ERROR_;
+	public static String Obsolete_tag___ERROR_;
 
 	static {
 		// load message values from bundle file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
index 7cb04b6..7301451 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2006 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -40,3 +40,6 @@
 #
 HTMLContentPropertiesManager_Updating=Updating Web Content Settings
 HTMLContentPropertiesManager_Problems_Updating=Problem saving Web Content Settings for {0}
+_ERROR_Resource_not_found_0=Resource not found: {0}
+Obsolete_attribute_name___ERROR_=Attribute ({0}) is obsolete. Its use is discouraged in HTML5 documents.
+Obsolete_tag___ERROR_=Element ({0}) is obsolete. Its use is discouraged in HTML5 documents.
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java
index 05675c6..7a2b246 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -37,7 +37,9 @@
 		IStructuredDocument structuredDocument = model.getStructuredDocument();
 		if (structuredDocument == null)
 			return node;
-
+		if ( !getCleanupPreferences().getFormatSource())
+			return node;
+		
 		String content = getCSSContent(node);
 		if (content == null)
 			return node;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
index 11af74b..9f37d31 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     David Carver (Intalion) - Cleanup Repeated Conditional check in isXMLType method
  *******************************************************************************/
 package org.eclipse.wst.html.core.internal.cleanup;
 
@@ -33,6 +34,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
@@ -52,6 +54,7 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 // nakamori_TODO: check and remove CSS formatting
 
@@ -105,10 +108,12 @@
 		// there are any
 		// insertMissingTags() will return the new missing start tag if one is
 		// missing
+		// then compress any empty element tags
 		// applyTagNameCase() will return the renamed node.
 		// The renamed/new node will be saved and returned to caller when all
 		// cleanup is done.
 		renamedNode = insertMissingTags(renamedNode);
+		renamedNode = compressEmptyElementTag(renamedNode);
 		renamedNode = insertRequiredAttrs(renamedNode);
 		renamedNode = applyTagNameCase(renamedNode);
 		applyAttrNameCase(renamedNode);
@@ -170,6 +175,8 @@
 
 		for (int i = 0; i < attributesLength; i++) {
 			IDOMNode eachAttr = (IDOMNode) attributes.item(i);
+			if (hasNestedRegion(eachAttr.getNameRegion()))
+				continue;
 			String oldAttrName = eachAttr.getNodeName();
 			String newAttrName = oldAttrName;
 			/*
@@ -195,6 +202,19 @@
 		}
 	}
 
+	/**
+	 * True if container has nested regions, meaning container is probably too
+	 * complicated (like JSP regions) to validate with this validator.
+	 */
+	private boolean hasNestedRegion(ITextRegion container) {
+		if (!(container instanceof ITextRegionContainer))
+			return false;
+		ITextRegionList regions = ((ITextRegionContainer) container).getRegions();
+		if (regions == null)
+			return false;
+		return true;
+	}
+
 	protected IDOMNode applyTagNameCase(IDOMNode node) {
 		IDOMElement element = (IDOMElement) node;
 		if (element.isCommentTag())
@@ -506,7 +526,7 @@
 	protected boolean isXMLType(IDOMModel structuredModel) {
 		boolean result = false;
 
-		if (structuredModel != null && structuredModel != null) {
+		if (structuredModel != null) {
 			IDOMDocument document = structuredModel.getDocument();
 
 			if (document != null)
@@ -692,4 +712,51 @@
 
 		return result;
 	}
+
+	/**
+	 * <p>Compress empty element tags if the prefence is set to do so</p>
+	 * 
+	 * @copyof org.eclipse.wst.xml.core.internal.cleanup.ElementNodeCleanupHandler#compressEmptyElementTag
+	 * 
+	 * @param node the {@link IDOMNode} to possible compress
+	 * @return the compressed node if the given node should be compressed, else the node as it was given
+	 */
+	private IDOMNode compressEmptyElementTag(IDOMNode node) {
+		boolean compressEmptyElementTags = getCleanupPreferences().getCompressEmptyElementTags();
+		IDOMNode newNode = node;
+
+		IStructuredDocumentRegion startTagStructuredDocumentRegion = newNode.getFirstStructuredDocumentRegion();
+		IStructuredDocumentRegion endTagStructuredDocumentRegion = newNode.getLastStructuredDocumentRegion();
+
+		//only compress tags if they are empty
+		if ((compressEmptyElementTags && startTagStructuredDocumentRegion != endTagStructuredDocumentRegion &&
+				startTagStructuredDocumentRegion != null)) {
+
+			//only compress end tags if its XHTML or not a container
+			if(isXMLTag((IDOMElement)newNode) || !newNode.isContainer()) {
+				ITextRegionList regions = startTagStructuredDocumentRegion.getRegions();
+				ITextRegion lastRegion = regions.get(regions.size() - 1);
+				// format children and end tag if not empty element tag
+				if (lastRegion.getType() != DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
+					NodeList childNodes = newNode.getChildNodes();
+					if (childNodes == null || childNodes.getLength() == 0 || (childNodes.getLength() == 1 && (childNodes.item(0)).getNodeType() == Node.TEXT_NODE && ((childNodes.item(0)).getNodeValue().trim().length() == 0))) {
+						IDOMModel structuredModel = newNode.getModel();
+						IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
+
+						int startTagStartOffset = newNode.getStartOffset();
+						int offset = endTagStructuredDocumentRegion.getStart();
+						int length = endTagStructuredDocumentRegion.getLength();
+						structuredDocument.replaceText(structuredDocument, offset, length, ""); //$NON-NLS-1$
+						newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
+
+						offset = startTagStructuredDocumentRegion.getStart() + lastRegion.getStart();
+						structuredDocument.replaceText(structuredDocument, offset, 0, "/"); //$NON-NLS-1$
+						newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
+					}
+				}
+			}
+		}
+
+		return newNode;
+	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
index ab2a71c..fa77f0e 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,10 +23,10 @@
 /**
  * Factory for attribute declarations.
  */
-final class AttributeCollection extends CMNamedNodeMapImpl implements HTML40Namespace {
+class AttributeCollection extends CMNamedNodeMapImpl implements HTML40Namespace {
 
 	/** bodycolors. */
-	private static final String[] BODYCOLORS = {ATTR_NAME_BGCOLOR, ATTR_NAME_TEXT, ATTR_NAME_LINK, ATTR_NAME_VLINK, HTML40Namespace.ATTR_NAME_ALINK};
+	private static final String[] BODYCOLORS = {ATTR_NAME_BGCOLOR, ATTR_NAME_TEXT, ATTR_NAME_LINK, ATTR_NAME_VLINK, ATTR_NAME_ALINK};
 	/** coreattrs. */
 	private static final String[] CORE = {ATTR_NAME_ID, ATTR_NAME_CLASS, ATTR_NAME_STYLE, ATTR_NAME_TITLE};
 	/** events. */
@@ -49,7 +49,7 @@
 	 * @param attrName
 	 *            java.lang.String
 	 */
-	private HTMLAttrDeclImpl create(String attrName) {
+	protected HTMLAttrDeclImpl create(String attrName) {
 		HTMLAttrDeclImpl attr = null;
 		HTMLCMDataTypeImpl atype = null;
 
@@ -1209,7 +1209,7 @@
 		atype.setEnumValues(values);
 
 		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-		declarations.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
+		declarations.putNamedItem(ATTR_NAME_ALIGN, attr);
 
 		// the rest.
 		Iterator names = Arrays.asList(CELLHALIGN).iterator();
@@ -1221,9 +1221,9 @@
 	 * (top|middle|bottom|baseline) #IMPLIED)
 	 */
 	public void getCellvalign(CMNamedNodeMapImpl declarations) {
-		HTMLAttributeDeclaration dec = getDeclaration(HTML40Namespace.ATTR_NAME_VALIGN);
+		HTMLAttributeDeclaration dec = getDeclaration(ATTR_NAME_VALIGN);
 		if (dec != null)
-			declarations.putNamedItem(HTML40Namespace.ATTR_NAME_VALIGN, dec);
+			declarations.putNamedItem(ATTR_NAME_VALIGN, dec);
 	}
 
 	/**
@@ -1282,4 +1282,410 @@
 		Iterator names = Arrays.asList(I18N).iterator();
 		getDeclarations(declarations, names);
 	}
+	
+	/**
+	 * create declarations.
+	 */
+	public void createAttributeDeclarations(String elementName, CMNamedNodeMapImpl attributes) {
+		 /* (type %InputType; TEXT) ... should be defined locally.
+		 * (name CDATA #IMPLIED)
+		 * (value CDATA #IMPLIED)
+		 * (checked (checked) #IMPLIED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (readonly (readonly) #IMPLIED)
+		 * (size CDATA #IMPLIED) ... should be defined locally.
+		 * (maxlength NUMBER #IMPLIED)
+		 * (src %URI; #IMPLIED)
+		 * (alt CDATA #IMPLIED) ... should be defined locally.
+		 * (usemap %URI; #IMPLIED)
+		 * (ismap (ismap) #IMPLIED)
+		 * (tabindex NUMBER #IMPLIED)
+		 * (accesskey %Character; #IMPLIED)
+		 * (onfocus %Script; #IMPLIED)
+		 * (onblur %Script; #IMPLIED)
+		 * (onselect %Script; #IMPLIED)
+		 * (onchange %Script; #IMPLIED)
+		 * (accept %ContentTypes; #IMPLIED)
+		 * (align %IAlign; #IMPLIED) ... should be defined locally.
+		 * (istyle CDATA #IMPLIED)
+		 * <<D215684
+		 * (width CDATA; #IMPLIED)
+		 * (height CDATA; #IMPLIED)
+		 * (border CDATA; #IMPLIED)
+		 * D215684
+		 */
+		if (elementName.equals(HTML40Namespace.ElementName.INPUT)){
+			HTMLCMDataTypeImpl atype = null;
+			HTMLAttrDeclImpl attr = null;
+			// (type %InputType; TEXT) ... should be defined locally.
+			// NOTE: %InputType is ENUM;
+			// (text | password | checkbox | radio | submit | reset |
+			//  file | hidden | image | button)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_TEXT, ATTR_VALUE_PASSWORD, ATTR_VALUE_CHECKBOX, ATTR_VALUE_RADIO, ATTR_VALUE_SUBMIT, ATTR_VALUE_RESET, ATTR_VALUE_FILE, ATTR_VALUE_HIDDEN, ATTR_VALUE_IMAGE, ATTR_VALUE_BUTTON};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TEXT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+
+			// (size CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SIZE, attr);
+
+			// (alt CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ALT, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_ALT, attr);
+
+			// (align %IAlign; #IMPLIED) ... should be defined locally.
+			attr = AttributeCollection.createAlignForImage();
+			attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
+
+			// the rest.
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_VALUE, ATTR_NAME_CHECKED, ATTR_NAME_DISABLED, ATTR_NAME_READONLY, ATTR_NAME_SIZE, ATTR_NAME_MAXLENGTH, ATTR_NAME_SRC, ATTR_NAME_ALT, ATTR_NAME_USEMAP, ATTR_NAME_ISMAP, ATTR_NAME_TABINDEX, ATTR_NAME_ACCESSKEY, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR, ATTR_NAME_ONSELECT, ATTR_NAME_ONCHANGE, ATTR_NAME_ACCEPT, ATTR_NAME_ALIGN, ATTR_NAME_ISTYLE,
+			//<<D215684
+						ATTR_NAME_WIDTH, ATTR_NAME_HEIGHT, ATTR_NAME_BORDER
+			//<D215684
+			};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		}
+		 /* (charset %Charset; #IMPLIED)
+		 * (href %URI; #IMPLIED)
+		 * (hreflang %LanguageCode; #IMPLIED)
+		 * (type %ContentType; #IMPLIED): should be defined locally.
+		 * (rel %LinkTypes; #IMPLIED)
+		 * (rev %LinkTypes; #IMPLIED)
+		 * (media %MediaDesc; #IMPLIED)
+		 * (target %FrameTarget; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.LINK)){
+			String[] names = {ATTR_NAME_CHARSET, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_REL, ATTR_NAME_REV, ATTR_NAME_MEDIA, ATTR_NAME_TARGET};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// (type %ContentType; #IMPLIED)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+		
+		}
+		/* (charset %Charset; #IMPLIED)
+		 * (type %ContentType; #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * (href %URI; #IMPLIED)
+		 * (hreflang %LanguageCode; #IMPLIED)
+		 * (target %FrameTarget; #IMPLIED)
+		 * (rel %LinkTypes; #IMPLIED)
+		 * (rev %LinkTypes; #IMPLIED)
+		 * (accesskey %Character; #IMPLIED)
+		 * (directkey %Character; #IMPLIED)
+		 * (shape %Shape; rect)
+		 * (coords %Coords; #IMPLIED)
+		 * (tabindex NUMBER #IMPLIED)
+		 * (onfocus %Script; #IMPLIED)
+		 * (onblur %Script; #IMPLIED) 
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.A)){
+			String[] names = {ATTR_NAME_CHARSET, ATTR_NAME_TYPE, ATTR_NAME_NAME, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_TARGET, ATTR_NAME_REL, ATTR_NAME_REV, ATTR_NAME_ACCESSKEY, ATTR_NAME_DIRECTKEY, ATTR_NAME_SHAPE, ATTR_NAME_COORDS, ATTR_NAME_TABINDEX, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		
+		}
+		/*
+		 * (shape %Shape; rect)
+		 * (coords %Coords; #IMPLIED)
+		 * (href %URI; #IMPLIED)
+		 * (target %FrameTarget; #IMPLIED)
+		 * (nohref (nohref) #IMPLIED)
+		 * (alt %Text; #REQUIRED)
+		 * (tabindex NUMBER #IMPLIED)
+		 * (accesskey %Character; #IMPLIED)
+		 * (onfocus %Script; #IMPLIED)
+		 * (onblur %Script; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.AREA)){
+			String[] names = {ATTR_NAME_SHAPE, ATTR_NAME_COORDS, ATTR_NAME_HREF, ATTR_NAME_TARGET, ATTR_NAME_NOHREF, ATTR_NAME_ALT, ATTR_NAME_TABINDEX, ATTR_NAME_ACCESSKEY, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		}
+		/*
+		 *  %i18n;
+		 * (http-equiv NAME #IMPLIED)
+		 * (name NAME #IMPLIED) ... should be defined locally.
+		 * (content CDATA #REQUIRED)
+		 * (scheme CDATA #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.META)){
+			// %i18n;
+			getI18n(attributes);
+
+			// (name NAME #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_NAME, attr);
+
+			String[] names = {ATTR_NAME_HTTP_EQUIV, ATTR_NAME_CONTENT, ATTR_NAME_SCHEME};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		}
+		/*
+		 * (src %URI; #REQUIRED): should be defined locally.
+		 * (alt %Text; #REQUIRED)
+		 * (longdesc %URI; #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * (height %Length; #IMPLIED)
+		 * (width %Length; #IMPLIED)
+		 * (usemap %URI; #IMPLIED)
+		 * (ismap (ismap) #IMPLIED)
+		 * (align %IAlign; #IMPLIED): should be defined locally.
+		 * (border %Pixels; #IMPLIED)
+		 * (hspace %Pixels; #IMPLIED)
+		 * (vspace %Pixels; #IMPLIED)
+		 * (mapfile %URI; #IMPLIED)
+	 
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.IMG)){
+			// (src %URI; #REQUIRED): should be defined locally.
+			HTMLCMDataTypeImpl atype = null;
+			HTMLAttrDeclImpl attr = null;
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_SRC, attr);
+
+			String[] names = {ATTR_NAME_ALT, ATTR_NAME_LONGDESC, ATTR_NAME_NAME, ATTR_NAME_HEIGHT, ATTR_NAME_WIDTH, ATTR_NAME_USEMAP, ATTR_NAME_ISMAP, ATTR_NAME_BORDER, ATTR_NAME_HSPACE, ATTR_NAME_VSPACE, ATTR_NAME_MAPFILE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// align (local); should be defined locally.
+			attr = AttributeCollection.createAlignForImage();
+			attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
+		
+		}
+		/*
+		 * (id ID #IMPLIED)
+		 * (name CDATA #REQUIRED) ... should be defined locally.
+		 * (value CDATA #IMPLIED)
+		 * (valuetype (DATA|REF|OBJECT) DATA)
+		 * (type %ContentType; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.PARAM)){
+			String[] names = {ATTR_NAME_ID, ATTR_NAME_VALUE, ATTR_NAME_VALUETYPE, ATTR_NAME_TYPE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// (name CDATA #REQUIRED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_NAME, attr);
+		}
+		/*
+		 * %reserved; ... empty
+		 * (name CDATA #IMPLIED)
+		 * (rows NUMBER #REQUIRED)
+		 * (cols NUMBER #REQUIRED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (readonly (readonly) #IMPLIED)
+		 * (tabindex NUMBER #IMPLIED)
+		 * (accesskey %Character; #IMPLIED)
+		 * (onfocus %Script; #IMPLIED)
+		 * (onblur %Script; #IMPLIED)
+		 * (onselect %Script; #IMPLIED)
+		 * (onchange %Script; #IMPLIED)
+		 * (istyle CDATA #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.TEXTAREA)){
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_ROWS, ATTR_NAME_COLS, ATTR_NAME_DISABLED, ATTR_NAME_READONLY, ATTR_NAME_TABINDEX, ATTR_NAME_ACCESSKEY, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR, ATTR_NAME_ONSELECT, ATTR_NAME_ONCHANGE, ATTR_NAME_ISTYLE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		}
+		/*
+		 * (charset %Charset; #IMPLIED)
+		 * (type %ContentType; #REQUIRED) ... should be defined locally.
+		 * (language CDATA #IMPLIED)
+		 * (src %URI; #IMPLIED)
+		 * (defer (defer) #IMPLIED)
+		 * (event CDATA #IMPLIED)
+		 * (for %URI; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.SCRIPT)){
+			String[] names = {ATTR_NAME_CHARSET, ATTR_NAME_LANGUAGE, ATTR_NAME_SRC, ATTR_NAME_DEFER, ATTR_NAME_EVENT, ATTR_NAME_FOR};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// (type %ContentType; #REQUIRED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/javascript"); //$NON-NLS-1$
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+		
+		}
+		/*
+		 *  %i18n;
+		 * (type %ContentType; #REQUIRED) ... should be defined locally.
+		 * (media %MediaDesc; #IMPLIED)
+		 * (title %Text; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.STYLE)){
+			// %i18n;
+			getI18n(attributes);
+
+			String[] names = {ATTR_NAME_MEDIA, ATTR_NAME_TITLE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			// (type %ContentType; #REQUIRED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/css"); //$NON-NLS-1$
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+		
+		}
+		/*
+		 * %reserved;
+		 * (name CDATA #IMPLIED)
+		 * (size NUMBER #IMPLIED) ... should be defined locally.
+		 * (multiple (multiple) #IMPLIED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (tabindex NUMBER #IMPLIED)
+		 * (onfocus %Script; #IMPLIED)
+		 * (onblur %Script; #IMPLIED)
+		 * (onchange %Script; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.SELECT)){
+			// (size NUMBER #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SIZE, attr);
+
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_MULTIPLE, ATTR_NAME_DISABLED, ATTR_NAME_TABINDEX, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR, ATTR_NAME_ONCHANGE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		
+		}
+		/*
+		 * 	(type %LIStyle; #IMPLIED) ... should be defined locally.
+		 * (value NUMBER #IMPLIED) ... should be defined locally.
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.LI)){
+			// (type %LIStyle; #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LI_STYLE);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+
+			// (value NUMBER #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_VALUE, attr);
+		
+		}
+		/*
+		 * (type %OLStyle; #IMPLIED) ... should be defined locally.
+		 * (compact (compact) #IMPLIED)
+		 * (start NUMBER #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.OL)){
+			// (type %OLStyle; #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.OL_STYLE);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+
+			// the rest.
+			String[] names = {ATTR_NAME_COMPACT, ATTR_NAME_START};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		
+		}
+		/**
+		 * %coreattrs;
+		 * (longdesc %URI; #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * (src %URI; #IMPLIED)
+		 * (frameborder (1|0) 1)
+		 * (marginwidth %Pixels; #IMPLIED)
+		 * (marginheight %Pixels; #IMPLIED)
+		 * (scrolling (yes|no|auto) auto)
+		 * (align %IAlign; #IMPLIED) ... should be defined locally.
+		 * (height %Length; #IMPLIED)
+		 * (width %Length; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.IFRAME)){
+			// %coreattrs;
+			getCore(attributes);
+
+			String[] names = {ATTR_NAME_LONGDESC, ATTR_NAME_NAME, ATTR_NAME_SRC, ATTR_NAME_FRAMEBORDER, ATTR_NAME_MARGINWIDTH, ATTR_NAME_MARGINHEIGHT, ATTR_NAME_SCROLLING, ATTR_NAME_HEIGHT, ATTR_NAME_WIDTH};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// align
+			HTMLAttrDeclImpl attr = AttributeCollection.createAlignForImage();
+			if (attr != null)
+				attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
+		
+		}
+		/*
+		 * %i18n attrs
+		 * %version
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.HTML)){
+			// %i18n;
+			getI18n(attributes);
+			// version
+			HTMLAttributeDeclaration adec = getDeclaration(ATTR_NAME_VERSION);
+			if (adec != null)
+				attributes.putNamedItem(ATTR_NAME_VERSION, adec);
+		
+		}
+		/*
+		 * (compact (compact) #IMPLIED)
+	 	 */
+		else if (elementName.equals(HTML40Namespace.ElementName.MENU)){
+			String[] names = {ATTR_NAME_COMPACT};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		
+		}
+		/*
+		 * %reserved; ... empty.
+		 * (name CDATA #IMPLIED)
+		 * (value CDATA #IMPLIED)
+		 * (type (button|submit|reset) submit) ... should be defined locally.
+		 * (disabled (disabled) #IMPLIED)
+		 * (tabindex NUMBER #IMPLIED)
+		 * (accesskey %Character; #IMPLIED)
+		 * (onfocus %Script; #IMPLIED)
+		 * (onblur %Script; #IMPLIED)
+	 	 */
+		else if (elementName.equals(HTML40Namespace.ElementName.BUTTON)){
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_VALUE, ATTR_NAME_DISABLED, ATTR_NAME_TABINDEX, ATTR_NAME_ACCESSKEY, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// (type (button|submit|reset) submit) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_BUTTON, ATTR_VALUE_SUBMIT, ATTR_VALUE_RESET};
+			atype.setEnumValues(values);
+
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+		
+		}
+		/*
+		 * %reserved;
+		 * (summary %Text; #IMPLIED)
+		 * (width %Length; #IMPLIED)
+		 * (border %Pixels; #IMPLIED)
+		 * (frame %TFrame; #IMPLIED)
+		 * (rules %TRules; #IMPLIED)
+		 * (cellspacing %Length; #IMPLIED)
+		 * (cellpadding %Length; #IMPLIED)
+		 * (align %TAlign; #IMPLIED)
+		 * (bgcolor %Color; #IMPLIED)
+		 * (datapagesize CDATA #IMPLIED)
+		 * (height %Pixels; #IMPLIED)
+		 * (background %URI; #IMPLIED)
+		 * (bordercolor %Color #IMPLIED) ... D205514
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.TABLE)){
+			// %reserved;
+			// ... %reserved; is empty in the current DTD.
+
+			String[] names = {ATTR_NAME_SUMMARY, ATTR_NAME_WIDTH, ATTR_NAME_BORDER, ATTR_NAME_FRAME, ATTR_NAME_RULES, ATTR_NAME_CELLSPACING, ATTR_NAME_CELLPADDING, ATTR_NAME_BGCOLOR, ATTR_NAME_DATAPAGESIZE, ATTR_NAME_HEIGHT, ATTR_NAME_BACKGROUND, ATTR_NAME_BORDERCOLOR // D205514
+			};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// align (local)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] alignValues = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT};
+			atype.setEnumValues(alignValues);
+			HTMLAttrDeclImpl adec = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_ALIGN, adec);
+			
+		}
+	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java
index 9a38d53..51d693d 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,6 +28,8 @@
 	public final static String CTYPE_COLUMN_GROUP = "CTYPE_COLUMN_GROUP";//$NON-NLS-1$
 	/** for DL. */
 	public final static String CTYPE_DEFINITION_LIST = "CTYPE_DEFINITION_LIST";//$NON-NLS-1$
+	/** for DETAILS */
+	public final static String CTYPE_DETAILS_CONTAINER = "CTYPE_DETAILS_CONTAINER";//$NON-NLS-1$
 	/** for EMBED. */
 	public final static String CTYPE_EMBED = "CTYPE_EMBED";//$NON-NLS-1$
 	/** empty content. No ComplexTypeDefinition instance should be created. */
@@ -64,7 +66,17 @@
 	public final static String CTYPE_TCELL_CONTAINER = "CTYPE_TCELL_CONTAINER";//$NON-NLS-1$
 	/** table record container. (TR)+ */
 	public final static String CTYPE_TR_CONTAINER = "CTYPE_TR_CONTAINER";//$NON-NLS-1$
-
+	/** heading group container. (H1|h2|H3|H4|H5|H6)+ */
+	public final static String CTYPE_HEADING_CONTAINER = "CTYPE_HGROUP_CONTAINER"; //$NON-NLS-1$
+	/** media content. (AUDIO|VIDEO) */
+	public final static String CTYPE_MEDIA_ELEMENT = "CTYPE_MEDIA";//$NON-NLS-1$
+	/** for DATALIST. */
+	public final static String CTYPE_DATALIST = "CTYPE_DATALIST";//$NON-NLS-1$
+	/** for FIGURE. */
+	public final static String CTYPE_FIGURE = "CTYPE_FIGURE";//$NON-NLS-1$
+	/** for RUBY. */
+	public final static String CTYPE_RUBY = "CTYPE_RUBY";//$NON-NLS-1$
+	
 	/**
 	 * ComplexTypeDefinitionFactory constructor comment.
 	 */
@@ -81,8 +93,17 @@
 	 * @param elementCollection ElementCollection
 	 */
 	public ComplexTypeDefinition createTypeDefinition(String definitionName, ElementCollection elementCollection) {
+		ComplexTypeDefinition[] defs = null;
 		if (definitions.containsKey(definitionName)) {
-			return (ComplexTypeDefinition) definitions.get(definitionName);
+			defs =  (ComplexTypeDefinition[]) definitions.get(definitionName);
+			for (int i = 0; i < defs.length; i++) {
+				if (defs[i].collection == elementCollection)
+					return defs[i];
+			}
+		}
+		else {
+			// initialize a new definition
+			defs = new ComplexTypeDefinition[0];
 		}
 
 		ComplexTypeDefinition def = null;
@@ -94,10 +115,17 @@
 			def = new CtdColumnGroup(elementCollection);
 
 		}
+		else if (definitionName == CTYPE_DATALIST) {
+			def = new CtdDatalist(elementCollection);
+
+		}
 		else if (definitionName == CTYPE_DEFINITION_LIST) {
 			def = new CtdDl(elementCollection);
 
 		}
+		else if (definitionName == CTYPE_DETAILS_CONTAINER) {
+			def = new CtdDetails(elementCollection);
+		}
 		else if (definitionName == CTYPE_EMBED) {
 			def = new CtdEmbed(elementCollection);
 
@@ -106,6 +134,10 @@
 			def = new CtdFieldset(elementCollection);
 
 		}
+		else if (definitionName == CTYPE_FIGURE) {
+			def = new CtdFigure(elementCollection);
+
+		}
 		else if (definitionName == CTYPE_FLOW_CONTAINER) {
 			def = new CtdFlowContainer(elementCollection);
 
@@ -118,6 +150,9 @@
 			def = new CtdHead(elementCollection);
 
 		}
+		else if (definitionName == CTYPE_HEADING_CONTAINER) {
+			def = new CtdHeadingContainer(elementCollection);
+		}
 		else if (definitionName == CTYPE_HTML) {
 			def = new CtdHtml(elementCollection);
 
@@ -134,6 +169,10 @@
 			def = new CtdMap(elementCollection);
 
 		}
+		else if (definitionName == CTYPE_MEDIA_ELEMENT) {
+			def = new CtdMediaElement(elementCollection);
+			
+		}
 		else if (definitionName == CTYPE_NOFRAMES_CONTENT) {
 			def = new CtdNoframesContent(elementCollection);
 
@@ -146,6 +185,10 @@
 			def = new CtdParamContainer(elementCollection);
 
 		}
+		else if (definitionName == CTYPE_RUBY) {
+			def = new CtdRuby(elementCollection);
+
+		}
 		else if (definitionName == CTYPE_SELECT) {
 			def = new CtdSelect(elementCollection);
 
@@ -167,7 +210,11 @@
 		}
 		if (def == null)
 			return null; // fail to create.
-		definitions.put(definitionName, def);
+		ComplexTypeDefinition[] temp = defs;
+		defs = new ComplexTypeDefinition[defs.length + 1];
+		System.arraycopy(temp, 0, defs, 0, temp.length);
+		defs[temp.length] = def;
+		definitions.put(definitionName, defs);
 		return def;
 	}
 
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDatalist.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDatalist.java
new file mode 100644
index 0000000..457debf
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDatalist.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * for DATALIST.
+ */
+final class CtdDatalist extends ComplexTypeDefinition {
+
+	/**
+	 * @param elementCollection ElementCollection
+	 */
+	public CtdDatalist(ElementCollection elementCollection) {
+		super(elementCollection);
+		primaryCandidateName = HTML40Namespace.ElementName.OPTION;
+	}
+
+	/**
+	 * (OPTION)+.
+	 */
+	protected void createContent() {
+		if (content != null)
+			return; // already created.
+		if (collection == null)
+			return;
+
+	
+		content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
+		// OPTION
+		CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.OPTION);
+		if (dec != null)
+			content.appendChild(dec);
+	}
+
+	/**
+	 * (OPTION)+.
+	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
+	 * those are defined in CMElementDeclaration.
+	 */
+	public int getContentType() {
+		return CMElementDeclaration.ELEMENT;
+	}
+
+	/**
+	 * @return java.lang.String
+	 */
+	public String getTypeName() {
+		return ComplexTypeDefinitionFactory.CTYPE_DATALIST;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDetails.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDetails.java
new file mode 100644
index 0000000..914d5db
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDetails.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+public class CtdDetails extends ComplexTypeDefinition {
+
+	public CtdDetails(ElementCollection elementCollection) {
+		super(elementCollection);
+		primaryCandidateName = HTML50Namespace.ElementName.SUMMARY;
+	}
+
+	protected void createContent() {
+		if (content != null)
+			return; // already created.
+		if (collection == null)
+			return;
+
+		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		// summary
+		CMNode dec = collection.getNamedItem(HTML50Namespace.ElementName.SUMMARY);
+		if (dec != null)
+			content.appendChild(dec);
+
+		CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
+		content.appendChild(group);
+		collection.getFlow(group);
+	}
+
+	public int getContentType() {
+		return CMElementDeclaration.ELEMENT;
+	}
+
+	public String getTypeName() {
+		return ComplexTypeDefinitionFactory.CTYPE_DETAILS_CONTAINER;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFigure.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFigure.java
new file mode 100644
index 0000000..165054f
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFigure.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * for FIGURE.
+ */
+final class CtdFigure extends ComplexTypeDefinition {
+
+	/**
+	 * @param elementCollection ElementCollection
+	 */
+	public CtdFigure(ElementCollection elementCollection) {
+		super(elementCollection);
+		primaryCandidateName = HTML50Namespace.ElementName.FIGCAPTION;
+	}
+
+	/**
+	 * (FIGCAPTION)+.
+	 */
+	protected void createContent() {
+		if (content != null)
+			return; // already created.
+		if (collection == null)
+			return;
+
+		// ( | )+
+		content = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
+		
+		CMGroupImpl group1 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		if (group1 != null){
+			content.appendChild(group1);
+		}
+		// FIGCAPTION, FLOW
+		CMNode dec = collection.getNamedItem(HTML50Namespace.ElementName.FIGCAPTION);
+		if (dec != null)
+			group1.appendChild(dec);
+		CMGroupImpl flowgroup = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		group1.appendChild(flowgroup);
+		collection.getFlow(flowgroup);
+		
+		CMGroupImpl group2 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		if (group2 != null){
+			content.appendChild(group2);
+		}
+		// FLOW , FIGCAPTION
+		CMGroupImpl flowgroup2 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		group2.appendChild(flowgroup2);
+		collection.getFlow(flowgroup2);
+		CMNode dec1 = collection.getNamedItem(HTML50Namespace.ElementName.FIGCAPTION);
+		if (dec1 != null)
+			group2.appendChild(dec1);
+		//FLOW
+		CMGroupImpl group3 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		if (group3 != null){
+			content.appendChild(group3);
+			
+		}
+		collection.getFlow(group3);
+
+	}
+
+	/**
+	 * (FIGCAPTION)+.
+	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
+	 * those are defined in CMElementDeclaration.
+	 */
+	public int getContentType() {
+		return CMElementDeclaration.ELEMENT;
+	}
+
+	/**
+	 * @return java.lang.String
+	 */
+	public String getTypeName() {
+		return ComplexTypeDefinitionFactory.CTYPE_FIGURE;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHeadingContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHeadingContainer.java
new file mode 100644
index 0000000..e7fdba7
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHeadingContainer.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+
+
+public class CtdHeadingContainer extends ComplexTypeDefinition {
+
+	/**
+	 * @param elementCollection ElementCollection
+	 */
+	public CtdHeadingContainer(ElementCollection elementCollection) {
+		super(elementCollection);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#createContent()
+	 */
+	protected void createContent() {
+		if (content != null)
+			return; // already created.
+		if (collection == null)
+			return;
+		// ( )*
+		content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
+		// H1|H2|H3|H4|H5|H6
+		 collection.getHeading(content);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#getContentType()
+	 */
+	public int getContentType() {
+		return CMElementDeclaration.ELEMENT;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#getTypeName()
+	 */
+	public String getTypeName() {
+		return ComplexTypeDefinitionFactory.CTYPE_HEADING_CONTAINER;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java
index d2396fc..ca7295b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
 import java.util.Arrays;
 
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
@@ -319,6 +320,53 @@
 	    edec = collection.getNamedItem(HTML40Namespace.ElementName.STRONG);
 		if (edec != null)
 			content.appendChild(edec);
+		edec = collection.getNamedItem(HTML50Namespace.ElementName.ARTICLE);
+		if (edec != null)
+			content.appendChild(edec);
+
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.ASIDE);
+		if (edec != null)
+			content.appendChild(edec);
+		edec = collection.getNamedItem(HTML50Namespace.ElementName.NAV);
+		if (edec != null)
+			content.appendChild(edec);
+
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.SECTION);
+		if (edec != null)
+			content.appendChild(edec);
+		edec = collection.getNamedItem(HTML50Namespace.ElementName.AUDIO);
+		if (edec != null)
+			content.appendChild(edec);
+
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.VIDEO);
+		if (edec != null)
+			content.appendChild(edec);
+		edec = collection.getNamedItem(HTML50Namespace.ElementName.CANVAS);
+		if (edec != null)
+			content.appendChild(edec);
+
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.COMMAND);
+		if (edec != null)
+			content.appendChild(edec);
+		
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.HEADER);
+		if (edec != null)
+			content.appendChild(edec);
+		
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.FOOTER);
+		if (edec != null)
+			content.appendChild(edec);
+		
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.MARK);
+		if (edec != null)
+			content.appendChild(edec);
+		
+		edec = collection.getNamedItem(HTML50Namespace.ElementName.FIGURE);
+		if (edec != null)
+			content.appendChild(edec);
+		edec = collection.getNamedItem(HTML50Namespace.ElementName.RUBY);
+		if (edec != null)
+			content.appendChild(edec);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMediaElement.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMediaElement.java
new file mode 100644
index 0000000..95cb598
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMediaElement.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+
+public class CtdMediaElement extends ComplexTypeDefinition {
+
+	/**
+	 * @param elementCollection ElementCollection
+	 */
+	public CtdMediaElement(ElementCollection elementCollection) {
+		super(elementCollection);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#createContent()
+	 */
+	protected void createContent() {
+		if (content != null)
+			return; // already created.
+		if (collection == null)
+			return;
+		// ( )*
+		content = new CMGroupImpl(CMGroup.SEQUENCE,0, 1);
+		//source
+		CMNode source = collection.getNamedItem(HTML50Namespace.ElementName.SOURCE);
+		if (source != null)
+			content.appendChild(source);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#getContentType()
+	 */
+	public int getContentType() {
+		return CMElementDeclaration.ELEMENT;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#getTypeName()
+	 */
+	public String getTypeName() {
+		return ComplexTypeDefinitionFactory.CTYPE_MEDIA_ELEMENT;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java
index 4732191..4eb45b4 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -49,6 +49,7 @@
 		if (flows == null)
 			return;
 		collection.getInline(flows);
+		collection.getBlock(flows);
 		content.appendChild(flows);
 	}
 
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdRuby.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdRuby.java
new file mode 100644
index 0000000..9ec37d0
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdRuby.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * for RUBY.
+ */
+final class CtdRuby extends ComplexTypeDefinition {
+
+	/**
+	 * @param elementCollection ElementCollection
+	 */
+	public CtdRuby(ElementCollection elementCollection) {
+		super(elementCollection);
+		primaryCandidateName = HTML50Namespace.ElementName.RT;
+	}
+
+	/**
+	 * (RT)+.
+	 */
+	protected void createContent() {
+		if (content != null)
+			return; // already created.
+		if (collection == null)
+			return;
+
+	
+		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
+		
+		CMGroupImpl phraseGroup = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
+		if (phraseGroup == null)
+			return;
+		content.appendChild(phraseGroup);
+		collection.getPhrase(phraseGroup);
+		
+		CMGroupImpl rtrpgroup = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
+		if (rtrpgroup == null)
+			return;
+		content.appendChild(rtrpgroup);
+		
+		//RT
+		CMNode dec = collection.getNamedItem(HTML50Namespace.ElementName.RT);
+		if (dec != null)
+			rtrpgroup.appendChild(dec);
+		
+		CMGroupImpl rpgroup = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		if (rpgroup == null)
+			return;
+		rtrpgroup.appendChild(rpgroup);
+		
+		// RP
+		dec = collection.getNamedItem(HTML50Namespace.ElementName.RP);
+		if (dec != null)
+			rpgroup.appendChild(dec);
+		// RT
+		dec = collection.getNamedItem(HTML50Namespace.ElementName.RT);
+		if (dec != null)
+			rpgroup.appendChild(dec);
+		dec = collection.getNamedItem(HTML50Namespace.ElementName.RP);
+		if (dec != null)
+			rpgroup.appendChild(dec);
+	}
+
+	/**
+	 * (RT)+.
+	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
+	 * those are defined in CMElementDeclaration.
+	 */
+	public int getContentType() {
+		return CMElementDeclaration.ELEMENT;
+	}
+
+	/**
+	 * @return java.lang.String
+	 */
+	public String getTypeName() {
+		return ComplexTypeDefinitionFactory.CTYPE_RUBY;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java
index 8349964..92ddfdf 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,11 +22,11 @@
 /**
  * Factory for element declarations.
  */
-final class ElementCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ElementName {
+class ElementCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ElementName {
 
 
 	// Element IDs
-	private static class Ids {
+	protected static class Ids {
 		public static final int ID_A = 0;
 		public static final int ID_ABBR = 1;
 		public static final int ID_ACRONYM = 2;
@@ -183,123 +183,18 @@
 	private static final String[] LIST = {UL, OL, DIR, MENU};
 	/** %preformatted;. PRE */
 	private static final String[] PREFORMATTED = {PRE};
-	private AttributeCollection attributeCollection = null;
+	protected AttributeCollection attributeCollection = null;
 	private static String[] fNames = null;
 
-	static {
-		fNames = new String[Ids.getNumOfIds()];
-		fNames[Ids.ID_A] = A;
-		fNames[Ids.ID_ABBR] = ABBR;
-		fNames[Ids.ID_ACRONYM] = ACRONYM;
-		fNames[Ids.ID_ADDRESS] = ADDRESS;
-		fNames[Ids.ID_APPLET] = APPLET;
-		fNames[Ids.ID_AREA] = AREA;
-		fNames[Ids.ID_B] = B;
-		fNames[Ids.ID_BASE] = BASE;
-		fNames[Ids.ID_BASEFONT] = BASEFONT;
-		fNames[Ids.ID_BDO] = BDO;
-		fNames[Ids.ID_BIG] = BIG;
-		fNames[Ids.ID_BLINK] = BLINK;
-		fNames[Ids.ID_BLOCKQUOTE] = BLOCKQUOTE;
-		fNames[Ids.ID_BODY] = BODY;
-		fNames[Ids.ID_BR] = BR;
-		fNames[Ids.ID_BUTTON] = BUTTON;
-		fNames[Ids.ID_CAPTION] = CAPTION;
-		fNames[Ids.ID_CENTER] = CENTER;
-		fNames[Ids.ID_CITE] = CITE;
-		fNames[Ids.ID_CODE] = CODE;
-		fNames[Ids.ID_COL] = COL;
-		fNames[Ids.ID_COLGROUP] = COLGROUP;
-		fNames[Ids.ID_DD] = DD;
-		fNames[Ids.ID_DEL] = DEL;
-		fNames[Ids.ID_DFN] = DFN;
-		fNames[Ids.ID_DIR] = DIR;
-		fNames[Ids.ID_DIV] = DIV;
-		fNames[Ids.ID_DL] = DL;
-		fNames[Ids.ID_DT] = DT;
-		fNames[Ids.ID_EM] = EM;
-		fNames[Ids.ID_EMBED] = EMBED;
-		fNames[Ids.ID_FIELDSET] = FIELDSET;
-		fNames[Ids.ID_FONT] = FONT;
-		fNames[Ids.ID_FORM] = FORM;
-		fNames[Ids.ID_FRAME] = FRAME;
-		fNames[Ids.ID_FRAMESET] = FRAMESET;
-		fNames[Ids.ID_H1] = H1;
-		fNames[Ids.ID_H2] = H2;
-		fNames[Ids.ID_H3] = H3;
-		fNames[Ids.ID_H4] = H4;
-		fNames[Ids.ID_H5] = H5;
-		fNames[Ids.ID_H6] = H6;
-		fNames[Ids.ID_HEAD] = HEAD;
-		fNames[Ids.ID_HR] = HR;
-		fNames[Ids.ID_HTML] = HTML;
-		fNames[Ids.ID_I] = I;
-		fNames[Ids.ID_IFRAME] = IFRAME;
-		fNames[Ids.ID_IMG] = IMG;
-		fNames[Ids.ID_INPUT] = INPUT;
-		fNames[Ids.ID_INS] = INS;
-		fNames[Ids.ID_ISINDEX] = ISINDEX;
-		fNames[Ids.ID_KBD] = KBD;
-		fNames[Ids.ID_LABEL] = LABEL;
-		fNames[Ids.ID_LEGEND] = LEGEND;
-		fNames[Ids.ID_LI] = LI;
-		fNames[Ids.ID_LINK] = LINK;
-		fNames[Ids.ID_MAP] = MAP;
-		fNames[Ids.ID_MENU] = MENU;
-		fNames[Ids.ID_META] = META;
-		fNames[Ids.ID_NOEMBED] = NOEMBED;
-		fNames[Ids.ID_NOFRAMES] = NOFRAMES;
-		fNames[Ids.ID_NOSCRIPT] = NOSCRIPT;
-		fNames[Ids.ID_OBJECT] = OBJECT;
-		fNames[Ids.ID_OL] = OL;
-		fNames[Ids.ID_OPTGROUP] = OPTGROUP;
-		fNames[Ids.ID_OPTION] = OPTION;
-		fNames[Ids.ID_P] = P;
-		fNames[Ids.ID_PARAM] = PARAM;
-		fNames[Ids.ID_PRE] = PRE;
-		fNames[Ids.ID_Q] = Q;
-		fNames[Ids.ID_S] = S;
-		fNames[Ids.ID_SAMP] = SAMP;
-		fNames[Ids.ID_SCRIPT] = SCRIPT;
-		fNames[Ids.ID_SELECT] = SELECT;
-		fNames[Ids.ID_SMALL] = SMALL;
-		fNames[Ids.ID_SPAN] = SPAN;
-		fNames[Ids.ID_STRIKE] = STRIKE;
-		fNames[Ids.ID_STRONG] = STRONG;
-		fNames[Ids.ID_STYLE] = STYLE;
-		fNames[Ids.ID_SUB] = SUB;
-		fNames[Ids.ID_SUP] = SUP;
-		fNames[Ids.ID_TABLE] = TABLE;
-		fNames[Ids.ID_TBODY] = TBODY;
-		fNames[Ids.ID_TD] = TD;
-		fNames[Ids.ID_TEXTAREA] = TEXTAREA;
-		fNames[Ids.ID_TFOOT] = TFOOT;
-		fNames[Ids.ID_TH] = TH;
-		fNames[Ids.ID_THEAD] = THEAD;
-		fNames[Ids.ID_TITLE] = TITLE;
-		fNames[Ids.ID_TR] = TR;
-		fNames[Ids.ID_TT] = TT;
-		fNames[Ids.ID_U] = U;
-		fNames[Ids.ID_UL] = UL;
-		fNames[Ids.ID_VAR] = VAR;
-		fNames[Ids.ID_MARQUEE] = MARQUEE;
-		fNames[Ids.ID_SSI_CONFIG] = SSI_CONFIG;
-		fNames[Ids.ID_SSI_ECHO] = SSI_ECHO;
-		fNames[Ids.ID_SSI_EXEC] = SSI_EXEC;
-		fNames[Ids.ID_SSI_FSIZE] = SSI_FSIZE;
-		fNames[Ids.ID_SSI_FLASTMOD] = SSI_FLASTMOD;
-		fNames[Ids.ID_SSI_INCLUDE] = SSI_INCLUDE;
-		fNames[Ids.ID_SSI_PRINTENV] = SSI_PRINTENV;
-		fNames[Ids.ID_SSI_SET] = SSI_SET;
-		fNames[Ids.ID_BGSOUND] = BGSOUND;
-		fNames[Ids.ID_NOBR] = NOBR;
-		fNames[Ids.ID_WBR] = WBR;
-	}
-
 	/**
 	 */
 	public ElementCollection(AttributeCollection collection) {
-		super(fNames, TOLERANT_CASE);
+		super(getNames(), TOLERANT_CASE);
+		attributeCollection = collection;
+	}
+
+	public ElementCollection(String[] names, AttributeCollection collection) {
+		super(names, TOLERANT_CASE);
 		attributeCollection = collection;
 	}
 
@@ -747,7 +642,7 @@
 		return attributeCollection;
 	}
 
-	public final Collection getNamesOfBlock() {
+	public Collection getNamesOfBlock() {
 		// P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR,
 		// TABLE, FIELDSET, ADDRESS
 		String[] blockMisc = {P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR, TABLE, FIELDSET, ADDRESS};
@@ -781,7 +676,7 @@
 	 * into a <code>CMGroupImpl</code> instance.
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getFlow(CMGroupImpl group) {
+	public void getFlow(CMGroupImpl group) {
 		if (group == null)
 			return;
 		getBlock(group);
@@ -793,7 +688,7 @@
 	 * instance.<br>
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getFontstyle(CMGroupImpl group) {
+	public void getFontstyle(CMGroupImpl group) {
 		if (group == null)
 			return;
 		getDeclarations(group, Arrays.asList(FONTSTYLE).iterator());
@@ -804,7 +699,7 @@
 	 * instance.<br>
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getFormctrl(CMGroupImpl group) {
+	public void getFormctrl(CMGroupImpl group) {
 		if (group == null)
 			return;
 		getDeclarations(group, Arrays.asList(FORMCTL).iterator());
@@ -814,7 +709,7 @@
 	 * %heading;.
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getHeading(CMGroupImpl group) {
+	public void getHeading(CMGroupImpl group) {
 		if (group == null)
 			return;
 
@@ -826,7 +721,7 @@
 	 * into a <code>CMGroupImpl</code> instance.
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getInline(CMGroupImpl group) {
+	public void getInline(CMGroupImpl group) {
 		if (group == null)
 			return;
 		getFontstyle(group);
@@ -839,7 +734,7 @@
 	 * %list;.
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getList(CMGroupImpl group) {
+	public void getList(CMGroupImpl group) {
 		if (group == null)
 			return;
 
@@ -851,7 +746,7 @@
 	 * instance.<br>
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getPhrase(CMGroupImpl group) {
+	public void getPhrase(CMGroupImpl group) {
 		if (group == null)
 			return;
 		getDeclarations(group, Arrays.asList(PHRASE).iterator());
@@ -861,7 +756,7 @@
 	 * %preformatted;
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getPreformatted(CMGroupImpl group) {
+	public void getPreformatted(CMGroupImpl group) {
 		if (group == null)
 			return;
 
@@ -873,9 +768,122 @@
 	 * instance.<br>
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getSpecial(CMGroupImpl group) {
+	public void getSpecial(CMGroupImpl group) {
 		if (group == null)
 			return;
 		getDeclarations(group, Arrays.asList(SPECIAL).iterator());
 	}
+
+	private static String[] getNames() {
+		if (fNames == null) {
+			fNames = new String[Ids.getNumOfIds()];
+			fNames[Ids.ID_A] = A;
+			fNames[Ids.ID_ABBR] = ABBR;
+			fNames[Ids.ID_ACRONYM] = ACRONYM;
+			fNames[Ids.ID_ADDRESS] = ADDRESS;
+			fNames[Ids.ID_APPLET] = APPLET;
+			fNames[Ids.ID_AREA] = AREA;
+			fNames[Ids.ID_B] = B;
+			fNames[Ids.ID_BASE] = BASE;
+			fNames[Ids.ID_BASEFONT] = BASEFONT;
+			fNames[Ids.ID_BDO] = BDO;
+			fNames[Ids.ID_BIG] = BIG;
+			fNames[Ids.ID_BLINK] = BLINK;
+			fNames[Ids.ID_BLOCKQUOTE] = BLOCKQUOTE;
+			fNames[Ids.ID_BODY] = BODY;
+			fNames[Ids.ID_BR] = BR;
+			fNames[Ids.ID_BUTTON] = BUTTON;
+			fNames[Ids.ID_CAPTION] = CAPTION;
+			fNames[Ids.ID_CENTER] = CENTER;
+			fNames[Ids.ID_CITE] = CITE;
+			fNames[Ids.ID_CODE] = CODE;
+			fNames[Ids.ID_COL] = COL;
+			fNames[Ids.ID_COLGROUP] = COLGROUP;
+			fNames[Ids.ID_DD] = DD;
+			fNames[Ids.ID_DEL] = DEL;
+			fNames[Ids.ID_DFN] = DFN;
+			fNames[Ids.ID_DIR] = DIR;
+			fNames[Ids.ID_DIV] = DIV;
+			fNames[Ids.ID_DL] = DL;
+			fNames[Ids.ID_DT] = DT;
+			fNames[Ids.ID_EM] = EM;
+			fNames[Ids.ID_EMBED] = EMBED;
+			fNames[Ids.ID_FIELDSET] = FIELDSET;
+			fNames[Ids.ID_FONT] = FONT;
+			fNames[Ids.ID_FORM] = FORM;
+			fNames[Ids.ID_FRAME] = FRAME;
+			fNames[Ids.ID_FRAMESET] = FRAMESET;
+			fNames[Ids.ID_H1] = H1;
+			fNames[Ids.ID_H2] = H2;
+			fNames[Ids.ID_H3] = H3;
+			fNames[Ids.ID_H4] = H4;
+			fNames[Ids.ID_H5] = H5;
+			fNames[Ids.ID_H6] = H6;
+			fNames[Ids.ID_HEAD] = HEAD;
+			fNames[Ids.ID_HR] = HR;
+			fNames[Ids.ID_HTML] = HTML;
+			fNames[Ids.ID_I] = I;
+			fNames[Ids.ID_IFRAME] = IFRAME;
+			fNames[Ids.ID_IMG] = IMG;
+			fNames[Ids.ID_INPUT] = INPUT;
+			fNames[Ids.ID_INS] = INS;
+			fNames[Ids.ID_ISINDEX] = ISINDEX;
+			fNames[Ids.ID_KBD] = KBD;
+			fNames[Ids.ID_LABEL] = LABEL;
+			fNames[Ids.ID_LEGEND] = LEGEND;
+			fNames[Ids.ID_LI] = LI;
+			fNames[Ids.ID_LINK] = LINK;
+			fNames[Ids.ID_MAP] = MAP;
+			fNames[Ids.ID_MENU] = MENU;
+			fNames[Ids.ID_META] = META;
+			fNames[Ids.ID_NOEMBED] = NOEMBED;
+			fNames[Ids.ID_NOFRAMES] = NOFRAMES;
+			fNames[Ids.ID_NOSCRIPT] = NOSCRIPT;
+			fNames[Ids.ID_OBJECT] = OBJECT;
+			fNames[Ids.ID_OL] = OL;
+			fNames[Ids.ID_OPTGROUP] = OPTGROUP;
+			fNames[Ids.ID_OPTION] = OPTION;
+			fNames[Ids.ID_P] = P;
+			fNames[Ids.ID_PARAM] = PARAM;
+			fNames[Ids.ID_PRE] = PRE;
+			fNames[Ids.ID_Q] = Q;
+			fNames[Ids.ID_S] = S;
+			fNames[Ids.ID_SAMP] = SAMP;
+			fNames[Ids.ID_SCRIPT] = SCRIPT;
+			fNames[Ids.ID_SELECT] = SELECT;
+			fNames[Ids.ID_SMALL] = SMALL;
+			fNames[Ids.ID_SPAN] = SPAN;
+			fNames[Ids.ID_STRIKE] = STRIKE;
+			fNames[Ids.ID_STRONG] = STRONG;
+			fNames[Ids.ID_STYLE] = STYLE;
+			fNames[Ids.ID_SUB] = SUB;
+			fNames[Ids.ID_SUP] = SUP;
+			fNames[Ids.ID_TABLE] = TABLE;
+			fNames[Ids.ID_TBODY] = TBODY;
+			fNames[Ids.ID_TD] = TD;
+			fNames[Ids.ID_TEXTAREA] = TEXTAREA;
+			fNames[Ids.ID_TFOOT] = TFOOT;
+			fNames[Ids.ID_TH] = TH;
+			fNames[Ids.ID_THEAD] = THEAD;
+			fNames[Ids.ID_TITLE] = TITLE;
+			fNames[Ids.ID_TR] = TR;
+			fNames[Ids.ID_TT] = TT;
+			fNames[Ids.ID_U] = U;
+			fNames[Ids.ID_UL] = UL;
+			fNames[Ids.ID_VAR] = VAR;
+			fNames[Ids.ID_MARQUEE] = MARQUEE;
+			fNames[Ids.ID_SSI_CONFIG] = SSI_CONFIG;
+			fNames[Ids.ID_SSI_ECHO] = SSI_ECHO;
+			fNames[Ids.ID_SSI_EXEC] = SSI_EXEC;
+			fNames[Ids.ID_SSI_FSIZE] = SSI_FSIZE;
+			fNames[Ids.ID_SSI_FLASTMOD] = SSI_FLASTMOD;
+			fNames[Ids.ID_SSI_INCLUDE] = SSI_INCLUDE;
+			fNames[Ids.ID_SSI_PRINTENV] = SSI_PRINTENV;
+			fNames[Ids.ID_SSI_SET] = SSI_SET;
+			fNames[Ids.ID_BGSOUND] = BGSOUND;
+			fNames[Ids.ID_NOBR] = NOBR;
+			fNames[Ids.ID_WBR] = WBR;
+		}
+		return fNames;
+	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/H5CMDocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/H5CMDocImpl.java
new file mode 100644
index 0000000..e16c9dd
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/H5CMDocImpl.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * CMDocument implementation for the HTML.
+ */
+class H5CMDocImpl extends CMNodeImpl implements HTMLCMDocument {
+
+	/** Namespace for all names of elements, entities and attributes. */
+	private CMNamespaceImpl namespace = null;
+	private HTML5ElementCollection elements = null;
+	private EntityCollection entities = null;
+	private AttributeCollection attributes = null;
+
+	/**
+	 */
+	public H5CMDocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
+		super(docTypeName);
+		namespace = targetNamespace;
+		
+		attributes = new HTML5AttributeCollection();
+		elements = new HTML5ElementCollection(attributes);
+		entities = new EntityCollection();
+	}
+
+	AttributeCollection getAttributes() {
+		return attributes;
+	}
+
+	public HTMLElementDeclaration getElementDeclaration(String elementName) {
+		if (elements == null)
+			return null;
+		return (HTMLElementDeclaration) elements.getNamedItem(elementName);
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
+	 */
+	public CMNamedNodeMap getElements() {
+		return elements;
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
+	 */
+	public CMNamedNodeMap getEntities() {
+		return entities;
+	}
+
+	public HTMLEntityDeclaration getEntityDeclaration(String entityName) {
+		if (entities == null)
+			return null;
+		return (HTMLEntityDeclaration) entities.getNamedItem(entityName);
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
+	 */
+	public CMNamespace getNamespace() {
+		return namespace;
+	}
+
+	/**
+	 * @see CMNode
+	 */
+	public int getNodeType() {
+		return CMNode.DOCUMENT;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java
new file mode 100644
index 0000000..9622122
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java
@@ -0,0 +1,1332 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+
+public class HTML5AttributeCollection extends AttributeCollection implements HTML50Namespace {
+	/** html5 core attribs */
+	private static final String[] CORE = {ATTR_NAME_ACCESSKEY, ATTR_NAME_CLASS, ATTR_NAME_CONTENT_EDITABLE, ATTR_NAME_CONTEXT_MENU, ATTR_NAME_DIR, ATTR_NAME_DRAGGABLE, ATTR_NAME_HIDDEN, ATTR_NAME_ID, ATTR_NAME_LANG, ATTR_NAME_SPELLCHECK,ATTR_NAME_STYLE, ATTR_NAME_TABINDEX, ATTR_NAME_TITLE};
+	/** events for HTML5. */
+	private static final String[] EVENTS = {ATTR_NAME_ONABORT, ATTR_NAME_ONBLUR, ATTR_NAME_ONCAN_PLAY, ATTR_NAME_ONCAN_PLAY_THROUGH, ATTR_NAME_ONCHANGE, ATTR_NAME_ONCLICK, ATTR_NAME_ONCONTEXT_MENU, ATTR_NAME_ONDBLCLICK, ATTR_NAME_ONDRAG, ATTR_NAME_ONDRAG_END, ATTR_NAME_ONDRAG_ENTER, ATTR_NAME_ONDRAG_LEAVE, 
+		ATTR_NAME_ONDRAG_OVER, ATTR_NAME_ONDRAG_START, ATTR_NAME_ONDROP, ATTR_NAME_ONDURATION_CHANGE, ATTR_NAME_ONEMPTIED, ATTR_NAME_ONENDED, ATTR_NAME_ONERROR, ATTR_NAME_ONFOCUS, ATTR_NAME_ONFORM_CHANGE, ATTR_NAME_ONFORM_INPUT, ATTR_NAME_ONINVALID,ATTR_NAME_ONKEYPRESS, ATTR_NAME_ONKEYDOWN, ATTR_NAME_ONKEYUP, 
+		ATTR_NAME_ONLOAD, ATTR_NAME_ONLOAD_START, ATTR_NAME_ONLOADED_DATA, ATTR_NAME_ONLOADED_METADATA, ATTR_NAME_ONMOUSEDOWN, ATTR_NAME_ONMOUSEUP, ATTR_NAME_ONMOUSEOVER, ATTR_NAME_ONMOUSEMOVE, ATTR_NAME_ONMOUSEOUT, ATTR_NAME_ONMOUSE_WHEEL, ATTR_NAME_ONPAUSE, ATTR_NAME_ONPLAY, ATTR_NAME_ONPLAYING, ATTR_NAME_ONPROGRESS,
+		ATTR_NAME_ONRATE_CHANGE, ATTR_NAME_ONREADY_STATE_CHANGE, ATTR_NAME_ONSCROLL, ATTR_NAME_ONSEEKED, ATTR_NAME_ONSEEKING, ATTR_NAME_ONSELECT, ATTR_NAME_ONSHOW, ATTR_NAME_ONSTALLED, ATTR_NAME_ONSUBMIT, ATTR_NAME_ONSUSPEND, ATTR_NAME_ONTIME_UPDATE, ATTR_NAME_ONVOLUME_UPDATE, ATTR_NAME_ONWAITING};
+
+	protected HTMLAttrDeclImpl create(String attrName) {
+		HTMLAttrDeclImpl attr = null;
+		HTMLCMDataTypeImpl atype = null;
+		if (attrName.equalsIgnoreCase(ATTR_NAME_AUTOFOCUS)) {
+			// (disabled (disabled) #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			// boolean attribute must have the same value as its name.
+			String[] values = {ATTR_NAME_AUTOFOCUS};
+			atype.setEnumValues(values);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_CONTENT_EDITABLE)) {
+			// (contenteditable (EMPTY|TRUE|FALSE|INHERIT) TRUE)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_EMPTY, ATTR_VALUE_TRUE, ATTR_VALUE_FALSE, ATTR_VALUE_INHERIT};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTENT_EDITABLE, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_CHALLENGE)) {
+			// (challenge CDATA; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CHALLENGE, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_CONTEXT_MENU)) {
+			// (contextmenu, CDATA, IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTEXT_MENU, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_DRAGGABLE)) {
+			// (draggable (TRUE|FALSE|AUTO) TRUE)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE, ATTR_VALUE_AUTO};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_DRAGGABLE, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_FORM)) {
+			// (form CDATA; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORM, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_KEYTYPE)) {
+			// (keytype CDATA; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_KEYTYPE, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_LOW)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_LOW, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_HIGH)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_HIGH, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_OPTIMUM)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_OPTIMUM, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_MIN)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MIN, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_MAX)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MAX, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_OPEN)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			atype.setEnumValues(new String[] { ATTR_NAME_OPEN });
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_OPEN, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_PUBDATE)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			atype.setEnumValues(new String[] { ATTR_NAME_PUBDATE });
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_PUBDATE, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_SPELLCHECK)) {
+			// (spellcheck (EMPTY|TRUE|FALSE) TRUE)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_EMPTY, ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SPELLCHECK, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONABORT)) {
+			// (onabort %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONABORT, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCAN_PLAY)) {
+			// (oncanplay %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCAN_PLAY, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCAN_PLAY_THROUGH)) {
+			// (oncanplaythrough %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCAN_PLAY_THROUGH, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCHANGE)) {
+			// (onchange %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCHANGE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCONTEXT_MENU)) {
+			// (onacontextmenu %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCONTEXT_MENU, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG)) {
+			// (onadrag %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_END)) {
+			// (ondragend %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_END, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_ENTER)) {
+			// (ondragenter %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_ENTER, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_LEAVE)) {
+			// (ondragleave %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_LEAVE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_OVER)) {
+			// (ondragover %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_OVER, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_START)) {
+			// (ondragstart %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_START, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDROP)) {
+			// (ondrop %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDROP, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDURATION_CHANGE)) {
+			// (ondurationchange %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDURATION_CHANGE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONEMPTIED)) {
+			// (onemptied %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONEMPTIED, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONENDED)) {
+			// (onended %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONENDED, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONERROR)) {
+			// (onerror %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONERROR, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONFOCUS)) {
+			// (onfocus %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONFORM_CHANGE)) {
+			// (onformchange %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONFORM_CHANGE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONFORM_INPUT)) {
+			// (onforminput %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONFORM_INPUT, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONINPUT)) {
+			// (oninput %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONINPUT, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONINVALID)) {
+			// (oninvalid %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONINVALID, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOAD)) {
+			// (onload %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOAD, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOAD_START)) {
+			// (onloadstart %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOAD_START, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOADED_DATA)) {
+			// (onloadeddata %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOADED_DATA, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOADED_METADATA)) {
+			// (onloadedmetadata %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOADED_METADATA, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSE_WHEEL)) {
+			// (onmousewheel %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSE_WHEEL, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONPLAY)) {
+			// (onplay %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONPLAY, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONPLAYING)) {
+			// (onplaying %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONPLAYING, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONPAUSE)) {
+			// (onpause %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONPAUSE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONPROGRESS)) {
+			// (onprogress %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONPROGRESS, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONRATE_CHANGE)) {
+			// (onratechange %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONRATE_CHANGE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONREADY_STATE_CHANGE)) {
+			// (onreadystatechange %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONREADY_STATE_CHANGE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSCROLL)) {
+			// (onscroll %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSCROLL, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSEEKED)) {
+			// (onseeked %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSEEKED, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSEEKING)) {
+			// (onseeking %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSEEKING, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSELECT)) {
+			// (onselect %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSELECT, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSHOW)) {
+			// (onshow %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSHOW, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSTALLED)) {
+			// (onstalled %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSTALLED, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSUBMIT)) {
+			// (onsubmit %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSUBMIT, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSUSPEND)) {
+			// (onsuspend %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSUSPEND, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONTIME_UPDATE)) {
+			// (ontimeupdate %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONTIME_UPDATE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONVOLUME_UPDATE)) {
+			// (onvolumeupdate %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONVOLUME_UPDATE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONWAITING)) {
+			// (onwaiting %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONWAITING, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else {
+			attr = super.create(attrName);
+		}
+		return attr;
+	}
+
+	public void getAttrs(CMNamedNodeMapImpl declarations) {
+		// %coreattrs;
+		getCore(declarations);
+		// %events;
+		getEvents(declarations);
+	}
+
+	public void getCore(CMNamedNodeMapImpl declarations) {
+		Iterator names = Arrays.asList(CORE).iterator();
+		getDeclarations(declarations, names);
+	}
+
+	public void getEvents(CMNamedNodeMapImpl declarations) {
+		Iterator names = Arrays.asList(EVENTS).iterator();
+		getDeclarations(declarations, names);
+	}
+	
+	public void createAttributeDeclarations(String elementName, CMNamedNodeMapImpl attributes) {
+		/* (type %InputType; TEXT) ... should be defined locally.
+		 * (name CDATA #IMPLIED)
+		 * (value CDATA #IMPLIED)
+		 * (checked (checked) #IMPLIED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (readonly (readonly) #IMPLIED)
+		 * (size CDATA #IMPLIED) ... should be defined locally.
+		 * (maxlength NUMBER #IMPLIED)
+		 * (src %URI; #IMPLIED)
+		 * (alt CDATA #IMPLIED) ... should be defined locally.
+		 * (accept %ContentTypes; #IMPLIED)
+		 * (width CDATA; #IMPLIED)
+		 * (height CDATA; #IMPLIED)
+		 * (autocomplete Boolean; #IMPLIED)
+		 * (autofocus Boolean; #IMPLIED)
+		 * (form CDATA; #IMPLIED)
+		 * (formaction)
+		 * (formenctype)
+		 * (formmethod)
+		 * (formnovalidate)
+		 * (formtarget)
+		 * (list)
+		 * (max)
+		 * (min)
+		 * (multiple)
+		 * (pattern)
+		 * (placeholder CDATA #IMPLIED)
+		 * (required)
+		 * (step)
+		 * discouraged tags :- 
+		 * (usemap %URI; #IMPLIED)
+		 * (ismap (ismap) #IMPLIED)
+		 */
+		if (elementName.equals(HTML40Namespace.ElementName.INPUT)){
+			HTMLCMDataTypeImpl atype = null;
+			HTMLAttrDeclImpl attr = null;
+			// (type %InputType; TEXT) ... should be defined locally.
+			// NOTE: %InputType is ENUM;
+			// (text | password | checkbox | radio | submit | reset |
+			//  file | hidden | image | button
+			//  color| date | time | datetime | datetime-local | month | week| email| 
+			//  number | range | search | tel)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_TEXT, ATTR_VALUE_PASSWORD, ATTR_VALUE_CHECKBOX, ATTR_VALUE_RADIO, ATTR_VALUE_SUBMIT, ATTR_VALUE_RESET, ATTR_VALUE_FILE, ATTR_VALUE_HIDDEN, ATTR_VALUE_IMAGE, ATTR_VALUE_BUTTON,
+					 ATTR_VALUE_COLOR, ATTR_VALUE_DATE, ATTR_VALUE_DATETIME, ATTR_VALUE_DATETIME_LOCAL, ATTR_VALUE_EMAIL, ATTR_VALUE_MONTH, ATTR_VALUE_NUMBER, ATTR_VALUE_RANGE, ATTR_VALUE_SEARCH, ATTR_VALUE_TEL, ATTR_VALUE_TIME};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TEXT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+
+			// (size CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SIZE, attr);
+
+			// (alt CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ALT, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_ALT, attr);
+			
+			
+			// (type %autocomeplete; ) ... should be defined locally.
+			// NOTE: %autocomeplete is ENUM;
+			// (on | off)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] autoCompleteValues = {ATTR_VALUE_ON, ATTR_VALUE_OFF};
+			atype.setEnumValues(autoCompleteValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOCOMPLETE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_AUTOCOMPLETE, attr);
+
+			
+			// (form CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORM, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORM, attr);
+			
+			
+			// (formaction URI #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMACTION, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMACTION, attr);
+
+			
+			// (type %formmethod; GET) ... should be defined locally.
+			// NOTE: %formmethod is ENUM;
+			// (GET|POST|PUT|DELETE)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] formMethodValues = {ATTR_VALUE_GET, ATTR_VALUE_POST, ATTR_VALUE_PUT, ATTR_VALUE_DELETE};
+			atype.setEnumValues(formMethodValues);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_GET);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMMETHOD, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMMETHOD, attr);
+
+			// (type %formenctype; GET) ... should be defined locally.
+			// NOTE: %formenctype is ENUM;
+			// (application/x-www-form-urlencoded| multipart/form-data| text/plain)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] formEncTypeValues = {ATTR_VALUE_WWW_FORM_URLENCODED, ATTR_VALUE_FORM_DATA, ATTR_VALUE_PLAIN};
+			atype.setEnumValues(formEncTypeValues);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_WWW_FORM_URLENCODED);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMENCTYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMENCTYPE, attr);
+
+			// (formtarget BROWSEING CONTEXT #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.BROWSING_CONTEXT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMTARGET, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMTARGET, attr);
+			
+			// (formtnovalidate  #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			// boolean attribute must have the same value as its name.
+			String[] formNoValidateValues = {ATTR_NAME_FORMNOVALIDATE};
+			atype.setEnumValues(formNoValidateValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMNOVALIDATE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMNOVALIDATE, attr);
+
+		
+			// (list ID #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.ID);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_LIST, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_LIST, attr);
+
+			// (min CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MIN, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_MIN, attr);
+
+			// (max CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MAX, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_MAX, attr);
+
+			// (maxlength NUMBER #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MAXLENGTH, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_MAXLENGTH, attr);
+
+			// (multiple  #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			// boolean attribute must have the same value as its name.
+			String[] multipleValues = {ATTR_NAME_MULTIPLE};
+			atype.setEnumValues(multipleValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MULTIPLE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_MULTIPLE, attr);
+
+		
+			// (step CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_STEP, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_STEP, attr);
+
+			// (placeholder CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_PLACEHOLDER, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_PLACEHOLDER, attr);
+
+			// (pattern CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_PATTERN, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_PATTERN, attr);
+
+			// (required  #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			// boolean attribute must have the same value as its name.
+			String[] requiredValues = {ATTR_NAME_REQUIRED};
+			atype.setEnumValues(requiredValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_REQUIRED, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_REQUIRED, attr);
+
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_VALUE, ATTR_NAME_CHECKED, ATTR_NAME_DISABLED, ATTR_NAME_READONLY, ATTR_NAME_SIZE, ATTR_NAME_MAXLENGTH, ATTR_NAME_SRC, ATTR_NAME_ALT, ATTR_NAME_ACCEPT, //<<D215684
+						ATTR_NAME_WIDTH, ATTR_NAME_HEIGHT,			//<D215684
+				//html5
+						ATTR_NAME_AUTOFOCUS
+			};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			//discouraged
+			// (ismap (ismap) #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] ismapValues = {ATTR_NAME_ISMAP};
+			atype.setEnumValues(ismapValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ISMAP, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_ISMAP, attr);
+			
+			// (usemap %URI; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_USEMAP, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_USEMAP, attr);
+
+			
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		}
+		/* (href %URI; #IMPLIED)
+		 * (hreflang %LanguageCode; #IMPLIED)
+		 * (type %ContentType; #IMPLIED): should be defined locally.
+		 * (rel %LinkTypes; #IMPLIED)
+		 * (media %MediaDesc; #IMPLIED)
+		 * // discouraged
+		 * (charset %Charset; #IMPLIED)
+		 * (rev %LinkTypes; #IMPLIED)
+		 * (target %FrameTarget; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.LINK)){
+			String[] names = { ATTR_NAME_TYPE, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_REL,  ATTR_NAME_MEDIA};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// (sizes %Pixels; #IMPLIED)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZES, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SIZES, attr);
+			
+			//discouraged
+			// (charset %Charset; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARSET);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CHARSET, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_CHARSET, attr);
+			
+			// (rev %LinkTypes; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LINK_TYPES);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_REV, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_REV, attr);
+			
+			// (target %FrameTarget; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.FRAME_TARGET);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_TARGET, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_TARGET, attr);
+			
+		}
+		/* (type %ContentType; #IMPLIED)
+		 * (href %URI; #IMPLIED)
+		 * (hreflang %LanguageCode; #IMPLIED)
+		 * (target %FrameTarget; #IMPLIED)
+		 * (rel %LinkTypes; #IMPLIED)
+		 * (media %media_desc; #IMPLIED
+		 * //discouraged
+		 * (charset %Charset; #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * (rev %LinkTypes; #IMPLIED)
+		 * (directkey %Character; #IMPLIED)
+		 * (shape %Shape; rect)
+		 * (coords %Coords; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.A)){
+			String[] names = { ATTR_NAME_MEDIA, ATTR_NAME_TYPE, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_REL};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			
+			
+			//discouraged
+			// (charset %Charset; #IMPLIED)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARSET);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_CHARSET, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_CHARSET, attr);
+			
+			// (rev %LinkTypes; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LINK_TYPES);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_REV, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_REV, attr);
+			
+			// (target %FrameTarget; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.FRAME_TARGET);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_TARGET, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_TARGET, attr);
+			
+			// (directkey %Character; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARACTER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_DIRECTKEY, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_DIRECTKEY, attr);
+			
+			// (shape %Shape; rect): %Shape; is (rect|circle|poly|default).
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_RECT, ATTR_VALUE_CIRCLE, ATTR_VALUE_POLY, ATTR_VALUE_DEFAULT};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_RECT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SHAPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_SHAPE, attr);
+			
+			// (coords %Coords; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COORDS);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_COORDS, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_COORDS, attr);
+			
+			// (name CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_NAME, attr);
+	
+		}
+		/*
+		 * (shape %Shape; rect)
+		 * (coords %Coords; #IMPLIED)
+		 * (href %URI; #IMPLIED)
+		 * (target %FrameTarget; #IMPLIED)
+		 * (alt %Text; #REQUIRED)
+		 * (media %media_desc; #IMPLIED)
+		 * (rel %LinkTypes; #IMPLIED)
+		 * (type %ContentType; #IMPLIED)
+		 * //disocuraged
+		 * (nohref (nohref) #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.AREA)){
+			// (media %MediaDesc; #IMPLIED)
+			String[] names = {ATTR_NAME_TYPE, ATTR_NAME_MEDIA, ATTR_NAME_SHAPE, ATTR_NAME_COORDS, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_TARGET, ATTR_NAME_ALT, ATTR_NAME_REL};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			
+			// (nohref (nohref) #IMPLIED)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_NAME_NOHREF};
+			atype.setEnumValues(values);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NOHREF, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_NOHREF, attr);
+		
+		}
+		/*
+		 *  %globalattrs;
+		 * (http-equiv NAME #IMPLIED)
+		 * (name NAME #IMPLIED) ... should be defined locally.
+		 * (content CDATA #REQUIRED)
+		 * (charset %Charset; #IMPLIED)
+		 *  //discouraged
+		 * (scheme CDATA #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.META)){
+			// globalattrs;
+			getAttrs(attributes);
+
+			// (name NAME #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_NAME, attr);
+
+			// (content CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTENT, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_CONTENT, attr);
+			
+			String[] names = {ATTR_NAME_HTTP_EQUIV, ATTR_NAME_CHARSET};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			
+			// discouraged
+			// (scheme CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SCHEME, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_SCHEME, attr);
+			
+		}
+		/*
+		 * (src %URI; #REQUIRED): should be defined locally.
+		 * (alt %Text; #REQUIRED)
+		 * (usemap %URI; #IMPLIED)
+		 * (ismap (ismap) #IMPLIED)
+		 *  // discouraged
+		 * (longdesc %URI; #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * (height %Length; #IMPLIED)
+		 * (width %Length; #IMPLIED)
+		 * (align %IAlign; #IMPLIED): should be defined locally.
+		 * (border %Pixels; #IMPLIED)
+		 * (hspace %Pixels; #IMPLIED)
+		 * (vspace %Pixels; #IMPLIED)
+		 * (mapfile %URI; #IMPLIED)
+	 
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.IMG)){
+			// (src %URI; #REQUIRED): should be defined locally.
+			HTMLCMDataTypeImpl atype = null;
+			HTMLAttrDeclImpl attr = null;
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_SRC, attr);
+
+			String[] names = {ATTR_NAME_ALT, ATTR_NAME_LONGDESC, ATTR_NAME_NAME, ATTR_NAME_HEIGHT, ATTR_NAME_WIDTH, ATTR_NAME_USEMAP, ATTR_NAME_ISMAP, ATTR_NAME_BORDER, ATTR_NAME_HSPACE, ATTR_NAME_VSPACE, ATTR_NAME_MAPFILE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// align (local); should be defined locally.
+			attr = AttributeCollection.createAlignForImage();
+			attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
+		
+		}
+		/*
+		 * (name CDATA #REQUIRED) ... should be defined locally.
+		 * (value CDATA #IMPLIED)
+		 * global attributes
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.PARAM)){
+			
+			// (name CDATA #REQUIRED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_NAME, attr);
+			
+			// (value CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_VALUE, attr);
+			
+			// gloabl attrs
+			getAttrs(attributes);
+		}
+		/*
+		 * (autofocus Boolean; #IMPLIED)
+		 * (form CDATA; #IMPLIED)
+		 * (placeholder CDATA #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * (rows NUMBER #REQUIRED)
+		 * (cols NUMBER #REQUIRED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (readonly (readonly) #IMPLIED)
+		 * (maxlength NUMBER; #IMPLIED)
+		 * (wrap ENUM; #IMPLIED)
+		 *  //discouraged
+		 * (istyle CDATA #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.TEXTAREA)){
+			String[] names = {ATTR_NAME_MAXLENGTH, ATTR_NAME_FORM, ATTR_NAME_AUTOFOCUS, ATTR_NAME_NAME, ATTR_NAME_ROWS, ATTR_NAME_COLS, ATTR_NAME_DISABLED, ATTR_NAME_READONLY};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			
+			// (placeholder CDATA #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_PLACEHOLDER, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_PLACEHOLDER, attr);
+			
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_SOFT, ATTR_VALUE_HARD};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_SOFT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_WRAP, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_WRAP, attr);
+			
+			// discouraged
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ISTYLE, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_ISTYLE, attr);
+		}
+		/*
+		 * (charset %Charset; #IMPLIED)
+		 * (type %ContentType; #REQUIRED) ... should be defined locally.
+		 * (asynch boolean #IMPLIED)
+		 * (src %URI; #IMPLIED)
+		 * (defer (defer) #IMPLIED)
+		 *  // discouraged
+		 * (language CDATA #IMPLIED)
+		 * (event CDATA #IMPLIED)
+		 * (for %URI; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.TEXTAREA)){
+			String[] names = {ATTR_NAME_CHARSET,  ATTR_NAME_SRC, ATTR_NAME_DEFER};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// (type %ContentType; #REQUIRED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/javascript"); //$NON-NLS-1$
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+			
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_NAME_ASYNC};
+			atype.setEnumValues(values);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ASYNC, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_ASYNC, attr);
+			
+			
+			// discouraged
+			// (language %CDATA; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_LANGUAGE, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_LANGUAGE, attr);
+			
+			// (event CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_EVENT, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_EVENT, attr);
+			
+			// (for %URI; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FOR, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_FOR, attr);
+		
+		}
+		/*
+		 *  %attrs;
+		 * (type %ContentType; #REQUIRED) ... should be defined locally.
+		 * (media %MediaDesc; #IMPLIED)
+		 * (scoped boolean; #implied)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.STYLE)){
+			// %i18n;
+			getAttrs(attributes);
+
+			String[] names = {ATTR_NAME_MEDIA};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			// (type %ContentType; #REQUIRED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/css"); //$NON-NLS-1$
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+			
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_NAME_SCOPED};
+			atype.setEnumValues(values);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SCOPED, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SCOPED, attr);
+		}
+		/*
+		 * %reserved;
+		 * (name CDATA #IMPLIED)
+		 * (size NUMBER #IMPLIED) ... should be defined locally.
+		 * (multiple (multiple) #IMPLIED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (autofocus Boolean; #IMPLIED)
+		 * (form CDATA; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.SELECT)){
+			// (size NUMBER #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SIZE, attr);
+
+			String[] names = {ATTR_NAME_FORM, ATTR_NAME_AUTOFOCUS,ATTR_NAME_NAME, ATTR_NAME_MULTIPLE, ATTR_NAME_DISABLED, ATTR_NAME_TABINDEX, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR, ATTR_NAME_ONCHANGE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		
+		}
+		/*
+		 * (value NUMBER #IMPLIED) ... should be defined locally.
+		 *  //discouraged
+		 *  (type %LIStyle; #IMPLIED) ... should be defined locally.
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.LI)){
+			// (type %LIStyle; #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LI_STYLE);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+
+			// (value NUMBER #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_VALUE, attr);
+		
+		}
+		/*
+		 * (start NUMBER #IMPLIED)
+		 * (reversed BOOLEAN; IMPLIED)
+		 *   //discouraged
+		 * (type %OLStyle; #IMPLIED) ... should be defined locally.
+		 * (compact (compact) #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.OL)){
+
+			String[] names = { ATTR_NAME_START};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_NAME_REVERSED};
+			atype.setEnumValues(values);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_REVERSED, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_REVERSED, attr);
+			
+			//discouraged 
+			// (type %OLStyle; #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.OL_STYLE);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+			
+			// (compact (compact) #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] compactValues = {ATTR_NAME_COMPACT};
+			atype.setEnumValues(compactValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_COMPACT, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_COMPACT, attr);
+		}
+		/**
+		 * %attrs;
+		 * (src %URI; #IMPLIED)
+		 * (srcdoc %CONTENT_TYPE; #IMPLIED)
+		 * (seamless BOOLEAN; #IMPLIED)
+		 * (sandbox CDATA; #IMPLED)
+		 * (height %Length; #IMPLIED)
+		 * (width %Length; #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * //discouraged
+		 * (longdesc %URI; #IMPLIED)
+		 * (frameborder (1|0) 1)
+		 * (marginwidth %Pixels; #IMPLIED)
+		 * (marginheight %Pixels; #IMPLIED)
+		 * (scrolling (yes|no|auto) auto)
+		 * (align %IAlign; #IMPLIED) ... should be defined locally.
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.IFRAME)){
+			// %attrs;
+			getAttrs(attributes);
+			
+			//srcdoc
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_SRCDOC, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SRCDOC, attr);
+
+			// (seamless (seamless) #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] compactValues = {ATTR_NAME_SEAMLESS};
+			atype.setEnumValues(compactValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SEAMLESS, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SEAMLESS, attr);
+		
+			//sandbox
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SANDBOX, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SANDBOX, attr);
+			
+			
+			String[] names = { ATTR_NAME_NAME, ATTR_NAME_SRC, ATTR_NAME_HEIGHT, ATTR_NAME_WIDTH};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			//discouraged
+			// (marginwidth %Pixels; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MARGINWIDTH, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_MARGINWIDTH, attr);
+			
+			// (marginheight %Pixels; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MARGINHEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_MARGINHEIGHT, attr);
+			
+			// (scrolling (yes|no|auto) auto)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_YES, ATTR_VALUE_NO, ATTR_VALUE_AUTO};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_AUTO);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SCROLLING, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_SCROLLING, attr);
+
+			// (frameborder (1|0) 1)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] frameValues = {ATTR_VALUE_1, ATTR_VALUE_0};
+			atype.setEnumValues(frameValues);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAMEBORDER, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_FRAMEBORDER, attr);
+			
+			// (longdesc %URI; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_LONGDESC, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_LONGDESC, attr);
+			
+			
+			// align
+			attr = AttributeCollection.createAlignForImage();
+			if (attr != null)
+				attr.obsolete(true);
+				attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
+		}
+		/*
+		 * (%attrs)
+		 * (manisfest %URI; #IMPLIED)
+		 * (xmlns %URI; #IMPLIED)
+		 * //discouraged
+		 * (version CDATA #FIXED '%HTML.Version;)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.HTML)){
+			// %attrs;
+			getAttrs(attributes);
+			// (manisfest %URI; #IMPLIED)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_MANIFEST, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_MANIFEST, attr);
+			
+			// (version CDATA #FIXED '%HTML.Version;)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_FIXED, ATTR_VALUE_VERSION_TRANSITIONAL);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_VERSION, atype, CMAttributeDeclaration.FIXED);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_VERSION, attr);
+			
+			// (xmlns CDATA #FIXED '%xmlns;)
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_XMLNS, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_XMLNS, attr);
+		}
+		/*
+		 * (type enum; (context | toolbar | list))
+		 * (label %Text; #IMPLIED)
+		 *  //discouraged
+		 * (compact (compact) #IMPLIED)
+	 	 */
+		else if (elementName.equals(HTML40Namespace.ElementName.MENU)){
+			// (type %menuType; list) ... should be defined locally is ENUM.
+			//  (context | toolbar | list)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_CONTEXT, ATTR_VALUE_TOOLBAR, ATTR_VALUE_LIST};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_LIST);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+
+			// (label %Text; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_LABEL, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_LABEL, attr);
+
+			// (compact (compact) #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] compactValues = {ATTR_NAME_COMPACT};
+			atype.setEnumValues(compactValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_COMPACT, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_COMPACT, attr);
+		}
+		/*
+		 * (type %button; TEXT) ... should be defined locally.
+		 * (name CDATA #IMPLIED)
+		 * (value CDATA #IMPLIED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (autofocus Boolean; #IMPLIED)
+		 * (form CDATA; #IMPLIED)
+		 * (formaction)
+		 * (formenctype)
+		 * (formmethod)
+		 * (formnovalidate)
+		 * (formtarget)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.BUTTON)){
+			// (type (button|submit|reset) submit) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_BUTTON, ATTR_VALUE_SUBMIT, ATTR_VALUE_RESET};
+			atype.setEnumValues(values);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+			
+
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_VALUE, ATTR_NAME_DISABLED,
+				//html5
+						ATTR_NAME_AUTOFOCUS
+			};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			
+			// (form CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORM, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORM, attr);
+			
+			
+			// (formaction URI #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMACTION, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMACTION, attr);
+
+			
+			// (type %formmethod; GET) ... should be defined locally.
+			// NOTE: %formmethod is ENUM;
+			// (GET|POST|PUT|DELETE)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] formMethodValues = {ATTR_VALUE_GET, ATTR_VALUE_POST, ATTR_VALUE_PUT, ATTR_VALUE_DELETE};
+			atype.setEnumValues(formMethodValues);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_GET);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMMETHOD, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMMETHOD, attr);
+
+			// (type %formenctype; GET) ... should be defined locally.
+			// NOTE: %formenctype is ENUM;
+			// (application/x-www-form-urlencoded| multipart/form-data| text/plain)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] formEncTypeValues = {ATTR_VALUE_WWW_FORM_URLENCODED, ATTR_VALUE_FORM_DATA, ATTR_VALUE_PLAIN};
+			atype.setEnumValues(formEncTypeValues);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_WWW_FORM_URLENCODED);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMENCTYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMENCTYPE, attr);
+
+			// (formtarget BROWSEING CONTEXT #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.BROWSING_CONTEXT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMTARGET, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMTARGET, attr);
+			
+			// (formtnovalidate  #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			// boolean attribute must have the same value as its name.
+			String[] formNoValidateValues = {ATTR_NAME_FORMNOVALIDATE};
+			atype.setEnumValues(formNoValidateValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMNOVALIDATE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMNOVALIDATE, attr);
+
+		}
+		/*
+		 * (name CDATA #IMPLIED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (form CDATA; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.FIELDSET)){
+			// (form CDATA #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_FORM, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORM, attr);
+			
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_DISABLED };
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+				
+		}
+		/*
+		 * (summary %Text; #IMPLIED)
+		 *  //discouraged
+		 * %reserved;
+		 * (width %Length; #IMPLIED)
+		 * (border %Pixels; #IMPLIED)
+		 * (frame %TFrame; #IMPLIED)
+		 * (rules %TRules; #IMPLIED)
+		 * (cellspacing %Length; #IMPLIED)
+		 * (cellpadding %Length; #IMPLIED)
+		 * (align %TAlign; #IMPLIED)
+		 * (bgcolor %Color; #IMPLIED)
+		 * (datapagesize CDATA #IMPLIED)
+		 * (height %Pixels; #IMPLIED)
+		 * (background %URI; #IMPLIED)
+		 * (bordercolor %Color #IMPLIED) ... D205514
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.TABLE)){
+			// %reserved;
+			// ... %reserved; is empty in the current DTD.
+
+			String[] names = {ATTR_NAME_SUMMARY};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// align (local)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] alignValues = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT};
+			atype.setEnumValues(alignValues);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
+			
+			// (width %Length; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_WIDTH, attr);
+			
+			// (border %Pixels; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDER, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_BORDER, attr);
+			
+			// (frame %TFrame; #IMPLIED)
+			// %TFrame; is
+			// (void|above|below|hsides|lhs|rhs|vsides|box|border).
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_VOID, ATTR_VALUE_ABOVE, ATTR_VALUE_BELOW, ATTR_VALUE_HSIDES, ATTR_VALUE_LHS, ATTR_VALUE_RHS, ATTR_VALUE_VSIDES, ATTR_VALUE_BOX, ATTR_VALUE_BORDER};
+			atype.setEnumValues(values);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAME, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_FRAME, attr);
+			
+			// (rules %TRules; #IMPLIED)
+			// %TRules; is (none | groups | rows | cols | all).
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] ruleValues = {ATTR_VALUE_NONE, ATTR_VALUE_GROUPS, ATTR_VALUE_ROWS, ATTR_VALUE_COLS, ATTR_VALUE_ALL};
+			atype.setEnumValues(ruleValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_RULES, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_RULES, attr);
+			
+			// (cellspacing %Length; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CELLSPACING, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_CELLSPACING, attr);
+			
+			// (cellpadding %Length; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CELLPADDING, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_CELLPADDING, attr);
+			
+			// (bgcolor %Color; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_BGCOLOR, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_BGCOLOR, attr);
+			
+			// (datapagesize CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_DATAPAGESIZE, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_DATAPAGESIZE, attr);
+			
+			// (height %Length; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_HEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_HEIGHT, attr);
+			
+			// (background %URI; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_BACKGROUND, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_BACKGROUND, attr);
+			
+			// (bordercolor, %Color; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDERCOLOR, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_BORDERCOLOR, attr);
+			
+			
+		}
+	}
+	
+	public static String[] getGlobalAttributeList(){
+		return CORE;
+	}
+	
+	public static String[] getGlobalEventList(){
+		return EVENTS;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java
new file mode 100644
index 0000000..9e2d4b8
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java
@@ -0,0 +1,577 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import java.lang.reflect.Field;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Vector;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * Factory for element declarations.
+ */
+class HTML5ElementCollection extends ElementCollection implements org.eclipse.wst.html.core.internal.provisional.HTML50Namespace.ElementName {
+
+
+	// Element IDs
+	private static class Ids50 extends Ids {
+		// <<D205513
+		
+		public static final int ID_ARTICLE =106;
+		public static final int ID_ASIDE =107;
+		public static final int ID_AUDIO =108;
+		public static final int ID_CANVAS =109;
+		public static final int ID_COMMAND =110;
+		public static final int ID_DATALIST =111;
+		public static final int ID_DETAILS = 112;
+		public static final int ID_FIGURE =113;
+		public static final int ID_FIGCAPTION = 114;
+		public static final int ID_FOOTER =115;
+		public static final int ID_HEADER = 116;
+		public static final int ID_HGROUP =117;
+		public static final int ID_KEYGEN =118;
+		public static final int ID_MARK =119;
+		public static final int ID_MATH =120;
+		public static final int ID_METER =121;
+		public static final int ID_NAV =122;
+		public static final int ID_OUTPUT =123;
+		public static final int ID_PROGRESS =124;
+		public static final int ID_RP = 125;
+		public static final int ID_RT = 126;
+		public static final int ID_RUBY =127;
+		public static final int ID_SECTION =128;
+		public static final int ID_SOURCE = 129;
+		public static final int ID_SUMMARY = 130;
+		public static final int ID_SVG =131;
+		public static final int ID_TIME =132;
+		public static final int ID_VIDEO =133;
+
+		// D205513
+
+		public static int getNumOfIds() {
+			if (numofids != -1)
+				return numofids;
+
+			// NOTE: If the reflection is too slow, this method should
+			// just return the literal value, like 105.
+			// -- 5/25/2001
+			Class clazz = Ids50.class;
+			Field[] fields = clazz.getFields();
+			numofids = 0;
+			for (int i = 0; i < fields.length; i++) {
+				String name = fields[i].getName();
+				if (name.startsWith("ID_"))//$NON-NLS-1$
+					numofids++;
+			}
+			return numofids;
+		}
+
+		// chache the result of the reflection.
+		private static int numofids = -1;
+	}
+
+	/** %fontstyle;. TT | I | B | U | S | STRIKE | BIG | SMALL | BLINK */
+	private static final String[] FONTSTYLE = {TT, I, B, U, S, STRIKE, BIG, SMALL, BLINK};
+	/** %formctl;. INPUT | SELECT | TEXTAREA | LABEL | BUTTON */
+	private static final String[] FORMCTL = {INPUT, SELECT, TEXTAREA, LABEL, BUTTON, DATALIST};
+	/** %phrase;.
+	 * EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE | ABBR | ACRONYM | MARK
+	 */	private static final String[] PHRASE = {KEYGEN, EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, ACRONYM, MARK};
+	/** %special;.
+	 * A | IMG | APPLET | OBJECT | FONT | BASEFONT | BR | SCRIPT |
+	 * MAP | Q | SUB | SUP | SPAN | BDO | IFRAME | EMBED | MARQUEE |
+	 * D2W | SUBMIT
+	 * WBR | NOBR | BGSOUND
+	 */
+	private static final String[] SPECIAL = {A, IMG, APPLET, OBJECT, FONT, BASEFONT, BR, WBR, // D205513
+				SCRIPT, MAP, Q, SUB, SUP, SPAN, BDO, IFRAME, EMBED, BGSOUND, // D205513
+				MARQUEE, NOBR, // D205513
+				OUTPUT, TIME, METER, PROGRESS,
+				COMMAND
+	};
+	/** %heading;. H[1-6] */
+	private static final String[] HEADING = {H1, H2, H3, H4, H5, H6};
+	/** %list;. UL | OL | DIR | MENU */
+	private static final String[] LIST = {UL, OL, DIR, MENU};
+	/** %preformatted;. PRE */
+	private static final String[] PREFORMATTED = {PRE};
+	/** %sectioning;. ARTICLE | ASIDE | NAV | SECTION */
+	private static final String[] SECTIONING = { ARTICLE, ASIDE, NAV, SECTION };
+
+	/** %embedded;. AUDIO|CANVAS|EMBED|IFRAME|IMG|MATH|OBJECT|SVG|VIDEO */
+	private static final String[] EMBEDDED = { AUDIO, CANVAS, EMBED, IFRAME, IMG, MATH, OBJECT, SVG, VIDEO};
+
+    private static String[] fNames = null;
+
+	/**
+	 */
+	public HTML5ElementCollection(AttributeCollection collection) {
+		super(getNames(), collection);
+		attributeCollection = collection;
+	}
+
+	/**
+	 * Actually creates HTMLElementDeclaration instance.
+	 * @return HTMLElementDeclaration
+	 */
+	protected CMNode create(String elementName) {
+		CMNode edec = null;
+
+		if (elementName.equalsIgnoreCase(ACRONYM)) {
+			edec = new HedPhrase(ACRONYM, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(APPLET)) {
+			edec = new HedAPPLET(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(ARTICLE)) {
+			edec = new HedSectioning(ARTICLE, this);
+
+		}
+		else if (elementName.equalsIgnoreCase(ASIDE)) {
+			edec = new HedSectioning(ASIDE, this);
+
+		}
+		else if (elementName.equalsIgnoreCase(AUDIO)) {
+			edec = new HedMediaElement(AUDIO, this);
+
+		}
+		else if (elementName.equalsIgnoreCase(BASEFONT)) {
+			edec = new HedBASEFONT(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(BIG)) {
+			edec = new HedFontStyle(BIG, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(CANVAS)) {
+			edec = new HedCANVAS(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(CENTER)) {
+			edec = new HedCENTER(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(COMMAND)) {
+			edec = new HedCOMMAND(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(DATALIST)) {
+			edec = new HedDATALIST(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(DETAILS)) {
+			edec = new HedDETAILS(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(DIR)) {
+			edec = new HedMENU(DIR, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(FIGCAPTION)) {
+			edec = new HedFIGCAPTION(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(FIGURE)) {
+			edec = new HedFIGURE(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(FOOTER)) {
+			edec = new HedHEADER(HTML50Namespace.ElementName.FOOTER ,this);
+
+		}
+		else if (elementName.equalsIgnoreCase(FRAME)) {
+			edec = new HedFRAME(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(FRAMESET)) {
+			edec = new HedFRAMESET(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(HEADER)) {
+			edec = new HedHEADER(HTML50Namespace.ElementName.HEADER ,this);
+		}
+		else if (elementName.equalsIgnoreCase(HGROUP)) {
+			edec = new HedHGROUP(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(ISINDEX)) {
+			edec = new HedISINDEX(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(KEYGEN)) {
+			edec = new HedKEYGEN(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(MARK)) {
+			edec = new HedPhrase(HTML50Namespace.ElementName.MARK,this);
+
+		}
+		else if (elementName.equalsIgnoreCase(MATH)) {
+			edec = new HedMath(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(METER)) {
+			edec = new HedMETER(this);
+		}
+		else if (elementName.equalsIgnoreCase(NAV)) {
+			edec = new HedSectioning(NAV, this);
+		}
+		else if (elementName.equalsIgnoreCase(NOFRAMES)) {
+			edec = new HedNOFRAMES(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(OUTPUT)) {
+			edec = new HedOUTPUT(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(PROGRESS)) {
+			edec = new HedPROGRESS(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(RP)) {
+			edec = new HedRP(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(RT)) {
+			edec = new HedRT(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(RUBY)) {
+			edec = new HedRUBY(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(S)) {
+			edec = new HedFontStyle(S, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(SECTION)) {
+			edec = new HedSectioning(SECTION, this);
+
+		}
+		else if (elementName.equalsIgnoreCase(SOURCE)) {
+			edec = new HedSOURCE(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(STRIKE)) {
+			edec = new HedFontStyle(STRIKE, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(SUMMARY)) {
+			edec = new HedSUMMARY(this);
+		}
+		else if (elementName.equalsIgnoreCase(SVG)) {
+			edec = new HedSVG(this);
+		}
+		else if (elementName.equalsIgnoreCase(TIME)) {
+			edec = new HedTIME(this);
+		}
+		else if (elementName.equalsIgnoreCase(TT)) {
+			edec = new HedFontStyle(TT, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(U)) {
+			edec = new HedFontStyle(U, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(VIDEO)) {
+			edec = new HedVIDEO(this);
+
+		}
+		// unknown
+		else {
+			// NOTE: We don't define the UNKNOWN element declaration.
+			// <code>null</code> for a declaration is a sign of
+			// the target element is unknown.
+			// -- 3/9/2001
+			edec = super.create(elementName);
+		}
+		return edec;
+	}
+
+	public AttributeCollection getAttributeCollection() {
+		return attributeCollection;
+	}
+
+	public final Collection getNamesOfBlock() {
+		// P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR,
+		// TABLE, FIELDSET, ADDRESS, RUBY, FIGURE
+		String[] blockMisc = {HEADER, FOOTER, HGROUP, P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR, TABLE, FIELDSET, ADDRESS, RUBY, FIGURE};
+		Vector names = new Vector(Arrays.asList(blockMisc));
+		// %heading;
+		names.addAll(Arrays.asList(HEADING));
+		// %list;
+		names.addAll(Arrays.asList(LIST));
+		// %preformatted;
+		names.addAll(Arrays.asList(PREFORMATTED));
+
+		
+		return names;
+	}
+
+	
+	public final void getSectioning(CMGroupImpl group) {
+		if (group == null)
+			return;
+		getDeclarations(group, Arrays.asList(SECTIONING).iterator());
+	}
+	
+	public void getEmbedded(CMGroupImpl group) {
+		if (group == null)
+			return;
+		getDeclarations(group, Arrays.asList(EMBEDDED).iterator());
+	}
+
+	public void getFlow(CMGroupImpl group) {
+		if (group == null)
+			return;
+		super.getFlow(group);
+		getSectioning(group);
+		CMNode node = getNamedItem(DETAILS);
+		if (node != null) {
+			group.appendChild(node);
+		}
+	}
+
+	public void getInline(CMGroupImpl group) {
+		if (group == null)
+			return;
+		super.getInline(group);
+		getEmbedded(group);
+	}
+
+	/**
+	 * Create element declarations and store them into a <code>CMGroupImpl</code>
+	 * instance.<br>
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getFontstyle(CMGroupImpl group) {
+		if (group == null)
+			return;
+		getDeclarations(group, Arrays.asList(FONTSTYLE).iterator());
+	}
+
+	/**
+	 * Create element declarations and store them into a <code>CMGroupImpl</code>
+	 * instance.<br>
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getFormctrl(CMGroupImpl group) {
+		if (group == null)
+			return;
+		getDeclarations(group, Arrays.asList(FORMCTL).iterator());
+	}
+
+	/**
+	 * %heading;.
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getHeading(CMGroupImpl group) {
+		if (group == null)
+			return;
+
+		getDeclarations(group, Arrays.asList(HEADING).iterator());
+	}
+
+	
+
+	/**
+	 * %list;.
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getList(CMGroupImpl group) {
+		if (group == null)
+			return;
+
+		getDeclarations(group, Arrays.asList(LIST).iterator());
+	}
+
+	/**
+	 * Create element declarations and store them into a <code>CMGroupImpl</code>
+	 * instance.<br>
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getPhrase(CMGroupImpl group) {
+		if (group == null)
+			return;
+		getDeclarations(group, Arrays.asList(PHRASE).iterator());
+	}
+
+	/**
+	 * %preformatted;
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getPreformatted(CMGroupImpl group) {
+		if (group == null)
+			return;
+
+		getDeclarations(group, Arrays.asList(PREFORMATTED).iterator());
+	}
+
+	/**
+	 * Create element declarations and store them into a <code>CMGroupImpl</code>
+	 * instance.<br>
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getSpecial(CMGroupImpl group) {
+		if (group == null)
+			return;
+		getDeclarations(group, Arrays.asList(SPECIAL).iterator());
+	}
+
+	private static String[] getNames() {
+		if (fNames == null) {
+			fNames = new String[Ids50.getNumOfIds()];
+			fNames[Ids.ID_A] = A;
+			fNames[Ids.ID_ABBR] = ABBR;
+			fNames[Ids.ID_ACRONYM] = ACRONYM;
+			fNames[Ids.ID_ADDRESS] = ADDRESS;
+			fNames[Ids.ID_APPLET] = APPLET;
+			fNames[Ids.ID_AREA] = AREA;
+			fNames[Ids50.ID_ARTICLE] = ARTICLE;
+			fNames[Ids50.ID_ASIDE] = ASIDE;
+			fNames[Ids50.ID_AUDIO] = AUDIO;
+			fNames[Ids.ID_B] = B;
+			fNames[Ids.ID_BASE] = BASE;
+			fNames[Ids.ID_BASEFONT] = BASEFONT;
+			fNames[Ids.ID_BDO] = BDO;
+			fNames[Ids.ID_BIG] = BIG;
+			fNames[Ids.ID_BLINK] = BLINK;
+			fNames[Ids.ID_BLOCKQUOTE] = BLOCKQUOTE;
+			fNames[Ids.ID_BODY] = BODY;
+			fNames[Ids.ID_BR] = BR;
+			fNames[Ids.ID_BUTTON] = BUTTON;
+			fNames[Ids.ID_CAPTION] = CAPTION;
+			fNames[Ids50.ID_CANVAS] = CANVAS;
+			fNames[Ids.ID_CENTER] = CENTER;
+			fNames[Ids.ID_CITE] = CITE;
+			fNames[Ids.ID_CODE] = CODE;
+			fNames[Ids.ID_COL] = COL;
+			fNames[Ids.ID_COLGROUP] = COLGROUP;
+			fNames[Ids50.ID_COMMAND] = COMMAND;
+			fNames[Ids50.ID_DATALIST] = DATALIST;
+			fNames[Ids50.ID_DETAILS] = DETAILS;
+			fNames[Ids.ID_DD] = DD;
+			fNames[Ids.ID_DEL] = DEL;
+			fNames[Ids.ID_DFN] = DFN;
+			fNames[Ids.ID_DIR] = DIR;
+			fNames[Ids.ID_DIV] = DIV;
+			fNames[Ids.ID_DL] = DL;
+			fNames[Ids.ID_DT] = DT;
+			fNames[Ids.ID_EM] = EM;
+			fNames[Ids.ID_EMBED] = EMBED;
+			fNames[Ids.ID_FIELDSET] = FIELDSET;
+			fNames[Ids50.ID_FIGURE] = FIGURE;
+			fNames[Ids50.ID_FIGCAPTION] = FIGCAPTION;
+			fNames[Ids.ID_FONT] = FONT;
+			fNames[Ids.ID_FORM] = FORM;
+			fNames[Ids50.ID_FOOTER] = FOOTER;
+			fNames[Ids.ID_FRAME] = FRAME;
+			fNames[Ids.ID_FRAMESET] = FRAMESET;
+			fNames[Ids.ID_H1] = H1;
+			fNames[Ids.ID_H2] = H2;
+			fNames[Ids.ID_H3] = H3;
+			fNames[Ids.ID_H4] = H4;
+			fNames[Ids.ID_H5] = H5;
+			fNames[Ids.ID_H6] = H6;
+			fNames[Ids.ID_HEAD] = HEAD;
+			fNames[Ids50.ID_HEADER] = HEADER;
+			fNames[Ids50.ID_HGROUP] = HGROUP;
+			fNames[Ids.ID_HR] = HR;
+			fNames[Ids.ID_HTML] = HTML;
+			fNames[Ids.ID_I] = I;
+			fNames[Ids.ID_IFRAME] = IFRAME;
+			fNames[Ids.ID_IMG] = IMG;
+			fNames[Ids.ID_INPUT] = INPUT;
+			fNames[Ids.ID_INS] = INS;
+			fNames[Ids.ID_ISINDEX] = ISINDEX;
+			fNames[Ids.ID_KBD] = KBD;
+			fNames[Ids50.ID_KEYGEN] = KEYGEN;
+			fNames[Ids.ID_LABEL] = LABEL;
+			fNames[Ids.ID_LEGEND] = LEGEND;
+			fNames[Ids.ID_LI] = LI;
+			fNames[Ids.ID_LINK] = LINK;
+			fNames[Ids.ID_MAP] = MAP;
+			fNames[Ids50.ID_MARK] = MARK;
+			fNames[Ids.ID_MARQUEE] = MARQUEE;
+			fNames[Ids50.ID_MATH] = MATH;
+			fNames[Ids.ID_MENU] = MENU;
+			fNames[Ids.ID_META] = META;
+			fNames[Ids50.ID_METER] = METER;
+			fNames[Ids50.ID_NAV] = NAV;
+			fNames[Ids.ID_NOEMBED] = NOEMBED;
+			fNames[Ids.ID_NOFRAMES] = NOFRAMES;
+			fNames[Ids.ID_NOSCRIPT] = NOSCRIPT;
+			fNames[Ids.ID_OBJECT] = OBJECT;
+			fNames[Ids.ID_OL] = OL;
+			fNames[Ids.ID_OPTGROUP] = OPTGROUP;
+			fNames[Ids.ID_OPTION] = OPTION;
+			fNames[Ids50.ID_OUTPUT] = OUTPUT;
+			fNames[Ids.ID_P] = P;
+			fNames[Ids.ID_PARAM] = PARAM;
+			fNames[Ids.ID_PRE] = PRE;
+			fNames[Ids50.ID_PROGRESS] = PROGRESS;
+			fNames[Ids.ID_Q] = Q;
+			fNames[Ids50.ID_RP] = RP;
+			fNames[Ids50.ID_RT] = RT;
+			fNames[Ids50.ID_RUBY] = RUBY;
+			fNames[Ids.ID_S] = S;
+			fNames[Ids.ID_SAMP] = SAMP;
+			fNames[Ids.ID_SCRIPT] = SCRIPT;
+			fNames[Ids50.ID_SECTION] = SECTION;
+			fNames[Ids.ID_SELECT] = SELECT;
+			fNames[Ids.ID_SMALL] = SMALL;
+			fNames[Ids50.ID_SOURCE] = SOURCE;
+			fNames[Ids.ID_SPAN] = SPAN;
+			fNames[Ids.ID_STRIKE] = STRIKE;
+			fNames[Ids.ID_STRONG] = STRONG;
+			fNames[Ids.ID_STYLE] = STYLE;
+			fNames[Ids50.ID_SUMMARY] = SUMMARY;
+			fNames[Ids.ID_SUB] = SUB;
+			fNames[Ids.ID_SUP] = SUP;
+			fNames[Ids50.ID_SVG] = SVG;
+			fNames[Ids.ID_TABLE] = TABLE;
+			fNames[Ids.ID_TBODY] = TBODY;
+			fNames[Ids.ID_TD] = TD;
+			fNames[Ids.ID_TEXTAREA] = TEXTAREA;
+			fNames[Ids.ID_TFOOT] = TFOOT;
+			fNames[Ids.ID_TH] = TH;
+			fNames[Ids.ID_THEAD] = THEAD;
+			fNames[Ids50.ID_TIME] = TIME;
+			fNames[Ids.ID_TITLE] = TITLE;
+			fNames[Ids.ID_TR] = TR;
+			fNames[Ids.ID_TT] = TT;
+			fNames[Ids.ID_U] = U;
+			fNames[Ids.ID_UL] = UL;
+			fNames[Ids.ID_VAR] = VAR;
+			fNames[Ids50.ID_VIDEO] = VIDEO;
+			fNames[Ids.ID_WBR] = WBR;
+			fNames[Ids.ID_SSI_CONFIG] = SSI_CONFIG;
+			fNames[Ids.ID_SSI_ECHO] = SSI_ECHO;
+			fNames[Ids.ID_SSI_EXEC] = SSI_EXEC;
+			fNames[Ids.ID_SSI_FSIZE] = SSI_FSIZE;
+			fNames[Ids.ID_SSI_FLASTMOD] = SSI_FLASTMOD;
+			fNames[Ids.ID_SSI_INCLUDE] = SSI_INCLUDE;
+			fNames[Ids.ID_SSI_PRINTENV] = SSI_PRINTENV;
+			fNames[Ids.ID_SSI_SET] = SSI_SET;
+			fNames[Ids.ID_BGSOUND] = BGSOUND;
+			fNames[Ids.ID_NOBR] = NOBR;
+			fNames[Ids.ID_WBR] = WBR;
+		}
+		return fNames;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java
index ce938e3..9c85e4a 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -27,6 +27,8 @@
 
 	private HTMLCMDataTypeImpl type = null;
 	private int usage = 0;
+	private boolean is_obsolete = false;
+
 
 	/**
 	 */
@@ -106,6 +108,9 @@
 			return true;
 		else if (propertyName.equals(HTMLCMProperties.IS_SCRIPTABLE))
 			return true;
+		else if (propertyName.equals(HTMLCMProperties.IS_OBSOLETE))
+			return is_obsolete;
+		
 		return super.supports(propertyName);
 	}
 
@@ -117,6 +122,13 @@
 		else if (propertyName.equals(HTMLCMProperties.IS_SCRIPTABLE)) {
 			return getAttrType().getDataTypeName() == HTMLCMDataType.SCRIPT ? new Boolean(true) : new Boolean(false);
 		}
+		else if (propertyName.equals(HTMLCMProperties.IS_OBSOLETE))
+			return new Boolean(is_obsolete);
+		
 		return super.getProperty(propertyName);
 	}
+	
+	public void obsolete(boolean is_obsolete){
+		this.is_obsolete = is_obsolete;
+	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java
index 675dc59..80adfe3 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,5 +20,5 @@
  * and {@link <code>HTMLCMNode</code>}.<br>
  */
 public interface HTMLAttributeDeclaration extends CMAttributeDeclaration {
-
+	String IS_HTML = "isHTML"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java
index fba0b86..3c94c47 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -63,4 +63,9 @@
 	public static final String STYLE_SHEET = CMDataType.CDATA;
 	/** %Text; == CDATA */
 	public static final String TEXT = CMDataType.CDATA;
+	/** %MediaType; == CDATA */
+	public static final String MEDIA_TYPE = CMDataType.CDATA;
+	/** %BrowsingContext; == CDATA */
+	public static final String BROWSING_CONTEXT = CMDataType.CDATA;
+	
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java
index 28316ec..7b9f634 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
 
 import org.eclipse.wst.html.core.internal.contentmodel.chtml.CHCMDocImpl;
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
 
@@ -27,7 +28,7 @@
 public final class HTMLCMDocumentFactory {
 
 	private static Hashtable cmdocs = new Hashtable();
-	private static List supportedCMtypes = Arrays.asList(new Object[]{CMDocType.HTML_DOC_TYPE, CMDocType.CHTML_DOC_TYPE, CMDocType.JSP11_DOC_TYPE, CMDocType.JSP12_DOC_TYPE, CMDocType.JSP20_DOC_TYPE, CMDocType.TAG20_DOC_TYPE});
+	private static List supportedCMtypes = Arrays.asList(new Object[]{CMDocType.HTML_DOC_TYPE, CMDocType.CHTML_DOC_TYPE, CMDocType.JSP11_DOC_TYPE, CMDocType.JSP12_DOC_TYPE, CMDocType.JSP20_DOC_TYPE, CMDocType.TAG20_DOC_TYPE, CMDocType.JSP21_DOC_TYPE, CMDocType.HTML5_DOC_TYPE});
 
 	private static JCMDocImpl jsp11doc = null;
 
@@ -62,12 +63,24 @@
 			return html40doc;
 		}
 
+		else if (CMDocType.HTML5_DOC_TYPE.equals(cmtype)) {
+			CMNamespaceImpl h50ns = new CMNamespaceImpl(HTML50Namespace.HTML50_URI, HTML50Namespace.HTML50_TAG_PREFIX);
+			H5CMDocImpl html50doc = new H5CMDocImpl(CMDocType.HTML5_DOC_TYPE, h50ns);
+			return html50doc;
+		}
+		
 		else if (CMDocType.JSP20_DOC_TYPE.equals(cmtype)) {
 			CMNamespaceImpl j20ns = new CMNamespaceImpl(JSP20Namespace.JSP20_URI, JSP11Namespace.JSP_TAG_PREFIX);
 			JCM20DocImpl jsp20doc = new JCM20DocImpl(CMDocType.JSP20_DOC_TYPE, j20ns);
 			return jsp20doc;
 		}
 
+		else if (CMDocType.JSP21_DOC_TYPE.equals(cmtype)) {
+			CMNamespaceImpl j21ns = new CMNamespaceImpl(JSP21Namespace.JSP21_URI, JSP11Namespace.JSP_TAG_PREFIX);
+			JCM21DocImpl jsp21doc = new JCM21DocImpl(CMDocType.JSP21_DOC_TYPE, j21ns);
+			return jsp21doc;
+		}
+
 		else if (CMDocType.TAG20_DOC_TYPE.equals(cmtype)) {
 			CMNamespaceImpl j20ns = new CMNamespaceImpl(JSP20Namespace.JSP20_URI, JSP11Namespace.JSP_TAG_PREFIX);
 			TagCMDocImpl tag20doc = new TagCMDocImpl(CMDocType.TAG20_DOC_TYPE, j20ns);
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java
index f0b1471..3f5a9b7 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -43,6 +43,7 @@
 	protected boolean indentChild = false;
 	protected ElementCollection elementCollection = null;
 	protected AttributeCollection attributeCollection = null;
+	private boolean is_obsolete = false;
 	protected final static CMNamedNodeMap EMPTY_MAP = new CMNamedNodeMap() {
 		public int getLength() {
 			return 0;
@@ -282,6 +283,9 @@
 			ComplexTypeDefinition def = getComplexTypeDefinition();
 			return (def != null);
 		}
+		if (propertyName.equals(HTMLCMProperties.IS_OBSOLETE)) {
+			return is_obsolete;
+		}
 		else {
 			PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
 			if (pp == null)
@@ -301,6 +305,9 @@
 			ComplexTypeDefinition def = getComplexTypeDefinition();
 			return (def != null) ? def.getPrimaryCandidate() : null;
 		}
+		else if (propertyName.equals(HTMLCMProperties.IS_OBSOLETE)){
+			return new Boolean(is_obsolete);
+		}
 		else {
 			PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
 			if (pp == null)
@@ -363,4 +370,8 @@
 		}
 		return false;
 	}
+	
+	public void obsolete(boolean is_obsolete){
+		this.is_obsolete = is_obsolete;
+	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java
index 92eb28e..270fc91 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,8 +12,6 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
@@ -35,21 +33,6 @@
 
 	/**
 	 * %attrs;
-	 * (charset %Charset; #IMPLIED)
-	 * (type %ContentType; #IMPLIED)
-	 * (name CDATA #IMPLIED)
-	 * (href %URI; #IMPLIED)
-	 * (hreflang %LanguageCode; #IMPLIED)
-	 * (target %FrameTarget; #IMPLIED)
-	 * (rel %LinkTypes; #IMPLIED)
-	 * (rev %LinkTypes; #IMPLIED)
-	 * (accesskey %Character; #IMPLIED)
-	 * (directkey %Character; #IMPLIED)
-	 * (shape %Shape; rect)
-	 * (coords %Coords; #IMPLIED)
-	 * (tabindex NUMBER #IMPLIED)
-	 * (onfocus %Script; #IMPLIED)
-	 * (onblur %Script; #IMPLIED) 
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -62,8 +45,9 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		String[] names = {HTML40Namespace.ATTR_NAME_CHARSET, HTML40Namespace.ATTR_NAME_TYPE, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_HREF, HTML40Namespace.ATTR_NAME_HREFLANG, HTML40Namespace.ATTR_NAME_TARGET, HTML40Namespace.ATTR_NAME_REL, HTML40Namespace.ATTR_NAME_REV, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_DIRECTKEY, HTML40Namespace.ATTR_NAME_SHAPE, HTML40Namespace.ATTR_NAME_COORDS, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.A, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java
index 3afad06..322e65c 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,8 +12,6 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
 
 
@@ -34,16 +32,6 @@
 	/**
 	 * AREA.
 	 * %attrs;
-	 * (shape %Shape; rect)
-	 * (coords %Coords; #IMPLIED)
-	 * (href %URI; #IMPLIED)
-	 * (target %FrameTarget; #IMPLIED)
-	 * (nohref (nohref) #IMPLIED)
-	 * (alt %Text; #REQUIRED)
-	 * (tabindex NUMBER #IMPLIED)
-	 * (accesskey %Character; #IMPLIED)
-	 * (onfocus %Script; #IMPLIED)
-	 * (onblur %Script; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -55,7 +43,8 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		String[] names = {HTML40Namespace.ATTR_NAME_SHAPE, HTML40Namespace.ATTR_NAME_COORDS, HTML40Namespace.ATTR_NAME_HREF, HTML40Namespace.ATTR_NAME_TARGET, HTML40Namespace.ATTR_NAME_NOHREF, HTML40Namespace.ATTR_NAME_ALT, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.AREA, attributes);
+	
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java
index 9754980..6ace2cb 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,9 +15,7 @@
 import java.util.Arrays;
 
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
@@ -35,15 +33,6 @@
 
 	/**
 	 * %attrs;
-	 * %reserved; ... empty.
-	 * (name CDATA #IMPLIED)
-	 * (value CDATA #IMPLIED)
-	 * (type (button|submit|reset) submit) ... should be defined locally.
-	 * (disabled (disabled) #IMPLIED)
-	 * (tabindex NUMBER #IMPLIED)
-	 * (accesskey %Character; #IMPLIED)
-	 * (onfocus %Script; #IMPLIED)
-	 * (onblur %Script; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -55,17 +44,10 @@
 
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_VALUE, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// (type (button|submit|reset) submit) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		String[] values = {HTML40Namespace.ATTR_VALUE_BUTTON, HTML40Namespace.ATTR_VALUE_SUBMIT, HTML40Namespace.ATTR_VALUE_RESET};
-		atype.setEnumValues(values);
-
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
+		
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.BUTTON, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCANVAS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCANVAS.java
new file mode 100644
index 0000000..453fb1c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCANVAS.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+
+
+/**
+ * CANVAS.
+ */
+final class HedCANVAS extends HTMLElemDeclImpl {
+
+	/**
+	 */
+	public HedCANVAS(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.CANVAS, collection);
+		layoutType = LAYOUT_BLOCK;
+	}
+
+	/**
+	 * %attrs;
+	 * (height, width)
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+		
+		
+		String[] names = { HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HEIGHT };
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOMMAND.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOMMAND.java
new file mode 100644
index 0000000..3fc7c03
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOMMAND.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+
+/**
+ * COMMAND.
+ */
+final class HedCOMMAND extends HTMLElemDeclImpl {
+
+	/**
+	 */
+	public HedCOMMAND(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.COMMAND, collection);
+		layoutType = LAYOUT_OBJECT;
+	}
+
+	/**
+	 * COMMAND.
+	 * %attrs;
+	 * // (type %CommandTYPE; command | checkbox|radio) 
+	 * // (label %CDATA; #REQUIRED) 
+	 * // (icon %URI; #OPTIONAL) 
+	 * // (disabled %BOOLEAN; #OPTIONAL) 
+	 * // (checked %BOOLEAN; #OPTIONAL) 
+	 * // (radiogroup %TEXT; #OPTIONAL) 
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+		HTMLCMDataTypeImpl atype = null;
+		HTMLAttrDeclImpl attr = null;
+		// (type %CommandTYPE; command | checkbox|radio) 
+		// NOTE: %InputType is ENUM;
+		atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+		String[] values = {HTML50Namespace.ATTR_VALUE_COMMAND, HTML40Namespace.ATTR_VALUE_CHECKBOX, HTML40Namespace.ATTR_VALUE_RADIO};
+		atype.setEnumValues(values);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML50Namespace.ATTR_VALUE_COMMAND);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
+		
+		// (label %CDATA; #REQUIRED) 
+		atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_LABEL, atype, CMAttributeDeclaration.REQUIRED);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_LABEL, attr);
+
+		// (icon %URI; #OPTIONAL) 
+		atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_ICON, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_ICON, attr);
+
+		
+		// (disabled %BOOLEAN; #OPTIONAL) 
+		atype = new HTMLCMDataTypeImpl(HTMLCMDataType.BOOLEAN);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_FALSE);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_DISABLED, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_DISABLED, attr);
+
+		// (checked %BOOLEAN; #OPTIONAL) 
+		atype = new HTMLCMDataTypeImpl(HTMLCMDataType.BOOLEAN);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_FALSE);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_CHECKED, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_CHECKED, attr);
+
+		// (radiogroup %TEXT; #OPTIONAL) 
+		atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_RADIOGROUP, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_RADIOGROUP, attr);
+
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDATALIST.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDATALIST.java
new file mode 100644
index 0000000..ba671c6
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDATALIST.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+/**
+ * DATALIST.
+ */
+final class HedDATALIST extends HTMLElemDeclImpl {
+
+	/**
+	 */
+	public HedDATALIST(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.DATALIST, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_DATALIST;
+		layoutType = LAYOUT_OBJECT;
+		indentChild = true;
+	}
+
+	/**
+	 * %attrs;
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDETAILS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDETAILS.java
new file mode 100644
index 0000000..a4e8f01
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDETAILS.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+public class HedDETAILS extends HTMLElemDeclImpl {
+
+	public HedDETAILS(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.DETAILS, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_DETAILS_CONTAINER;
+	}
+
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+		CMNode node = attributeCollection.getDeclaration(HTML50Namespace.ATTR_NAME_OPEN);
+		if (node != null)
+			attributes.putNamedItem(HTML50Namespace.ATTR_NAME_OPEN, node);
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java
index f47fbcb..3e0d7ff 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -41,6 +41,9 @@
 
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.FIELDSET, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGCAPTION.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGCAPTION.java
new file mode 100644
index 0000000..9b6162c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGCAPTION.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+public class HedFIGCAPTION extends HedFlowContainer {
+	public HedFIGCAPTION(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.FIGCAPTION, collection);
+		layoutType = LAYOUT_HIDDEN;
+	}
+
+	/**
+	 * Article.
+	 * %attrs;
+	 * Global attributes
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGURE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGURE.java
new file mode 100644
index 0000000..87a4610
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGURE.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+/**
+ * FIGURE.
+ */
+final class HedFIGURE extends HTMLElemDeclImpl {
+
+	/**
+	 */
+	public HedFIGURE(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.FIGURE, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FIGURE;
+		layoutType = LAYOUT_BLOCK;
+		indentChild = true;
+	}
+
+	/**
+	 * %attrs;
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+	}
+	
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEADER.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEADER.java
new file mode 100644
index 0000000..5e72a35
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEADER.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+public class HedHEADER extends HedFlowContainer {
+
+	public HedHEADER(String name, ElementCollection collection) {
+		super(name, collection);
+	}
+
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+	}
+
+	/**
+	 * Exclusion.
+	 * <code>HEADER</code> has the exclusion.
+	 * It is <code>HEADER</code> and <code>FOOTER</code>.
+	 */
+	public CMContent getExclusion() {
+		if (exclusion != null)
+			return exclusion; // already created.
+		if (elementCollection == null)
+			return null; // fatal
+
+		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
+		CMNode node = elementCollection.getNamedItem(HTML50Namespace.ElementName.HEADER);
+		if (node != null)
+			exclusion.appendChild(node);
+		node = elementCollection.getNamedItem(HTML50Namespace.ElementName.FOOTER);
+		if (node != null)
+			exclusion.appendChild(node);
+
+		return exclusion;
+	}
+
+	/**
+	 */
+	public CMNamedNodeMap getProhibitedAncestors() {
+		if (prohibitedAncestors != null)
+			return prohibitedAncestors;
+
+		String[] names = {HTML50Namespace.ElementName.HEADER, HTML50Namespace.ElementName.FOOTER};
+		prohibitedAncestors = elementCollection.getDeclarations(names);
+
+		return prohibitedAncestors;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHGROUP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHGROUP.java
new file mode 100644
index 0000000..3bb51a4
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHGROUP.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+
+public class HedHGROUP extends HTMLElemDeclImpl {
+
+	public HedHGROUP(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.HGROUP, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HEADING_CONTAINER;
+		correctionType = CORRECT_EMPTY;
+		layoutType = LAYOUT_BLOCK;
+		indentChild = true;
+	}
+
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+	}
+
+	/**
+	 */
+	public CMNamedNodeMap getProhibitedAncestors() {
+		if (prohibitedAncestors != null)
+			return prohibitedAncestors;
+
+		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
+		prohibitedAncestors = elementCollection.getDeclarations(names);
+
+		return prohibitedAncestors;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java
index 99b6332..e393d04 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -62,13 +62,10 @@
 
 		attributes = new CMNamedNodeMapImpl();
 
-		// %i18n;
-		attributeCollection.getI18n(attributes);
-		// version
-		HTMLAttributeDeclaration adec = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_VERSION);
-		if (adec != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_VERSION, adec);
-	}
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.HTML, attributes);
+	
+		}
 
 	/**
 	 * HTML has terminators.
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java
index 191615e..0e4c564 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,8 +12,6 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
@@ -29,19 +27,7 @@
 		layoutType = LAYOUT_OBJECT;
 	}
 
-	/**
-	 * %coreattrs;
-	 * (longdesc %URI; #IMPLIED)
-	 * (name CDATA #IMPLIED)
-	 * (src %URI; #IMPLIED)
-	 * (frameborder (1|0) 1)
-	 * (marginwidth %Pixels; #IMPLIED)
-	 * (marginheight %Pixels; #IMPLIED)
-	 * (scrolling (yes|no|auto) auto)
-	 * (align %IAlign; #IMPLIED) ... should be defined locally.
-	 * (height %Length; #IMPLIED)
-	 * (width %Length; #IMPLIED)
-	 */
+	
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
 			return; // already created.
@@ -50,16 +36,9 @@
 
 		attributes = new CMNamedNodeMapImpl();
 
-		// %coreattrs;
-		attributeCollection.getCore(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_LONGDESC, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_SRC, HTML40Namespace.ATTR_NAME_FRAMEBORDER, HTML40Namespace.ATTR_NAME_MARGINWIDTH, HTML40Namespace.ATTR_NAME_MARGINHEIGHT, HTML40Namespace.ATTR_NAME_SCROLLING, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// align
-		HTMLAttrDeclImpl attr = AttributeCollection.createAlignForImage();
-		if (attr != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.IFRAME, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java
index 1e1805e..b719416 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,11 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
 /**
@@ -34,19 +30,6 @@
 	/**
 	 * IMG.
 	 * %attrs;
-	 * (src %URI; #REQUIRED): should be defined locally.
-	 * (alt %Text; #REQUIRED)
-	 * (longdesc %URI; #IMPLIED)
-	 * (name CDATA #IMPLIED)
-	 * (height %Length; #IMPLIED)
-	 * (width %Length; #IMPLIED)
-	 * (usemap %URI; #IMPLIED)
-	 * (ismap (ismap) #IMPLIED)
-	 * (align %IAlign; #IMPLIED): should be defined locally.
-	 * (border %Pixels; #IMPLIED)
-	 * (hspace %Pixels; #IMPLIED)
-	 * (vspace %Pixels; #IMPLIED)
-	 * (mapfile %URI; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -59,19 +42,9 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		// (src %URI; #REQUIRED): should be defined locally.
-		HTMLCMDataTypeImpl atype = null;
-		HTMLAttrDeclImpl attr = null;
-		atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_ALT, HTML40Namespace.ATTR_NAME_LONGDESC, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_USEMAP, HTML40Namespace.ATTR_NAME_ISMAP, HTML40Namespace.ATTR_NAME_BORDER, HTML40Namespace.ATTR_NAME_HSPACE, HTML40Namespace.ATTR_NAME_VSPACE, HTML40Namespace.ATTR_NAME_MAPFILE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// align (local); should be defined locally.
-		attr = AttributeCollection.createAlignForImage();
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.IMG, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java
index 60b3049..9080201 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,11 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
 /**
@@ -34,32 +30,7 @@
 	/**
 	 * INPUT.
 	 * %attrs;
-	 * (type %InputType; TEXT) ... should be defined locally.
-	 * (name CDATA #IMPLIED)
-	 * (value CDATA #IMPLIED)
-	 * (checked (checked) #IMPLIED)
-	 * (disabled (disabled) #IMPLIED)
-	 * (readonly (readonly) #IMPLIED)
-	 * (size CDATA #IMPLIED) ... should be defined locally.
-	 * (maxlength NUMBER #IMPLIED)
-	 * (src %URI; #IMPLIED)
-	 * (alt CDATA #IMPLIED) ... should be defined locally.
-	 * (usemap %URI; #IMPLIED)
-	 * (ismap (ismap) #IMPLIED)
-	 * (tabindex NUMBER #IMPLIED)
-	 * (accesskey %Character; #IMPLIED)
-	 * (onfocus %Script; #IMPLIED)
-	 * (onblur %Script; #IMPLIED)
-	 * (onselect %Script; #IMPLIED)
-	 * (onchange %Script; #IMPLIED)
-	 * (accept %ContentTypes; #IMPLIED)
-	 * (align %IAlign; #IMPLIED) ... should be defined locally.
-	 * (istyle CDATA #IMPLIED)
-	 * <<D215684
-	 * (width CDATA; #IMPLIED)
-	 * (height CDATA; #IMPLIED)
-	 * (border CDATA; #IMPLIED)
-	 * D215684
+	
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -72,40 +43,8 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		HTMLCMDataTypeImpl atype = null;
-		HTMLAttrDeclImpl attr = null;
-		// (type %InputType; TEXT) ... should be defined locally.
-		// NOTE: %InputType is ENUM;
-		// (text | password | checkbox | radio | submit | reset |
-		//  file | hidden | image | button)
-		atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		String[] values = {HTML40Namespace.ATTR_VALUE_TEXT, HTML40Namespace.ATTR_VALUE_PASSWORD, HTML40Namespace.ATTR_VALUE_CHECKBOX, HTML40Namespace.ATTR_VALUE_RADIO, HTML40Namespace.ATTR_VALUE_SUBMIT, HTML40Namespace.ATTR_VALUE_RESET, HTML40Namespace.ATTR_VALUE_FILE, HTML40Namespace.ATTR_VALUE_HIDDEN, HTML40Namespace.ATTR_VALUE_IMAGE, HTML40Namespace.ATTR_VALUE_BUTTON};
-		atype.setEnumValues(values);
-		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_TEXT);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-
-		// (size CDATA #IMPLIED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SIZE, attr);
-
-		// (alt CDATA #IMPLIED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_ALT, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALT, attr);
-
-		// (align %IAlign; #IMPLIED) ... should be defined locally.
-		attr = AttributeCollection.createAlignForImage();
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-
-		// the rest.
-		String[] names = {HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_VALUE, HTML40Namespace.ATTR_NAME_CHECKED, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_READONLY, HTML40Namespace.ATTR_NAME_SIZE, HTML40Namespace.ATTR_NAME_MAXLENGTH, HTML40Namespace.ATTR_NAME_SRC, HTML40Namespace.ATTR_NAME_ALT, HTML40Namespace.ATTR_NAME_USEMAP, HTML40Namespace.ATTR_NAME_ISMAP, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR, HTML40Namespace.ATTR_NAME_ONSELECT, HTML40Namespace.ATTR_NAME_ONCHANGE, HTML40Namespace.ATTR_NAME_ACCEPT, HTML40Namespace.ATTR_NAME_ALIGN, HTML40Namespace.ATTR_NAME_ISTYLE,
-		//<<D215684
-					HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_BORDER
-		//<D215684
-		};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.INPUT, attributes);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedKEYGEN.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedKEYGEN.java
new file mode 100644
index 0000000..c84b30a
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedKEYGEN.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+public class HedKEYGEN extends HedEmpty {
+
+	public HedKEYGEN(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.KEYGEN, collection);
+		layoutType = LAYOUT_OBJECT;
+	}
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		attributeCollection.getAttrs(attributes);
+
+		String[] names = { HTML50Namespace.ATTR_NAME_AUTOFOCUS, HTML50Namespace.ATTR_NAME_CHALLENGE, HTML40Namespace.ATTR_NAME_DISABLED, HTML50Namespace.ATTR_NAME_FORM, HTML50Namespace.ATTR_NAME_KEYTYPE, HTML40Namespace.ATTR_NAME_NAME};
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java
index f43785e..a413193 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,8 +16,6 @@
 import java.util.Iterator;
 
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 
 /**
  * LI.
@@ -36,8 +34,6 @@
 
 	/**
 	 * %attrs;
-	 * (type %LIStyle; #IMPLIED) ... should be defined locally.
-	 * (value NUMBER #IMPLIED) ... should be defined locally.
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -50,15 +46,9 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		// (type %LIStyle; #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LI_STYLE);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-
-		// (value NUMBER #IMPLIED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_VALUE, attr);
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.LI, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java
index bfe132c..4c28bbe 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,10 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 
 /**
  * LINK.
@@ -32,14 +29,6 @@
 	/**
 	 * LINK.
 	 * %attrs;
-	 * (charset %Charset; #IMPLIED)
-	 * (href %URI; #IMPLIED)
-	 * (hreflang %LanguageCode; #IMPLIED)
-	 * (type %ContentType; #IMPLIED): should be defined locally.
-	 * (rel %LinkTypes; #IMPLIED)
-	 * (rev %LinkTypes; #IMPLIED)
-	 * (media %MediaDesc; #IMPLIED)
-	 * (target %FrameTarget; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -52,12 +41,8 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		String[] names = {HTML40Namespace.ATTR_NAME_CHARSET, HTML40Namespace.ATTR_NAME_HREF, HTML40Namespace.ATTR_NAME_HREFLANG, HTML40Namespace.ATTR_NAME_REL, HTML40Namespace.ATTR_NAME_REV, HTML40Namespace.ATTR_NAME_MEDIA, HTML40Namespace.ATTR_NAME_TARGET};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// (type %ContentType; #IMPLIED)
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
+		// different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.LINK, attributes);
+		
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java
index 0142558..812af9b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -32,8 +32,7 @@
 
 	/**
 	 * MENU/DIR.
-	 * (compact (compact) #IMPLIED)
-	 */
+	*/
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
 			return; // already created.
@@ -45,8 +44,8 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		String[] names = {HTML40Namespace.ATTR_NAME_COMPACT};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.MENU, attributes);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java
index d5b232c..92554ea 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,10 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 
 /**
  * META.
@@ -31,11 +28,7 @@
 
 	/**
 	 * META.
-	 * %i18n;
-	 * (http-equiv NAME #IMPLIED)
-	 * (name NAME #IMPLIED) ... should be defined locally.
-	 * (content CDATA #REQUIRED)
-	 * (scheme CDATA #IMPLIED)
+
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -44,16 +37,9 @@
 			return; // fatal
 
 		attributes = new CMNamedNodeMapImpl();
-
-		// %i18n;
-		attributeCollection.getI18n(attributes);
-
-		// (name NAME #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_NAME, attr);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_HTTP_EQUIV, HTML40Namespace.ATTR_NAME_CONTENT, HTML40Namespace.ATTR_NAME_SCHEME};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+		
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.META, attributes);
+	
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETER.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETER.java
new file mode 100644
index 0000000..c79e9e9
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETER.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+public class HedMETER extends HedInlineContainer {
+
+	public HedMETER(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.METER, collection);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.HTMLElemDeclImpl#createAttributeDeclarations()
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+		attributeCollection.getAttrs(attributes);
+
+		String[] names = { HTML50Namespace.ATTR_NAME_MIN, HTML50Namespace.ATTR_NAME_MAX, HTML50Namespace.ATTR_NAME_LOW, HTML50Namespace.ATTR_NAME_HIGH, HTML50Namespace.ATTR_NAME_OPTIMUM, HTML50Namespace.ATTR_NAME_FORM };
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+
+		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+		HTMLAttrDeclImpl decl = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_VALUE, atype, CMAttributeDeclaration.REQUIRED);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_VALUE, decl);
+	}
+
+	public CMContent getExclusion() {
+		if (exclusion != null)
+			return exclusion; // already created.
+		if (elementCollection == null)
+			return null;
+
+		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
+		CMNode meter = elementCollection.getNamedItem(HTML50Namespace.ElementName.METER);
+		if (meter != null)
+			exclusion.appendChild(meter);
+
+		return exclusion;
+	}
+
+	public CMNamedNodeMap getProhibitedAncestors() {
+		if (prohibitedAncestors != null)
+			return prohibitedAncestors;
+
+		String[] names = {HTML50Namespace.ElementName.METER};
+		prohibitedAncestors = elementCollection.getDeclarations(names);
+
+		return prohibitedAncestors;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMath.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMath.java
new file mode 100644
index 0000000..154dbfa
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMath.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+
+/**
+ * Math.
+ */
+final class HedMath extends HTMLElemDeclImpl {
+
+	private static String[] terminators = {HTML50Namespace.ElementName.MATH};
+
+	/**
+	 */
+	public HedMath(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.MATH, collection);
+		layoutType = LAYOUT_OBJECT;
+	}
+
+	/**
+	 * Create all attribute declarations.
+	 * MathML namespace
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+	}
+
+	/**
+	 * MATH has terminators.
+	 * @return java.util.Iterator
+	 */
+	protected Iterator getTerminators() {
+		return Arrays.asList(terminators).iterator();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMediaElement.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMediaElement.java
new file mode 100644
index 0000000..dd23bd4
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMediaElement.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+
+/**
+ * EMBED.
+ */
+class HedMediaElement extends HTMLElemDeclImpl {
+
+	/**
+	 */
+	public HedMediaElement(String elementName, ElementCollection collection) {
+		super(elementName, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_MEDIA_ELEMENT;
+		layoutType = LAYOUT_OBJECT;
+		indentChild = true;
+	}
+
+	/**
+	 * MediaElement
+	 * %attrs;
+	 * (src %URI; #REQUIRED): should be defined locally.
+	 * (preload %CDATA; #IMPLIED) 
+	 * (autoplay %ENUM; #IMPLIED) 
+	 * (loop %ENUM; #IMPLIED)
+	 * (controls %MediaType; #IMPLIED)
+	 * Global attributes
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+	
+		// (src %URI; #REQUIRED): should be defined locally.
+		HTMLCMDataTypeImpl atype = null;
+		HTMLAttrDeclImpl attr = null;
+		atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
+
+		//(preload %CDATA; #IMPLIED) ENUM
+		// (none | metadata | auto)
+		atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+		String[] values = {HTML40Namespace.ATTR_VALUE_NONE, HTML50Namespace.ATTR_VALUE_METADATA, HTML40Namespace.ATTR_VALUE_AUTO, HTML50Namespace.ATTR_VALUE_EMPTY};
+		atype.setEnumValues(values);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_AUTO);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_PRELOAD, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_PRELOAD, attr);
+
+		// (autoplay (boolean) #IMPLIED)
+		atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+		String[] autoPlayValues = {HTML50Namespace.ATTR_NAME_AUTOPLAY};
+		atype.setEnumValues(autoPlayValues);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_AUTOPLAY, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_AUTOPLAY, attr);
+
+		// (loop (true|false) #IMPLIED)
+		atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+		String[] loopValues = {HTML40Namespace.ATTR_VALUE_TRUE, HTML40Namespace.ATTR_VALUE_FALSE};
+		atype.setEnumValues(loopValues);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_FALSE);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_LOOP, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_LOOP, attr);
+
+		// (controls (true|false) #IMPLIED)
+		atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+		String[] controlValues = {HTML40Namespace.ATTR_VALUE_TRUE, HTML40Namespace.ATTR_VALUE_FALSE};
+		atype.setEnumValues(controlValues);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_FALSE);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_CONTROLS, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_CONTROLS, attr);
+
+		
+		// global attributes
+		attributeCollection.getAttrs(attributes);
+	}
+}
+
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java
index 6668b90..6c6d50c 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,10 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
 /**
@@ -31,9 +28,6 @@
 
 	/**
 	 * OL.
-	 * (type %OLStyle; #IMPLIED) ... should be defined locally.
-	 * (compact (compact) #IMPLIED)
-	 * (start NUMBER #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -46,14 +40,9 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		// (type %OLStyle; #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.OL_STYLE);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-
-		// the rest.
-		String[] names = {HTML40Namespace.ATTR_NAME_COMPACT, HTML40Namespace.ATTR_NAME_START};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.OL, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOUTPUT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOUTPUT.java
new file mode 100644
index 0000000..fc172e1
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOUTPUT.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+public class HedOUTPUT extends HedInlineContainer {
+
+	public HedOUTPUT(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.OUTPUT, collection);
+	}
+
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+		String[] names = { HTML40Namespace.ATTR_NAME_FOR, HTML50Namespace.ATTR_NAME_FORM, HTML40Namespace.ATTR_NAME_NAME};
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java
index 5541a1f..1bcea7e 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,11 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 
 /**
  * PARAM.
@@ -32,11 +28,6 @@
 
 	/**
 	 * PARAM.
-	 * (id ID #IMPLIED)
-	 * (name CDATA #REQUIRED) ... should be defined locally.
-	 * (value CDATA #IMPLIED)
-	 * (valuetype (DATA|REF|OBJECT) DATA)
-	 * (type %ContentType; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -46,12 +37,9 @@
 
 		attributes = new CMNamedNodeMapImpl();
 
-		String[] names = {HTML40Namespace.ATTR_NAME_ID, HTML40Namespace.ATTR_NAME_VALUE, HTML40Namespace.ATTR_NAME_VALUETYPE, HTML40Namespace.ATTR_NAME_TYPE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// (name CDATA #REQUIRED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_NAME, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_NAME, attr);
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.PARAM, attributes);
+	
+		
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPROGRESS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPROGRESS.java
new file mode 100644
index 0000000..223c129
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPROGRESS.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+public class HedPROGRESS extends HedInlineContainer {
+
+	public HedPROGRESS(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.PROGRESS, collection);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.HTMLElemDeclImpl#createAttributeDeclarations()
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+		attributeCollection.getAttrs(attributes);
+
+		String[] names = { HTML40Namespace.ATTR_NAME_VALUE, HTML50Namespace.ATTR_NAME_MAX, HTML50Namespace.ATTR_NAME_FORM };
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+	}
+
+	public CMContent getExclusion() {
+		if (exclusion != null)
+			return exclusion;
+		if (elementCollection == null)
+			return null;
+
+		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
+		CMNode progress = elementCollection.getNamedItem(HTML50Namespace.ElementName.PROGRESS);
+		if (progress != null) {
+			exclusion.appendChild(progress);
+		}
+		return exclusion;
+	}
+
+	public CMNamedNodeMap getProhibitedAncestors() {
+		if (prohibitedAncestors == null) {
+			String[] names = { HTML50Namespace.ElementName.PROGRESS };
+			prohibitedAncestors = elementCollection.getDeclarations(names);
+		}
+		return prohibitedAncestors;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRP.java
new file mode 100644
index 0000000..e31a9bc
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRP.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+
+/**
+ * RP.
+ */
+final class HedRP extends HedPcdata {
+
+	private static String[] terminators = {HTML50Namespace.ElementName.RP};
+
+	/**
+	 */
+	public HedRP(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.RP, collection);
+		layoutType = LAYOUT_HIDDEN;
+	}
+
+	/**
+	 * OPTION.
+	 * %attrs;
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+	}
+
+	/**
+	 * OPTION has terminators.
+	 * @return java.util.Iterator
+	 */
+	protected Iterator getTerminators() {
+		return Arrays.asList(terminators).iterator();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRT.java
new file mode 100644
index 0000000..aba4a38
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRT.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+
+/**
+ * RT.
+ */
+final class HedRT extends HedPcdata {
+
+	private static String[] terminators = {HTML50Namespace.ElementName.RT};
+
+	/**
+	 */
+	public HedRT(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.RT, collection);
+		layoutType = LAYOUT_BLOCK;
+
+	}
+
+	/**
+	 * OPTION.
+	 * %attrs;
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+	}
+
+	/**
+	 * OPTION has terminators.
+	 * @return java.util.Iterator
+	 */
+	protected Iterator getTerminators() {
+		return Arrays.asList(terminators).iterator();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRUBY.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRUBY.java
new file mode 100644
index 0000000..6686a25
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRUBY.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+/**
+ * RUBY.
+ */
+final class HedRUBY extends HTMLElemDeclImpl {
+
+	/**
+	 */
+	public HedRUBY(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.RUBY, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_RUBY;
+		layoutType = LAYOUT_BLOCK;
+		indentChild = true;
+	}
+
+	/**
+	 * %attrs;
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java
index ae910b7..2af1317 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,12 +12,8 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 
 /**
@@ -35,13 +31,6 @@
 
 	/**
 	 * SCRIPT.
-	 * (charset %Charset; #IMPLIED)
-	 * (type %ContentType; #REQUIRED) ... should be defined locally.
-	 * (language CDATA #IMPLIED)
-	 * (src %URI; #IMPLIED)
-	 * (defer (defer) #IMPLIED)
-	 * (event CDATA #IMPLIED)
-	 * (for %URI; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -51,14 +40,9 @@
 
 		attributes = new CMNamedNodeMapImpl();
 
-		String[] names = {HTML40Namespace.ATTR_NAME_CHARSET, HTML40Namespace.ATTR_NAME_LANGUAGE, HTML40Namespace.ATTR_NAME_SRC, HTML40Namespace.ATTR_NAME_DEFER, HTML40Namespace.ATTR_NAME_EVENT, HTML40Namespace.ATTR_NAME_FOR};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// (type %ContentType; #REQUIRED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
-		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/javascript"); //$NON-NLS-1$
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.SCRIPT, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java
index 78c3a08..a0de442 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,11 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
 /**
@@ -35,15 +31,6 @@
 
 	/**
 	 * %attrs;
-	 * %reserved;
-	 * (name CDATA #IMPLIED)
-	 * (size NUMBER #IMPLIED) ... should be defined locally.
-	 * (multiple (multiple) #IMPLIED)
-	 * (disabled (disabled) #IMPLIED)
-	 * (tabindex NUMBER #IMPLIED)
-	 * (onfocus %Script; #IMPLIED)
-	 * (onblur %Script; #IMPLIED)
-	 * (onchange %Script; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -55,14 +42,11 @@
 
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
+		
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.SELECT, attributes);
+	
 
-		// (size NUMBER #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SIZE, attr);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_MULTIPLE, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR, HTML40Namespace.ATTR_NAME_ONCHANGE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSOURCE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSOURCE.java
new file mode 100644
index 0000000..647a9d4
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSOURCE.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+
+/**
+ * SOURCE.
+ */
+final class HedSOURCE extends HTMLElemDeclImpl {
+
+	private static String[] terminators = {HTML50Namespace.ElementName.SOURCE};
+
+	/**
+	 */
+	public HedSOURCE(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.SOURCE, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_CDATA;
+		layoutType = LAYOUT_HIDDEN;
+	}
+
+	/**
+	 * SOURCE
+	 * %attrs;
+	 * (src %URI; #REQUIRED): should be defined locally.
+	 * (type %ContentType; #IMPLIED) 
+	 * (media %MediaType; #IMPLIED) 
+	 * Global attributes
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+	
+		// (src %URI; #REQUIRED): should be defined locally.
+		HTMLCMDataTypeImpl atype = null;
+		HTMLAttrDeclImpl attr = null;
+		atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
+
+		// (type %ContentType; #IMPLIED) 
+		atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
+		
+
+		// (media %MediaType; #IMPLIED) 
+		atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MEDIA_TYPE);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_ALL);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_MEDIA, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_MEDIA, attr);
+		
+		
+		// global attributes
+		attributeCollection.getAttrs(attributes);
+	}
+	
+	/**
+	 * SOURCE has terminators.
+	 * @return java.util.Iterator
+	 */
+	protected Iterator getTerminators() {
+		return Arrays.asList(terminators).iterator();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java
index 985b7fa..da0c3ed 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,12 +12,8 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 
 /**
@@ -35,11 +31,7 @@
 
 	/**
 	 * STYLE
-	 * %i18n;
-	 * (type %ContentType; #REQUIRED) ... should be defined locally.
-	 * (media %MediaDesc; #IMPLIED)
-	 * (title %Text; #IMPLIED)
-	 */
+	*/
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
 			return; // already created.
@@ -47,17 +39,11 @@
 			return; // fatal
 
 		attributes = new CMNamedNodeMapImpl();
-
-		// %i18n;
-		attributeCollection.getI18n(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_MEDIA, HTML40Namespace.ATTR_NAME_TITLE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-		// (type %ContentType; #REQUIRED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
-		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/css"); //$NON-NLS-1$
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
+		
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.STYLE, attributes);
+	
+		
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSUMMARY.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSUMMARY.java
new file mode 100644
index 0000000..c2b3e82
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSUMMARY.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+public class HedSUMMARY extends HedInlineContainer {
+
+	public HedSUMMARY(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.SUMMARY, collection);
+	}
+
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSVG.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSVG.java
new file mode 100644
index 0000000..0515172
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSVG.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+
+/**
+ * SVG.
+ */
+final class HedSVG extends HTMLElemDeclImpl {
+
+	private static String[] terminators = {HTML50Namespace.ElementName.SVG};
+
+	/**
+	 */
+	public HedSVG(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.SVG, collection);
+		layoutType = LAYOUT_OBJECT;
+	}
+
+	/**
+	 * Create all attribute declarations.
+	 * SVG namespace
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		attributeCollection.getAttrs(attributes);
+	}
+
+	/**
+	 * SVG has terminators.
+	 * @return java.util.Iterator
+	 */
+	protected Iterator getTerminators() {
+		return Arrays.asList(terminators).iterator();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSectioning.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSectioning.java
new file mode 100644
index 0000000..07a7209
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSectioning.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+public class HedSectioning extends HedFlowContainer {
+	public HedSectioning(String elementName, ElementCollection collection) {
+		super(elementName, collection);
+		layoutType = LAYOUT_BLOCK;
+		correctionType = CORRECT_EMPTY;
+	}
+
+	/**
+	 * Article.
+	 * %attrs;
+	 * Global attributes
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java
index bed267c..426cd78 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,11 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
 /**
@@ -36,20 +32,6 @@
 	/**
 	 * TABLE.
 	 * %attrs;
-	 * %reserved;
-	 * (summary %Text; #IMPLIED)
-	 * (width %Length; #IMPLIED)
-	 * (border %Pixels; #IMPLIED)
-	 * (frame %TFrame; #IMPLIED)
-	 * (rules %TRules; #IMPLIED)
-	 * (cellspacing %Length; #IMPLIED)
-	 * (cellpadding %Length; #IMPLIED)
-	 * (align %TAlign; #IMPLIED)
-	 * (bgcolor %Color; #IMPLIED)
-	 * (datapagesize CDATA #IMPLIED)
-	 * (height %Pixels; #IMPLIED)
-	 * (background %URI; #IMPLIED)
-	 * (bordercolor %Color #IMPLIED) ... D205514
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -61,19 +43,10 @@
 
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
-		// %reserved;
-		// ... %reserved; is empty in the current DTD.
-
-		String[] names = {HTML40Namespace.ATTR_NAME_SUMMARY, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_BORDER, HTML40Namespace.ATTR_NAME_FRAME, HTML40Namespace.ATTR_NAME_RULES, HTML40Namespace.ATTR_NAME_CELLSPACING, HTML40Namespace.ATTR_NAME_CELLPADDING, HTML40Namespace.ATTR_NAME_BGCOLOR, HTML40Namespace.ATTR_NAME_DATAPAGESIZE, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_BACKGROUND, HTML40Namespace.ATTR_NAME_BORDERCOLOR // D205514
-		};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// align (local)
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		String[] alignValues = {HTML40Namespace.ATTR_VALUE_LEFT, HTML40Namespace.ATTR_VALUE_CENTER, HTML40Namespace.ATTR_VALUE_RIGHT};
-		atype.setEnumValues(alignValues);
-		HTMLAttrDeclImpl adec = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, adec);
+		
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.TABLE, attributes);
+		
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java
index f8a61c6..1b5ba41 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,8 +12,6 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
@@ -35,19 +33,6 @@
 	/**
 	 * TEXTAREA.
 	 * %attrs;
-	 * %reserved; ... empty
-	 * (name CDATA #IMPLIED)
-	 * (rows NUMBER #REQUIRED)
-	 * (cols NUMBER #REQUIRED)
-	 * (disabled (disabled) #IMPLIED)
-	 * (readonly (readonly) #IMPLIED)
-	 * (tabindex NUMBER #IMPLIED)
-	 * (accesskey %Character; #IMPLIED)
-	 * (onfocus %Script; #IMPLIED)
-	 * (onblur %Script; #IMPLIED)
-	 * (onselect %Script; #IMPLIED)
-	 * (onchange %Script; #IMPLIED)
-	 * (istyle CDATA #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -58,10 +43,10 @@
 
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_ROWS, HTML40Namespace.ATTR_NAME_COLS, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_READONLY, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR, HTML40Namespace.ATTR_NAME_ONSELECT, HTML40Namespace.ATTR_NAME_ONCHANGE, HTML40Namespace.ATTR_NAME_ISTYLE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.TEXTAREA, attributes);
+	
+		}
 
 	/**
 	 */
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTIME.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTIME.java
new file mode 100644
index 0000000..ec8191c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTIME.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+public class HedTIME extends HedInlineContainer {
+
+	public HedTIME(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.TIME, collection);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.HTMLElemDeclImpl#createAttributeDeclarations()
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+		attributeCollection.getAttrs(attributes);
+
+		String[] names = { HTML40Namespace.ATTR_NAME_DATETIME, HTML50Namespace.ATTR_NAME_PUBDATE };
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+
+	}
+
+	public CMContent getExclusion() {
+		if (exclusion != null)
+			return exclusion; // already created.
+		if (elementCollection == null)
+			return null;
+
+		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
+		CMNode time = elementCollection.getNamedItem(HTML50Namespace.ElementName.TIME);
+		if (time != null)
+			exclusion.appendChild(time);
+
+		return exclusion;
+	}
+
+	public CMNamedNodeMap getProhibitedAncestors() {
+		if (prohibitedAncestors != null)
+			return prohibitedAncestors;
+
+		String[] names = {HTML50Namespace.ElementName.TIME};
+		prohibitedAncestors = elementCollection.getDeclarations(names);
+		return prohibitedAncestors;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedVIDEO.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedVIDEO.java
new file mode 100644
index 0000000..98eb444
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedVIDEO.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+
+
+
+
+/**
+ * VIDEO.
+ */
+final class HedVIDEO extends HedMediaElement {
+
+	
+	public HedVIDEO(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.VIDEO, collection);
+	}
+
+	/**
+	 * MediaElement
+	 * %attrs;
+	 * (src %URI; #REQUIRED): should be defined locally.
+	 * (preload %CDATA; #IMPLIED) 
+	 * (autoplay %ENUM; #IMPLIED) 
+	 * (loop %ENUM; #IMPLIED)
+	 * (controls %MediaType; #IMPLIED)
+	 * (poster %URI; OPTIONAL)
+	 * (height %Length; #IMPLIED)
+	 * (width %Length; #IMPLIED)
+	 * Global attributes
+	 */
+	protected void createAttributeDeclarations() {
+		super.createAttributeDeclarations();
+		
+		// (poster %URI; #optional): should be defined locally.
+		
+		HTMLCMDataTypeImpl atype = null;
+		HTMLAttrDeclImpl attr = null;
+		atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_POSTER, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_POSTER, attr);
+		
+		// height , width
+		String[] names = {HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH};
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+
+
+		
+	}
+}
+
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM21DocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM21DocImpl.java
new file mode 100644
index 0000000..ba9e0cd
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM21DocImpl.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+class JCM21DocImpl extends JCMDocImpl {
+	/**
+	 * JCM21DocImpl constructor comment.
+	 */
+	public JCM21DocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
+		super(docTypeName, targetNamespace, new JSP21ElementCollection());
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java
index 3ca1dad..fd404c5 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java
@@ -23,7 +23,7 @@
 /**
  * Factory for element declarations of JSP 1.1 and JSP 1.2.
  */
-final class JSP20ElementCollection extends JSPElementCollection implements JSP20Namespace.ElementName {
+class JSP20ElementCollection extends JSPElementCollection implements JSP20Namespace.ElementName {
 
 	// element IDs
 	private static class Ids20 extends Ids {
@@ -55,7 +55,7 @@
 	}
 
 	// attribute creater
-	private class JACreater20 extends JACreater {
+	class JACreater20 extends JACreater {
 		public JACreater20() {
 			super();
 		}
@@ -483,9 +483,13 @@
 		if (content != null)
 			decl.setContent(content);
 
-		JACreater20 creater = new JACreater20();
+		JACreater20 creater = getAttributeCreator();
 		decl.setAttributes(creater.getDeclarations(eid));
 
 		return decl;
 	}
+
+	protected JACreater20 getAttributeCreator() {
+		return new JACreater20();
+	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21ElementCollection.java
new file mode 100644
index 0000000..4b7a1ba
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21ElementCollection.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+
+class JSP21ElementCollection extends JSP20ElementCollection {
+
+	class JACreator21 extends JACreater20 {
+		void createForDirPage() {
+			super.createForDirPage();
+			AttrDecl adec;
+			// ("trimDirectiveWhitespaces" ENUM DECLARED (true|false) "false")
+			adec = createBoolType(JSP21Namespace.ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES, ATTR_VALUE_FALSE);
+			if (adec != null) {
+				adec.usage = CMAttributeDeclaration.OPTIONAL;
+				declarations.putNamedItem(JSP21Namespace.ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES, adec);
+			}
+			// ("deferredSyntaxAllowedAsLiteral" ENUM DECLARED (true|false) "false")
+			adec = createBoolType(JSP21Namespace.ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL, ATTR_VALUE_FALSE);
+			if (adec != null) {
+				adec.usage = CMAttributeDeclaration.OPTIONAL;
+				declarations.putNamedItem(JSP21Namespace.ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL, adec);
+			}
+		}
+	}
+
+	protected JACreater20 getAttributeCreator() {
+		return new JACreator21();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java
new file mode 100644
index 0000000..dde35b7
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+public interface JSP21Namespace extends JSP20Namespace {
+	String JSP21_URI = "";//$NON-NLS-1$
+	String ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES = "trimDirectiveWhitespaces"; //$NON-NLS-1$
+	String ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL = "deferredSyntaxAllowedAsLiteral"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java
index 7ae40f2..8dd86bc 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java
@@ -501,23 +501,23 @@
 
 	static {
 		names = new String[TagIds20.getNumOfIds()];
-		names[Ids.ID_SCRIPTLET] = JSP11Namespace.ElementName.SCRIPTLET;
-		names[Ids.ID_EXPRESSION] = JSP11Namespace.ElementName.EXPRESSION;
-		names[Ids.ID_DECLARATION] = JSP11Namespace.ElementName.DECLARATION;
+		names[TagIds20.ID_SCRIPTLET] = JSP11Namespace.ElementName.SCRIPTLET;
+		names[TagIds20.ID_EXPRESSION] = JSP11Namespace.ElementName.EXPRESSION;
+		names[TagIds20.ID_DECLARATION] = JSP11Namespace.ElementName.DECLARATION;
 		names[TagIds20.ID_DIRECTIVE_TAG] = JSP20Namespace.ElementName.DIRECTIVE_TAG;
-		names[Ids.ID_DIRECTIVE_INCLUDE] = JSP11Namespace.ElementName.DIRECTIVE_INCLUDE;
-		names[Ids.ID_DIRECTIVE_TAGLIB] = JSP11Namespace.ElementName.DIRECTIVE_TAGLIB;
-		names[Ids.ID_USEBEAN] = JSP11Namespace.ElementName.USEBEAN;
-		names[Ids.ID_SETPROPERTY] = JSP11Namespace.ElementName.SETPROPERTY;
-		names[Ids.ID_GETPROPERTY] = JSP11Namespace.ElementName.GETPROPERTY;
-		names[Ids.ID_INCLUDE] = JSP11Namespace.ElementName.INCLUDE;
-		names[Ids.ID_FORWARD] = JSP11Namespace.ElementName.FORWARD;
-		names[Ids.ID_PLUGIN] = JSP11Namespace.ElementName.PLUGIN;
-		names[Ids.ID_PARAMS] = JSP11Namespace.ElementName.PARAMS;
-		names[Ids.ID_FALLBACK] = JSP11Namespace.ElementName.FALLBACK;
-		names[Ids.ID_PARAM] = JSP11Namespace.ElementName.PARAM;
-		names[Ids.ID_ROOT] = JSP11Namespace.ElementName.ROOT;
-		names[Ids.ID_TEXT] = JSP11Namespace.ElementName.TEXT;
+		names[TagIds20.ID_DIRECTIVE_INCLUDE] = JSP11Namespace.ElementName.DIRECTIVE_INCLUDE;
+		names[TagIds20.ID_DIRECTIVE_TAGLIB] = JSP11Namespace.ElementName.DIRECTIVE_TAGLIB;
+		names[TagIds20.ID_USEBEAN] = JSP11Namespace.ElementName.USEBEAN;
+		names[TagIds20.ID_SETPROPERTY] = JSP11Namespace.ElementName.SETPROPERTY;
+		names[TagIds20.ID_GETPROPERTY] = JSP11Namespace.ElementName.GETPROPERTY;
+		names[TagIds20.ID_INCLUDE] = JSP11Namespace.ElementName.INCLUDE;
+		names[TagIds20.ID_FORWARD] = JSP11Namespace.ElementName.FORWARD;
+		names[TagIds20.ID_PLUGIN] = JSP11Namespace.ElementName.PLUGIN;
+		names[TagIds20.ID_PARAMS] = JSP11Namespace.ElementName.PARAMS;
+		names[TagIds20.ID_FALLBACK] = JSP11Namespace.ElementName.FALLBACK;
+		names[TagIds20.ID_PARAM] = JSP11Namespace.ElementName.PARAM;
+		names[TagIds20.ID_ROOT] = JSP11Namespace.ElementName.ROOT;
+		names[TagIds20.ID_TEXT] = JSP11Namespace.ElementName.TEXT;
 		names[TagIds20.ID_DIRECTIVE_VARIABLE] = JSP20Namespace.ElementName.DIRECTIVE_VARIABLE;
 		names[TagIds20.ID_DIRECTIVE_ATTRIBUTE] = JSP20Namespace.ElementName.DIRECTIVE_ATTRIBUTE;
 		names[TagIds20.ID_BODY] = JSP20Namespace.ElementName.BODY;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java
index 1dbdf56..ea727f8 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java
@@ -1,7 +1,7 @@
-/* The following code was generated by JFlex 1.2.2 on 7/28/08 5:19 PM */
+/* The following code was generated by JFlex 1.2.2 on 8/17/10 3:37 PM */
 
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -24,8 +24,8 @@
 /**
  * This class is a scanner generated by 
  * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 7/28/08 5:19 PM from the specification file
- * <tt>file:/D:/workspaces/wtp301/workspace/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex</tt>
+ * on 8/17/10 3:37 PM from the specification file
+ * <tt>file:/D:/dev/workspaces/helios/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex</tt>
  */
 public class HTMLHeadTokenizer {
 
@@ -57,14 +57,14 @@
    */
   final private static String yycmap_packed = 
     "\1\11\10\0\1\6\1\7\2\0\1\10\22\0\1\6\1\0\1\40"+
-    "\2\0\1\44\1\0\1\43\5\0\1\34\1\0\1\42\13\0\1\45"+
+    "\2\0\1\46\1\0\1\45\5\0\1\34\1\0\1\44\13\0\1\47"+
     "\1\13\1\12\1\31\1\14\1\0\1\22\1\0\1\24\1\26\1\20"+
     "\1\0\1\30\1\32\1\27\2\0\1\17\1\16\1\23\1\25\1\33"+
-    "\1\35\2\0\1\21\1\36\1\37\1\0\1\15\1\41\7\0\1\22"+
-    "\1\0\1\24\1\26\1\20\1\0\1\30\1\32\1\27\2\0\1\17"+
-    "\1\16\1\23\1\25\1\33\1\35\2\0\1\21\1\36\1\37\1\0"+
-    "\1\15\1\41\101\0\1\4\3\0\1\5\17\0\1\3\16\0\1\1"+
-    "\20\0\1\3\16\0\1\1\1\2\170\0\1\2\ufe87\0";
+    "\1\35\1\42\1\43\1\21\1\36\1\37\1\0\1\15\1\41\7\0"+
+    "\1\22\1\0\1\24\1\26\1\20\1\0\1\30\1\32\1\27\2\0"+
+    "\1\17\1\16\1\23\1\25\1\33\1\35\1\42\1\43\1\21\1\36"+
+    "\1\37\1\0\1\15\1\41\101\0\1\4\3\0\1\5\17\0\1\3"+
+    "\16\0\1\1\20\0\1\3\16\0\1\1\1\2\170\0\1\2\ufe87\0";
 
   /** 
    * Translates characters to character classes
@@ -116,7 +116,7 @@
   private int yy_endRead;
 
   /** number of newlines encountered up to the start of the matched text */
-//  private int yyline;
+  //private int yyline;
 
   /** the number of characters up to the start of the matched text */
   private int yychar;
@@ -125,7 +125,7 @@
    * the number of characters from the last newline up to the start of the 
    * matched text
    */
-//  private int yycolumn; 
+  //private int yycolumn; 
 
   /** 
    * yy_atBOL == true <=> the scanner is currently at the beginning of a line
@@ -142,6 +142,7 @@
 
 
 	private boolean hasMore = true;
+	private boolean hasCharsetAttr = false;
 	private final static int MAX_TO_SCAN = 8000;
 	StringBuffer string = new StringBuffer();
 	// state stack for easier state handling
@@ -188,7 +189,7 @@
   		yy_endRead = 0;
 
   		/* number of newlines encountered up to the start of the matched text */
-//  		yyline = 0;
+  		// yyline = 0;
 
   		/* the number of characters up to the start of the matched text */
   		yychar = 0;
@@ -197,7 +198,7 @@
   		 * the number of characters from the last newline up to the start
   		 * of the matched text
   		 */
-//  		yycolumn = 0; 
+  		// yycolumn = 0; 
 
   		/** 
   		 * yy_atBOL == true <=> the scanner is currently at the beginning 
@@ -215,6 +216,7 @@
   		fStateStack.clear();
   		
   		hasMore = true;
+  		hasCharsetAttr = false;
   		
 		// its a little wasteful to "throw away" first char array generated
 		// by class init (via auto generated code), but we really do want
@@ -229,8 +231,16 @@
 
 	public final HeadParserToken getNextToken() throws IOException {
 		String context = null;
-		context = primGetNextToken();
 		HeadParserToken result = null;
+		try {
+			context = primGetNextToken();
+		}
+		catch (IllegalStateException e) {
+			hasMore = false;
+			result = createToken(HTMLHeadTokenizerConstants.UNDEFINED, yychar, yytext());
+			while(yy_advance() != YYEOF) {}
+			return result;
+		}
 		if (valueText != null) {
 			result = createToken(context, yychar, valueText);
 			valueText = null;
@@ -247,6 +257,9 @@
 		fStateStack.push(yystate());
 
 	}
+	public final boolean hasCharsetAttr() {
+		return hasCharsetAttr;
+	}
 
 	private void popState() {
 		yybegin(fStateStack.pop());
@@ -288,7 +301,7 @@
     char [] map = new char[0x10000];
     int i = 0;  /* index in packed string  */
     int j = 0;  /* index in unpacked array */
-    while (i < 176) {
+    while (i < 180) {
       int  count = packed.charAt(i++);
       char value = packed.charAt(i++);
       do map[j++] = value; while (--count > 0);
@@ -347,7 +360,7 @@
     return yy_buffer[yy_currentPos++];
   }
 
-
+    
   /**
    * Closes the input stream.
    */
@@ -397,13 +410,14 @@
    */
   private void yy_ScanError(int errorCode) {
     try {
-      System.out.println(YY_ERROR_MSG[errorCode]);
+      IllegalStateException ise = new IllegalStateException("Instance: " + System.identityHashCode(this) + " offset:" + yychar + " state:" + yystate());
+      System.out.println(YY_ERROR_MSG[errorCode] + "\n" + ise);
+      throw ise;
     }
     catch (ArrayIndexOutOfBoundsException e) {
       System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
     }
 
-    System.exit(1);
   } 
 
 
@@ -473,7 +487,7 @@
 
       yy_forAction: {
         while (true) {
-
+    
           yy_input = yy_advance();
 
           if ( yy_input == YYEOF ) break yy_forAction;
@@ -519,21 +533,22 @@
             case 3:
               switch (yy_input) {
                 case 9: yy_isFinal = true; yy_state = 21; break yy_forNext;
-                case 25: yy_isFinal = true; yy_state = 22; break yy_forNext;
-                case 26: yy_isFinal = true; yy_state = 23; break yy_forNext;
-                case 34: yy_isFinal = true; yy_state = 24; break yy_forNext;
+                case 20: yy_isFinal = true; yy_state = 22; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 26: yy_isFinal = true; yy_state = 24; break yy_forNext;
+                case 36: yy_isFinal = true; yy_state = 25; break yy_forNext;
                 default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 9; break yy_forNext;
               }
 
             case 4:
               switch (yy_input) {
                 case 6: 
-                case 8: yy_isFinal = true; yy_state = 26; break yy_forNext;
-                case 7: yy_isFinal = true; yy_state = 27; break yy_forNext;
-                case 9: yy_isFinal = true; yy_state = 28; break yy_forNext;
-                case 32: yy_isFinal = true; yy_state = 29; break yy_forNext;
-                case 35: yy_isFinal = true; yy_state = 30; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
+                case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                case 7: yy_isFinal = true; yy_state = 28; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 30; break yy_forNext;
+                case 37: yy_isFinal = true; yy_state = 31; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
               }
 
             case 5:
@@ -541,12 +556,12 @@
                 case 7: 
                 case 8: 
                 case 11: 
-                case 25: yy_isFinal = true; yy_state = 32; break yy_forNext;
-                case 9: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 34; break yy_forNext;
                 case 12: 
-                case 34: yy_isFinal = true; yy_state = 34; break yy_forNext;
-                case 32: yy_isFinal = true; yy_state = 35; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 31; break yy_forNext;
+                case 36: yy_isFinal = true; yy_state = 35; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 36; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
               }
 
             case 6:
@@ -554,28 +569,28 @@
                 case 7: 
                 case 8: 
                 case 11: 
-                case 25: yy_isFinal = true; yy_state = 32; break yy_forNext;
-                case 34: yy_isFinal = true; yy_state = 34; break yy_forNext;
-                case 35: yy_isFinal = true; yy_state = 35; break yy_forNext;
-                case 9: yy_isFinal = true; yy_state = 36; break yy_forNext;
-                case 36: yy_isFinal = true; yy_state = 37; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 31; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 36: yy_isFinal = true; yy_state = 35; break yy_forNext;
+                case 37: yy_isFinal = true; yy_state = 36; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 37; break yy_forNext;
+                case 38: yy_isFinal = true; yy_state = 38; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
               }
 
             case 7:
               switch (yy_input) {
                 case 11: 
-                case 25: yy_isFinal = true; yy_state = 32; break yy_forNext;
-                case 34: yy_isFinal = true; yy_state = 34; break yy_forNext;
-                case 12: yy_isFinal = true; yy_state = 37; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 36: yy_isFinal = true; yy_state = 35; break yy_forNext;
+                case 12: yy_isFinal = true; yy_state = 38; break yy_forNext;
                 case 6: 
                 case 7: 
-                case 8: yy_isFinal = true; yy_state = 38; break yy_forNext;
-                case 9: yy_isFinal = true; yy_state = 39; break yy_forNext;
+                case 8: yy_isFinal = true; yy_state = 39; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 40; break yy_forNext;
                 case 32: 
-                case 35: yy_isFinal = true; yy_state = 40; break yy_forNext;
-                case 37: yy_isFinal = true; yy_pushbackPos = yy_currentPos; yy_pushback = true; yy_state = 41; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 31; break yy_forNext;
+                case 37: yy_isFinal = true; yy_state = 41; break yy_forNext;
+                case 39: yy_isFinal = true; yy_pushbackPos = yy_currentPos; yy_pushback = true; yy_state = 42; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
               }
 
             case 8:
@@ -583,38 +598,38 @@
                 case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 9; break yy_forNext;
                 case 6: 
                 case 7: 
-                case 8: yy_isFinal = true; yy_noLookAhead = true; yy_state = 31; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 42; break yy_forNext;
+                case 8: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 43; break yy_forNext;
               }
 
             case 10:
               switch (yy_input) {
-                case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 43; break yy_forNext;
+                case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 44; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 11:
               switch (yy_input) {
-                case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 44; break yy_forNext;
+                case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 45; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 12:
               switch (yy_input) {
-                case 4: yy_state = 45; break yy_forNext;
+                case 4: yy_state = 46; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 13:
               switch (yy_input) {
-                case 11: yy_state = 46; break yy_forNext;
+                case 11: yy_state = 47; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 14:
               switch (yy_input) {
-                case 9: yy_state = 47; break yy_forNext;
-                case 14: yy_state = 48; break yy_forNext;
+                case 9: yy_state = 48; break yy_forNext;
+                case 14: yy_state = 49; break yy_forNext;
                 default: break yy_forAction;
               }
 
@@ -622,9 +637,9 @@
               switch (yy_input) {
                 case 6: 
                 case 7: 
-                case 8: yy_state = 49; break yy_forNext;
-                case 9: yy_state = 50; break yy_forNext;
-                case 11: yy_state = 51; break yy_forNext;
+                case 8: yy_state = 50; break yy_forNext;
+                case 9: yy_state = 51; break yy_forNext;
+                case 11: yy_state = 52; break yy_forNext;
                 default: break yy_forAction;
               }
 
@@ -632,226 +647,224 @@
               switch (yy_input) {
                 case 6: 
                 case 7: 
-                case 8: yy_state = 49; break yy_forNext;
-                case 11: yy_state = 52; break yy_forNext;
+                case 8: yy_state = 50; break yy_forNext;
+                case 11: yy_state = 53; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 17:
               switch (yy_input) {
-                case 14: yy_state = 48; break yy_forNext;
-                case 9: yy_state = 53; break yy_forNext;
-                case 12: yy_state = 54; break yy_forNext;
+                case 14: yy_state = 49; break yy_forNext;
+                case 9: yy_state = 54; break yy_forNext;
+                case 12: yy_state = 55; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 18:
               switch (yy_input) {
-                case 12: yy_state = 55; break yy_forNext;
-                case 16: yy_state = 56; break yy_forNext;
+                case 12: yy_state = 56; break yy_forNext;
+                case 16: yy_state = 57; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 19:
               switch (yy_input) {
-                case 9: yy_state = 57; break yy_forNext;
-                case 25: yy_isFinal = true; yy_state = 58; break yy_forNext;
+                case 9: yy_state = 58; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 59; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 20:
               switch (yy_input) {
-                case 9: yy_state = 59; break yy_forNext;
-                case 19: yy_state = 60; break yy_forNext;
+                case 9: yy_state = 60; break yy_forNext;
+                case 19: yy_state = 61; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 21:
               switch (yy_input) {
-                case 25: yy_isFinal = true; yy_state = 22; break yy_forNext;
-                case 26: yy_state = 61; break yy_forNext;
-                case 34: yy_state = 62; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 20: yy_state = 62; break yy_forNext;
+                case 26: yy_state = 63; break yy_forNext;
+                case 36: yy_state = 64; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 22:
               switch (yy_input) {
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 63; break yy_forNext;
+                case 9: yy_state = 65; break yy_forNext;
+                case 26: yy_state = 66; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 23:
               switch (yy_input) {
-                case 9: yy_state = 64; break yy_forNext;
-                case 17: yy_state = 65; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 67; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 24:
               switch (yy_input) {
-                case 9: yy_state = 66; break yy_forNext;
-                case 25: yy_isFinal = true; yy_state = 67; break yy_forNext;
+                case 9: yy_state = 68; break yy_forNext;
+                case 17: yy_state = 69; break yy_forNext;
                 default: break yy_forAction;
               }
 
-            case 26:
+            case 25:
               switch (yy_input) {
-                case 6: 
-                case 8: yy_isFinal = true; yy_state = 26; break yy_forNext;
-                case 7: yy_state = 68; break yy_forNext;
-                case 9: yy_isFinal = true; yy_state = 69; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
+                case 9: yy_state = 70; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 71; break yy_forNext;
+                default: break yy_forAction;
               }
 
             case 27:
               switch (yy_input) {
                 case 6: 
-                case 8: yy_isFinal = true; yy_state = 26; break yy_forNext;
-                case 7: yy_state = 68; break yy_forNext;
-                case 9: yy_isFinal = true; yy_state = 69; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
+                case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                case 7: yy_state = 72; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 73; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
               }
 
             case 28:
               switch (yy_input) {
-                case 32: yy_isFinal = true; yy_state = 29; break yy_forNext;
-                case 35: yy_isFinal = true; yy_state = 30; break yy_forNext;
                 case 6: 
-                case 7: 
-                case 8: yy_state = 68; break yy_forNext;
-                default: break yy_forAction;
+                case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                case 7: yy_state = 72; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 73; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
               }
 
             case 29:
               switch (yy_input) {
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 70; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 30; break yy_forNext;
+                case 37: yy_isFinal = true; yy_state = 31; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 72; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 30:
               switch (yy_input) {
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 71; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 74; break yy_forNext;
                 default: break yy_forAction;
               }
 
-            case 32:
+            case 31:
               switch (yy_input) {
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 72; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 75; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 33:
               switch (yy_input) {
-                case 7: 
-                case 8: 
-                case 11: 
-                case 25: yy_isFinal = true; yy_state = 32; break yy_forNext;
-                case 32: yy_isFinal = true; yy_state = 35; break yy_forNext;
-                case 12: 
-                case 34: yy_state = 73; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 76; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 34:
               switch (yy_input) {
-                case 9: yy_state = 74; break yy_forNext;
-                case 25: yy_isFinal = true; yy_state = 75; break yy_forNext;
+                case 7: 
+                case 8: 
+                case 11: 
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 36; break yy_forNext;
+                case 12: 
+                case 36: yy_state = 77; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 35:
               switch (yy_input) {
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 76; break yy_forNext;
+                case 9: yy_state = 78; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 79; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 36:
               switch (yy_input) {
-                case 7: 
-                case 8: 
-                case 11: 
-                case 25: yy_isFinal = true; yy_state = 32; break yy_forNext;
-                case 35: yy_isFinal = true; yy_state = 35; break yy_forNext;
-                case 34: yy_state = 73; break yy_forNext;
-                case 36: yy_state = 77; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 80; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 37:
               switch (yy_input) {
-                case 25: yy_isFinal = true; yy_state = 32; break yy_forNext;
-                case 9: yy_state = 78; break yy_forNext;
+                case 7: 
+                case 8: 
+                case 11: 
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 37: yy_isFinal = true; yy_state = 36; break yy_forNext;
+                case 36: yy_state = 77; break yy_forNext;
+                case 38: yy_state = 81; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 38:
               switch (yy_input) {
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 79; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 9: yy_state = 82; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 39:
               switch (yy_input) {
-                case 11: 
-                case 25: yy_isFinal = true; yy_state = 32; break yy_forNext;
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_state = 38; break yy_forNext;
-                case 32: 
-                case 35: yy_isFinal = true; yy_state = 40; break yy_forNext;
-                case 34: yy_state = 73; break yy_forNext;
-                case 12: yy_state = 77; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 83; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 40:
               switch (yy_input) {
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 80; break yy_forNext;
+                case 11: 
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 39; break yy_forNext;
+                case 32: 
+                case 37: yy_isFinal = true; yy_state = 41; break yy_forNext;
+                case 36: yy_state = 77; break yy_forNext;
+                case 12: yy_state = 81; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 41:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_pushback = true; yy_state = 81; break yy_forNext;
-                case 9: yy_state = 82; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 84; break yy_forNext;
                 default: break yy_forAction;
               }
 
-            case 45:
+            case 42:
               switch (yy_input) {
-                case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 83; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_pushback = true; yy_state = 85; break yy_forNext;
+                case 9: yy_state = 86; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 46:
               switch (yy_input) {
-                case 9: yy_state = 47; break yy_forNext;
-                case 14: yy_state = 48; break yy_forNext;
+                case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 87; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 47:
               switch (yy_input) {
-                case 14: yy_state = 48; break yy_forNext;
+                case 9: yy_state = 48; break yy_forNext;
+                case 14: yy_state = 49; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 48:
               switch (yy_input) {
-                case 9: yy_state = 84; break yy_forNext;
-                case 16: yy_state = 85; break yy_forNext;
+                case 14: yy_state = 49; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 49:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 49; break yy_forNext;
-                case 9: yy_state = 50; break yy_forNext;
-                case 11: yy_state = 51; break yy_forNext;
+                case 9: yy_state = 88; break yy_forNext;
+                case 16: yy_state = 89; break yy_forNext;
                 default: break yy_forAction;
               }
 
@@ -859,196 +872,205 @@
               switch (yy_input) {
                 case 6: 
                 case 7: 
-                case 8: yy_state = 49; break yy_forNext;
-                case 11: yy_state = 51; break yy_forNext;
-                case 9: yy_state = 86; break yy_forNext;
+                case 8: yy_state = 50; break yy_forNext;
+                case 9: yy_state = 51; break yy_forNext;
+                case 11: yy_state = 52; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 51:
               switch (yy_input) {
-                case 12: yy_state = 54; break yy_forNext;
-                case 9: yy_state = 87; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 50; break yy_forNext;
+                case 11: yy_state = 52; break yy_forNext;
+                case 9: yy_state = 90; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 52:
               switch (yy_input) {
-                case 14: yy_state = 48; break yy_forNext;
-                case 9: yy_state = 53; break yy_forNext;
-                case 12: yy_state = 54; break yy_forNext;
+                case 12: yy_state = 55; break yy_forNext;
+                case 9: yy_state = 91; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 53:
               switch (yy_input) {
-                case 14: yy_state = 48; break yy_forNext;
-                case 12: yy_state = 54; break yy_forNext;
+                case 14: yy_state = 49; break yy_forNext;
+                case 9: yy_state = 54; break yy_forNext;
+                case 12: yy_state = 55; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 54:
               switch (yy_input) {
-                case 9: yy_state = 88; break yy_forNext;
-                case 13: yy_state = 89; break yy_forNext;
+                case 14: yy_state = 49; break yy_forNext;
+                case 12: yy_state = 55; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 55:
               switch (yy_input) {
-                case 9: yy_state = 57; break yy_forNext;
-                case 25: yy_isFinal = true; yy_state = 58; break yy_forNext;
+                case 9: yy_state = 92; break yy_forNext;
+                case 13: yy_state = 93; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 56:
               switch (yy_input) {
-                case 9: yy_state = 59; break yy_forNext;
-                case 19: yy_state = 60; break yy_forNext;
+                case 9: yy_state = 58; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 59; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 57:
               switch (yy_input) {
-                case 25: yy_isFinal = true; yy_state = 58; break yy_forNext;
+                case 9: yy_state = 60; break yy_forNext;
+                case 19: yy_state = 61; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 58:
               switch (yy_input) {
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 90; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 59; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 59:
               switch (yy_input) {
-                case 19: yy_state = 60; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 94; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 60:
               switch (yy_input) {
-                case 9: yy_state = 91; break yy_forNext;
-                case 20: yy_state = 92; break yy_forNext;
+                case 19: yy_state = 61; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 61:
               switch (yy_input) {
-                case 9: yy_state = 64; break yy_forNext;
-                case 17: yy_state = 65; break yy_forNext;
+                case 9: yy_state = 95; break yy_forNext;
+                case 20: yy_state = 96; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 62:
               switch (yy_input) {
-                case 9: yy_state = 66; break yy_forNext;
-                case 25: yy_isFinal = true; yy_state = 67; break yy_forNext;
+                case 9: yy_state = 65; break yy_forNext;
+                case 26: yy_state = 66; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 63:
+              switch (yy_input) {
+                case 9: yy_state = 68; break yy_forNext;
+                case 17: yy_state = 69; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 64:
               switch (yy_input) {
-                case 17: yy_state = 65; break yy_forNext;
+                case 9: yy_state = 70; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 71; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 65:
               switch (yy_input) {
-                case 9: yy_state = 93; break yy_forNext;
-                case 17: yy_state = 94; break yy_forNext;
+                case 26: yy_state = 66; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 66:
               switch (yy_input) {
-                case 25: yy_isFinal = true; yy_state = 67; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 67:
-              switch (yy_input) {
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 95; break yy_forNext;
+                case 9: yy_state = 97; break yy_forNext;
+                case 18: yy_state = 98; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 68:
               switch (yy_input) {
-                case 6: 
-                case 8: yy_isFinal = true; yy_state = 26; break yy_forNext;
-                case 7: yy_state = 68; break yy_forNext;
-                case 9: yy_isFinal = true; yy_state = 69; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
+                case 17: yy_state = 69; break yy_forNext;
+                default: break yy_forAction;
               }
 
             case 69:
               switch (yy_input) {
+                case 9: yy_state = 99; break yy_forNext;
+                case 17: yy_state = 100; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 70:
+              switch (yy_input) {
+                case 25: yy_isFinal = true; yy_state = 71; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 71:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 101; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 72:
+              switch (yy_input) {
                 case 6: 
-                case 8: yy_isFinal = true; yy_state = 26; break yy_forNext;
-                case 7: yy_state = 68; break yy_forNext;
-                case 9: yy_isFinal = true; yy_state = 96; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
+                case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                case 7: yy_state = 72; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 73; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
               }
 
             case 73:
               switch (yy_input) {
-                case 9: yy_state = 74; break yy_forNext;
-                case 25: yy_isFinal = true; yy_state = 75; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 74:
-              switch (yy_input) {
-                case 25: yy_isFinal = true; yy_state = 75; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 75:
-              switch (yy_input) {
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 97; break yy_forNext;
-                default: break yy_forAction;
+                case 6: 
+                case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                case 7: yy_state = 72; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 102; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
               }
 
             case 77:
               switch (yy_input) {
-                case 25: yy_isFinal = true; yy_state = 32; break yy_forNext;
                 case 9: yy_state = 78; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 79; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 78:
               switch (yy_input) {
-                case 25: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 79; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 79:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 103; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 81:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_pushback = true; yy_state = 81; break yy_forNext;
-                case 9: yy_isFinal = true; yy_pushback = true; yy_state = 98; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 9: yy_state = 82; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 82:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_pushback = true; yy_state = 81; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 84:
-              switch (yy_input) {
-                case 16: yy_state = 85; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 85:
               switch (yy_input) {
-                case 9: yy_state = 99; break yy_forNext;
-                case 17: yy_state = 100; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_pushback = true; yy_state = 85; break yy_forNext;
+                case 9: yy_isFinal = true; yy_pushback = true; yy_state = 104; break yy_forNext;
                 default: break yy_forAction;
               }
 
@@ -1056,70 +1078,74 @@
               switch (yy_input) {
                 case 6: 
                 case 7: 
-                case 8: yy_state = 49; break yy_forNext;
-                case 11: yy_state = 51; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 87:
-              switch (yy_input) {
-                case 12: yy_state = 54; break yy_forNext;
+                case 8: yy_isFinal = true; yy_pushback = true; yy_state = 85; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 88:
               switch (yy_input) {
-                case 13: yy_state = 89; break yy_forNext;
+                case 16: yy_state = 89; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 89:
               switch (yy_input) {
-                case 9: yy_state = 101; break yy_forNext;
-                case 14: yy_state = 102; break yy_forNext;
+                case 9: yy_state = 105; break yy_forNext;
+                case 17: yy_state = 106; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 90:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 50; break yy_forNext;
+                case 11: yy_state = 52; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 91:
               switch (yy_input) {
-                case 20: yy_state = 92; break yy_forNext;
+                case 12: yy_state = 55; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 92:
               switch (yy_input) {
-                case 9: yy_state = 103; break yy_forNext;
-                case 21: yy_state = 104; break yy_forNext;
+                case 13: yy_state = 93; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 93:
               switch (yy_input) {
-                case 17: yy_state = 94; break yy_forNext;
+                case 9: yy_state = 107; break yy_forNext;
+                case 14: yy_state = 108; break yy_forNext;
                 default: break yy_forAction;
               }
 
-            case 94:
+            case 95:
               switch (yy_input) {
-                case 9: yy_state = 105; break yy_forNext;
-                case 27: yy_state = 106; break yy_forNext;
+                case 20: yy_state = 96; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 96:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 68; break yy_forNext;
+                case 9: yy_state = 109; break yy_forNext;
+                case 21: yy_state = 110; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 97:
+              switch (yy_input) {
+                case 18: yy_state = 98; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 98:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_pushback = true; yy_state = 81; break yy_forNext;
-                case 9: yy_state = 82; break yy_forNext;
+                case 9: yy_state = 111; break yy_forNext;
+                case 34: yy_state = 112; break yy_forNext;
                 default: break yy_forAction;
               }
 
@@ -1131,310 +1157,278 @@
 
             case 100:
               switch (yy_input) {
-                case 9: yy_state = 107; break yy_forNext;
-                case 18: yy_isFinal = true; yy_state = 108; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 101:
-              switch (yy_input) {
-                case 14: yy_state = 102; break yy_forNext;
+                case 9: yy_state = 113; break yy_forNext;
+                case 27: yy_state = 114; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 102:
               switch (yy_input) {
-                case 9: yy_state = 109; break yy_forNext;
-                case 15: yy_state = 110; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 103:
-              switch (yy_input) {
-                case 21: yy_state = 104; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 72; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 104:
               switch (yy_input) {
-                case 9: yy_state = 111; break yy_forNext;
-                case 22: yy_state = 112; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_pushback = true; yy_state = 85; break yy_forNext;
+                case 9: yy_state = 86; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 105:
               switch (yy_input) {
-                case 27: yy_state = 106; break yy_forNext;
+                case 17: yy_state = 106; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 106:
               switch (yy_input) {
-                case 9: yy_state = 113; break yy_forNext;
-                case 28: yy_state = 114; break yy_forNext;
+                case 9: yy_state = 115; break yy_forNext;
+                case 18: yy_isFinal = true; yy_state = 116; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 107:
               switch (yy_input) {
-                case 18: yy_isFinal = true; yy_state = 108; break yy_forNext;
+                case 14: yy_state = 108; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 108:
               switch (yy_input) {
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 115; break yy_forNext;
+                case 9: yy_state = 117; break yy_forNext;
+                case 15: yy_state = 118; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 109:
               switch (yy_input) {
-                case 15: yy_state = 110; break yy_forNext;
+                case 21: yy_state = 110; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 110:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
-                case 9: yy_state = 117; break yy_forNext;
+                case 9: yy_state = 119; break yy_forNext;
+                case 22: yy_state = 120; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 111:
               switch (yy_input) {
-                case 22: yy_state = 112; break yy_forNext;
+                case 34: yy_state = 112; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 112:
               switch (yy_input) {
-                case 9: yy_state = 118; break yy_forNext;
-                case 23: yy_state = 119; break yy_forNext;
+                case 9: yy_state = 121; break yy_forNext;
+                case 35: yy_state = 122; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 113:
               switch (yy_input) {
-                case 28: yy_state = 114; break yy_forNext;
+                case 27: yy_state = 114; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 114:
               switch (yy_input) {
-                case 9: yy_state = 120; break yy_forNext;
-                case 16: yy_state = 121; break yy_forNext;
+                case 9: yy_state = 123; break yy_forNext;
+                case 28: yy_state = 124; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 115:
+              switch (yy_input) {
+                case 18: yy_isFinal = true; yy_state = 116; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 116:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
-                case 9: yy_isFinal = true; yy_state = 122; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 125; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 117:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
-                case 9: yy_state = 123; break yy_forNext;
+                case 15: yy_state = 118; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 118:
               switch (yy_input) {
-                case 23: yy_state = 119; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 126; break yy_forNext;
+                case 9: yy_state = 127; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 119:
               switch (yy_input) {
-                case 9: yy_state = 124; break yy_forNext;
-                case 19: yy_state = 125; break yy_forNext;
+                case 22: yy_state = 120; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 120:
               switch (yy_input) {
-                case 16: yy_state = 121; break yy_forNext;
+                case 9: yy_state = 128; break yy_forNext;
+                case 23: yy_state = 129; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 121:
               switch (yy_input) {
-                case 9: yy_state = 126; break yy_forNext;
-                case 29: yy_state = 127; break yy_forNext;
+                case 35: yy_state = 122; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 122:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
-                case 9: yy_state = 123; break yy_forNext;
+                case 9: yy_state = 130; break yy_forNext;
+                case 16: yy_state = 131; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 123:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
+                case 28: yy_state = 124; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 124:
               switch (yy_input) {
-                case 19: yy_state = 125; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 125:
-              switch (yy_input) {
-                case 9: yy_state = 128; break yy_forNext;
-                case 24: yy_state = 129; break yy_forNext;
+                case 9: yy_state = 132; break yy_forNext;
+                case 16: yy_state = 133; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 126:
               switch (yy_input) {
-                case 29: yy_state = 127; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 126; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 134; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 127:
               switch (yy_input) {
-                case 9: yy_state = 130; break yy_forNext;
-                case 30: yy_state = 131; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 126; break yy_forNext;
+                case 9: yy_state = 135; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 128:
               switch (yy_input) {
-                case 24: yy_state = 129; break yy_forNext;
+                case 23: yy_state = 129; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 129:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 129; break yy_forNext;
-                case 9: yy_state = 132; break yy_forNext;
-                case 10: yy_isFinal = true; yy_state = 133; break yy_forNext;
+                case 9: yy_state = 136; break yy_forNext;
+                case 19: yy_state = 137; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 130:
               switch (yy_input) {
-                case 30: yy_state = 131; break yy_forNext;
+                case 16: yy_state = 131; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 131:
               switch (yy_input) {
-                case 9: yy_state = 134; break yy_forNext;
-                case 23: yy_state = 135; break yy_forNext;
+                case 9: yy_state = 138; break yy_forNext;
+                case 17: yy_state = 139; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 132:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 129; break yy_forNext;
-                case 10: yy_isFinal = true; yy_state = 133; break yy_forNext;
-                case 9: yy_state = 136; break yy_forNext;
+                case 16: yy_state = 133; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 133:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_state = 137; break yy_forNext;
-                case 9: yy_state = 138; break yy_forNext;
+                case 9: yy_state = 140; break yy_forNext;
+                case 29: yy_state = 141; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 134:
               switch (yy_input) {
-                case 23: yy_state = 135; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 126; break yy_forNext;
+                case 9: yy_state = 135; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 135:
               switch (yy_input) {
-                case 9: yy_state = 139; break yy_forNext;
-                case 31: yy_state = 140; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 126; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 136:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 129; break yy_forNext;
+                case 19: yy_state = 137; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 137:
               switch (yy_input) {
-                case 9: yy_isFinal = true; yy_state = 133; break yy_forNext;
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_state = 137; break yy_forNext;
+                case 9: yy_state = 142; break yy_forNext;
+                case 24: yy_state = 143; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 138:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_state = 137; break yy_forNext;
+                case 17: yy_state = 139; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 139:
               switch (yy_input) {
-                case 31: yy_state = 140; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 139; break yy_forNext;
+                case 9: yy_state = 144; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 145; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 140:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 140; break yy_forNext;
-                case 9: yy_state = 141; break yy_forNext;
-                case 10: yy_state = 142; break yy_forNext;
+                case 29: yy_state = 141; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 141:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 140; break yy_forNext;
-                case 10: yy_state = 142; break yy_forNext;
-                case 9: yy_state = 143; break yy_forNext;
+                case 9: yy_state = 146; break yy_forNext;
+                case 30: yy_state = 147; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 142:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 144; break yy_forNext;
-                case 9: yy_state = 145; break yy_forNext;
-                case 20: yy_state = 146; break yy_forNext;
-                case 32: yy_state = 147; break yy_forNext;
+                case 24: yy_state = 143; break yy_forNext;
                 default: break yy_forAction;
               }
 
@@ -1442,18 +1436,19 @@
               switch (yy_input) {
                 case 6: 
                 case 7: 
-                case 8: yy_state = 140; break yy_forNext;
+                case 8: yy_state = 143; break yy_forNext;
+                case 9: yy_state = 148; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 149; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 144:
               switch (yy_input) {
-                case 9: yy_state = 142; break yy_forNext;
                 case 6: 
                 case 7: 
-                case 8: yy_state = 144; break yy_forNext;
-                case 20: yy_state = 146; break yy_forNext;
-                case 32: yy_state = 147; break yy_forNext;
+                case 8: yy_state = 139; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 145; break yy_forNext;
+                case 9: yy_state = 150; break yy_forNext;
                 default: break yy_forAction;
               }
 
@@ -1461,326 +1456,343 @@
               switch (yy_input) {
                 case 6: 
                 case 7: 
-                case 8: yy_state = 144; break yy_forNext;
-                case 20: yy_state = 146; break yy_forNext;
-                case 32: yy_state = 147; break yy_forNext;
-                case 9: yy_state = 148; break yy_forNext;
+                case 8: yy_isFinal = true; yy_state = 151; break yy_forNext;
+                case 9: yy_state = 152; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 146:
               switch (yy_input) {
-                case 9: yy_state = 149; break yy_forNext;
-                case 21: yy_state = 150; break yy_forNext;
+                case 30: yy_state = 147; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 147:
               switch (yy_input) {
-                case 20: yy_state = 146; break yy_forNext;
-                case 9: yy_state = 148; break yy_forNext;
+                case 9: yy_state = 153; break yy_forNext;
+                case 23: yy_state = 154; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 148:
               switch (yy_input) {
-                case 20: yy_state = 146; break yy_forNext;
-                case 9: yy_state = 151; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 143; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 149; break yy_forNext;
+                case 9: yy_state = 155; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 149:
               switch (yy_input) {
-                case 21: yy_state = 150; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 156; break yy_forNext;
+                case 9: yy_state = 157; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 150:
               switch (yy_input) {
-                case 9: yy_state = 152; break yy_forNext;
-                case 19: yy_state = 153; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 139; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 151:
               switch (yy_input) {
-                case 20: yy_state = 146; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 145; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 151; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 152:
               switch (yy_input) {
-                case 19: yy_state = 153; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 151; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 153:
               switch (yy_input) {
-                case 9: yy_state = 154; break yy_forNext;
-                case 17: yy_state = 155; break yy_forNext;
+                case 23: yy_state = 154; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 154:
               switch (yy_input) {
-                case 17: yy_state = 155; break yy_forNext;
+                case 9: yy_state = 158; break yy_forNext;
+                case 31: yy_state = 159; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 155:
               switch (yy_input) {
-                case 9: yy_state = 156; break yy_forNext;
-                case 16: yy_state = 157; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 143; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 156:
               switch (yy_input) {
-                case 16: yy_state = 157; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 149; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 156; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 157:
               switch (yy_input) {
-                case 9: yy_state = 158; break yy_forNext;
-                case 19: yy_state = 159; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 156; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 158:
               switch (yy_input) {
-                case 19: yy_state = 159; break yy_forNext;
+                case 31: yy_state = 159; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 159:
               switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 159; break yy_forNext;
                 case 9: yy_state = 160; break yy_forNext;
-                case 17: yy_state = 161; break yy_forNext;
+                case 10: yy_state = 161; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 160:
               switch (yy_input) {
-                case 17: yy_state = 161; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 159; break yy_forNext;
+                case 10: yy_state = 161; break yy_forNext;
+                case 9: yy_state = 162; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 161:
               switch (yy_input) {
-                case 9: yy_state = 162; break yy_forNext;
-                case 28: yy_state = 163; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 163; break yy_forNext;
+                case 9: yy_state = 164; break yy_forNext;
+                case 20: yy_state = 165; break yy_forNext;
+                case 32: yy_state = 166; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 162:
               switch (yy_input) {
-                case 28: yy_state = 163; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 159; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 163:
               switch (yy_input) {
-                case 9: yy_state = 164; break yy_forNext;
-                case 17: yy_state = 165; break yy_forNext;
+                case 9: yy_state = 161; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 163; break yy_forNext;
+                case 20: yy_state = 165; break yy_forNext;
+                case 32: yy_state = 166; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 164:
               switch (yy_input) {
-                case 17: yy_state = 165; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 163; break yy_forNext;
+                case 20: yy_state = 165; break yy_forNext;
+                case 32: yy_state = 166; break yy_forNext;
+                case 9: yy_state = 167; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 165:
               switch (yy_input) {
-                case 9: yy_state = 166; break yy_forNext;
-                case 33: yy_state = 167; break yy_forNext;
+                case 9: yy_state = 168; break yy_forNext;
+                case 21: yy_state = 169; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 166:
               switch (yy_input) {
-                case 33: yy_state = 167; break yy_forNext;
+                case 20: yy_state = 165; break yy_forNext;
+                case 9: yy_state = 167; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 167:
               switch (yy_input) {
-                case 9: yy_state = 168; break yy_forNext;
-                case 27: yy_state = 169; break yy_forNext;
+                case 20: yy_state = 165; break yy_forNext;
+                case 9: yy_state = 170; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 168:
               switch (yy_input) {
-                case 27: yy_state = 169; break yy_forNext;
+                case 21: yy_state = 169; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 169:
               switch (yy_input) {
-                case 9: yy_state = 170; break yy_forNext;
-                case 16: yy_state = 171; break yy_forNext;
+                case 9: yy_state = 171; break yy_forNext;
+                case 19: yy_state = 172; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 170:
               switch (yy_input) {
-                case 16: yy_state = 171; break yy_forNext;
+                case 20: yy_state = 165; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 171:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 172; break yy_forNext;
-                case 9: yy_state = 173; break yy_forNext;
-                case 32: yy_state = 174; break yy_forNext;
+                case 19: yy_state = 172; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 172:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 172; break yy_forNext;
-                case 9: yy_state = 175; break yy_forNext;
-                case 20: yy_state = 176; break yy_forNext;
+                case 9: yy_state = 173; break yy_forNext;
+                case 17: yy_state = 174; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 173:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 172; break yy_forNext;
-                case 32: yy_state = 174; break yy_forNext;
-                case 9: yy_state = 177; break yy_forNext;
+                case 17: yy_state = 174; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 174:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 172; break yy_forNext;
-                case 9: yy_state = 177; break yy_forNext;
+                case 9: yy_state = 175; break yy_forNext;
+                case 16: yy_state = 176; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 175:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 172; break yy_forNext;
-                case 20: yy_state = 176; break yy_forNext;
-                case 9: yy_state = 178; break yy_forNext;
+                case 16: yy_state = 176; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 176:
               switch (yy_input) {
-                case 9: yy_state = 179; break yy_forNext;
-                case 21: yy_state = 180; break yy_forNext;
+                case 9: yy_state = 177; break yy_forNext;
+                case 19: yy_state = 178; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 177:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 172; break yy_forNext;
-                case 9: yy_state = 181; break yy_forNext;
+                case 19: yy_state = 178; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 178:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 172; break yy_forNext;
-                case 20: yy_state = 176; break yy_forNext;
+                case 9: yy_state = 179; break yy_forNext;
+                case 17: yy_state = 180; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 179:
               switch (yy_input) {
-                case 21: yy_state = 180; break yy_forNext;
+                case 17: yy_state = 180; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 180:
               switch (yy_input) {
-                case 9: yy_state = 182; break yy_forNext;
-                case 19: yy_state = 183; break yy_forNext;
+                case 9: yy_state = 181; break yy_forNext;
+                case 28: yy_state = 182; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 181:
               switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 8: yy_state = 172; break yy_forNext;
+                case 28: yy_state = 182; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 182:
               switch (yy_input) {
-                case 19: yy_state = 183; break yy_forNext;
+                case 9: yy_state = 183; break yy_forNext;
+                case 17: yy_state = 184; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 183:
               switch (yy_input) {
-                case 9: yy_state = 184; break yy_forNext;
-                case 17: yy_state = 185; break yy_forNext;
+                case 17: yy_state = 184; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 184:
               switch (yy_input) {
-                case 17: yy_state = 185; break yy_forNext;
+                case 9: yy_state = 185; break yy_forNext;
+                case 33: yy_state = 186; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 185:
               switch (yy_input) {
-                case 9: yy_state = 186; break yy_forNext;
-                case 16: yy_state = 187; break yy_forNext;
+                case 33: yy_state = 186; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 186:
               switch (yy_input) {
-                case 16: yy_state = 187; break yy_forNext;
+                case 9: yy_state = 187; break yy_forNext;
+                case 27: yy_state = 188; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 187:
               switch (yy_input) {
-                case 9: yy_state = 188; break yy_forNext;
-                case 19: yy_state = 189; break yy_forNext;
+                case 27: yy_state = 188; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 188:
               switch (yy_input) {
-                case 19: yy_state = 189; break yy_forNext;
+                case 9: yy_state = 189; break yy_forNext;
+                case 16: yy_state = 190; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 189:
               switch (yy_input) {
-                case 9: yy_state = 190; break yy_forNext;
-                case 17: yy_state = 191; break yy_forNext;
+                case 16: yy_state = 190; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 190:
               switch (yy_input) {
-                case 17: yy_state = 191; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 191; break yy_forNext;
+                case 9: yy_state = 192; break yy_forNext;
+                case 32: yy_state = 193; break yy_forNext;
                 default: break yy_forAction;
               }
 
@@ -1789,8 +1801,8 @@
                 case 6: 
                 case 7: 
                 case 8: yy_state = 191; break yy_forNext;
-                case 9: yy_state = 192; break yy_forNext;
-                case 10: yy_isFinal = true; yy_state = 193; break yy_forNext;
+                case 9: yy_state = 194; break yy_forNext;
+                case 20: yy_state = 195; break yy_forNext;
                 default: break yy_forAction;
               }
 
@@ -1799,8 +1811,8 @@
                 case 6: 
                 case 7: 
                 case 8: yy_state = 191; break yy_forNext;
-                case 10: yy_isFinal = true; yy_state = 193; break yy_forNext;
-                case 9: yy_state = 194; break yy_forNext;
+                case 32: yy_state = 193; break yy_forNext;
+                case 9: yy_state = 196; break yy_forNext;
                 default: break yy_forAction;
               }
 
@@ -1808,7 +1820,7 @@
               switch (yy_input) {
                 case 6: 
                 case 7: 
-                case 8: yy_isFinal = true; yy_state = 195; break yy_forNext;
+                case 8: yy_state = 191; break yy_forNext;
                 case 9: yy_state = 196; break yy_forNext;
                 default: break yy_forAction;
               }
@@ -1818,15 +1830,15 @@
                 case 6: 
                 case 7: 
                 case 8: yy_state = 191; break yy_forNext;
+                case 20: yy_state = 195; break yy_forNext;
+                case 9: yy_state = 197; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 195:
               switch (yy_input) {
-                case 9: yy_isFinal = true; yy_state = 193; break yy_forNext;
-                case 6: 
-                case 7: 
-                case 8: yy_isFinal = true; yy_state = 195; break yy_forNext;
+                case 9: yy_state = 198; break yy_forNext;
+                case 21: yy_state = 199; break yy_forNext;
                 default: break yy_forAction;
               }
 
@@ -1834,7 +1846,150 @@
               switch (yy_input) {
                 case 6: 
                 case 7: 
-                case 8: yy_isFinal = true; yy_state = 195; break yy_forNext;
+                case 8: yy_state = 191; break yy_forNext;
+                case 9: yy_state = 200; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 197:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 191; break yy_forNext;
+                case 20: yy_state = 195; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 198:
+              switch (yy_input) {
+                case 21: yy_state = 199; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 199:
+              switch (yy_input) {
+                case 9: yy_state = 201; break yy_forNext;
+                case 19: yy_state = 202; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 200:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 191; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 201:
+              switch (yy_input) {
+                case 19: yy_state = 202; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 202:
+              switch (yy_input) {
+                case 9: yy_state = 203; break yy_forNext;
+                case 17: yy_state = 204; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 203:
+              switch (yy_input) {
+                case 17: yy_state = 204; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 204:
+              switch (yy_input) {
+                case 9: yy_state = 205; break yy_forNext;
+                case 16: yy_state = 206; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 205:
+              switch (yy_input) {
+                case 16: yy_state = 206; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 206:
+              switch (yy_input) {
+                case 9: yy_state = 207; break yy_forNext;
+                case 19: yy_state = 208; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 207:
+              switch (yy_input) {
+                case 19: yy_state = 208; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 208:
+              switch (yy_input) {
+                case 9: yy_state = 209; break yy_forNext;
+                case 17: yy_state = 210; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 209:
+              switch (yy_input) {
+                case 17: yy_state = 210; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 210:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 210; break yy_forNext;
+                case 9: yy_state = 211; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 212; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 211:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 210; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 212; break yy_forNext;
+                case 9: yy_state = 213; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 212:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 214; break yy_forNext;
+                case 9: yy_state = 215; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 213:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 210; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 214:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_state = 212; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 214; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 215:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 214; break yy_forNext;
                 default: break yy_forAction;
               }
 
@@ -1858,37 +2013,37 @@
 
       switch (yy_action) {    
 
-        case 32: 
-        case 72: 
+        case 33: 
+        case 76: 
           {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 198: break;
-        case 25: 
+        case 217: break;
         case 26: 
-        case 28: 
-        case 69: 
-        case 96: 
+        case 27: 
+        case 29: 
+        case 73: 
+        case 102: 
           {  yypushback(1); yybegin(UnDelimitedString); string.setLength(0); }
-        case 199: break;
-        case 22: 
-        case 63: 
-          {  yybegin(YYINITIAL);  if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd; }
-        case 200: break;
-        case 40: 
-        case 80: 
-          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
-        case 201: break;
+        case 218: break;
+        case 23: 
         case 67: 
-        case 95: 
+          {  yybegin(YYINITIAL);  if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd; }
+        case 219: break;
+        case 41: 
+        case 84: 
+          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
+        case 220: break;
+        case 71: 
+        case 101: 
           {  yybegin(YYINITIAL); if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd; }
-        case 202: break;
-        case 75: 
-        case 97: 
+        case 221: break;
+        case 79: 
+        case 103: 
           {  yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 203: break;
-        case 116: 
-        case 122: 
+        case 222: break;
+        case 126: 
+        case 134: 
           { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;} }
-        case 204: break;
+        case 223: break;
         case 9: 
         case 10: 
         case 11: 
@@ -1902,68 +2057,73 @@
         case 19: 
         case 20: 
         case 21: 
-        case 23: 
+        case 22: 
         case 24: 
-        case 27: 
-        case 33: 
-        case 36: 
-        case 39: 
-          { if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
-        case 205: break;
-        case 108: 
-        case 115: 
-          { yybegin(ST_META_TAG); return HTMLHeadTokenizerConstants.MetaTagStart; }
-        case 206: break;
-        case 58: 
-        case 90: 
-          { yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd; }
-        case 207: break;
-        case 193: 
-        case 195: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType; }
-        case 208: break;
-        case 133: 
-        case 137: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
-        case 209: break;
-        case 83: 
-          { hasMore = false; return EncodingParserConstants.UTF83ByteBOM; }
-        case 210: break;
-        case 43: 
-          { hasMore = false; return EncodingParserConstants.UTF16BE; }
-        case 211: break;
-        case 44: 
-          { hasMore = false; return EncodingParserConstants.UTF16LE; }
-        case 212: break;
-        case 35: 
-        case 76: 
-          {  popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;  }
-        case 213: break;
-        case 31: 
+        case 25: 
+        case 28: 
         case 34: 
         case 37: 
-          {  string.append( yytext() );  }
-        case 214: break;
-        case 30: 
-        case 71: 
-          {  yybegin(SQ_STRING); string.setLength(0);  }
-        case 215: break;
-        case 29: 
-        case 70: 
-          {  yybegin(DQ_STRING); string.setLength(0);  }
-        case 216: break;
+        case 40: 
+          { if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
+        case 224: break;
+        case 116: 
+        case 125: 
+          { yybegin(ST_META_TAG); return HTMLHeadTokenizerConstants.MetaTagStart; }
+        case 225: break;
+        case 59: 
+        case 94: 
+          { yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd; }
+        case 226: break;
+        case 212: 
+        case 214: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType; }
+        case 227: break;
+        case 149: 
+        case 156: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
+        case 228: break;
+        case 145: 
+        case 151: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; hasCharsetAttr=true; return HTMLHeadTokenizerConstants.MetaTagContentType; }
+        case 229: break;
+        case 87: 
+          { hasMore = false; return EncodingParserConstants.UTF83ByteBOM; }
+        case 230: break;
+        case 44: 
+          { hasMore = false; return EncodingParserConstants.UTF16BE; }
+        case 231: break;
+        case 45: 
+          { hasMore = false; return EncodingParserConstants.UTF16LE; }
+        case 232: break;
+        case 36: 
+        case 80: 
+          {  popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;  }
+        case 233: break;
+        case 32: 
+        case 35: 
         case 38: 
-        case 79: 
+          {  string.append( yytext() );  }
+        case 234: break;
+        case 31: 
+        case 75: 
+          {  yybegin(SQ_STRING); string.setLength(0);  }
+        case 235: break;
+        case 30: 
+        case 74: 
+          {  yybegin(DQ_STRING); string.setLength(0);  }
+        case 236: break;
+        case 39: 
+        case 83: 
           {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
-        case 217: break;
-        case 41: 
-        case 81: 
-        case 98: 
-          {  pushCurrentState(); yybegin(UnDelimitedCharset); string.append( yytext() );  }
-        case 218: break;
+        case 237: break;
         case 42: 
+        case 85: 
+        case 104: 
+          {  pushCurrentState(); yybegin(UnDelimitedCharset); string.append( yytext() );  }
+        case 238: break;
+        case 43: 
           { yypushback(1); popState();  }
-        case 219: break;
+        case 239: break;
         default: 
           if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
             yy_atEOF = true;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java
index 938bcde..2600b07 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,5 +16,5 @@
 	String MetaTagEnd = "MetaTagEnd"; //$NON-NLS-1$
 	String MetaTagStart = "MetaTagStart"; //$NON-NLS-1$
 	String MetaTagContentType = "MetaTagContentType"; //$NON-NLS-1$
-
+	String UNDEFINED = "UNDEFINED"; //$NON-NLS-1$
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java
index 0367e54..9754fa8 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -146,7 +146,15 @@
 		}
 		while (tokenizer.hasMoreTokens());
 		if (contentTypeValue != null) {
-			parseContentTypeValue(contentTypeValue);
+			if (tokenizer.hasCharsetAttr()) {
+				contentTypeValue = contentTypeValue.trim();
+				if (contentTypeValue.length() > 0) {
+					createEncodingMemento(contentTypeValue, EncodingMemento.FOUND_ENCODING_IN_CONTENT);
+				}
+			}
+			else {
+				parseContentTypeValue(contentTypeValue);
+			}
 		}
 	}
 
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java
index 88b8ba8..f48f2f0 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java
@@ -94,6 +94,21 @@
 	}
 
 	public int size() {
-		return list.length;
+		return size;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	public String toString() {
+		StringBuffer s = new StringBuffer(getClass().getName() + ":" +size + " [");
+		for (int i = 0; i < size; i++) {
+			s.append(list[i]);
+			if(i < size - 1) {
+				s.append(", ");
+			}
+		}
+		s.append("]");
+		return s.toString();
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java
index eda938f..8efb14b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java
@@ -9,10 +9,7 @@
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
 /*
- * Created on Sep 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
+ * http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-DocumentStyle
  */
 package org.eclipse.wst.html.core.internal.document;
 
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
index 1f806e5..c00fd7e 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -72,9 +72,11 @@
 
 		// find DOCTYPE delcaration and Public ID
 		String publicId = null;
+		String systemId = null;
 		DocumentType newDocumentType = findDocumentType(document);
 		if (newDocumentType != null) {
 			publicId = newDocumentType.getPublicId();
+			systemId = newDocumentType.getSystemId();
 		}
 		else {
 			// lookup default set by contentsettings
@@ -86,6 +88,11 @@
 		if (publicId != null) {
 			newEntry = HTMLDocumentTypeRegistry.getInstance().getEntry(publicId);
 		}
+		else if (systemId == null){
+			if (newDocumentType != null){ // <!DOCTYPE html>
+				newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_HTML5);
+			}
+		}
 
 		boolean newXMLType = (newEntry != null ? newEntry.isXMLType() : false);
 		boolean newWMLType = (newEntry != null ? newEntry.isWMLType() : false);
@@ -137,7 +144,7 @@
 				if (impl != null) {
 					String name = newEntry.getName();
 					publicId = newEntry.getPublicId();
-					String systemId = newEntry.getSystemId();
+					systemId = newEntry.getSystemId();
 					newDocumentType = impl.createDocumentType(name, publicId, systemId);
 				}
 			}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java
index 3cd71ff..8f3ca14 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,14 +10,28 @@
  *******************************************************************************/
 package org.eclipse.wst.html.core.internal.document;
 
-
-
+import java.text.Collator;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.Enumeration;
 import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
 
-/**
- */
 public class HTMLDocumentTypeRegistry {
+	static class HTMLDocumentTypeEntryComparator implements Comparator {
+		static Collator delegate = Collator.getInstance();
+
+		public int compare(Object o1, Object o2) {
+			if (o1 instanceof HTMLDocumentTypeEntry && o2 instanceof HTMLDocumentTypeEntry) {
+				if (((HTMLDocumentTypeEntry) o1).getDisplayName() != null && ((HTMLDocumentTypeEntry) o2).getDisplayName() != null) {
+					return delegate.compare(((HTMLDocumentTypeEntry) o1).getDisplayName(), ((HTMLDocumentTypeEntry) o2).getDisplayName());
+				}
+			}
+			return 0;
+		}
+	}
 
 	private static HTMLDocumentTypeRegistry instance = null;
 	private Hashtable entries = null;
@@ -25,11 +39,15 @@
 	private HTMLDocumentTypeEntry defaultXHTMLEntry = null;
 	private HTMLDocumentTypeEntry defaultWMLEntry = null;
 	private HTMLDocumentTypeEntry defaultCHTMLEntry = null;
+	private HTMLDocumentTypeEntry defaultHTML5Entry = null;
+	private HTMLDocumentTypeEntry defaultXHTML5Entry = null;
 
 	final static int DEFAULT_HTML = 0;
 	final static int DEFAULT_XHTML = 1;
 	final static int DEFAULT_WML = 2;
 	final static int DEFAULT_CHTML = 3;
+	final static int DEFAULT_HTML5 = 4;
+	final static int DEFAULT_XHTML5 = 5;
 
 	public static final String CHTML_PUBLIC_ID = "-//W3C//DTD Compact HTML 1.0 Draft//EN";//$NON-NLS-1$
 
@@ -61,6 +79,18 @@
 		this.defaultCHTMLEntry = new HTMLDocumentTypeEntry(name, publicId, null, null, false, false, displayName, false, false, false, true);
 		this.entries.put(publicId, this.defaultCHTMLEntry);
 
+		//HTML5
+		name = "HTML5";//$NON-NLS-1$
+		publicId = "";
+		displayName = "HTML5"; //$NON-NLS-1$
+		this.defaultHTML5Entry = new HTMLDocumentTypeEntry(name, publicId, null, null, false, false, displayName, false, false, false, true);
+		this.entries.put(publicId, this.defaultHTML5Entry);
+		
+		displayName = "XHTML5"; //$NON-NLS-1$
+		this.defaultXHTML5Entry = new HTMLDocumentTypeEntry(name, publicId, null, null, true, false, displayName, true, false, false, true);
+		this.entries.put("xmlns", this.defaultXHTML5Entry);
+		
+
 		HTMLDocumentTypeRegistryReader reader = new HTMLDocumentTypeRegistryReader();
 		if (reader != null)
 			reader.readRegistry(this);
@@ -88,6 +118,12 @@
 	public HTMLDocumentTypeEntry getDefaultEntry(int type) {
 		HTMLDocumentTypeEntry entry = null;
 		switch (type) {
+			case DEFAULT_HTML5 :
+				entry = this.defaultHTML5Entry;
+				break;
+			case DEFAULT_XHTML5 :
+				entry = this.defaultXHTML5Entry;
+				break;
 			case DEFAULT_XHTML :
 				entry = this.defaultXHTMLEntry;
 				break;
@@ -121,7 +157,9 @@
 	/**
 	 */
 	public Enumeration getEntries() {
-		return this.entries.elements();
+		List values = new ArrayList(this.entries.values());
+		Collections.sort(values, new HTMLDocumentTypeEntryComparator());
+		return new Vector(values).elements();
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java
index 6e30557..4e7ddcb 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
 
 
 import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
 import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
@@ -62,6 +63,14 @@
 		return false;
 	}
 
+	public boolean isEndTagOmissible(Element element) {
+		CMElementDeclaration dec = CMNodeUtil.getElementDeclaration(element);
+		if (dec == null || !(dec instanceof HTMLPropertyDeclaration))
+			return false;
+		int type = ((HTMLPropertyDeclaration)dec ).getOmitType();
+		return type == HTMLElementDeclaration.OMIT_BOTH || type == HTMLElementDeclaration.OMIT_END || type == HTMLElementDeclaration.OMIT_END_DEFAULT || type == HTMLElementDeclaration.OMIT_END_MUST;
+	}
+
 	/**
 	 */
 	public boolean canContain(Element element, Node child) {
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java
index cf58aa4..cee65d1 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,13 +12,13 @@
 
 
 
-import com.ibm.icu.util.StringTokenizer;
-
 import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSelectorAdapter;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.w3c.dom.Element;
 
+import com.ibm.icu.util.StringTokenizer;
+
 /**
  * Insert the type's description here.
  */
@@ -67,8 +67,7 @@
 		if (i > 0) {
 			if (i > 1)
 				return false;
-			key = element.getAttribute("id");//$NON-NLS-1$
-			if (key == null)
+			if (!element.hasAttribute("id") || (key = element.getAttribute("id")).length() == 0)//$NON-NLS-1$ //$NON-NLS-2$
 				return false;
 			if (!selector.getID(0).equals(key))
 				return false;
@@ -77,8 +76,7 @@
 		// check class
 		i = selector.getNumOfClasses();
 		if (i > 0) {
-			key = element.getAttribute("class");//$NON-NLS-1$
-			if (key == null)
+			if (!element.hasAttribute("class") || (key = element.getAttribute("class")).length() == 0) //$NON-NLS-1$  //$NON-NLS-2$
 				return false;
 			StringTokenizer tokenizer = new StringTokenizer(key);
 			for (i = i - 1; i >= 0; i--) {
@@ -99,8 +97,9 @@
 			StringTokenizer tokenizer = new StringTokenizer(selector.getAttribute(i), "=~| \t\r\n\f");//$NON-NLS-1$
 			int countTokens = tokenizer.countTokens();
 			if (countTokens > 0) {
-				String attrValue = element.getAttribute(tokenizer.nextToken());
-				if (attrValue == null)
+				String attrName = tokenizer.nextToken();
+				String attrValue = null;
+				if (!element.hasAttribute(attrName) || (attrValue = element.getAttribute(attrName)).length() == 0)
 					return false;
 				if (countTokens > 1) {
 					String token = tokenizer.nextToken("= \t\r\n\f");//$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java
index 0c73ac2..6113d4b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
 import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
 import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.util.URIResolver;
@@ -73,8 +74,8 @@
 		URIResolver resolver = baseModel.getResolver();
 
 		// resolve to absolute url : this need not exact location of css file. It is important that absurl is not null. 
-		String ref = getElement().getAttribute(org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ATTR_NAME_HREF);
-		String absurl = (resolver != null && ref != null) ? resolver.getLocationByURI(ref, true) : null;
+		String ref = getElement().getAttribute(HTML40Namespace.ATTR_NAME_HREF);
+		String absurl = (resolver != null && ref != null && ref.length() > 0) ? resolver.getLocationByURI(ref, true) : null;
 		if ((absurl == null) || (absurl.length() == 0)) {
 			IPath basePath = new Path(baseModel.getBaseLocation());
 			URLHelper helper = new URLHelper(basePath.removeLastSegments(1).toString());
@@ -200,14 +201,11 @@
 		Element element = getElement();
 		if (element == null)
 			return false;
-		String rel = element.getAttribute("rel");//$NON-NLS-1$
-		if (rel == null || !rel.equalsIgnoreCase("stylesheet"))//$NON-NLS-1$
+		if (!element.hasAttribute("rel") || !"stylesheet".equalsIgnoreCase(element.getAttribute("rel")))//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			return false;
-		String type = element.getAttribute("type");//$NON-NLS-1$
-		if (type != null && !type.equalsIgnoreCase("text/css"))//$NON-NLS-1$
+		if (element.hasAttribute("type") && !"text/css".equalsIgnoreCase(element.getAttribute("type")))//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			return false;
-		String href = element.getAttribute("href");//$NON-NLS-1$
-		if (href == null || href.length() == 0)
+		if (!element.hasAttribute("href") || element.getAttribute("href").length() == 0) //$NON-NLS-1$ //$NON-NLS-2$
 			return false;
 		return true;
 	}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java
index 3ef97b9..f26c904 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004-2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -166,7 +166,9 @@
 				modelProvideAdapter.modelProvided(model);
 
 			// from createModel()
-			IStructuredDocument structuredDocument = model.getStructuredDocument();
+			IStructuredDocument structuredDocument = null;
+			if (model != null)
+				structuredDocument = model.getStructuredDocument();
 			if (structuredDocument == null)
 				return null;
 			structuredDocument.addDocumentChangedListener(this);
@@ -198,7 +200,7 @@
 			return false;
 		}
 		String type = element.getAttribute(HTML40Namespace.ATTR_NAME_TYPE);
-		if (type != null && type.length() > 0 && !type.equalsIgnoreCase("text/css")) { //$NON-NLS-1$
+		if (element.hasAttribute(HTML40Namespace.ATTR_NAME_TYPE) && type.length() > 0 && !type.equalsIgnoreCase("text/css")) { //$NON-NLS-1$
 			return false;
 		}
 		return true;
@@ -217,10 +219,11 @@
 			return null;
 		}
 
-		if (!addListener)
-			return super.createModel(false);
+		ICSSModel model = super.createModel(addListener);
 
-		ICSSModel model = super.createModel();
+		if (!addListener)
+			return model;
+
 		IStructuredDocument structuredDocument = model.getStructuredDocument();
 		if (structuredDocument == null)
 			return null;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java
index 50cdd0f..cf9ffb7 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,7 +23,7 @@
 import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
 import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
 import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTagParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser;
+import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
 import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
 import org.eclipse.wst.sse.core.internal.util.Assert;
@@ -71,9 +71,11 @@
 	/*
 	 * @see EmbeddedContentType#initializeParser(RegionParser)
 	 */
-	public void initializeParser(JSPCapableParser parser) {
-		addHTMLishTag(parser, "script"); //$NON-NLS-1$
-		addHTMLishTag(parser, "style"); //$NON-NLS-1$
+	public void initializeParser(RegionParser parser) {
+		if (parser instanceof BlockTagParser) {
+			addHTMLishTag((BlockTagParser) parser, "script"); //$NON-NLS-1$
+			addHTMLishTag((BlockTagParser) parser, "style"); //$NON-NLS-1$
+		}
 	}
 
 	public List getSupportedMimeTypes() {
@@ -142,11 +144,13 @@
 
 	}
 
-	public void uninitializeParser(JSPCapableParser parser) {
+	public void uninitializeParser(RegionParser parser) {
 		// I'm assuming block markers are unique based on name only
 		// we add these as full BlockMarkers, but remove based on name alone.
-		parser.removeBlockMarker("script"); //$NON-NLS-1$
-		parser.removeBlockMarker("script"); //$NON-NLS-1$
+		if (parser instanceof BlockTagParser) {
+			((BlockTagParser) parser).removeBlockMarker("style"); //$NON-NLS-1$
+			((BlockTagParser) parser).removeBlockMarker("script"); //$NON-NLS-1$
+		}
 	}
 
 	public EmbeddedTypeHandler newInstance() {
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java
index 40e6d3d..80c1ce5 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -38,6 +38,7 @@
 public class HTMLModelQueryCMProvider implements ModelQueryCMProvider {
 
 
+	private static CMDocument staticHTML5 = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML5_DOC_TYPE);
 	private static CMDocument staticHTML = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
 	private static CMDocument staticCHTML = HTMLCMDocumentFactory.getCMDocument(CMDocType.CHTML_DOC_TYPE);
 	private static HTMLDocumentTypeRegistry doctypeRegistry = HTMLDocumentTypeRegistry.getInstance();
@@ -60,8 +61,10 @@
 			return null;
 
 		String pid = getPublicId(owner);
-		if (pid == null)
-			return staticHTML;
+		// no PID, always return the currently-supported HTML version
+		if (pid == null || "".equals(pid)){
+			return staticHTML5;
+		}
 
 		HTMLDocumentTypeEntry entry = doctypeRegistry.getEntry(pid);
 		if (entry == null)
@@ -112,6 +115,10 @@
 		if (doc == null)
 			return null;
 		DocumentType doctype = doc.getDoctype();
+		//doctype.
 		return (doctype != null) ? doctype.getPublicId() : doc.getDocumentTypeId();
 	}
+	
+	
+	
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java
index bee1432..b3b02bd 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java
@@ -85,12 +85,15 @@
 		// Now, the time to check exclusion.
 		Vector content = new Vector(candidates.size());
 		for (int i = 0; i < candidates.size(); i++) {
-			CMElementDeclaration candidate = (CMElementDeclaration) candidates.elementAt(i);
-			if (candidate == null)
-				continue;
-			if (isExcluded(candidate, element))
-				continue;
-			content.add(candidate);
+			Object eCandidate = candidates.elementAt(i);
+			if(eCandidate instanceof CMElementDeclaration) {
+				CMElementDeclaration candidate = (CMElementDeclaration) eCandidate;
+				if (candidate == null)
+					continue;
+				if (isExcluded(candidate, element))
+					continue;
+				content.add(candidate);
+			}
 		}
 
 		return content;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java
new file mode 100644
index 0000000..4c44297
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java
@@ -0,0 +1,209 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.modelquery;
+
+
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.XMLAssociationProvider;
+import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
+import org.w3c.dom.Document;
+
+/**
+ * A Class to provide an association between XHTML documents and DTDs for
+ * XHTML. This class is intended to be used only in HTMLModelQueryCMProvider.
+ */
+/*
+ * This class closely resemble XMLModelQueryAssociationProvider.
+ */
+class XHTMLAssociationProvider extends XMLAssociationProvider {
+	
+	/**
+	 * set CACHE_FIXED_DOCUMENTS to false to test effects of not caching certain catalog-contributed schemas.
+	 */
+	private static final boolean CACHE_FIXED_DOCUMENTS = true;
+	private static final String[] STANDARD_SCHEMA_BUNDLES = new String[] {"org.eclipse.wst.standard.schemas","org.eclipse.jst.standard.schemas"};
+	private static final String XML_CATALOG_EXT_POINT = "org.eclipse.wst.xml.core.catalogContributions"; 
+	private static Collection fFixedPublicIDs = null;
+	private static Map fFixedCMDocuments = new HashMap();
+
+	/**
+	 * set USE_QUICK_CACHE to false to test effects of not caching at all.
+	 */
+	private static final boolean USE_QUICK_CACHE = true;
+	protected URIResolver idResolver;
+	private String fCachedGrammerURI;
+	private String fCachedPublicID;
+	private String fCachedSystemID;
+	private boolean cached;
+
+	public XHTMLAssociationProvider(CMDocumentCache cache, URIResolver idResolver) {
+		super(cache);
+		this.idResolver = idResolver;
+		   
+		// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=136399. If the CM document URI
+		// is resolved and cached at this level instruct the CM model manager to avoid 
+		// re-resolving the URI.
+
+		if (USE_QUICK_CACHE) {
+		  documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_PERFORM_URI_RESOLUTION, false);
+		}
+	}
+
+	/**
+	 * 
+	 * @param publicId
+	 * @param systemId
+	 * @return
+	 */
+	public CMDocument getXHTMLCMDocument(String publicId, String systemId) {
+		if (idResolver == null)
+			return null;
+		
+		String grammerURI = null;
+		if (USE_QUICK_CACHE) {
+			/*
+			 * In parsing a document, we get many identical requests to this
+			 * method, so instead of looking up (resolving) grammerURI each
+			 * time, we'll just return previously cached one. Probably not
+			 * worth have a more complex cache than that.
+			 */
+			if (cached && sameAs(fCachedPublicID, publicId) && sameAs(fCachedSystemID, systemId)) {
+				grammerURI = fCachedGrammerURI;
+			}
+			else {
+				grammerURI = idResolver.resolve(null, publicId, systemId);
+				fCachedGrammerURI = grammerURI;
+				fCachedPublicID = publicId;
+				fCachedSystemID = systemId;
+				cached = true;
+			}
+		}
+		else {
+			grammerURI = idResolver.resolve(null, publicId, systemId);
+		}
+
+		if (grammerURI == null)
+			return null;
+		
+		CMDocument cmDocument = null;
+		if (CACHE_FIXED_DOCUMENTS) {
+			Reference ref = (Reference) fFixedCMDocuments.get(publicId);
+			if (ref != null) {
+				cmDocument = (CMDocument) ref.get();
+				if (cmDocument != null) {
+					return cmDocument;
+				}
+			}
+		}
+		
+		/*
+		 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=88896
+		 * 
+		 * We once called the deprecated 2 argument form of getCMDocument.
+		 * 
+		 * CMDocument cmDocument = documentManager.getCMDocument(publicId,
+		 * grammerURI);
+		 * 
+		 * which eventually resulted in empty string for type, which I don't
+		 * think the infrastructure handles any longer. So, I deleted
+		 * deprecated methods, and switched to null for type argument.
+		 * 
+		 * 'null' means to "create based on uri".
+		 * 
+		 * FYI, 'dtd' would mean load only those registered as dtd's
+		 * 
+		 * CMDocument cmDocument = documentManager.getCMDocument(publicId,
+		 * grammerURI); CMDocument cmDocument =
+		 * documentManager.getCMDocument(publicId, grammerURI, "dtd");
+		 */
+		synchronized (grammerURI) {
+			cmDocument = documentManager.getCMDocument(publicId, grammerURI, null);
+		}
+		
+		if (CACHE_FIXED_DOCUMENTS && getFixedPublicIDs().contains(publicId)) {
+			fFixedCMDocuments.put(publicId, new SoftReference(cmDocument));
+		}
+		
+		return cmDocument;
+	}
+
+	/**
+	 */
+	protected String resolveGrammarURI(Document document, String publicId, String systemId) {
+		return idResolver.resolve(null, publicId, systemId);
+	}
+
+	private boolean sameAs(String a, String b) {
+		boolean result = false;
+		if (a == null) {
+			result = b == null;
+		}
+		else {
+			result = a.equals(b);
+		}
+		return result;
+	}
+
+	/**
+	 * This added and/or made public specifically for experimentation. It
+	 * will change as this functionality becomes API. See
+	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=119084
+	 */
+	public String getCachedGrammerURI() {
+		return fCachedGrammerURI;
+	}
+
+	/**
+	 * @return the fFixedPublicIDs, a collection of contributed Public
+	 *         Identifiers from the known schema plug-ins.
+	 */
+	private static Collection getFixedPublicIDs() {
+		/**
+		 * public:publicId
+		 * TODO: system:systemId and uri:name in their own methods and maps?
+		 */
+		synchronized (STANDARD_SCHEMA_BUNDLES) {
+			if (fFixedPublicIDs == null) {
+				fFixedPublicIDs = new HashSet();
+				for (int i = 0; i < STANDARD_SCHEMA_BUNDLES.length; i++) {
+					IExtension[] extensions = Platform.getExtensionRegistry().getExtensions(STANDARD_SCHEMA_BUNDLES[i]);
+					for (int j = 0; j < extensions.length; j++) {
+						if (XML_CATALOG_EXT_POINT.equals(extensions[j].getExtensionPointUniqueIdentifier())) {
+							IConfigurationElement[] configurationElements = extensions[j].getConfigurationElements();
+							for (int k = 0; k < configurationElements.length; k++) {
+								IConfigurationElement[] publics = configurationElements[k].getChildren("public");
+								for (int l = 0; l < publics.length; l++) {
+									String publicId = publics[l].getAttribute("publicId");
+									if (publicId != null && publicId.length() > 0) {
+										fFixedPublicIDs.add(publicId);
+									}
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+		return fFixedPublicIDs;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
index 44e2146..e7b5e5b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -79,13 +79,16 @@
 		node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_DUPLICATE, ValidationMessage.WARNING);
 		node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_MISMATCH, ValidationMessage.ERROR);
 		node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_UNCLOSED, ValidationMessage.WARNING);
+		node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_RESOURCE_NOT_FOUND, ValidationMessage.IGNORE);
+		node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_OBSOLETE_NAME, ValidationMessage.WARNING);
+		
 		
 		// Elements
 		node.putInt(HTMLCorePreferenceNames.ELEM_UNKNOWN_NAME, ValidationMessage.WARNING);
 		node.putInt(HTMLCorePreferenceNames.ELEM_INVALID_NAME, ValidationMessage.ERROR);
 		node.putInt(HTMLCorePreferenceNames.ELEM_START_INVALID_CASE, ValidationMessage.WARNING);
 		node.putInt(HTMLCorePreferenceNames.ELEM_END_INVALID_CASE, ValidationMessage.ERROR);
-		node.putInt(HTMLCorePreferenceNames.ELEM_MISSING_START, ValidationMessage.ERROR);
+		node.putInt(HTMLCorePreferenceNames.ELEM_MISSING_START, ValidationMessage.WARNING);
 		node.putInt(HTMLCorePreferenceNames.ELEM_MISSING_END, ValidationMessage.WARNING);
 		node.putInt(HTMLCorePreferenceNames.ELEM_UNNECESSARY_END, ValidationMessage.WARNING);
 		node.putInt(HTMLCorePreferenceNames.ELEM_INVALID_DIRECTIVE, ValidationMessage.ERROR);
@@ -95,6 +98,8 @@
 		node.putInt(HTMLCorePreferenceNames.ELEM_UNCLOSED_START_TAG, ValidationMessage.ERROR);
 		node.putInt(HTMLCorePreferenceNames.ELEM_UNCLOSED_END_TAG, ValidationMessage.ERROR);
 		node.putInt(HTMLCorePreferenceNames.ELEM_INVALID_EMPTY_TAG, ValidationMessage.WARNING);
+		node.putInt(HTMLCorePreferenceNames.ELEM_OBSOLETE_NAME, ValidationMessage.WARNING);
+		
 		
 		// DOCTYPE
 		node.putInt(HTMLCorePreferenceNames.DOC_DUPLICATE, ValidationMessage.ERROR);
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
index f4d3644..5c501e3 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -240,6 +240,9 @@
 	public static final String ATTRIBUTE_DUPLICATE = "attrDuplicate";//$NON-NLS-1$
 	public static final String ATTRIBUTE_VALUE_MISMATCH = "attrValueMismatch";//$NON-NLS-1$
 	public static final String ATTRIBUTE_VALUE_UNCLOSED = "attrValueUnclosed";//$NON-NLS-1$
+	public static final String ATTRIBUTE_VALUE_RESOURCE_NOT_FOUND = "resourceNotFound";//$NON-NLS-1$
+	public static final String ATTRIBUTE_OBSOLETE_NAME = "attrObsoleteName";//$NON-NLS-1$
+	
 	
 	public static final String ELEM_UNKNOWN_NAME = "elemUnknownName";//$NON-NLS-1$
 	public static final String ELEM_INVALID_NAME = "elemInvalidName";//$NON-NLS-1$
@@ -255,6 +258,7 @@
 	public static final String ELEM_UNCLOSED_START_TAG = "elemUnclosedStartTag";//$NON-NLS-1$
 	public static final String ELEM_UNCLOSED_END_TAG = "elemUnclosedEndTag";//$NON-NLS-1$
 	public static final String ELEM_INVALID_EMPTY_TAG = "elemInvalidEmptyTag";//$NON-NLS-1$
+	public static final String ELEM_OBSOLETE_NAME = "elemObsoleteName";//$NON-NLS-1$
 	
 	public static final String DOC_DUPLICATE = "docDuplicateTag";//$NON-NLS-1$
 	public static final String DOC_INVALID_CONTENT = "docInvalidContent";//$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML50Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML50Namespace.java
new file mode 100644
index 0000000..fc8d5be
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML50Namespace.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.provisional;
+
+public interface HTML50Namespace extends HTML40Namespace {
+
+	public static interface ElementName extends HTML40Namespace.ElementName {
+		String ARTICLE = "article"; //$NON-NLS-1$
+		String ASIDE = "aside"; //$NON-NLS-1$
+		String AUDIO = "audio";
+		String CANVAS = "canvas";
+		String COMMAND = "command";
+		String DATALIST = "datalist";
+		String DETAILS = "details";
+		String FIGURE = "figure"; //$NON-NLS-1$
+		String FIGCAPTION = "figcaption"; //$NON-NLS-1$
+		String FOOTER = "footer"; //$NON-NLS-1$
+		String HEADER = "header";
+		String HGROUP = "hgroup";
+		String KEYGEN = "keygen";
+		String MARK = "mark";
+		String MATH = "math";
+		String METER = "meter";
+		String NAV = "nav";
+		String OUTPUT = "output";
+		String PROGRESS = "progress";
+		String RP = "rp";
+		String RT = "rt";
+		String RUBY = "ruby";
+		String SECTION = "section"; //$NON-NLS-1$
+		String SOURCE = "source";
+		String SUMMARY = "summary";
+		String SVG = "svg";
+		String TIME = "time";
+		String VIDEO = "video";
+	}
+
+	String HTML50_URI = "http://www.w3.org/TR/html50/";
+	String HTML50_TAG_PREFIX = "";
+
+	// global attribute names
+	String ATTR_NAME_CONTENT_EDITABLE = "contenteditable"; // %coreattrs; //$NON-NLS-1$
+	String ATTR_NAME_CONTEXT_MENU = "contextmenu"; // %coreattrs; //$NON-NLS-1$
+	String ATTR_NAME_DRAGGABLE = "draggable"; // %coreattrs; //$NON-NLS-1$
+	String ATTR_NAME_ROLE = "role"; // %coreattrs; //$NON_NLS-1$
+	String ATTR_NAME_SPELLCHECK = "spellcheck"; // %coreattrs; //$NON-NLS-1$
+	String ATTR_NAME_ONABORT = "onabort"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONCAN_PLAY = "oncanply"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONCAN_PLAY_THROUGH = "oncanplaythrough"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONCONTEXT_MENU = "oncontextmenu"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDRAG = "ondrag"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDRAG_END = "ondragend"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDRAG_OVER = "ondragover"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDRAG_ENTER = "ondragenter"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDRAG_LEAVE = "ondragleave"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDRAG_START = "ondragstart"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDROP = "ondrop"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDURATION_CHANGE = "ondurationchange"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONEMPTIED = "onemptied"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONENDED = "onended"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONERROR = "onerror"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONFORM_CHANGE = "onformchange"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONFORM_INPUT = "onform_input"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONINPUT = "oninput"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONINVALID = "oninvalid"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONLOADED_DATA = "onloadeddata"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONLOADED_METADATA = "onloadedmetadeta"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONLOAD_START = "onloadstart"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONMOUSE_WHEEL = "onmousewheel"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONPAUSE = "onpause"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONPLAY = "onplay"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONPLAYING = "onplaying"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONPROGRESS = "onprogress"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONRATE_CHANGE = "onratechange"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONREADY_STATE_CHANGE = "onreadystatechange"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONSCROLL = "onscroll"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONSEEKED = "onseeked"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONSEEKING = "onseeking"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONSHOW = "onshow"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONSTALLED = "onstalled"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONSUSPEND = "onsuspend"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONTIME_UPDATE = "ontimeupdate"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONVOLUME_UPDATE = "onvolumeupdate"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONWAITING = "onwaiting"; // %event; //$NON-NLS-1$
+
+	String ATTR_NAME_PING = "ping";
+	String ATTR_NAME_AUTOFOCUS = "autofocus";
+	String ATTR_NAME_CHALLENGE = "challenge";
+	String ATTR_NAME_FORM = "form";
+	String ATTR_NAME_KEYTYPE = "keytype";
+	String ATTR_NAME_REQUIRED = "required";
+	String ATTR_NAME_AUTOCOMPLETE = "autocomplete"; // input
+	String ATTR_NAME_MIN = "min"; // input
+	String ATTR_NAME_MAX = "max"; // input
+	String ATTR_NAME_PATTERN = "pattern"; // input
+	String ATTR_NAME_STEP = "step"; // input
+	String ATTR_NAME_NOVALIDATE = "novalidate"; // form
+	String ATTR_NAME_FORMACTION = "formaction"; // input|button
+	String ATTR_NAME_FORMENCTYPE = "formenctype"; // input|button
+	String ATTR_NAME_FORMMETHOD = "formmethod"; // input|button
+	String ATTR_NAME_FORMNOVALIDATE = "formnovalidate"; // input|button
+	String ATTR_NAME_FORMTARGET = "formtarget"; // input|button
+	String ATTR_NAME_SCOPED = "scoped"; // style
+	String ATTR_NAME_ASYNC = "async"; // script
+	String ATTR_NAME_MANIFEST = "manifest"; // html
+	String ATTR_NAME_SIZES = "sizes"; // link
+	String ATTR_NAME_REVERSED = "reversed"; // ol
+	String ATTR_NAME_SANDBOX = "sandbox"; // iframe
+	String ATTR_NAME_SEAMLESS = "seamless"; // iframe
+	String ATTR_NAME_SRCDOC = "srcdoc"; // iframe
+	String ATTR_NAME_PRELOAD = "preload"; // %mediaElement; //$NON-NLS-1$
+	String ATTR_NAME_AUTOPLAY = "autoplay"; // %mediaElement; //$NON-NLS-1$
+	String ATTR_NAME_LOOP = "loop"; // %mediaElement; //$NON-NLS-1$
+	String ATTR_NAME_CONTROLS = "controls"; // %mediaElement; //$NON-NLS-1$
+	String ATTR_NAME_POSTER = "poster"; // %video; //$NON-NLS-1$
+	String ATTR_NAME_OPEN = "open"; // details //$NON-NLS-1$
+	String ATTR_NAME_PUBDATE = "pubdate"; //time //$NON-NLS-1$
+	String ATTR_NAME_LOW = "low"; //meter //$NON-NLS-1$
+	String ATTR_NAME_HIGH = "high"; //meter //$NON-NLS-1$
+	String ATTR_NAME_OPTIMUM = "optimum"; //meter //$NON-NLS-1$
+	String ATTR_NAME_ICON = "icon"; //command //$NON-NLS-1$
+	String ATTR_NAME_RADIOGROUP = "radiogroup"; //command //$NON-NLS-1$
+	String ATTR_NAME_LIST = "list"; //input //$NON-NLS-1$
+	String ATTR_NAME_PLACEHOLDER = "placeholder"; //input //$NON-NLS-1$
+	String ATTR_NAME_WRAP = "wrap"; //textarea //$NON-NLS-1$
+	String ATTR_NAME_XMLNS = "xmlns"; //html //$NON-NLS-1$
+	
+	// Global attributes properties
+
+	// for contenteditable (EMPTY|TRUE|FALSE|INHERIT)
+	String ATTR_VALUE_EMPTY = ""; // contenteditable //$NON-NLS-1$
+	String ATTR_VALUE_INHERIT = "inherit"; // contenteditable //$NON-NLS-1$
+	
+	// for MediaElement (Audio/Video) 
+	String ATTR_VALUE_METADATA = "metadata"; // mediaelement //$NON-NLS-1$
+	
+	// for Command
+	String ATTR_VALUE_COMMAND = "command"; //command //$NON-NLS-1$
+	
+	//Input type
+	String ATTR_VALUE_SEARCH = "search"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_TEL = "tel"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_URL = "url"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_EMAIL = "email"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_DATE = "date"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_DATETIME = "datetime"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_MONTH = "month"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_WEEK = "week"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_TIME = "time"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_DATETIME_LOCAL = "datetime-local"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_RANGE = "range"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_COLOR = "color"; //input type //$NON-NLS-1$
+	
+	String ATTR_VALUE_ON = "on"; //input autocomplete //$NON-NLS-1$
+	String ATTR_VALUE_OFF = "off"; //input autocomplete //$NON-NLS-1$
+	
+	String ATTR_VALUE_PUT = "PUT"; //input formmethod //$NON-NLS-1$
+	String ATTR_VALUE_DELETE = "DELETE"; //input formmethod //$NON-NLS-1$
+	
+	String ATTR_VALUE_FORM_DATA = "multipart/form-data"; //input formencType //$NON-NLS-1$
+	String ATTR_VALUE_PLAIN = "text/plain"; //input formencType //$NON-NLS-1$
+	
+	String ATTR_VALUE_SOFT = "soft"; //textarea wrap //$NON-NLS-1$
+	String ATTR_VALUE_HARD = "hard"; //textarea wrap //$NON-NLS-1$
+	
+	
+	String ATTR_VALUE_CONTEXT = "context"; //menu type //$NON-NLS-1$
+	String ATTR_VALUE_TOOLBAR = "toolbar"; //menu type //$NON-NLS-1$
+	String ATTR_VALUE_LIST = "list"; //menu type //$NON-NLS-1$
+		
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java
index 1d7a753..8098721 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -78,6 +78,11 @@
 	 * "isScriptable" returns java.lang.Boolean object.
 	 */
 	public static final String IS_SCRIPTABLE = "isScriptable"; //$NON-NLS-1$
+	/**
+	 * "isObsolete" returns java.lang.Boolean object.
+	 */
+	public static final String IS_OBSOLETE = "isObsolete";//$NON-NLS-1$
+	
 
 	public static interface Values {
 		/*
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
index fdde5c7..e1b3e38 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -51,7 +51,15 @@
 		HTML40Namespace.ATTR_NAME_ONKEYPRESS,
 		HTML40Namespace.ATTR_NAME_ONKEYDOWN,
 		HTML40Namespace.ATTR_NAME_ONKEYUP,
-		HTML40Namespace.ATTR_NAME_ONHELP};
+		HTML40Namespace.ATTR_NAME_ONHELP,
+		HTML40Namespace.ATTR_NAME_ONBLUR,
+		HTML40Namespace.ATTR_NAME_ONFOCUS,
+		HTML40Namespace.ATTR_NAME_ONLOAD,
+		HTML40Namespace.ATTR_NAME_ONUNLOAD,
+		HTML40Namespace.ATTR_NAME_ONSUBMIT};
+	
+	/** array of style attribute names */
+	private static final String[] STYLE_ATTRIBUTE_NAMES =  {HTML40Namespace.ATTR_NAME_STYLE};
 	
 	public StructuredTextPartitionerForHTML() {
 		super();
@@ -105,6 +113,15 @@
 							language = StringUtils.strip(node.getText(region));
 						else if (attrName.equalsIgnoreCase(HTML40Namespace.ATTR_NAME_TYPE)) {
 							type = StringUtils.strip(node.getText(region));
+							/*
+							 * Avoid partition names built with MIME subtypes,
+							 * e.g. type="text/javascript;e4x=1"
+							 */
+							if (type != null) {
+								int index = type.indexOf(';');
+								if (index > 1)
+									type = type.substring(0, index);
+							}
 							break;
 						}
 						attrNameRegion = null;
@@ -143,12 +160,14 @@
 
 	public String getPartitionType(ITextRegion region, int offset) {
 		String result = null;
-		if (region.getType() == DOMRegionContext.XML_COMMENT_TEXT || region.getType() == DOMRegionContext.XML_COMMENT_OPEN)
+		if (region.getType() == DOMRegionContext.XML_COMMENT_TEXT || region.getType() == DOMRegionContext.XML_COMMENT_OPEN || region.getType() == DOMRegionContext.XML_COMMENT_CLOSE)
 			result = IHTMLPartitions.HTML_COMMENT;
 		else if (region.getType() == DOMRegionContext.XML_DOCTYPE_DECLARATION || region.getType() == DOMRegionContext.XML_DECLARATION_OPEN)
 			result = IHTMLPartitions.HTML_DECLARATION;
 		else if (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE && isScriptAttributeValue(region, offset))
 			result = IHTMLPartitions.SCRIPT_EVENTHANDLER;
+		else if (isStyleAttributeValue(region, offset))
+			result = ICSSPartitions.STYLE;
 		else
 			result = super.getPartitionType(region, offset);
 		return result;
@@ -198,7 +217,7 @@
 		}
 		else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT))
 			result = IHTMLPartitions.SCRIPT;
-		else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE))
+		else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) || isStyleAttributeValue(region,offset))
 			result = ICSSPartitions.STYLE;
 		else if (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE && isScriptAttributeValue(region, offset))
 			result = IHTMLPartitions.SCRIPT_EVENTHANDLER;
@@ -227,14 +246,41 @@
 		if (region.getType() != DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
 			return false;
 
-		return isAttributeNameForValueAnEventScript(region, offset);
+		return isAttributeNameForValueInArray(EVENT_ATTRIBUTE_NAMES, region, offset);
 	}
+	
+	/**
+	 * @param region {@link ITextRegion} containing <code>offset</code>
+	 * @param offset offset in the given <code>region</code> to check if it is in
+	 * the attribute value region of a style attribute
+	 * @return <code>true</code> if the given offset in the given region is
+	 * in the value region of a style attribute, <code>false</code> otherwise
+	 */
+	private boolean isStyleAttributeValue(ITextRegion region, int offset) {
+		boolean isStyleAttributeValue = false;
+		if (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+			isStyleAttributeValue = isAttributeNameForValueInArray(STYLE_ATTRIBUTE_NAMES, region, offset);
+		}
 
-	private boolean isAttributeNameForValueAnEventScript(ITextRegion attrValueRegion, int offset) {
+		return isStyleAttributeValue;
+	}
+	
+	/**
+	 * <p>determines if the attribute name associated with the given attribute region
+	 * is in the given array of attribute names</p>
+	 * 
+	 * @param attributeNames determine if the attribute name associated with the given offset
+	 * is in this array of attribute names
+	 * @param attrValueRegion {@link ITextRegion} of the attribute region containing the given offset
+	 * @param offset offset in an attribute region to determine if it is in the list of given attribute names
+	 * @return <code>true</code> if the attribute name associated with the given offset is in the given
+	 * list of attribute names, <code>false</code> otherwise
+	 */
+	private boolean isAttributeNameForValueInArray(String[] attributeNames, ITextRegion attrValueRegion, int offset) {
 		IStructuredDocumentRegion node = fStructuredDocument.getRegionAtCharacterOffset(offset);
 		ITextRegionList regionList = node.getRegions();
 		int currentIndex = regionList.indexOf(attrValueRegion);
-
+		
 		/*
 		 * 4 is the minimum index allowing for the tag's open, name, attribute
 		 * name and equals character to appear first
@@ -243,17 +289,17 @@
 			return false;
 		ITextRegion tagAttrNameRegion = regionList.get(currentIndex - 2);
 		
-		boolean isEvent = false;
+		boolean foundAttributeName = false;
 		if (fStructuredDocument instanceof IRegionComparible) {
 			int start = node.getStartOffset(tagAttrNameRegion);
-			for (int i = 0; !isEvent && i < EVENT_ATTRIBUTE_NAMES.length; i++) {
-				isEvent = ((IRegionComparible) fStructuredDocument).regionMatchesIgnoreCase(start, tagAttrNameRegion.getTextLength(), EVENT_ATTRIBUTE_NAMES[i]);
+			for (int i = 0; !foundAttributeName && i < attributeNames.length; i++) {
+				foundAttributeName = ((IRegionComparible) fStructuredDocument).regionMatchesIgnoreCase(start, tagAttrNameRegion.getTextLength(), attributeNames[i]);
 			}
 		}
 		else {
 			String tagAttrName = node.getText(tagAttrNameRegion);
-			isEvent = StringUtils.contains(EVENT_ATTRIBUTE_NAMES, tagAttrName, false);
+			foundAttributeName = StringUtils.contains(attributeNames, tagAttrName, false);
 		}
-		return isEvent;
+		return foundAttributeName;
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java
index 1809abd..9633916 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -197,4 +197,16 @@
 		}
 		return false;
 	}
+	
+	/**
+	 * The method to distinguish HTML and XHTML from other mark up.
+	 * This method returns true if the target is,
+	 * (1) not JSP,
+	 * (2) not SSI.
+	 */
+	public static boolean isObsolete(CMNode decl) {
+		return decl.supports(HTMLCMProperties.IS_OBSOLETE) && ((Boolean)(decl.getProperty(HTMLCMProperties.IS_OBSOLETE))).booleanValue();
+	}
+	
+	
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java
index 8097da4..4710a1e 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java
@@ -37,6 +37,7 @@
 					case UNDEFINED_VALUE_ERROR :
 					case MISMATCHED_VALUE_ERROR :
 					case UNCLOSED_ATTR_VALUE :
+					case RESOURCE_NOT_FOUND :
 						//D210422
 						return ((Attr) target).getValue();
 					default :
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java
index 17af433..f64d50e 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,9 @@
 	static final int UNDEFINED_NAME_ERROR = 11;
 	static final int UNDEFINED_VALUE_ERROR = 12;
 	static final int MISMATCHED_VALUE_ERROR = 13;
+	static final int OBSOLETE_ATTR_NAME_ERROR = 14;
+	static final int OBSOLETE_TAG_NAME_ERROR = 15;
+	
 	// format error
 	static final int FORMAT_ERROR_LEVEL = 100;
 	static final int INVALID_NAME_ERROR = 101;
@@ -33,6 +36,7 @@
 	static final int UNCLOSED_END_TAG_ERROR = 111;
 	static final int INVALID_EMPTY_ELEMENT_TAG = 112;
 	static final int UNCLOSED_ATTR_VALUE = 113; //D210422
+	static final int RESOURCE_NOT_FOUND = 114; //D210422
 	// layout error
 	static final int LAYOUT_ERROR_LEVEL = 1000;
 	static final int INVALID_CONTENT_ERROR = 1001;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java
index a548dea..f3ee02a 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,11 @@
 
 
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 
 final class FMUtil {
 
@@ -21,6 +25,8 @@
 	public final static int SEG_WHOLE_TAG = 1;
 	public final static int SEG_START_TAG = 2;
 	public final static int SEG_END_TAG = 3;
+	public final static int SEG_START_TAG_NAME = 4;
+	public final static int SEG_END_TAG_NAME = 5;
 
 	/**
 	 */
@@ -55,7 +61,7 @@
 					seg = new Segment(startTag);
 				}
 				else {
-					seg = new Segment(target.getStartOffset(), 0);
+					seg = new Segment(target.getStartOffset(), 1);
 				}
 				break;
 			case SEG_END_TAG :
@@ -64,7 +70,31 @@
 					seg = new Segment(endTag);
 				}
 				else {
-					seg = new Segment(target.getEndOffset(), 0);
+					seg = new Segment(target.getEndOffset(), 1);
+				}
+				break;
+			case SEG_START_TAG_NAME :
+				startTag = target.getStartStructuredDocumentRegion();
+				if (startTag != null) {
+					ITextRegion nameRegion = getNameRegion(startTag);
+					if (nameRegion != null) {
+						seg = new Segment(startTag.getStartOffset(nameRegion), nameRegion.getTextLength());
+					}
+				}
+				if (seg == null) {
+					seg = getSegment(target, SEG_START_TAG);
+				}
+				break;
+			case SEG_END_TAG_NAME :
+				endTag = target.getEndStructuredDocumentRegion();
+				if (endTag != null) {
+					ITextRegion nameRegion = getNameRegion(endTag);
+					if (nameRegion != null) {
+						seg = new Segment(endTag.getStartOffset(nameRegion), nameRegion.getTextLength());
+					}
+				}
+				if (seg == null) {
+					seg = getSegment(target, SEG_END_TAG);
 				}
 				break;
 			case SEG_NONE :
@@ -74,5 +104,17 @@
 		return seg;
 	}
 
+	private static ITextRegion getNameRegion(ITextRegionCollection containerRegion) {
+		ITextRegionList regions = containerRegion.getRegions();
+		ITextRegion nameRegion = null;
+		for (int i = 0; i < regions.size(); i++) {
+			ITextRegion r = regions.get(i);
+			if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
+				nameRegion = r;
+				break;
+			}
+		}
+		return nameRegion ;
+	}
 
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
index a4a0279..0551d74 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,14 +10,15 @@
  *******************************************************************************/
 package org.eclipse.wst.html.core.internal.validate;
 
-
-
-import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
-import java.util.Map;
 
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
@@ -26,7 +27,6 @@
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
 import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
@@ -44,6 +44,8 @@
 	private static final char SINGLE_QUOTE = '\'';
 	private static final char DOUBLE_QUOTE = '\"';
 
+	private static final String ATTR_NAME_DATA = "data-";
+
 	// D210422
 	/**
 	 * HTMLAttributeValidator constructor comment.
@@ -71,13 +73,17 @@
 			if (errorNode instanceof IDOMAttr) {
 				IDOMElement ownerElement = (IDOMElement) ((IDOMAttr) errorNode).getOwnerElement();
 				if (ownerElement != null) {
-					int regionStartOffset = ownerElement.getFirstStructuredDocumentRegion().getStartOffset(rgn);
-					int regionLength = rgn.getLength();
-					return new Segment(regionStartOffset, regionLength);
+					//if editor closed during validation this could be null
+					IStructuredDocumentRegion firstRegion = ownerElement.getFirstStructuredDocumentRegion();
+					if(firstRegion != null) {
+						int regionStartOffset = firstRegion.getStartOffset(rgn);
+						int regionLength = rgn.getTextLength();
+						return new Segment(regionStartOffset, regionLength);
+					}
 				}
 			}
 		}
-		return new Segment(errorNode.getStartOffset(), 0);
+		return new Segment(errorNode.getStartOffset(), 1);
 	}
 
 	/**
@@ -99,38 +105,7 @@
 			return;
 		CMNamedNodeMap declarations = edec.getAttributes();
 
-		CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(declarations) {
-			private Map caseInsensitive;
-			
-			private Map getCaseInsensitiveMap() {
-				if(caseInsensitive == null)
-					caseInsensitive = new HashMap();
-				return caseInsensitive;
-			}
-
-			public CMNode getNamedItem(String name) {
-				CMNode node = super.getNamedItem(name);
-				if (node == null) {
-					node = (CMNode) getCaseInsensitiveMap().get(name.toLowerCase(Locale.US));
-				}
-				return node;
-			}
-
-			public void put(CMNode cmNode) {
-				super.put(cmNode);
-				getCaseInsensitiveMap().put(cmNode.getNodeName().toLowerCase(Locale.US), cmNode);
-			}
-		};
-
-		List nodes = ModelQueryUtil.getModelQuery(target.getOwnerDocument()).getAvailableContent((Element) node, edec, ModelQuery.INCLUDE_ATTRIBUTES);
-		for (int k = 0; k < nodes.size(); k++) {
-			CMNode cmnode = (CMNode) nodes.get(k);
-			if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
-				allAttributes.put(cmnode);
-			}
-		}
-		declarations = allAttributes;
-
+		List modelQueryNodes = null;
 		NamedNodeMap attrs = target.getAttributes();
 		for (int i = 0; i < attrs.getLength(); i++) {
 			int rgnType = REGION_NAME;
@@ -149,7 +124,27 @@
 					continue; // skip futher validation and begin next loop.
 			}
 
+			String attrName = a.getName().toLowerCase(Locale.US);
+			if (attrName.startsWith(ATTR_NAME_DATA) && attrName.length() > ATTR_NAME_DATA.length())
+				continue;
+
 			CMAttributeDeclaration adec = (CMAttributeDeclaration) declarations.getNamedItem(a.getName());
+			
+			/* Check the modelquery if nothing is declared by the element declaration */
+			if (adec == null) {
+				if (modelQueryNodes == null)
+					modelQueryNodes = ModelQueryUtil.getModelQuery(target.getOwnerDocument()).getAvailableContent((Element) node, edec, ModelQuery.INCLUDE_ATTRIBUTES);
+				
+				
+				for (int k = 0; k < modelQueryNodes.size(); k++) {
+					CMNode cmnode = (CMNode) modelQueryNodes.get(k);
+					if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION && cmnode.getNodeName().toLowerCase(Locale.US).equals(attrName)) {
+						adec = (CMAttributeDeclaration) cmnode;
+						break;
+					}
+				}
+			}
+			
 			if (adec == null) {
 				// No attr declaration was found. That is, the attr name is
 				// undefined.
@@ -162,6 +157,9 @@
 			} else {
 				// The attr declaration was found.
 				// At 1st, the name should be checked.
+				if (CMUtil.isObsolete(adec)){
+					state = ErrorState.OBSOLETE_ATTR_NAME_ERROR;
+				}
 				if (CMUtil.isHTML(edec) && (!CMUtil.isXHTML(edec))) {
 					// If the target element is pure HTML (not XHTML), some
 					// attributes
@@ -193,32 +191,67 @@
 							rgnType = REGION_VALUE;
 							state = ErrorState.UNDEFINED_VALUE_ERROR;
 						}
-					} else {
-						String[] candidates = attrType.getEnumeratedValues();
-						if (candidates != null && candidates.length > 0) {
-							// several candidates are found.
-							boolean found = false;
-							for (int index = 0; index < candidates.length; index++) {
-								String candidate = candidates[index];
+					}
+					else if (CMDataType.URI.equals(attrType.getDataTypeName())) {
+						// TODO: URI validation?
+						if (false && actualValue.indexOf('#') < 0 && actualValue.indexOf(":/") == -1 && CMUtil.isHTML(edec)) { //$NON-NLS-1$ //$NON-NLS-2$
+							IStructuredDocumentRegion start = ((IDOMNode) node).getStartStructuredDocumentRegion();
+							if (start != null && start.getFirstRegion().getTextLength() == 1) {
+								IPath basePath = new Path(((IDOMNode) node).getModel().getBaseLocation());
+								if (basePath.segmentCount() > 1) {
+									IPath path = ModuleCoreSupport.resolve(basePath, actualValue);
+									IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
+									if (found == null || !found.isAccessible()) {
+										rgnType = REGION_VALUE;
+										state = ErrorState.RESOURCE_NOT_FOUND;
+									}
+								}
+							}
+						}
+					}
+					else if (CMDataType.ENUM.equals(attrType.getDataTypeName())) {
+						/*
+						 * Check current value is valid among a known list.
+						 * There may be enumerated values provided even when
+						 * the datatype is not ENUM, but we'll only validate
+						 * against that list if the type matches.
+						 */
+						String[] enumeratedValues = attrType.getEnumeratedValues();
+						// several candidates are found.
+						boolean found = false;
+						for (int j = 0; j < enumeratedValues.length; j++) {
+							// At 1st, compare ignoring case.
+							if (actualValue.equalsIgnoreCase(enumeratedValues[j])) {
+								found = true;
+								if (CMUtil.isCaseSensitive(edec) && (!actualValue.equals(enumeratedValues[j]))) {
+									rgnType = REGION_VALUE;
+									state = ErrorState.MISMATCHED_VALUE_ERROR;
+								}
+								break; // exit the loop.
+							}
+						}
+						if (!found) {
+							// retrieve and check extended values (retrieval can call extensions, which may take longer)
+							String[] modelQueryExtensionValues = ModelQueryUtil.getModelQuery(target.getOwnerDocument()).getPossibleDataTypeValues((Element) node, adec);
+							// copied loop from above
+							for (int j = 0; j < modelQueryExtensionValues.length; j++) {
 								// At 1st, compare ignoring case.
-								if (actualValue.equalsIgnoreCase(candidate)) {
+								if (actualValue.equalsIgnoreCase(modelQueryExtensionValues[j])) {
 									found = true;
-									if (CMUtil.isCaseSensitive(edec) && (!actualValue.equals(candidate))) {
+									if (CMUtil.isCaseSensitive(edec) && (!actualValue.equals(modelQueryExtensionValues[j]))) {
 										rgnType = REGION_VALUE;
 										state = ErrorState.MISMATCHED_VALUE_ERROR;
 									}
 									break; // exit the loop.
 								}
 							}
-							if (!found) {
-								// No candidate was found. That is,
-								// actualValue is invalid.
-								// but not regard it as undefined value if it
-								// includes nested region.
-								if (!hasNestedRegion(((IDOMNode) a).getValueRegion())) {
-									rgnType = REGION_VALUE;
-									state = ErrorState.UNDEFINED_VALUE_ERROR;
-								}
+							// No candidate was found. That is,
+							// actualValue is invalid.
+							// but not regard it as undefined value if it
+							// includes nested region.
+							if (!hasNestedRegion(((IDOMNode) a).getValueRegion())) {
+								rgnType = REGION_VALUE;
+								state = ErrorState.UNDEFINED_VALUE_ERROR;
 							}
 						}
 					}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java
index 9041574..d7462fe 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,10 +10,10 @@
  *******************************************************************************/
 package org.eclipse.wst.html.core.internal.validate;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
 
+import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
@@ -50,7 +50,7 @@
 
 		validateContent(target, target.getFirstChild());
 	}
-
+	
 	private void validateContent(Element parent, Node child) {
 		if (child == null)
 			return;
@@ -59,28 +59,10 @@
 		if(ed == null || ed.getContentType() == CMElementDeclaration.ANY)
 			return;
 		
-		/*
-		 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=218143 - 
-		 * ModelQuery use not pervasive enough
-		 */
-		List availableChildElementDeclarations = ModelQueryUtil.getModelQuery(parent.getOwnerDocument()).getAvailableContent(parent, ed, ModelQuery.INCLUDE_CHILD_NODES);
-		/*
-		 * Retrieve and set aside just the element names for faster checking
-		 * later.
-		 */
-		int availableChildCount = availableChildElementDeclarations.size();
-		List availableChildElementLowercaseNames = new ArrayList(availableChildCount);
-		for (int i = 0; i < availableChildCount; i++) {
-			CMNode cmnode = (CMNode) availableChildElementDeclarations.get(i);
-			if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION) {
-				availableChildElementLowercaseNames.add(cmnode.getNodeName().toLowerCase(Locale.US));
-			}
-		}
-		Object[] availableChildElementLowercaseNamesArray = availableChildElementLowercaseNames.toArray();
-
+		List[] extendedContent = new List[1];
 		while (child != null) {
 			// perform actual validation
-			validateNode(parent, child, ed, availableChildElementLowercaseNamesArray);
+			validateNode(parent, child, ed, extendedContent);
 			child = child.getNextSibling();
 		}
 	}
@@ -109,17 +91,17 @@
 	// return 1;
 	// }
 
-	private boolean containsName(String name, Object[] possible) {
-		if (name != null && possible != null) {
-			for (int i = 0; i < possible.length; i++) {
-				if(name.equals(possible[i]))
-				return true;
-			}
-		}
-		return false;
-	}
+//	private boolean containsName(String name, Object[] possible) {
+//		if (name != null && possible != null) {
+//			for (int i = 0; i < possible.length; i++) {
+//				if(name.equals(possible[i]))
+//				return true;
+//			}
+//		}
+//		return false;
+//	}
 
-	private void validateNode(Element target, Node child, CMElementDeclaration edec, Object[] availableLowercaseChildElementNames) {
+	private void validateNode(Element target, Node child, CMElementDeclaration edec, List[] extendedContent) {
 		// NOTE: If the target element is 'UNKNOWN', that is, it has no
 		// element declaration, the content type of the element should be
 		// regarded as 'ANY'. -- 9/10/2001
@@ -144,9 +126,13 @@
 				// Defect 186774: If a child is not one of HTML elements,
 				// it should be regarded as a valid child regardless the
 				// type of the parent content model. -- 10/12/2001
-				if (ced == null || CMUtil.isSSI(ced) || (!CMUtil.isHTML(ced)) || containsName(ced.getElementName().toLowerCase(Locale.US), availableLowercaseChildElementNames))
+				if (ced == null || CMUtil.isSSI(ced) || (!CMUtil.isHTML(ced)))
 					return;
-
+				if (CMUtil.isObsolete(ced)){
+					error = ErrorState.OBSOLETE_TAG_NAME_ERROR;
+					break;
+				}
+				
 				switch (contentType) {
 					case CMElementDeclaration.ANY :
 						// Keep going.
@@ -165,6 +151,29 @@
 							if (CMUtil.isValidInclusion(ced, target))
 								return;
 						}
+						
+						/*
+						 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=218143 - 
+						 * ModelQuery use not pervasive enough
+						 */
+						if (extendedContent[0] == null) {
+							extendedContent[0] = ModelQueryUtil.getModelQuery(target.getOwnerDocument()).getAvailableContent(target, edec, ModelQuery.INCLUDE_CHILD_NODES);
+						}
+
+						List availableChildElementDeclarations = extendedContent[0];
+						/*
+						 * Retrieve and set aside just the element names for faster checking
+						 * later.
+						 */
+						int availableChildCount = availableChildElementDeclarations.size();
+						String elementName = ced.getElementName().toLowerCase(Locale.US);
+						for (int i = 0; i < availableChildCount; i++) {
+							CMNode cmnode = (CMNode) availableChildElementDeclarations.get(i);
+							if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION && cmnode.getNodeName().toLowerCase(Locale.US).equals(elementName)) {
+								return;
+							}
+						}
+						
 						error = ErrorState.INVALID_CONTENT_ERROR;
 						break;
 					default :
@@ -204,6 +213,13 @@
 				// Mark the whole node as an error segment.
 				segType = FMUtil.SEG_WHOLE_TAG;
 				break;
+			case Node.CDATA_SECTION_NODE :
+				if (edec.supports(HTMLCMProperties.IS_XHTML) && Boolean.TRUE.equals(edec.getProperty(HTMLCMProperties.IS_XHTML)))
+					return;
+				// Mark the whole CDATA section as an error segment
+				error = ErrorState.INVALID_CONTENT_ERROR;
+				segType = FMUtil.SEG_WHOLE_TAG;
+				break;
 			default :
 				error = ErrorState.INVALID_CONTENT_ERROR;
 				// Mark the whole node as an error segment.
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java
index bee3e48..d7ed235 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,8 +14,11 @@
 
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IPreferencesService;
+import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.core.runtime.preferences.InstanceScope;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.wst.html.core.internal.HTMLCoreMessages;
@@ -30,6 +33,8 @@
 
 
 	private IProject fProject;
+	private IScopeContext[] fLookupOrder;
+	private IPreferencesService fPreferenceService;
 	
 	public MessageFactory() {
 		init();
@@ -56,24 +61,21 @@
 	 * @param msg the message for the error
 	 */
 	private void mapToKey(String key, ErrorTable errorTable, int state, String msg) {
-		boolean useProject = false;
-		IEclipsePreferences prefs = null;
-		
-		if (fProject != null) {
-			prefs = new ProjectScope(fProject).getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
-			useProject = prefs.getBoolean(HTMLCorePreferenceNames.USE_PROJECT_SETTINGS, false);
-		}
-		
 		int severity = ValidationMessage.WARNING;
-		if(useProject)
-			severity = prefs.getInt(key, ValidationMessage.WARNING);
-		else
-			severity = new InstanceScope().getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName()).getInt(key, ValidationMessage.WARNING);
-			
+		severity = fPreferenceService.getInt(HTMLCorePlugin.getDefault().getBundle().getSymbolicName(), key, ValidationMessage.WARNING, fLookupOrder);
 		errorTable.put(state, msg, severity);
 	}
 	
 	private void init() {
+		fPreferenceService = Platform.getPreferencesService();
+		fLookupOrder = new IScopeContext[] {new InstanceScope(), new DefaultScope()};
+		
+		if (fProject != null) {
+			ProjectScope projectScope = new ProjectScope(fProject);
+			if(projectScope.getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName()).getBoolean(HTMLCorePreferenceNames.USE_PROJECT_SETTINGS, false))
+				fLookupOrder = new IScopeContext[] {projectScope, new InstanceScope(), new DefaultScope()};
+		}
+		
 		for (int i = 0; i < NodeType.MAX_TYPE; i++) {
 			errTables[i] = new ErrorTable();
 		}
@@ -91,6 +93,8 @@
 		mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_DUPLICATE, attrTable, DUPLICATE_ERROR, MSG_DUPLICATE_ATTR_ERROR);
 		mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_MISMATCH, attrTable, MISMATCHED_VALUE_ERROR, MSG_MISMATCHED_ATTR_VALUE_ERROR);
 		mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_UNCLOSED, attrTable, UNCLOSED_ATTR_VALUE, MSG_UNCLOSED_ATTR_VALUE_ERROR);
+		mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_RESOURCE_NOT_FOUND, attrTable, RESOURCE_NOT_FOUND, MSG_RESOURCE_NOT_FOUND);
+		mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_OBSOLETE_NAME, attrTable, OBSOLETE_ATTR_NAME_ERROR, MSG_OBSOLETE_ATTR_ERROR);
 
 		// element error map
 		ErrorTable elemTable = errTables[NodeType.ELEMENT];// short hand
@@ -109,6 +113,8 @@
 		mapToKey(HTMLCorePreferenceNames.ELEM_UNCLOSED_START_TAG, elemTable, UNCLOSED_TAG_ERROR, MSG_UNCLOSED_START_TAG_ERROR);
 		mapToKey(HTMLCorePreferenceNames.ELEM_UNCLOSED_END_TAG, elemTable, UNCLOSED_END_TAG_ERROR, MSG_UNCLOSED_END_TAG_ERROR);
 		mapToKey(HTMLCorePreferenceNames.ELEM_INVALID_EMPTY_TAG, elemTable, INVALID_EMPTY_ELEMENT_TAG, MSG_INVALID_EMPTY_ELEMENT_TAG);
+		mapToKey(HTMLCorePreferenceNames.ELEM_OBSOLETE_NAME, elemTable, OBSOLETE_TAG_NAME_ERROR, MSG_OBSOLETE_TAG_ERROR);
+
 
 		// document type error map
 		ErrorTable docTable = errTables[NodeType.DOCUMENT_TYPE];// short hand
@@ -233,6 +239,10 @@
 	private static final String MSG_UNCLOSED_CDATA_SECTION_ERROR = HTMLCoreMessages.CDATA_section_not_closed__ERROR_;
 	private static final String MSG_INVALID_EMPTY_ELEMENT_TAG = HTMLCoreMessages._ERROR_Tag___0___should_be_an_empty_element_tag_1;
 	private static final String MSG_UNCLOSED_ATTR_VALUE_ERROR = HTMLCoreMessages._ERROR_Attribute_value___0___not_closed__1;
+	private static final String MSG_RESOURCE_NOT_FOUND = HTMLCoreMessages._ERROR_Resource_not_found_0;
+	private static final String MSG_OBSOLETE_ATTR_ERROR = HTMLCoreMessages.Obsolete_attribute_name___ERROR_;
+	private static final String MSG_OBSOLETE_TAG_ERROR = HTMLCoreMessages.Obsolete_tag___ERROR_;
+	
 	private ErrorTable[] errTables = new ErrorTable[NodeType.MAX_TYPE];
 
 //	static {
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupport.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupport.java
new file mode 100644
index 0000000..1bce59a
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupport.java
@@ -0,0 +1,198 @@
+/*******************************************************************************

+ * Copyright (c) 2007, 2008 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+package org.eclipse.wst.html.core.internal.validate;

+

+import org.eclipse.core.filebuffers.FileBuffers;

+import org.eclipse.core.resources.IContainer;

+import org.eclipse.core.resources.IFile;

+import org.eclipse.core.resources.IFolder;

+import org.eclipse.core.resources.IProject;

+import org.eclipse.core.resources.IResource;

+import org.eclipse.core.resources.IWorkspaceRoot;

+import org.eclipse.core.resources.ResourcesPlugin;

+import org.eclipse.core.runtime.IPath;

+import org.eclipse.core.runtime.Path;

+

+/**

+ * This class encapsulates any used Module Core APIs along with fallbacks for

+ * use on non-compliant projects and when those services are not available at

+ * runtime.

+ * 

+ * Because ModuleCore API calls can result in locks needing to be acquired,

+ * none of these methods should be called while other thread locks have

+ * already been acquired.

+ */

+public final class ModuleCoreSupport {

+	static final boolean _dump_NCDFE = false;

+	private static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$

+	private static final IPath WEB_INF_PATH = new Path(WEB_INF);

+

+	/**

+	 * @param project

+	 * @return the computed IPath to the "root" of the web contents, either

+	 *         from facet knowledge or hueristics, or null if one can not be

+	 *         determined

+	 */

+	public static IPath computeWebContentRootPath(IPath path) {

+		IPath root = null;

+		try {

+			root = ModuleCoreSupportDelegate.getWebContentRootPath(ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0)));

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+		if (root == null) {

+			/*

+			 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=213245

+			 * 

+			 * NPE in JSPTaglibDirectiveContentAssistProcessor with

+			 * non-faceted project

+			 */

+			root = getLocalRoot(path);

+		}

+		return root;

+	}

+

+	/**

+	 * @param project

+	 * @return the IPath to the "root" of the web contents

+	 */

+	public static IPath getWebContentRootPath(IProject project) {

+		if (project == null)

+			return null;

+

+		IPath path = null;

+		try {

+			path = ModuleCoreSupportDelegate.getWebContentRootPath(project);

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+		return path;

+	}

+

+	/**

+	 * @param path

+	 *            - the full path to a resource within the workspace

+	 * @return - the runtime path of the resource if one exists, null

+	 *         otherwise

+	 */

+	public static IPath getRuntimePath(IPath path) {

+		IPath result = null;

+		try {

+			result = ModuleCoreSupportDelegate.getRuntimePath(path);

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+		if (result == null) {

+			IPath root = getLocalRoot(path);

+			result = path.removeFirstSegments(root.segmentCount()).makeAbsolute();

+		}

+		return result;

+	}

+

+	/**

+	 * @param basePath

+	 *            - the full path to a resource within the workspace

+	 * @param reference

+	 *            - the reference string to resolve

+	 * @return - the full path within the workspace that corresponds to the

+	 *         given reference according to the virtual pathing support

+	 */

+	public static IPath resolve(IPath basePath, String reference) {

+		IPath resolvedPath = null;

+		try {

+			resolvedPath = ModuleCoreSupportDelegate.resolve(basePath, reference);

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+

+		if (resolvedPath == null) {

+			IPath rootPath = getLocalRoot(basePath);

+			if (reference.startsWith(Path.ROOT.toString())) {

+				resolvedPath = rootPath.append(reference);

+			}

+			else {

+				resolvedPath = basePath.removeLastSegments(1).append(reference);

+			}

+		}

+

+		return resolvedPath;

+	}

+

+	/**

+	 * @param basePath

+	 * @return the applicable Web context root path, if one exists

+	 */

+	private static IPath getLocalRoot(IPath basePath) {

+		IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();

+

+		// existing workspace resources - this is the 93% case

+		IResource file = FileBuffers.getWorkspaceFileAtLocation(basePath);

+

+		// Try the base path as a folder first

+		if (file == null && basePath.segmentCount() > 1) {

+			file = workspaceRoot.getFolder(basePath);

+		}

+		// If not a folder, then try base path as a file

+		if (file != null && !file.exists() && basePath.segmentCount() > 1) {

+			file = workspaceRoot.getFile(basePath);

+		}

+

+		if (file == null && basePath.segmentCount() == 1) {

+			file = workspaceRoot.getProject(basePath.segment(0));

+		}

+

+		if (file == null) {

+			/*

+			 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=116529

+			 * 

+			 * This method produces a less accurate result, but doesn't

+			 * require that the file exist yet.

+			 */

+			IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(basePath);

+			if (files.length > 0)

+				file = files[0];

+		}

+

+		while (file != null) {

+			/**

+			 * Treat any parent folder with a WEB-INF subfolder as a web-app

+			 * root

+			 */

+			IContainer folder = null;

+			if ((file.getType() & IResource.FOLDER) != 0) {

+				folder = (IContainer) file;

+			}

+			else {

+				folder = file.getParent();

+			}

+			// getFolder on a workspace root must use a full path, skip

+			if (folder != null && (folder.getType() & IResource.ROOT) == 0) {

+				IFolder webinf = folder.getFolder(WEB_INF_PATH);

+				if (webinf != null && webinf.exists()) {

+					return folder.getFullPath();

+				}

+			}

+			file = file.getParent();

+		}

+

+		return basePath.uptoSegment(1);

+	}

+

+

+}

diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java
new file mode 100644
index 0000000..818d340
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.validate;
+
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
+import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
+
+/**
+ * Wrapper class for all Facet-related calls. If the Facet or ModuleCore
+ * bundles are not available, this class will not load, or if it does, its
+ * methods will cause NoClassDefFoundErrors. This allows us to
+ * compartmentalize the dependencies.
+ * 
+ */
+final class ModuleCoreSupportDelegate {
+	private static final String SLASH = "/";
+	private static Map fResolvedMap = new HashMap();
+
+	/**
+	 * @param path
+	 *            - the full path to a resource within the workspace
+	 * @return - the runtime path of the resource if one exists, null
+	 *         otherwise
+	 */
+	static IPath getRuntimePath(IPath path) {
+		if (path == null)
+			return null;
+
+		IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));
+
+		if (!ModuleCoreNature.isFlexibleProject(project))
+			return null;
+
+		IVirtualResource[] virtualResources = ComponentCore.createResources(ResourcesPlugin.getWorkspace().getRoot().getFile(path));
+		if (virtualResources != null && virtualResources.length > 0) {
+			return virtualResources[0].getRuntimePath();
+		}
+		return null;
+	}
+
+	/**
+	 * @param project
+	 * @return the IPath to the "root" of the web contents
+	 */
+	static IPath getWebContentRootPath(IProject project) {
+		if (project == null)
+			return null;
+
+		if (!ModuleCoreNature.isFlexibleProject(project))
+			return null;
+
+		IPath path = null;
+		IVirtualComponent component = ComponentCore.createComponent(project);
+		if (component != null && component.exists()) {
+			path = component.getRootFolder().getWorkspaceRelativePath();
+		}
+		return path;
+	}
+
+	/**
+	 * @param basePath
+	 *            - the full path to a resource within the workspace
+	 * @param reference
+	 *            - the reference string to resolve
+	 * @return - the full path within the workspace that corresponds to the
+	 *         given reference according to the virtual pathing support
+	 */
+	static IPath resolve(IPath basePath, String reference) {
+		if (reference == null || basePath == null || basePath.segmentCount() == 0)
+			return null;
+
+		IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
+
+		if (!ModuleCoreNature.isFlexibleProject(project))
+			return null;
+
+		if (basePath.segmentCount() > 1) {
+			/*
+			 * It can take the better part of a full second to do this, so
+			 * cache the result.
+			 */
+			IPath resolved = null;
+			Map mapForBaseResource = null;
+			mapForBaseResource = (Map) fResolvedMap.get(basePath);
+			if (mapForBaseResource != null) {
+				Reference resolvedReference = (Reference) mapForBaseResource.get(reference);
+				if (resolvedReference != null)
+					resolved = (IPath) resolvedReference.get();
+			}
+			else {
+				mapForBaseResource = new HashMap();
+				fResolvedMap.put(basePath, mapForBaseResource);
+			}
+
+			if (resolved == null) {
+				IFile baseFile = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
+				IVirtualResource[] virtualResources = ComponentCore.createResources(baseFile);
+				for (int i = 0; i < virtualResources.length; i++) {
+					IPath baseRuntimePath = virtualResources[i].getRuntimePath();
+					IPath referenceRuntimePath = null;
+					if (reference.startsWith(SLASH)) {
+						referenceRuntimePath = new Path(reference);
+					}
+					else {
+						referenceRuntimePath = baseRuntimePath.removeLastSegments(1).append(reference);
+					}
+					IVirtualFile virtualFile = ComponentCore.createFile(project, referenceRuntimePath);
+					if (virtualFile != null && virtualFile.exists()) {
+						IFile[] underlyingFiles = virtualFile.getUnderlyingFiles();
+						for (int j = 0; j < underlyingFiles.length; j++) {
+							if (underlyingFiles[j].getProject().equals(project) && underlyingFiles[j].exists()) {
+								mapForBaseResource.put(reference, new SoftReference(underlyingFiles[j].getFullPath()));
+								resolved = underlyingFiles[j].getFullPath();
+							}
+
+						}
+					}
+				}
+			}
+			return resolved;
+		}
+		else {
+			IVirtualFile virtualFile = ComponentCore.createFile(project, new Path(reference));
+			if (virtualFile != null && virtualFile.exists()) {
+				return virtualFile.getUnderlyingFile().getFullPath();
+			}
+		}
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java
index f9e31ac..0df91b7 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java
@@ -41,7 +41,12 @@
 			IDOMElement e = (IDOMElement) target;
 			if (!isValidPrefix(e.getPrefix(), target) && !e.isCommentTag()) {
 				// report unknown tag error.
-				Segment errorSeg = FMUtil.getSegment(e, FMUtil.SEG_START_TAG);
+				Segment errorSeg = null;
+				if (e.hasStartTag())
+					errorSeg = FMUtil.getSegment(e, FMUtil.SEG_START_TAG);
+				else if (e.hasEndTag())
+					errorSeg = FMUtil.getSegment(e, FMUtil.SEG_END_TAG);
+
 				if (errorSeg != null)
 					reporter.report(new ErrorInfoImpl(UNDEFINED_NAME_ERROR, errorSeg, e));
 			}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java
index 75cc031..4dd8979 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,8 +12,11 @@
 
 import java.util.Iterator;
 
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
 import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
 import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
@@ -26,8 +29,10 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 
 class SyntaxValidator extends PrimeValidator implements ErrorState {
@@ -75,9 +80,10 @@
 		public CMElementDeclaration decl = null;
 		public IStructuredDocumentRegion startTag = null;
 		public IStructuredDocumentRegion endTag = null;
-		public boolean hasStartTag = false;
-		public boolean hasEndTag = false;
+		public boolean hasStartTag() {return startTag != null;}
+		public boolean hasEndTag() {return endTag != null;}
 		public boolean isXHTML = false;
+		public boolean isXHTML5 = false;
 	}
 
 	public void validate(IndexedRegion indexedNode) {
@@ -95,8 +101,8 @@
 		// gather information to validate from target at once.
 		getInfo(info);
 
+		validateTags(info);
 		if (info.target.isGlobalTag()) {
-			validateTags(info);
 			validateNames(info);
 			if (info.decl != null && info.isXHTML) {
 				validateTagCase(info);
@@ -109,18 +115,45 @@
 		info.startTag = info.target.getStartStructuredDocumentRegion();
 		info.endTag = info.target.getEndStructuredDocumentRegion();
 
-		info.hasStartTag = (info.startTag != null);
-		info.hasEndTag = (info.endTag != null);
-
 		Document doc = info.target.getOwnerDocument();
 		if (!(doc instanceof IDOMDocument))
 			return;
 		String typeid = ((IDOMDocument) doc).getDocumentTypeId();
 		if (typeid != null) {
-			HTMLDocumentTypeEntry entry = HTMLDocumentTypeRegistry.getInstance().getEntry(typeid);
-			info.isXHTML = (entry != null && entry.isXMLType());
+			if (typeid.trim().length()!= 0){
+				HTMLDocumentTypeEntry entry = HTMLDocumentTypeRegistry.getInstance().getEntry(typeid);
+				info.isXHTML = (entry != null && entry.isXMLType());
+			}
+			else {
+				info.isXHTML = getXMLTarget(doc);
+				info.isXHTML5 = info.isXHTML;
+			}
 		}
 	}
+	
+	private boolean getXMLTarget(Document doc) {
+		if (doc == null)
+			return false;
+		Node child = doc.getFirstChild();
+		while (child != null) {
+			if (child.getNodeType() == Node.ELEMENT_NODE) {
+				if (child.getNodeName().equalsIgnoreCase("html")){
+					if (child.getAttributes()!= null){
+						NamedNodeMap attrs = child.getAttributes();
+						for (int i = 0; i < attrs.getLength(); i++) {
+							Attr a = (Attr) attrs.item(i);
+							if (a.getName().equalsIgnoreCase(HTML50Namespace.ATTR_NAME_XMLNS))
+									return true;
+						}
+					}
+					return false;
+				}
+				
+			}
+			child = child.getNextSibling();
+		}
+		return false;
+	}
 
 	class TagErrorInfoImpl extends AbstractErrorInfo {
 		private String hint = null;
@@ -175,7 +208,7 @@
 	}
 
 	private void validateTags(ElementInfo info) {
-		if (info.hasStartTag) {
+		if (info.hasStartTag()) {
 			if (!info.target.isStartTagClosed()) {
 				// Mark the whole START tag as an error segment.
 				Segment errorSeg = new Segment(info.startTag);
@@ -183,29 +216,39 @@
 			}
 		}
 		else {
-			if (info.hasEndTag) {
+			if (info.hasEndTag()) {
 				if (info.decl != null) {
-					if (CMUtil.isHTML(info.decl) && !info.target.hasChildNodes()) {
-						if (info.target.isContainer()) {
-							// Set the error mark to the start of the element.
-							Segment errorSeg = new Segment(info.target.getStartOffset(), 0);
-							report(MISSING_START_TAG_ERROR, errorSeg, info.target);
-						}
-						else {
-							// Mark the whole END tag as an error segment.
-							Segment errorSeg = new Segment(info.endTag);
-							report(UNNECESSARY_END_TAG_ERROR, errorSeg, info.target);
-						}
-					}
-					else if (info.isXHTML) {
-						Segment errorSeg = new Segment(info.target.getStartOffset(), 0);
+					//if xhtml then must have end tag
+					//else determine if end tag is omissible
+					if (info.isXHTML) {
+						Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_END_TAG_NAME);
 						report(MISSING_START_TAG_ERROR, errorSeg, info.target);
+					} else {
+						//determine if the end tag is omissible
+						boolean canOmitStartTag = false;
+						if(info.decl instanceof HTMLPropertyDeclaration) {
+							int omitType = ((HTMLPropertyDeclaration)info.decl).getOmitType();
+							canOmitStartTag = omitType == HTMLElementDeclaration.OMIT_BOTH;
+						}
+					
+						if (!canOmitStartTag && !info.target.hasChildNodes()) {
+							if (info.target.isContainer()) {
+								// Set the error mark to the start of the element.
+								Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_END_TAG);
+								report(MISSING_START_TAG_ERROR, errorSeg, info.target);
+							}
+							else {
+								// Mark the whole END tag as an error segment.
+								Segment errorSeg = new Segment(info.endTag);
+								report(UNNECESSARY_END_TAG_ERROR, errorSeg, info.target);
+							}
+						}
 					}
 				}
 			}
 		}
 
-		if (info.hasEndTag) {
+		if (info.hasEndTag()) {
 			if (!info.target.isClosed()) {
 				// Set the whole END tag as error segment.
 				Segment errorSeg = new Segment(info.endTag);
@@ -214,24 +257,31 @@
 		}
 		else {
 			if (info.isXHTML) { // XHTML
-				if (!info.target.isEmptyTag()) {
+				//if editor closed during validation this could be null
+				IStructuredDocumentRegion structRegion = info.target.getStartStructuredDocumentRegion();
+				if (!info.target.isEmptyTag() && structRegion != null && DOMRegionContext.XML_TAG_OPEN.equals(structRegion.getFirstRegion().getType())) {
+					/*
+					 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=248963 :
+					 * report empty tags not written as such, but only when
+					 * they follow actual XML/HTML syntax
+					 */
 					if (isEmptyContent(info.decl)) {
-						// EMPTY element should be written in <.../> form.
+						// EMPTY element should be written in <.../> form
 						Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
 						report(INVALID_EMPTY_ELEMENT_TAG, errorSeg, info.target);
 					}
 					else {
 						// end tag is required.
-						Segment errorSeg = new Segment(info.target.getEndOffset(), 0);
+						Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
 						report(MISSING_END_TAG_ERROR, errorSeg, info.target);
 					}
 				}
 			}
 			else { // HTML
-				if (info.hasStartTag) {
-					if (info.decl != null && CMUtil.isHTML(info.decl) && !info.target.isEmptyTag() && !CMUtil.isEndTagOmissible(info.decl)) {
+				if (info.hasStartTag()) {
+					if (info.decl != null && CMUtil.isHTML(info.decl) && !info.target.isEmptyTag() && !CMUtil.isEndTagOmissible(info.decl) && DOMRegionContext.XML_TAG_OPEN.equals(info.startTag.getFirstRegion().getType())) {
 						// Set the error mark to the end of the element.
-						Segment errorSeg = new Segment(info.target.getEndOffset(), 0);
+						Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
 						report(MISSING_END_TAG_ERROR, errorSeg, info.target);
 					}
 				}
@@ -241,15 +291,15 @@
 
 	/* perform validation about tag name definition. */
 	private void validateNames(ElementInfo info) {
-		boolean corrupted = info.hasEndTag && isEndTagCorrupted(info);
+		boolean corrupted = info.hasEndTag() && isEndTagCorrupted(info);
 		if (info.decl == null) {
 			// If no declaration is retrieved, the target is really
 			// unknown element.
-			if (!info.hasStartTag && corrupted) {
+			if (!info.hasStartTag() && corrupted) {
 				reportCorruptedEndTagError(info);
 			}
 			else {
-				Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
+				Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG_NAME);
 				report(UNDEFINED_NAME_ERROR, errorSeg, info.target);
 			}
 		}
@@ -271,24 +321,41 @@
 		if (declared == null)
 			return;
 
-		// start tag
-		if (info.hasStartTag) {
-			startTagName = getTagName(info.startTag);
-			if (!declared.equals(startTagName)) {
-				TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.startTag, startTagName);
-				this.reporter.report(error);
+		if (info.isXHTML5){
+			if (info.hasStartTag()) {
+				startTagName = getTagName(info.startTag);
+				if (info.hasEndTag()) {
+					endTagName = getTagName(info.endTag);
+					if (!endTagName.equals(startTagName)){
+						TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.endTag, endTagName);
+						this.reporter.report(error);
+					}
+				}
 			}
+			
 		}
-		// end tag
-		if (info.hasEndTag) {
-			endTagName = getTagName(info.endTag);
-			if (!info.hasStartTag || (!endTagName.equals(startTagName))) {
-				if (!declared.equals(endTagName)) {
-					TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.endTag, endTagName);
+		else
+		{
+			// start tag
+			if (info.hasStartTag()) {
+				startTagName = getTagName(info.startTag);
+				if (!declared.equals(startTagName)) {
+					TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.startTag, startTagName);
 					this.reporter.report(error);
 				}
 			}
+			// end tag
+			if (info.hasEndTag()) {
+				endTagName = getTagName(info.endTag);
+				if (!info.hasStartTag() || (!endTagName.equals(startTagName))) {
+					if (!declared.equals(endTagName)) {
+						TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.endTag, endTagName);
+						this.reporter.report(error);
+					}
+				}
+			}
 		}
+		
 	}
 
 	private void validateChildren(Node target) {
diff --git a/bundles/org.eclipse.wst.html.ui/.classpath b/bundles/org.eclipse.wst.html.ui/.classpath
new file mode 100644
index 0000000..ce55878
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/.classpath
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="src-html-validation"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.wst.html.ui/.cvsignore b/bundles/org.eclipse.wst.html.ui/.cvsignore
new file mode 100644
index 0000000..e4239f5
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/.cvsignore
@@ -0,0 +1,7 @@
+bin
+htmleditor.jar
+temp.folder
+build.xml
+@dot
+src.zip
+javaCompiler...args
diff --git a/bundles/org.eclipse.wst.html.ui/.options b/bundles/org.eclipse.wst.html.ui/.options
new file mode 100644
index 0000000..6d015ff
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/.options
@@ -0,0 +1 @@
+org.eclipse.wst.html.ui/projectionperf=false
diff --git a/bundles/org.eclipse.wst.html.ui/.project b/bundles/org.eclipse.wst.html.ui/.project
new file mode 100644
index 0000000..38bee73
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.wst.html.ui</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.resources.prefs
similarity index 100%
rename from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs
rename to bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.resources.prefs
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.runtime.prefs
similarity index 100%
rename from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.runtime.prefs
rename to bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.runtime.prefs
diff --git a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..ecc10e4
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,79 @@
+#Wed Mar 28 03:26:40 EDT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=ignore
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..301c7ad
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,4 @@
+#Mon Apr 17 01:48:39 EDT 2006
+eclipse.preferences.version=1
+internal.default.compliance=default
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<templates/>
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
similarity index 100%
rename from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.ltk.core.refactoring.prefs
rename to bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
diff --git a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000..fc522bb
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,16 @@
+#Mon Apr 17 02:01:33 EDT 2006
+compilers.incompatible-environment=0
+compilers.p.build=0
+compilers.p.deprecated=1
+compilers.p.illegal-att-value=0
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=0
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.p.unused-element-or-attribute=0
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..2556c77
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,52 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.wst.html.ui; singleton:=true
+Bundle-Version: 1.0.502.qualifier
+Bundle-Activator: org.eclipse.wst.html.ui.internal.HTMLUIPlugin
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Export-Package: org.eclipse.wst.html.internal.validation;x-internal:=true,
+ org.eclipse.wst.html.ui,
+ org.eclipse.wst.html.ui.internal;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.autoedit;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.contentassist;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.contentoutline;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.contentproperties.ui;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.correction;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.derived;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.edit.ui;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.editor;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.handlers;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.hyperlink;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.preferences;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.preferences.ui;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.registry;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.search;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.style;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.taginfo;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.templates;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.text;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.wizard;x-internal:=true,
+ org.eclipse.wst.html.ui.views.contentoutline
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8"
+Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.3.0)",
+ org.eclipse.wst.xml.ui;bundle-version="[1.1.100,1.2.0)",
+ org.eclipse.wst.css.ui;bundle-version="[1.0.500,1.1.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.css.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)",
+ org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.0,2.0.0)";resolution:=optional,
+ org.eclipse.wst.common.modulecore;bundle-version="[1.2.0,2.0.0)";resolution:=optional
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.xml.core/about.html b/bundles/org.eclipse.wst.html.ui/about.html
similarity index 100%
rename from bundles/org.eclipse.wst.xml.core/about.html
rename to bundles/org.eclipse.wst.html.ui/about.html
diff --git a/bundles/org.eclipse.wst.html.ui/build.properties b/bundles/org.eclipse.wst.html.ui/build.properties
new file mode 100644
index 0000000..be98a59
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/build.properties
@@ -0,0 +1,22 @@
+###############################################################################
+# Copyright (c) 2004, 2005 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+bin.includes = plugin.xml,\
+               icons/,\
+               plugin.properties,\
+               templates/,\
+               META-INF/,\
+               .,\
+               about.html
+bin.excludes = bin/**,\
+               @dot/**,\
+               temp.folder/**
+source.. = src/,\
+           src-html-validation/
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/dtool16/newhtml_wiz.gif b/bundles/org.eclipse.wst.html.ui/icons/full/dtool16/newhtml_wiz.gif
new file mode 100644
index 0000000..8175aa9
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/dtool16/newhtml_wiz.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/etool16/newhtml_wiz.gif b/bundles/org.eclipse.wst.html.ui/icons/full/etool16/newhtml_wiz.gif
new file mode 100644
index 0000000..976e18d
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/etool16/newhtml_wiz.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/sourceEditor.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/sourceEditor.gif
new file mode 100644
index 0000000..75ebdb8
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/sourceEditor.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/table.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/table.gif
new file mode 100644
index 0000000..b99b45c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/table.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-anchor.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-anchor.gif
new file mode 100644
index 0000000..f58992d
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-anchor.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-body.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-body.gif
new file mode 100644
index 0000000..005fa99
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-body.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-button.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-button.gif
new file mode 100644
index 0000000..d143fcf
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-button.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-font.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-font.gif
new file mode 100644
index 0000000..bbb40cb
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-font.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-form.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-form.gif
new file mode 100644
index 0000000..3b13958
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-form.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-generic.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-generic.gif
new file mode 100644
index 0000000..65f516e
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-generic.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-html.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-html.gif
new file mode 100644
index 0000000..fb39ba6
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-html.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image-map.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image-map.gif
new file mode 100644
index 0000000..ef3235d
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image-map.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image.gif
new file mode 100644
index 0000000..a988c1d
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-jsp.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-jsp.gif
new file mode 100644
index 0000000..4084602
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-jsp.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-template.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-template.gif
new file mode 100644
index 0000000..5d1f81b
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-template.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-title.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-title.gif
new file mode 100644
index 0000000..b129090
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-title.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag.gif
new file mode 100644
index 0000000..5e7fb33
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/wizban/newhfile_wiz.png b/bundles/org.eclipse.wst.html.ui/icons/full/wizban/newhfile_wiz.png
new file mode 100644
index 0000000..a4fa448
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/icons/full/wizban/newhfile_wiz.png
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/plugin.properties b/bundles/org.eclipse.wst.html.ui/plugin.properties
new file mode 100644
index 0000000..3232def
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/plugin.properties
@@ -0,0 +1,82 @@
+###############################################################################
+# Copyright (c) 2005, 2010 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+providerName=Eclipse Web Tools Platform
+pluginName=HTML UI Source Editor
+HTML_Source_Page_Editor.name=HTML Editor
+WEB.name=Web
+HTML_Files.name=HTML Files
+HTML_Source.name=Editor
+HTML_Content_Assist.name=Content Assist
+HTML_Templates.name=Templates
+HTML_Styles.name=Styles
+HTML_Syntax_Coloring=Syntax Coloring
+HTML_Typing=Typing
+HTML_Validation=Validation
+HTML_Property_validation=HTML Syntax
+WebContentSettings.name=Web Content Settings
+Device_Profile_Entry_Provider_Extension.name=Device Profile Entry Provider Extension
+All_HTML_context_type_Extension_Element.name=All HTML
+HTML_New_context_type_Extension_Element.name=New HTML
+HTML_Tag_context_type_Extension_Element.name=HTML Tag
+HTML_Attribute_context_type_Extension_Element.name=HTML Attribute
+HTML_Attribute_value_context_type_Extension_Element.name=HTML Attribute value
+HTML_Syntax_Validator.name=HTML Syntax Validator
+###############################################################################
+#org.eclipse.ui.newWizards extension point
+_UI_WIZARD_NAME = HTML File
+_UI_WIZARD_CREATE_NEW_FILE = Create a new HTML file
+##
+AddTask.label=Add &Task...
+AddTask.tooltip=Add Task...
+AddBookmark.label=Add Boo&kmark...
+AddBookmark.tooltip=Add Bookmark...
+SelectRuler.label=Select Ruler
+##
+CleanupDocument_label=Cleanup Document...
+CleanupDocument_tooltip=Cleanup Document
+ToggleComment_label=Toggle Comment
+ToggleComment_tooltip=Toggle Comment
+AddBlockComment_label=Add Block Comment
+AddBlockComment_tooltip=Add Block Comment
+RemoveBlockComment_label=Remove Block Comment
+RemoveBlockComment_tooltip=Remove Block Comment
+FindOccurrences_label=Occurrences in File
+StructureSelectEnclosing_label=Enclosing Element
+StructureSelectEnclosing_tooltip=Expand selection to include enclosing element
+StructureSelectNext_label=Next Element
+StructureSelectNext_tooltip=Expand selection to include next sibling
+StructureSelectPrevious_label=Previous Element
+StructureSelectPrevious_tooltip=Expand selection to include previous sibling
+StructureSelectHistory_label=Restore Last Selection
+StructureSelectHistory_tooltip=Restore last selection
+##
+preferenceKeywords.files=editor html creating saving files suffix specified encoding iana loading
+preferenceKeywords.source=editor html source formatting line width split multiple attributes new clear blank indent tabs spaces size content assist automatically suggestions prompt characters inserted strategy lax strict markup case code generation tag names capitalization uppercase lowercase
+preferenceKeywords.contentassist=html editor content code assist complete completion insert overwrite single proposal common prefix automatically import fill argument name guess alphabetical hide auto activation trigger category categories separate specific
+preferenceKeywords.templates=editor html templates snippet macros
+preferenceKeywords.styles=editor html style customize syntax highlighting type text content foreground background bold color
+preferenceKeywords.webcontent=editor html web content settings profile style document type doctype public system css
+preferenceKeywords.severities=html errors warnings ignore options severity severities suppress project specific projectspecific
+##
+HTML_Editors_target_name=HTML Editors
+
+scope.structured.text.editor.html.name=Editing HTML Source
+scope.structured.text.editor.html.description=Editing HTML Source
+scope.structured.text.editor.html.occurrences.name=HTML Source Occurrences
+scope.structured.text.editor.html.occurrences.description=HTML Source Occurrences
+
+Colors.scriptAreaBorder=Script Area Border
+hyperlinkDetector.anchor.name=Anchors
+hyperlink.target.script.name=HTML Client Script
+hyperlink.target.eventhandler.name=HTML Event Handlers
+
+proposalCategory.htmlTags=HTML Tag Proposals
+proposalCategory.htmlTemplates=HTML Template Proposals
diff --git a/bundles/org.eclipse.wst.html.ui/plugin.xml b/bundles/org.eclipse.wst.html.ui/plugin.xml
new file mode 100644
index 0000000..3f0d41b
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/plugin.xml
@@ -0,0 +1,704 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+	<extension-point id="deviceProfileEntryProvider" name="%Device_Profile_Entry_Provider_Extension.name" schema="schema/deviceProfileEntryProvider.exsd"/>
+
+	<extension point="org.eclipse.ui.editors">
+		<editor
+			name="%HTML_Source_Page_Editor.name"
+			icon="$nl$/icons/full/obj16/sourceEditor.gif"
+			contributorClass="org.eclipse.wst.html.ui.internal.edit.ui.ActionContributorHTML"
+			class="org.eclipse.wst.sse.ui.StructuredTextEditor"
+			symbolicFontName="org.eclipse.wst.sse.ui.textfont"
+			id="org.eclipse.wst.html.core.htmlsource.source">
+			<contentTypeBinding
+				contentTypeId="org.eclipse.wst.html.core.htmlsource" />
+		</editor>
+	</extension>
+	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
+		<sourceViewerConfiguration
+			class="org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML"
+			target="org.eclipse.wst.html.core.htmlsource" />
+		<contentOutlineConfiguration
+			class="org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration"
+			target="org.eclipse.wst.html.core.htmlsource" />
+		<quickOutlineConfiguration
+			class="org.eclipse.wst.xml.ui.internal.quickoutline.XMLQuickOutlineConfiguration"
+			target="org.eclipse.wst.html.core.htmlsource"/>
+		<propertySheetConfiguration
+			class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
+			target="org.eclipse.wst.html.core.htmlsource" />
+  		<documentationTextHover
+        	class="org.eclipse.wst.html.ui.internal.taginfo.HTMLTagInfoHoverProcessor"
+        	target="org.eclipse.wst.html.HTML_DEFAULT">
+  		</documentationTextHover>
+		<provisionalConfiguration
+			type="sourceeditingtexttools"
+			class="org.eclipse.wst.xml.ui.internal.provisional.XMLSourceEditingTextTools"
+			target="org.eclipse.wst.html.core.htmlsource" />
+		<provisionalConfiguration
+			type="characterpairmatcher"
+			class="org.eclipse.wst.html.ui.internal.text.HTMLDocumentRegionEdgeMatcher"
+			target="org.eclipse.wst.html.core.htmlsource" />
+		<provisionalConfiguration
+			type="foldingstrategy"
+			class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"
+			target="org.eclipse.wst.html.core.htmlsource" />
+		<provisionalConfiguration
+			type="org.eclipse.jface.text.quickassist.IQuickAssistProcessor"
+			class="org.eclipse.wst.xml.ui.internal.correction.XMLQuickAssistProcessor"
+			target="org.eclipse.wst.html.HTML_DEFAULT" />
+		<provisionalConfiguration
+			type="autoeditstrategy"
+			class="org.eclipse.wst.html.ui.internal.autoedit.StructuredAutoEditStrategyHTML"
+			target="org.eclipse.wst.html.HTML_DEFAULT, org.eclipse.wst.html.HTML_DECLARATION" />
+		<provisionalDefinition
+			type="preferencepages"
+			value="org.eclipse.wst.html.ui.preferences.html, org.eclipse.wst.html.ui.preferences.source, org.eclipse.wst.html.ui.preferences.templates, org.eclipse.wst.html.ui.preferences.styles,org.eclipse.wst.html.ui.preferences.validation, org.eclipse.wst.html.ui.preferences.contentassist"
+			target="org.eclipse.wst.html.core.htmlsource" />
+		<provisionalDefinition
+			type="spellingregions"
+			value="XML_COMMENT_TEXT, XML_CONTENT"
+			target="org.eclipse.wst.html.core.htmlsource" />
+		<provisionalDefinition
+			type="activecontexts"
+			value="org.eclipse.wst.html.core.htmlsource, org.eclipse.wst.html.occurrences, org.eclipse.core.runtime.xml, org.eclipse.wst.xml.navigation, org.eclipse.wst.xml.comments, org.eclipse.wst.xml.selection"
+        	target="org.eclipse.wst.html.core.htmlsource" />
+	</extension>
+	<extension
+		point="org.eclipse.core.filebuffers.annotationModelCreation">
+		<factory
+			contentTypeId="org.eclipse.wst.html.core.htmlsource"
+			class="org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModelFactory" />
+	</extension>
+	<extension
+		point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
+		<adapterFactoryDescription
+			class="org.eclipse.wst.html.ui.internal.registry.AdapterFactoryProviderForHTML">
+			<contentType id="org.eclipse.wst.html.core.htmlsource" />
+		</adapterFactoryDescription>
+	</extension>
+	<extension point="org.eclipse.ui.preferencePages">
+		<page
+			name="%WEB.name"
+			class="org.eclipse.wst.html.ui.internal.preferences.ui.EmptyFilePreferencePage"
+			id="org.eclipse.wst.html.ui.preferences.web">
+		</page>
+		<!-- HTML PREFERENCE PAGES-->
+		<page
+			name="%HTML_Files.name"
+			category="org.eclipse.wst.html.ui.preferences.web"
+			class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLFilesPreferencePage"
+			id="org.eclipse.wst.html.ui.preferences.html">
+			<keywordReference id="org.eclipse.wst.html.ui.files"/>
+		</page>
+		<page
+			name="%HTML_Source.name"
+			category="org.eclipse.wst.html.ui.preferences.html"
+			class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLSourcePreferencePage"
+			id="org.eclipse.wst.html.ui.preferences.source">
+			<keywordReference id="org.eclipse.wst.html.ui.source"/>
+		</page>
+  <page
+        category="org.eclipse.wst.html.ui.preferences.source"
+        class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLContentAssistPreferencePage"
+        id="org.eclipse.wst.html.ui.preferences.contentassist"
+        name="%HTML_Content_Assist.name">
+     <keywordReference
+           id="org.eclipse.wst.html.ui.contentassist">
+     </keywordReference>
+  </page>
+		<page
+			name="%HTML_Templates.name"
+			category="org.eclipse.wst.html.ui.preferences.source"
+			class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLTemplatePreferencePage"
+			id="org.eclipse.wst.html.ui.preferences.templates">
+			<keywordReference id="org.eclipse.wst.html.ui.templates"/>
+		</page>
+		<page
+			name="%HTML_Syntax_Coloring"
+			category="org.eclipse.wst.html.ui.preferences.source"
+			class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLSyntaxColoringPage"
+			id="org.eclipse.wst.html.ui.preferences.styles">
+			<keywordReference id="org.eclipse.wst.html.ui.styles"/>
+		</page>
+		<page
+			name="%HTML_Validation"
+			category="org.eclipse.wst.html.ui.preferences.html"
+			class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLValidationPreferencePage"
+			id="org.eclipse.wst.html.ui.preferences.validation">
+		</page>
+		<page
+			name="%HTML_Typing"
+			category="org.eclipse.wst.html.ui.preferences.source"
+			class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLTypingPreferencePage"
+			id="org.eclipse.wst.html.ui.preferences.typing">
+		</page>
+	</extension>
+	<!-- Web content settings -->
+	<extension point="org.eclipse.ui.propertyPages">
+		<!-- for dynamic web project -->
+		<page
+			name="%WebContentSettings.name"
+			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.ProjectWebContentSettingsPropertyPage"
+			id="org.eclipse.wst.html.ui.dynamicprojectpropertypage">
+         	<enabledWhen>
+               	<and>
+					<adapt type="org.eclipse.core.resources.IProject">
+						<or> 
+							<test 
+								forcePluginActivation="true"
+								property="org.eclipse.wst.common.project.facet.core.projectFacet"
+								value="jst.web" />
+							<test 
+								forcePluginActivation="true"
+								property="org.eclipse.wst.common.project.facet.core.projectFacet"
+								value="wst.web" />
+						</or>
+					</adapt>
+				</and> 
+			</enabledWhen>
+         	<keywordReference id="org.eclipse.wst.html.ui.webcontent"/>
+		</page>
+		<page
+			name="%WebContentSettings.name"
+			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage"
+			id="org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage">
+         	<enabledWhen>
+               	<and>
+					<adapt type="org.eclipse.core.resources.IFile">
+						<or> 
+							<test 
+								forcePluginActivation="true"
+								property="org.eclipse.core.resources.contentTypeId"
+								value="org.eclipse.wst.html.core.htmlsource" />
+							<test 
+								forcePluginActivation="true"
+								property="org.eclipse.core.resources.contentTypeId"
+								value="org.eclipse.jst.jsp.core.jspsource" />
+							<test 
+								forcePluginActivation="true"
+								property="org.eclipse.core.resources.contentTypeId"
+								value="org.eclipse.jst.jsp.core.jspfragmentsource" />
+							<test 
+								forcePluginActivation="true"
+								property="org.eclipse.core.resources.contentTypeId"
+								value="org.eclipse.jst.jsp.core.cssjspfragmentsource" />
+						</or>
+					</adapt>
+				</and> 
+			</enabledWhen>
+         	<keywordReference id="org.eclipse.wst.html.ui.webcontent"/>
+		</page>
+		<page
+			name="%HTML_Property_validation"
+			class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLValidationPreferencePage"
+			id="org.eclipse.wst.html.ui.propertyPage.project.validation"
+			category="ValidationPropertiesPage">
+			<enabledWhen>
+				<adapt type="org.eclipse.core.resources.IProject">
+					
+				</adapt>
+			</enabledWhen>
+		</page>
+	</extension>
+	
+	<!-- Keywords for preference and properties pages -->
+	<extension point="org.eclipse.ui.keywords">
+		<keyword
+			label="%preferenceKeywords.files"
+			id="org.eclipse.wst.html.ui.files"/>
+		<keyword
+			label="%preferenceKeywords.source"
+			id="org.eclipse.wst.html.ui.source"/>
+		<keyword
+			label="%preferenceKeywords.contentassist"
+			id="org.eclipse.wst.html.ui.contentassist"/>
+		<keyword
+			label="%preferenceKeywords.templates"
+			id="org.eclipse.wst.html.ui.templates"/>
+		<keyword
+			label="%preferenceKeywords.styles"
+			id="org.eclipse.wst.html.ui.styles"/>
+		<keyword
+			label="%preferenceKeywords.webcontent"
+			id="org.eclipse.wst.html.ui.webcontent"/>
+		<keyword
+			label="%preferenceKeywords.severities"
+			id="org.eclipse.wst.html.ui.severities"/>
+    </extension>
+	
+	<!-- Editor actionsets -->
+	<extension point="org.eclipse.ui.actionSetPartAssociations">
+		<actionSetPartAssociation
+			targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
+			<part id="org.eclipse.wst.html.core.htmlsource.source">
+			</part>
+		</actionSetPartAssociation>
+		<actionSetPartAssociation
+			targetID="org.eclipse.ui.NavigateActionSet">
+			<part id="org.eclipse.wst.html.core.htmlsource.source">
+			</part>
+		</actionSetPartAssociation>
+	</extension>
+
+	<!-- Templates -->
+	<extension point="org.eclipse.ui.editors.templates">
+		<contextType
+			name="%All_HTML_context_type_Extension_Element.name"
+			class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
+			id="html_all">
+		</contextType>
+		<contextType
+			name="%HTML_New_context_type_Extension_Element.name"
+			class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
+			id="html_new">
+		</contextType>
+		<contextType
+			name="%HTML_Tag_context_type_Extension_Element.name"
+			class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
+			id="html_tag">
+		</contextType>
+		<contextType
+			name="%HTML_Attribute_context_type_Extension_Element.name"
+			class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
+			id="html_attribute">
+		</contextType>
+		<contextType
+			name="%HTML_Attribute_value_context_type_Extension_Element.name"
+			class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
+			id="html_attribute_value">
+		</contextType>
+		<include
+			file="templates/htmldefault-templates.xml"
+			translations="$nl$/templates/htmldefault-templates.properties">
+		</include>
+	</extension>
+	
+	<!-- Define the HTML Contexts -->
+	<extension point="org.eclipse.ui.contexts">
+		<context
+			name="%scope.structured.text.editor.html.name"
+			parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
+			description="%scope.structured.text.editor.html.description"
+			id="org.eclipse.wst.html.core.htmlsource">
+		</context>
+		<context
+			name="%scope.structured.text.editor.html.occurrences.name"
+			parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
+			description="%scope.structured.text.editor.html.occurrences.description"
+			id="org.eclipse.wst.html.occurrences">
+		</context>
+	</extension>
+	
+	<!-- initialize html ui preferences -->
+	<extension point="org.eclipse.core.runtime.preferences">
+		<initializer
+			class="org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceInitializer" />
+	</extension>
+
+	<!--======================================================================================-->
+	<!-- Document provider for ExternalFileEditorInput                                        -->
+	<!--======================================================================================-->
+	<extension point="org.eclipse.ui.editors.documentProviders">
+		<provider
+			inputTypes="org.eclipse.wst.html.ui.internal.hyperlink.ExternalFileEditorInput"
+			class="org.eclipse.ui.editors.text.TextFileDocumentProvider"
+			id="org.eclipse.wst.html.ui.internal.ExternalFileDocumentProvider">
+		</provider>
+	</extension>
+
+	<!--======================================================================================-->
+	<!-- Workbench validation                                       						  -->
+	<!--======================================================================================-->
+   <extension id="HTMLValidator" name="%HTML_Syntax_Validator.name" point="org.eclipse.wst.validation.validatorV2">
+      <validator
+            build="true"
+            class="org.eclipse.wst.html.internal.validation.HTMLValidator"
+            manual="true"
+            sourceid="org.eclipse.wst.html.ui.internal.validation.htmlsyntaxvalidator"
+            version="1"
+            markerId="org.eclipse.wst.html.core.validationMarker">
+         <include>
+            <rules>
+               <contentType id="org.eclipse.wst.html.core.htmlsource"></contentType>
+               <fileext caseSensitive="false" ext="html"/>
+               <fileext caseSensitive="false" ext="xhtml"/>
+               <fileext caseSensitive="false" ext="htm"/>
+               <fileext caseSensitive="false" ext="htpl"/>
+               <fileext caseSensitive="false" ext="wml"/>
+            </rules>
+         </include>
+         <group id="org.eclipse.wst.sse.core.structuredModelGroup"/>
+      </validator>
+   </extension>
+
+	<!--======================================================================================-->
+	<!-- As you type validation                                      						  -->
+	<!--======================================================================================-->
+
+	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
+		<validator
+			scope="total"
+			class="org.eclipse.wst.html.internal.validation.HTMLValidator"
+			id="org.eclipse.wst.html.ui.internal.validation.htmlsyntaxvalidator">
+			<contentTypeIdentifier
+				id="org.eclipse.wst.html.core.htmlsource">
+				<partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
+				<partitionType id="org.eclipse.wst.html.HTML_DECLARATION"/>
+				<partitionType id="org.eclipse.wst.html.HTML_COMMENT"/>
+				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
+				<partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
+			</contentTypeIdentifier>
+		</validator>
+	</extension>
+
+	<!-- New HTML wizard -->
+	<extension point="org.eclipse.ui.newWizards">
+		<wizard
+			id="org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard"
+			name="%_UI_WIZARD_NAME"
+			class="org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard"
+			category="org.eclipse.wst.web.ui"
+			icon="$nl$/icons/full/etool16/newhtml_wiz.gif">
+			<description>%_UI_WIZARD_CREATE_NEW_FILE</description>
+			<selection class="org.eclipse.core.resources.IResource" />
+		</wizard>
+	</extension>
+
+	<!-- Add new HTML wizard to Common Navigator -->
+	<extension
+		id="org.eclipse.wst.html.commonWizard.newHTML"
+		point="org.eclipse.ui.navigator.navigatorContent">
+		<commonWizard
+        menuGroupId="org.eclipse.wst.web.ui"
+        type="new"
+        wizardId="org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard">
+			<enablement>
+				<or>
+					<adapt type="org.eclipse.core.resources.IResource">
+						<or>
+							<test
+								property="org.eclipse.wst.common.project.facet.core.projectFacet"
+								value="wst.web"/>
+							<test
+								property="org.eclipse.wst.common.project.facet.core.projectFacet"
+								value="jst.web"/>
+						</or>
+					</adapt>
+				</or>
+			</enablement>
+		</commonWizard>
+	</extension>
+
+	<extension point="org.eclipse.ui.popupMenus">
+		<viewerContribution
+			targetID="org.eclipse.wst.html.core.htmlsource.source.RulerContext"
+			id="org.eclipse.ui.texteditor.ruler.context.actions">
+			<action
+				label="%AddTask.label"
+				helpContextId="org.eclipse.ui.AddTask_action_context"
+				class="org.eclipse.ui.texteditor.TaskRulerAction"
+				tooltip="%AddTask.tooltip"
+				menubarPath="additions"
+				id="org.eclipse.ui.texteditor.TaskRulerAction">
+			</action>
+			<action
+				label="%AddBookmark.label"
+				helpContextId="org.eclipse.ui.bookmark_action_context"
+				class="org.eclipse.ui.texteditor.BookmarkRulerAction"
+				tooltip="%AddBookmark.tooltip"
+				menubarPath="additions"
+				id="org.eclipse.ui.texteditor.BookmarkRulerAction">
+			</action>
+		</viewerContribution>
+	</extension>
+	
+	<extension point="org.eclipse.ui.editorActions">
+	<!--	<editorContribution
+			id="org.eclipse.wst.html.core.htmlsource.source.editorActions"
+			targetID="org.eclipse.wst.html.core.htmlsource.source">
+			<action
+				id="CleanupDocument"
+				label="%CleanupDocument_label"
+				definitionId="org.eclipse.wst.sse.ui.cleanup.document"
+				tooltip="%CleanupDocument_tooltip"
+				class="org.eclipse.wst.html.ui.internal.edit.ui.CleanupActionHTMLDelegate"
+				actionID="CleanupDocument">
+			</action>
+			<action
+				id="ToggleComment"
+				label="%ToggleComment_label"
+				definitionId="org.eclipse.wst.sse.ui.toggle.comment"
+				tooltip="%ToggleComment_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.actions.ToggleCommentActionXMLDelegate"
+				actionID="ToggleComment">
+			</action>
+			<action
+				id="AddBlockComment"
+				label="%AddBlockComment_label"
+				definitionId="org.eclipse.wst.sse.ui.add.block.comment"
+				tooltip="%AddBlockComment_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.actions.AddBlockCommentActionXMLDelegate"
+				actionID="AddBlockComment">
+			</action>
+			<action
+				id="RemoveBlockComment"
+				label="%RemoveBlockComment_label"
+				definitionId="org.eclipse.wst.sse.ui.remove.block.comment"
+				tooltip="%RemoveBlockComment_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.actions.RemoveBlockCommentActionXMLDelegate"
+				actionID="RemoveBlockComment">
+			</action>
+			<action
+				id="FindOccurrences"
+				label="%FindOccurrences_label"
+				definitionId="org.eclipse.wst.sse.ui.search.find.occurrences"
+				class="org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesActionDelegate"
+				actionID="FindOccurrences">
+			</action>
+			<action
+				id="StructureSelectEnclosing"
+				label="%StructureSelectEnclosing_label"
+				definitionId="org.eclipse.wst.sse.ui.structure.select.enclosing"
+				tooltip="%StructureSelectEnclosing_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectEnclosingXMLActionDelegate"
+				actionID="StructureSelectEnclosing">
+			</action>
+			<action
+				id="StructureSelectNext"
+				label="%StructureSelectNext_label"
+				definitionId="org.eclipse.wst.sse.ui.structure.select.next"
+				tooltip="%StructureSelectNext_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectNextXMLActionDelegate"
+				actionID="StructureSelectNext">
+			</action>
+			<action
+				id="StructureSelectPrevious"
+				label="%StructureSelectPrevious_label"
+				definitionId="org.eclipse.wst.sse.ui.structure.select.previous"
+				tooltip="%StructureSelectPrevious_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectPreviousXMLActionDelegate"
+				actionID="StructureSelectPrevious">
+			</action>
+			<action
+				id="StructureSelectHistory"
+				label="%StructureSelectHistory_label"
+				definitionId="org.eclipse.wst.sse.ui.structure.select.last"
+				tooltip="%StructureSelectHistory_tooltip"
+				class="org.eclipse.wst.sse.ui.internal.selection.StructuredSelectHistoryActionDelegate"
+				actionID="StructureSelectHistory">
+			</action>
+		</editorContribution>-->
+        <editorContribution
+            targetID="org.eclipse.wst.html.core.htmlsource.source"
+            id="org.eclipse.wst.html.core.htmlsource.ruler.actions">
+         <action
+               label="%AddBookmark.label"
+               helpContextId="org.eclipse.ui.bookmark_action_context"
+               class="org.eclipse.ui.texteditor.BookmarkRulerAction"
+               actionID="RulerDoubleClick"
+               id="org.eclipse.ui.texteditor.BookmarkRulerAction"/>
+         <action
+               label="%SelectRuler.label"
+               class="org.eclipse.ui.texteditor.SelectRulerAction"
+               actionID="RulerClick"
+               id="org.eclipse.ui.texteditor.SelectRulerAction"/>
+        </editorContribution>
+	</extension>
+	
+	<extension
+       point="org.eclipse.ui.handlers">
+       <handler
+             class="org.eclipse.wst.html.ui.internal.edit.ui.CleanupDocumentHandler"
+             commandId="org.eclipse.wst.sse.ui.cleanup.document">
+             <activeWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.html.ui.htmlSourceContributions.definition">
+             	</reference>
+             </activeWhen>
+             <enabledWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.html.ui.htmlSourceContributions.definition">
+             	</reference>
+             </enabledWhen>
+       </handler>
+       <handler
+             class="org.eclipse.wst.html.ui.internal.handlers.HTMLFindOccurrencesHandler"
+             commandId="org.eclipse.wst.sse.ui.search.find.occurrences">
+             <activeWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.html.ui.occurrences">
+             	</reference>
+             </activeWhen>
+             <enabledWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.html.ui.occurrences">
+             	</reference>
+             </enabledWhen>
+       </handler>
+       
+	</extension>
+	
+	<extension
+		point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets">
+		<target
+			id="org.eclipse.wst.html.core.htmlsource"
+			name="%HTML_Editors_target_name"/>
+		<target
+			id="org.eclipse.wst.html.SCRIPT"
+			name="%hyperlink.target.script.name"/>
+		<target
+			id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"
+			name="%hyperlink.target.eventhandler.name"/>
+	</extension>
+	
+	<extension
+		point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
+		<hyperlinkDetector
+			class="org.eclipse.wst.html.ui.internal.hyperlink.AnchorHyperlinkDetector"
+			id="org.eclipse.wst.html.ui.internal.hyperlink.AnchorHyperlinkDetector"
+			name="%hyperlinkDetector.anchor.name"
+			targetId="org.eclipse.core.runtime.xml">
+		</hyperlinkDetector>
+		
+   </extension>
+
+	<extension point="org.eclipse.core.expressions.definitions">
+		<definition id="org.eclipse.wst.html.ui.htmlSourceContributions.definition">
+            <with variable="activeContexts">
+	           <iterate operator="or">
+	              <equals value="org.eclipse.wst.html.core.htmlsource"/>
+	           </iterate>
+            </with>
+		</definition>
+	</extension>
+	
+	<extension point="org.eclipse.core.expressions.definitions">
+		<definition id="org.eclipse.wst.html.ui.occurrences">
+            <with variable="activeContexts">
+	           <iterate operator="or">
+	              <equals value="org.eclipse.wst.html.occurrences"/>
+	           </iterate>
+            </with>
+		</definition>
+	</extension>
+	
+	<!-- Define theme - Many of the color overrides and definitions come from 
+	     the XML plugin -->
+	<extension
+		point="org.eclipse.ui.themes">
+		<theme
+			id="org.eclipse.ui.ide.systemDefault">
+			<colorOverride
+				id="SCRIPT_AREA_BORDER"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+		</theme>
+		<colorDefinition
+			id="SCRIPT_AREA_BORDER"
+			isEditable="false"
+			label="%Colors.scriptAreaBorder"
+			value="191, 95, 63">
+		</colorDefinition>
+	</extension>
+	
+	<!-- Enable the FormatHandler for HTML Content Type -->
+	<extension point="org.eclipse.ui.handlers">
+		<handler 
+			class="org.eclipse.wst.sse.ui.internal.handlers.FormatHandler"
+			commandId="org.eclipse.wst.sse.ui.format">
+			<activeWhen>
+				<reference definitionId="org.eclipse.wst.html.ui.htmlContentType.definition"></reference>
+			</activeWhen>
+			<enabledWhen>
+				<reference definitionId="org.eclipse.wst.html.ui.htmlContentType.definition"></reference>
+			</enabledWhen>
+		</handler>
+	</extension>
+	
+	<!-- Set up a definition for HTML Content Types -->
+	<extension point="org.eclipse.core.expressions.definitions">
+		<definition id="org.eclipse.wst.html.ui.htmlContentType.definition">
+			<iterate ifEmpty="false">
+				<adapt type="org.eclipse.core.resources.IFile">
+					<!-- Force property tester to load, should not cause entire plug-in to start -->
+					<test property="org.eclipse.wst.sse.core.resources.contentTypeId"
+						value="org.eclipse.wst.html.core.htmlsource" forcePluginActivation="true"/>
+				</adapt>
+			</iterate>
+		</definition>
+	</extension>
+	<extension point="org.eclipse.wst.sse.ui.characterPairing">
+		<inserter class="org.eclipse.wst.html.ui.internal.text.CharacterPairInserter" id="org.eclipse.wst.html.ui.inserter">
+			<contentTypeIdentifier
+				id="org.eclipse.wst.html.core.htmlsource"
+				partitions="org.eclipse.wst.html.HTML_DEFAULT">
+			</contentTypeIdentifier>
+		</inserter>
+	</extension>
+ <extension
+       point="org.eclipse.wst.sse.ui.completionProposal">
+    <proposalCategory
+          icon="icons/full/obj16/tag-generic.gif"
+          id="org.eclipse.wst.html.ui.proposalCategory.htmlTags"
+          name="%proposalCategory.htmlTags">
+    </proposalCategory>
+    <proposalCategory
+          icon="icons/full/obj16/tag-template.gif"
+          id="org.eclipse.wst.html.ui.proposalCategory.htmlTemplates"
+          name="%proposalCategory.htmlTemplates">
+    </proposalCategory>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.wst.html.ui.proposalCategory.htmlTags"
+          class="org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer"
+          id="org.eclipse.wst.html.ui.proposalComputer.htmlTags">
+       <contentType
+             id="org.eclipse.wst.html.core.htmlsource">
+          <partitionType
+                id="org.eclipse.wst.html.HTML_DEFAULT">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.wst.html.ui.proposalCategory.htmlTemplates"
+          class="org.eclipse.wst.html.ui.internal.contentassist.HTMLTemplatesCompletionProposalComputer"
+          id="org.eclipse.wst.html.ui.proposalComputer.htmlTemplates">
+       <contentType
+             id="org.eclipse.wst.html.core.htmlsource">
+          <partitionType
+                id="org.eclipse.wst.html.HTML_DEFAULT">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.css.ui.proposalComputer.css">
+       <contentType
+             id="org.eclipse.wst.html.core.htmlsource">
+          <partitionType
+                id="org.eclipse.wst.css.STYLE">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.css.ui.proposalComputer.cssTemplates">
+       <contentType
+             id="org.eclipse.wst.html.core.htmlsource">
+          <partitionType
+                id="org.eclipse.wst.css.STYLE">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+ </extension>
+ <extension
+       point="org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration">
+    <categoriesConfiguration
+          class="org.eclipse.wst.html.ui.internal.preferences.HTMLCompletionProposalCategoriesConfiguration"
+          contentTypeID="org.eclipse.wst.html.core.htmlsource">
+    </categoriesConfiguration>
+ </extension>
+	
+</plugin>
diff --git a/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd b/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd
new file mode 100644
index 0000000..742f82f
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.html.ui">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.eclipse.wst.html.ui" id="deviceProfileEntryProvider" name="Device Profile Entry Provider Extension"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <complexType>
+         <sequence>
+            <element ref="deviceProfileEntryProvider"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute translatable="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="deviceProfileEntryProvider">
+      <complexType>
+         <attribute name="class" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         &lt;b&gt;This extension point is deprecated and should not be used by any other plugins.&lt;/b&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiInfo"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="implementation"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
+All rights reserved. This program and the accompanying materials are made 
+available under the terms of the Eclipse Public License v1.0 which accompanies 
+this distribution, and is available at &lt;a
+href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationReporter.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationReporter.java
new file mode 100644
index 0000000..4d1068c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationReporter.java
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.internal.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.wst.html.core.internal.validate.MessageFactory;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.validate.ErrorInfo;
+import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
+import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+
+public class HTMLValidationReporter implements ValidationReporter {
+
+	private IValidator owner = null;
+	private IReporter reporter = null;
+	private IFile file = null;
+	private IStructuredModel model = null;
+	private HTMLValidationResult result = null;
+	private MessageFactory fFactory = null;
+	
+	/**
+	 */
+	public HTMLValidationReporter(IValidator owner, IReporter reporter, IFile file, IStructuredModel model) {
+		super();
+		this.owner = owner;
+		this.reporter = reporter;
+		this.file = file;
+		this.model = model;
+		fFactory = new MessageFactory(file != null ? file.getProject() : null);
+	}
+
+	/**
+	 */
+	public void clear() {
+		if (this.file == null)
+			return;
+
+		this.result = null;
+
+		if (this.reporter != null) {
+			this.reporter.removeAllMessages(this.owner, this.file);
+		}
+		else {
+			// remove by myself?
+			String id = HTMLValidator.class.getName();
+			try {
+				// TaskListHelper API changed
+				// TaskListHelper.getTaskList().removeAllTasks(id, this.file,
+				// null);
+				TaskListHelper.getTaskList().removeAllTasks(this.file, id, null);
+			}
+			catch (CoreException ex) {
+			}
+		}
+	}
+
+
+	/**
+	 */
+	public HTMLValidationResult getResult() {
+		if (this.result == null)
+			this.result = new HTMLValidationResult();
+		return this.result;
+	}
+
+	/**
+	 */
+	public void report(ValidationMessage message) {
+		if (message == null || message.getSeverity() == ValidationMessage.IGNORE)
+			return;
+		IMessage mes = translateMessage(message);
+
+		if (this.reporter != null) {
+			this.reporter.addMessage(this.owner, mes);
+		}
+		else {
+			if (this.file == null)
+				return;
+
+			// add by myself?
+			String id = HTMLValidator.class.getName();
+			String location = Integer.toString(mes.getLineNumber());
+			String name = ""; //$NON-NLS-1$
+			IPath filePath = this.file.getFullPath();
+			if (filePath != null) {
+				name = filePath.toString();
+			}
+			try {
+				TaskListHelper.getTaskList().addTask(id, this.file, location, mes.getId(), mes.getText(), mes.getSeverity(), name, mes.getGroupName(), mes.getOffset(), mes.getLength());
+			}
+			catch (CoreException ex) {
+			}
+		}
+	}
+
+	/**
+	 * Translate ValidationMessage to IMessage and generate result log
+	 */
+	private IMessage translateMessage(ValidationMessage message) {
+		int severity = IMessage.LOW_SEVERITY;
+		HTMLValidationResult result = getResult();
+		switch (message.getSeverity()) {
+			case ValidationMessage.ERROR :
+				severity = IMessage.HIGH_SEVERITY;
+				result.addError();
+				break;
+			case ValidationMessage.WARNING :
+				severity = IMessage.NORMAL_SEVERITY;
+				result.addWarning();
+				break;
+			case ValidationMessage.INFORMATION :
+				result.addInformation();
+				break;
+			default :
+//				result.addInformation();
+				break;
+		}
+
+		IMessage mes = new LocalizedMessage(severity, message.getMessage(), this.file);
+		mes.setOffset(message.getOffset());
+		mes.setLength(message.getLength());
+		if (this.model != null) {
+			IStructuredDocument flatModel = this.model.getStructuredDocument();
+			if (flatModel != null) {
+				int line = flatModel.getLineOfOffset(message.getOffset());
+				mes.setLineNo(line + 1);
+			}
+		}
+
+		return mes;
+	}
+
+	public void report(ErrorInfo info) {
+		report(fFactory.createMessage(info));
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationResult.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationResult.java
new file mode 100644
index 0000000..26c5f08
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationResult.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.internal.validation;
+
+public class HTMLValidationResult {
+	private int errors = 0;
+	private int warnings = 0;
+	private int informations = 0;
+
+	/**
+	 */
+	public HTMLValidationResult() {
+	}
+
+	/**
+	 */
+	public void addError() {
+		this.errors++;
+	}
+
+	/**
+	 */
+	public void addInformation() {
+		this.informations++;
+	}
+
+	/**
+	 */
+	public void addWarning() {
+		this.warnings++;
+	}
+
+	/**
+	 */
+	public int getErrors() {
+		return this.errors;
+	}
+
+	/**
+	 */
+	public int getInformations() {
+		return this.informations;
+	}
+
+	/**
+	 */
+	public int getWarnings() {
+		return this.warnings;
+	}
+
+	/**
+	 */
+	public boolean isValid() {
+		return (this.errors == 0 && this.warnings == 0 && this.informations == 0);
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationWorkbenchHelper.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationWorkbenchHelper.java
new file mode 100644
index 0000000..90bfde5
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationWorkbenchHelper.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.internal.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.wst.validation.internal.operations.WorkbenchContext;
+
+public class HTMLValidationWorkbenchHelper extends WorkbenchContext {
+	/**
+	 */
+	public HTMLValidationWorkbenchHelper() {
+		super();
+	}
+
+	/**
+	 * When an IValidator associates a target object with an IMessage, the
+	 * WorkbenchReporter eventually resolves that target object with an
+	 * IResource. Sometimes more than one target object resolves to the same
+	 * IResource (usually the IProject, which is the default IResource when an
+	 * IFile cannot be found). This method is called, by the
+	 * WorkbenchReporter, so that the WorkbenchReporter can distinguish
+	 * between the IMessages which are on the same IResource, but refer to
+	 * different target objects. This is needed for the
+	 * removeAllMessages(IValidator, Object) method, so that when one target
+	 * object removes all of its messages, that it doesn't remove another
+	 * target object's messages.
+	 * 
+	 * This method may return null only if object is null. Otherwise, an id
+	 * which can uniquely identify a particular object must be returned. The
+	 * id needs to be unique only within one particular IValidator.
+	 */
+	public String getTargetObjectName(Object object) {
+		if (object == null)
+			return null;
+		if (object instanceof IFile)
+			return getPortableName((IFile) object);
+		return object.toString();
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java
new file mode 100644
index 0000000..dfbf27c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java
@@ -0,0 +1,560 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.internal.validation;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.filebuffers.ITextFileBuffer;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.core.runtime.content.IContentTypeManager;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeConstants;
+import org.eclipse.wst.html.core.internal.validate.HTMLValidationAdapterFactory;
+import org.eclipse.wst.html.ui.internal.Logger;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.util.URIResolver;
+import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
+import org.eclipse.wst.validation.AbstractValidator;
+import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
+import org.eclipse.wst.validation.internal.core.Message;
+import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
+import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
+import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.w3c.dom.Text;
+
+public class HTMLValidator extends AbstractValidator implements IValidatorJob, ISourceValidator, IExecutableExtension {
+	private static final String ORG_ECLIPSE_WST_HTML_CORE_HTMLSOURCE = "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
+
+	static boolean shouldValidate(IFile file) {
+		IResource resource = file;
+		do {
+			if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || (resource.getName().charAt(0) == '.' && resource.getType() == IResource.FOLDER)) {
+				return false;
+			}
+			resource = resource.getParent();
+		}
+		while ((resource.getType() & IResource.PROJECT) == 0);
+		return true;
+	}
+
+	private IDocument fDocument;
+	private IContentTypeManager fContentTypeManager;
+	private IContentType[] fOtherSupportedContentTypes = null;
+	private String[] fAdditionalContentTypesIDs = null;
+	private IContentType fHTMLContentType;
+
+	public HTMLValidator() {
+		super();
+		fContentTypeManager = Platform.getContentTypeManager();
+		fHTMLContentType = fContentTypeManager.getContentType(ORG_ECLIPSE_WST_HTML_CORE_HTMLSOURCE);
+	}
+
+	/**
+	 */
+	public void cleanup(IReporter reporter) {
+		// nothing to do
+	}
+
+	/**
+	 * Gets list of content types this validator is interested in
+	 * 
+	 * @return All HTML-related content types
+	 */
+	private IContentType[] getOtherSupportedContentTypes() {
+		if (fOtherSupportedContentTypes == null) {
+			List contentTypes = new ArrayList(3);
+			if (fAdditionalContentTypesIDs != null) {
+				for (int i = 0; i < fAdditionalContentTypesIDs.length; i++) {
+					IContentType type = Platform.getContentTypeManager().getContentType(fAdditionalContentTypesIDs[i]);
+					if (type != null) {
+						contentTypes.add(type);
+					}
+				}
+			}
+			fOtherSupportedContentTypes = (IContentType[]) contentTypes.toArray(new IContentType[contentTypes.size()]);
+		}
+		return fOtherSupportedContentTypes;
+	}
+
+
+	/**
+	 */
+	protected IDOMModel getModel(IProject project, IFile file) {
+		if (project == null || file == null)
+			return null;
+		if (!file.exists())
+			return null;
+		if (!canHandle(file))
+			return null;
+
+		IStructuredModel model = null;
+		IModelManager manager = StructuredModelManager.getModelManager();
+		try {
+			file.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
+		}
+		catch (CoreException e) {
+			Logger.logException(e);
+		}
+		try {
+			try {
+				model = manager.getModelForRead(file);
+			}
+			catch (UnsupportedEncodingException ex) {
+				// retry ignoring META charset for invalid META charset
+				// specification
+				// recreate input stream, because it is already partially read
+				model = manager.getModelForRead(file, new String(), null);
+			}
+		}
+		catch (UnsupportedEncodingException ex) {
+		}
+		catch (IOException ex) {
+		}
+		catch (CoreException e) {
+			Logger.logException(e);
+		}
+
+		if (model == null)
+			return null;
+		if (!(model instanceof IDOMModel)) {
+			releaseModel(model);
+			return null;
+		}
+		return (IDOMModel) model;
+	}
+
+	/**
+	 */
+	protected HTMLValidationReporter getReporter(IReporter reporter, IFile file, IDOMModel model) {
+		return new HTMLValidationReporter(this, reporter, file, model);
+	}
+
+	/**
+	 * Check file extension to validate
+	 */
+	private boolean canHandle(IFile file) {
+		boolean result = false;
+		if (file != null) {
+			try {
+				IContentDescription contentDescription = file.getContentDescription();
+				if (contentDescription != null) {
+					IContentType fileContentType = contentDescription.getContentType();
+					if (fileContentType.isKindOf(fHTMLContentType)) {
+						result = true;
+					}
+					else {
+						IContentType[] otherTypes = getOtherSupportedContentTypes();
+						for (int i = 0; i < otherTypes.length; i++) {
+							result = result || fileContentType.isKindOf(otherTypes[i]);
+						}
+					}
+				}
+				else if (fHTMLContentType != null) {
+					result = fHTMLContentType.isAssociatedWith(file.getName());
+				}
+			}
+			catch (CoreException e) {
+				// should be rare, but will ignore to avoid logging "encoding
+				// exceptions" and the like here.
+				// Logger.logException(e);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 */
+	private boolean hasHTMLFeature(IDOMDocument document) {
+		DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
+		if (adapter == null)
+			return false;
+		return adapter.hasFeature(HTMLDocumentTypeConstants.HTML);
+	}
+
+	/**
+	 */
+	protected void releaseModel(IStructuredModel model) {
+		if (model != null)
+			model.releaseFromRead();
+	}
+
+	/**
+	 */
+	public void validate(IValidationContext helper, IReporter reporter) {
+		if (helper == null)
+			return;
+		if ((reporter != null) && (reporter.isCancelled() == true)) {
+			throw new OperationCanceledException();
+		}
+		String[] deltaArray = helper.getURIs();
+		if (deltaArray != null && deltaArray.length > 0) {
+			validateDelta(helper, reporter);
+		}
+		else {
+			validateFull(helper, reporter);
+		}
+	}
+
+	/**
+	 * This validate call is for the ISourceValidator partial document
+	 * validation approach
+	 * 
+	 * @param dirtyRegion
+	 * @param helper
+	 * @param reporter
+	 * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
+	 */
+	public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
+
+		if (helper == null || fDocument == null)
+			return;
+
+		if ((reporter != null) && (reporter.isCancelled() == true)) {
+			throw new OperationCanceledException();
+		}
+
+		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
+		if (model == null)
+			return; // error
+
+		try {
+
+			IDOMDocument document = null;
+			if (model instanceof IDOMModel) {
+				document = ((IDOMModel) model).getDocument();
+			}
+
+			if (document == null || !hasHTMLFeature(document)) {
+				// handled in finally clause
+				// model.releaseFromRead();
+				return; //ignore
+			}
+			
+			IPath filePath = null;
+			IFile file = null;
+
+			ITextFileBuffer fb = FileBufferModelManager.getInstance().getBuffer(fDocument);
+			if (fb != null) {
+				filePath = fb.getLocation();
+
+				if (filePath.segmentCount() > 1) {
+					file = ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
+					if (!file.isAccessible()) {
+						file = null;
+					}
+				}
+			}
+			else {
+				filePath = new Path(model.getId());
+			}
+
+			// this will be the wrong region if it's Text (instead of Element)
+			// we don't know how to validate Text
+			IndexedRegion ir = getCoveringNode(dirtyRegion); //  model.getIndexedRegion(dirtyRegion.getOffset());
+			if (ir instanceof Text) {
+				while (ir != null && ir instanceof Text) {
+					// it's assumed that this gets the IndexedRegion to
+					// the right of the end offset
+					ir = model.getIndexedRegion(ir.getEndOffset());
+				}
+			}
+			
+			if (ir instanceof INodeNotifier) {
+
+				INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
+				ValidationAdapter adapter = (ValidationAdapter) factory.adapt((INodeNotifier) ir);
+				if (adapter == null)
+					return; // error
+
+				if (reporter != null) {
+					HTMLValidationReporter rep = null;
+					rep = getReporter(reporter, file, (IDOMModel) model);
+					rep.clear();
+					adapter.setReporter(rep);
+
+					Message mess = new LocalizedMessage(IMessage.LOW_SEVERITY, filePath.toString().substring(1));
+					reporter.displaySubtask(this, mess);
+				}
+				adapter.validate(ir);
+			}
+		}
+		finally {
+			if (model != null)
+				model.releaseFromRead();
+		}
+	}
+
+	private IndexedRegion getCoveringNode(IRegion dirtyRegion) {
+		
+		IndexedRegion largestRegion = null;
+		if(fDocument instanceof IStructuredDocument) {
+			IStructuredDocumentRegion[] regions = ((IStructuredDocument) fDocument).getStructuredDocumentRegions(dirtyRegion.getOffset(), dirtyRegion.getLength());
+			largestRegion = getLargest(regions);
+		}
+		return largestRegion;
+	}
+	protected IndexedRegion getLargest(IStructuredDocumentRegion[] sdRegions) {
+		
+		if(sdRegions == null || sdRegions.length == 0)
+			return null;
+		 
+		IndexedRegion currentLargest = getCorrespondingNode(sdRegions[0]);
+		for (int i = 0; i < sdRegions.length; i++) {
+		    if(!sdRegions[i].isDeleted()) {
+    			IndexedRegion corresponding = getCorrespondingNode(sdRegions[i]);
+    			
+    			if(currentLargest instanceof Text)
+    				currentLargest = corresponding;
+    			
+                if(corresponding != null) {
+                	if(!(corresponding instanceof Text)) {
+	        			if (corresponding.getStartOffset() <= currentLargest.getStartOffset()  
+	        						&&  corresponding.getEndOffset() >= currentLargest.getEndOffset() )
+	        				currentLargest = corresponding;
+                	}
+                }
+                
+            }
+		}
+		return currentLargest;
+	}
+	protected IndexedRegion getCorrespondingNode(IStructuredDocumentRegion sdRegion) {
+		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
+        IndexedRegion indexedRegion = null;
+        try {
+            if (sModel != null) 
+                indexedRegion = sModel.getIndexedRegion(sdRegion.getStart());    
+        } finally {
+            if (sModel != null)
+                sModel.releaseFromRead();
+        }
+        return indexedRegion;
+    }
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
+	 */
+	public void connect(IDocument document) {
+		fDocument = document;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
+	 */
+	public void disconnect(IDocument document) {
+		fDocument = null;
+	}
+
+	/**
+	 */
+	protected HTMLValidationResult validate(IDOMModel model, IFile file) {
+		IProject prj = null;
+		if (file != null) {
+			prj = file.getProject();
+		}
+		if ((prj == null) && (model != null)) {
+			URIResolver res = model.getResolver();
+			if (res != null) {
+				prj = res.getProject();
+			}
+		}
+		final WorkbenchReporter reporter = new WorkbenchReporter(prj, new NullProgressMonitor());
+		return validate(reporter, file, model);
+	}
+
+	/**
+	 */
+	private HTMLValidationResult validate(IReporter reporter, IFile file, IDOMModel model) {
+		if (file == null || model == null)
+			return null; // error
+		IDOMDocument document = model.getDocument();
+		if (document == null)
+			return null; // error
+		if (!hasHTMLFeature(document))
+			return null; // ignore
+
+		INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
+		ValidationAdapter adapter = (ValidationAdapter) factory.adapt(document);
+		if (adapter == null)
+			return null; // error
+
+		HTMLValidationReporter rep = getReporter(reporter, file, model);
+		rep.clear();
+		adapter.setReporter(rep);
+		adapter.validate(document);
+		return rep.getResult();
+	}
+
+	/**
+	 */
+	private void validateContainer(IValidationContext helper, IReporter reporter, IContainer container) {
+		try {
+			IResource[] resourceArray = container.members(false);
+			for (int i = 0; i < resourceArray.length; i++) {
+				IResource resource = resourceArray[i];
+				if (resource == null || reporter.isCancelled())
+					continue;
+				if (resource instanceof IFile) {
+					Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, resource.getFullPath().toString().substring(1));
+					reporter.displaySubtask(this, message);
+					validateFile(helper, reporter, (IFile) resource);
+				}
+				else if (resource instanceof IContainer) {
+					validateContainer(helper, reporter, (IContainer) resource);
+				}
+			}
+		}
+		catch (CoreException ex) {
+		}
+	}
+
+	/**
+	 */
+	private void validateDelta(IValidationContext helper, IReporter reporter) {
+		String[] deltaArray = helper.getURIs();
+		for (int i = 0; i < deltaArray.length; i++) {
+			String delta = deltaArray[i];
+			if (delta == null)
+				continue;
+
+			if (reporter != null) {
+				Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, delta.substring(1));
+				reporter.displaySubtask(this, message);
+			}
+
+			IResource resource = getResource(delta);
+			if (resource == null || !(resource instanceof IFile))
+				continue;
+			validateFile(helper, reporter, (IFile) resource);
+		}
+	}
+
+	/**
+	 */
+	private void validateFile(IValidationContext helper, IReporter reporter, IFile file) {
+		if ((reporter != null) && (reporter.isCancelled() == true)) {
+			throw new OperationCanceledException();
+		}
+		if (!shouldValidate(file)) {
+			return;
+		}
+		IDOMModel model = getModel(file.getProject(), file);
+		if (model == null)
+			return;
+
+		try {
+			validate(reporter, file, model);
+		}
+		finally {
+			releaseModel(model);
+		}
+	}
+
+	/**
+	 */
+	private void validateFull(IValidationContext helper, IReporter reporter) {
+		IProject project = null;
+		String[] fileDelta = helper.getURIs();
+		if (helper instanceof IWorkbenchContext) {
+			IWorkbenchContext wbHelper = (IWorkbenchContext) helper;
+			project = wbHelper.getProject();
+		}
+		else if(fileDelta.length > 0){
+			// won't work for project validation (b/c nothing in file delta)
+			project = getResource(fileDelta[0]).getProject();
+		}
+		if (project == null)
+			return;
+		validateContainer(helper, reporter, project);
+	}
+
+	/*
+	 * added to get rid or dependency on IWorkbenchHelper
+	 * 
+	 */
+	public IResource getResource(String delta) {
+		return ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(delta));
+	}
+
+	public ISchedulingRule getSchedulingRule(IValidationContext helper) {
+		return null;
+	}
+
+	public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException {
+		// Exception catching was removed, see
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=123600
+		IStatus status = Status.OK_STATUS;
+		validate(helper, reporter);
+		return status;
+	}
+	
+	/**
+	 * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement,
+	 *      java.lang.String, java.lang.Object)
+	 */
+	public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+		fAdditionalContentTypesIDs = new String[0];
+		if (data != null) {
+			if (data instanceof String && data.toString().length() > 0) {
+				fAdditionalContentTypesIDs = StringUtils.unpack(data.toString());
+			}
+		}
+	}
+
+	public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
+		if (resource.getType() != IResource.FILE)
+			return null;
+		ValidationResult result = new ValidationResult();
+		IReporter reporter = result.getReporter(monitor);
+		validateFile(null, reporter, (IFile) resource);
+		return result;
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/LocalizedMessage.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/LocalizedMessage.java
new file mode 100644
index 0000000..1e38729
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/LocalizedMessage.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.internal.validation;
+
+import java.util.Locale;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.wst.validation.internal.core.Message;
+
+/**
+ * copied from org.eclipse.wst.validation.internal.operations.LocalizedMessage
+ * 
+ * This class is provided for validators which run only in Eclipse and whose messages, because they
+ * come from another tool, are already localized. LocalizedMessage cannot be used by any validator
+ * which needs to run in both WebSphere and Eclipse.
+ */
+public class LocalizedMessage extends Message {
+	private String _message = null;
+
+	public LocalizedMessage(int severity, String messageText) {
+		this(severity, messageText, null);
+	}
+
+	public LocalizedMessage(int severity, String messageText, IResource targetObject) {
+		this(severity, messageText, (Object) targetObject);
+	}
+
+	public LocalizedMessage(int severity, String messageText, Object targetObject) {
+		super(null, severity, null);
+		setLocalizedMessage(messageText);
+		setTargetObject(targetObject);
+	}
+
+	public void setLocalizedMessage(String message) {
+		_message = message;
+	}
+
+	public String getLocalizedMessage() {
+		return _message;
+	}
+
+	public String getText() {
+		return getLocalizedMessage();
+	}
+
+	public String getText(ClassLoader cl) {
+		return getLocalizedMessage();
+	}
+
+	public String getText(Locale l) {
+		return getLocalizedMessage();
+	}
+
+	public String getText(Locale l, ClassLoader cl) {
+		return getLocalizedMessage();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListHelper.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListHelper.java
new file mode 100644
index 0000000..71ede2d
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListHelper.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.internal.validation;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * 
+ * Class to help this Problem's list.
+ * 
+ */
+class TaskListHelper {
+	private static TaskListHelper _taskListHelper = null;
+
+	public static TaskListHelper getTaskList() {
+		if (_taskListHelper == null) {
+			_taskListHelper = new TaskListHelper();
+		}
+		return _taskListHelper;
+	}
+
+	/**
+	 * This method adds a message to a resource in the task list.
+	 */
+	public void addTask(String pluginId, IResource resource, String location, String messageId, String message, int markerType, String targetObjectName, String groupName, int offset, int length) throws CoreException {
+		TaskListUtility.addTask(pluginId, resource, location, messageId, message, markerType, targetObjectName, groupName, offset, length);
+	}
+
+	/**
+	 * This method removes all messages from a resource in the task list.
+	 */
+	public void removeAllTasks(IResource resource, String owner, String objectName) throws CoreException {
+		TaskListUtility.removeAllTasks(resource, owner, objectName);
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListUtility.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListUtility.java
new file mode 100644
index 0000000..3de0a92
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListUtility.java
@@ -0,0 +1,436 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.internal.validation;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+
+/**
+ * This class must be called only by the validation framework.
+ * 
+ * This singleton interacts with the eclipse workbench's Task list.
+ * TaskListUtility adds and removes tasks from the list.
+ * 
+ * This class must not be called outside of an IWorkspaceRunnable or
+ * IRunnableWithProgress. Many resource deltas can be generated by the methods
+ * in this class.
+ * 
+ * This came from TaskListUtility
+ */
+public class TaskListUtility {
+	// private static final String PLUGIN_ID = ValidationPlugin.PLUGIN_ID;
+	private static final String PLUGIN_ID = HTMLUIPlugin.ID;
+	private static final String VALIDATION_MARKER = PLUGIN_ID + ".problemmarker"; //$NON-NLS-1$ // The extension which is used to add validation markers to the task list
+	private static final String VALIDATION_MARKER_OWNER = "owner"; //$NON-NLS-1$ // The IValidator who owns the IMarker on the task list
+	private static final String VALIDATION_MARKER_SEVERITY = "validationSeverity"; //$NON-NLS-1$ // one of the IMessage values
+	private static final String VALIDATION_MARKER_TARGETOBJECT = "targetObject"; //$NON-NLS-1$ // When more than one target object resolves to the same IResource, this field identifies which targetObject owns a particular message.
+	private static final String VALIDATION_MARKER_GROUP = "groupName"; //$NON-NLS-1$ // For incremental validation, this field associates a message with a group, so that a subset of messages may be removed from a file.
+	private static final String VALIDATION_MARKER_MESSAGEID = "messageId"; //$NON-NLS-1$ // Persist the message id of the message, not just the translated text.
+	private static final int DEPTH_INFINITE = IResource.DEPTH_INFINITE;
+	private static final int DEPTH_ZERO = IResource.DEPTH_ZERO;
+	private final static IMarker[] NO_MARKERS = new IMarker[0];
+
+	/**
+	 * This method adds a message to a resource in the task list.
+	 */
+	public static IMarker addTask(String pluginId, IResource resource, String location, String messageId, String message, int markerType, String targetObjectName, String groupName, int offset, int length) throws CoreException {
+		if ((message == null) || (resource == null)) {
+			return null;
+		}
+
+		int severity = getSeverity(markerType);
+
+		// Allow duplicate entries in the task list.
+		// Prior to a full validation, the validation framework will remove
+		// all messages owned
+		// by a validator before it is executed.
+		// Prior to an incremental validation, the validation framework will
+		// remove all messages,
+		// on each of the changed resources, owned by a validator before it is
+		// invoked.
+		// 
+		// It is up to the validator to make sure that it is not adding the
+		// same message
+		// in more than one place, and also to clear out any old messages
+		// which are not cleared
+		// by the validation framework.
+		IMarker item = resource.createMarker(VALIDATION_MARKER); // add a
+																	// validation
+																	// marker
+
+		// For performance reasons, replace the multiple setAttribute
+		// calls above with a single setAttributes call.
+		boolean offsetSet = ((offset != IMessage.OFFSET_UNSET) && (length != IMessage.OFFSET_UNSET));
+		int size = (offsetSet) ? 10 : 8; // add CHAR_START, CHAR_END only
+											// if the offset is set. If the
+											// offset is set, it takes
+											// precendence over the line
+											// number. (eclipse's rule, not
+											// mine.)
+		String[] attribNames = new String[size];
+		Object[] attribValues = new Object[size];
+
+		// Very first thing, add the owner. That way, if the code dies
+		// before things are persisted, hopefully this marker will be
+		// persisted.
+		// Hopefully, eclipse WILL persist this field, as requested.
+		attribNames[0] = VALIDATION_MARKER_OWNER;
+		attribValues[0] = pluginId;
+		attribNames[1] = VALIDATION_MARKER_SEVERITY; // this validation
+														// severity is stored,
+														// in addition to the
+														// marker severity, to
+														// enable more than
+														// one severity of
+														// message to be
+														// displayed. e.g.
+														// ERROR | WARNING
+														// (using binary OR).
+														// The IMarker
+														// constants are
+														// regular decimal
+														// constants.
+		attribValues[1] = new Integer(markerType);
+		attribNames[2] = VALIDATION_MARKER_TARGETOBJECT; // to distinguish
+															// between
+															// messages which
+															// are registered
+															// on an
+															// IResource, but
+															// against
+															// different
+															// target objects
+		attribValues[2] = ((targetObjectName == null) ? "" : targetObjectName); //$NON-NLS-1$
+		attribNames[3] = VALIDATION_MARKER_GROUP;
+		attribValues[3] = ((groupName == null) ? "" : groupName); //$NON-NLS-1$
+		attribNames[4] = IMarker.MESSAGE;
+		attribValues[4] = message;
+		attribNames[5] = VALIDATION_MARKER_MESSAGEID;
+		attribValues[5] = messageId;
+
+		attribNames[6] = IMarker.SEVERITY; // IMarker.SEVERITY_ERROR,
+											// IMarker.SEVERITY_WARNING,
+											// IMarker.SEVERITY_INFO
+		attribValues[6] = new Integer(severity);
+		try {
+			// If the location is a line number, store it as a line number
+			Integer lineNumber = Integer.valueOf(location);
+			attribNames[7] = IMarker.LINE_NUMBER;
+			attribValues[7] = lineNumber;
+		}
+		catch (NumberFormatException exc) {
+			// Otherwise, store it as a text location
+			attribNames[7] = IMarker.LOCATION;
+			attribValues[7] = location;
+		}
+
+		if (offsetSet) {
+			attribNames[8] = IMarker.CHAR_START;
+			attribValues[8] = new Integer(offset);
+			attribNames[9] = IMarker.CHAR_END;
+			attribValues[9] = new Integer(offset + length);
+		}
+
+		item.setAttributes(attribNames, attribValues);
+
+		return item;
+	}
+
+	/**
+	 * Given one of the SeverityEnum severities, return the IMarker severity
+	 * int that is its equivalent.
+	 */
+	private static int getSeverity(int severityEnumValue) {
+		switch (severityEnumValue) {
+			case (IMessage.HIGH_SEVERITY) : {
+				return IMarker.SEVERITY_ERROR;
+			}
+
+			case (IMessage.LOW_SEVERITY) : {
+				return IMarker.SEVERITY_INFO;
+			}
+
+			case (IMessage.NORMAL_SEVERITY) : {
+				return IMarker.SEVERITY_WARNING;
+			}
+
+			case (IMessage.ALL_MESSAGES) :
+			case (IMessage.ERROR_AND_WARNING) :
+			default : {
+				// assume it's a warning.
+				return IMarker.SEVERITY_WARNING;
+			}
+		}
+	}
+
+	private static int getDepth(IResource resource) {
+		if (resource instanceof IProject) {
+			return DEPTH_INFINITE; // DEPTH_INFINITE means get this project's
+									// markers, and the markers belonging to
+									// the project's children.
+		}
+		else if (resource instanceof IWorkspaceRoot) {
+			// Needed for the ValidationMigrator when it checks for orphan
+			// tasks.
+			return DEPTH_INFINITE; // DEPTH_INFINITE means get all of the
+									// markers in the workspace
+		}
+
+		return DEPTH_ZERO; // DEPTH_ZERO means just this resource, not its
+							// children
+	}
+
+	private static IMarker[] getValidationTasks(IResource resource, int severity, int depth) {
+		IMarker[] tempMarkers = null;
+		int validCount = 0;
+		try {
+			IMarker[] allMarkers = null;
+			try {
+				allMarkers = resource.findMarkers(VALIDATION_MARKER, false, depth); // false
+																					// means
+																					// only
+																					// consider
+																					// PROBLEM_MARKER,
+																					// not
+																					// variants
+																					// of
+																					// PROBLEM_MARKER.
+																					// Since
+																					// addTask
+																					// only
+																					// adds
+																					// PROBLEM_MARKER,
+																					// we
+																					// don't
+																					// need
+																					// to
+																					// consider
+																					// its
+																					// subtypes.
+			}
+			catch (CoreException exc) {
+				// Logger logger =
+				// ValidationPlugin.getPlugin().getMsgLogger();
+				// if (logger.isLoggingLevel(Level.SEVERE)) {
+				// LogEntry entry = ValidationPlugin.getLogEntry();
+				// entry.setSourceID("TaskListUtility.getValidationTasks(IResource,
+				// int)"); //$NON-NLS-1$
+				// entry.setTargetException(exc);
+				// logger.write(Level.SEVERE, entry);
+				// }
+				return NO_MARKERS;
+			}
+
+			// Now filter in the markers, based on severity type.
+			if (allMarkers.length != 0) {
+				tempMarkers = new IMarker[allMarkers.length];
+				for (int i = 0; i < allMarkers.length; i++) {
+					IMarker marker = allMarkers[i];
+					Integer filterSeverity = (Integer) marker.getAttribute(VALIDATION_MARKER_SEVERITY);
+					if (filterSeverity == null) {
+						// odd...marker wasn't created correctly. How could
+						// this happen?
+						// Default to the current severity and add it to the
+						// list.
+						try {
+							marker.setAttribute(IMarker.SEVERITY, getSeverity(severity));
+						}
+						catch (CoreException exc) {
+							// Logger logger =
+							// ValidationPlugin.getPlugin().getMsgLogger();
+							// if (logger.isLoggingLevel(Level.SEVERE)) {
+							// LogEntry entry =
+							// ValidationPlugin.getLogEntry();
+							// entry.setSourceID("TaskListUtility.getValidationTasks(int,
+							// IResource, int)"); //$NON-NLS-1$
+							// entry.setTargetException(exc);
+							// logger.write(Level.SEVERE, entry);
+							// }
+							continue;
+						}
+						catch (Exception exc) {
+							// Logger logger =
+							// ValidationPlugin.getPlugin().getMsgLogger();
+							// if (logger.isLoggingLevel(Level.SEVERE)) {
+							// LogEntry entry =
+							// ValidationPlugin.getLogEntry();
+							// entry.setSourceID("TaskListUtility.getValidationTasks(int,
+							// IResource, int)"); //$NON-NLS-1$
+							// entry.setTargetException(exc);
+							// logger.write(Level.SEVERE, entry);
+							// }
+							continue;
+						}
+					}
+					else if ((severity & filterSeverity.intValue()) == 0) {
+						continue;
+					}
+					tempMarkers[validCount++] = marker;
+				}
+			}
+		}
+		catch (CoreException exc) {
+			// Logger logger = ValidationPlugin.getPlugin().getMsgLogger();
+			// if (logger.isLoggingLevel(Level.SEVERE)) {
+			// LogEntry entry = ValidationPlugin.getLogEntry();
+			// entry.setSourceID("TaskListUtility.getValidationTasks(int,
+			// IResource, int)"); //$NON-NLS-1$
+			// entry.setTargetException(exc);
+			// logger.write(Level.SEVERE, entry);
+			// }
+		}
+
+		if (validCount == 0) {
+			return NO_MARKERS;
+		}
+
+		IMarker[] validMarkers = new IMarker[validCount];
+		System.arraycopy(tempMarkers, 0, validMarkers, 0, validCount);
+		return validMarkers;
+	}
+
+	private static IMarker[] getValidationTasks(IResource resource, String[] messageOwners, int depth) {
+		IMarker[] markers = getValidationTasks(resource, IMessage.ALL_MESSAGES, depth);
+		if (markers.length == 0) {
+			return NO_MARKERS;
+		}
+
+		IMarker[] temp = new IMarker[markers.length];
+		int validCount = 0;
+		for (int i = 0; i < markers.length; i++) {
+			IMarker marker = markers[i];
+
+			try {
+				Object owner = marker.getAttribute(VALIDATION_MARKER_OWNER);
+				if ((owner == null) || !(owner instanceof String)) {
+					// The ValidationMigrator will remove any "unowned"
+					// validation markers.
+					continue;
+				}
+
+				for (int j = 0; j < messageOwners.length; j++) {
+					String messageOwner = messageOwners[j];
+					if (((String) owner).equals(messageOwner)) {
+						temp[validCount++] = marker;
+						break;
+					}
+				}
+			}
+			catch (CoreException exc) {
+				// Logger logger =
+				// ValidationPlugin.getPlugin().getMsgLogger();
+				// if (logger.isLoggingLevel(Level.SEVERE)) {
+				// LogEntry entry = ValidationPlugin.getLogEntry();
+				// entry.setSourceID("TaskListUtility.getValidationTasks(project,
+				// String[])"); //$NON-NLS-1$
+				// entry.setTargetException(exc);
+				// logger.write(Level.SEVERE, entry);
+				// }
+				return NO_MARKERS;
+			}
+		}
+
+		IMarker[] result = new IMarker[validCount];
+		System.arraycopy(temp, 0, result, 0, validCount);
+		return result;
+	}
+
+	/**
+	 * This method retrieves all validation tasks from the resource. If depth
+	 * is INFINITE, child tasks are returned as well. Only the tasks which are
+	 * owned by the specified messageOwner, and apply to the named IMessage's
+	 * target object (objectName) will be returned.
+	 */
+	private static IMarker[] getValidationTasks(IResource resource, String[] messageOwner, String objectName, String groupName, int depth) throws CoreException {
+		if ((messageOwner == null) || (resource == null)) {
+			return NO_MARKERS;
+		}
+
+		int validCount = 0;
+		IMarker[] validList = null;
+		IMarker[] markers = getValidationTasks(resource, messageOwner, depth);
+		if (markers != null) {
+			validList = new IMarker[markers.length];
+			for (int i = 0; i < markers.length; i++) {
+				IMarker marker = markers[i];
+
+				// If more than one target object resolves to the same
+				// resource, removing one target's
+				// messages should not remove the other target object's
+				// messages.
+				if (objectName != null) {
+					Object targetObject = marker.getAttribute(VALIDATION_MARKER_TARGETOBJECT);
+					if ((targetObject == null) || !(targetObject instanceof String) || !(((String) targetObject).equals(objectName))) {
+						continue;
+					}
+				}
+
+				if (groupName != null) {
+					Object group = marker.getAttribute(VALIDATION_MARKER_GROUP);
+					if ((group == null) || !(group instanceof String) || !(((String) group).equals(groupName))) {
+						continue;
+					}
+				}
+
+				validList[validCount++] = marker;
+			}
+		}
+
+		if (validCount == 0) {
+			return NO_MARKERS;
+		}
+
+		IMarker[] result = new IMarker[validCount];
+		System.arraycopy(validList, 0, result, 0, validCount);
+		return result;
+	}
+
+	/**
+	 * This method removes all messages from a resource in the task list.
+	 */
+	public static void removeAllTasks(IResource resource, String owner, String objectName) throws CoreException {
+		removeAllTasks(resource, new String[]{owner}, objectName);
+	}
+
+	public static void removeAllTasks(IResource resource, String[] owners, String objectName) throws CoreException {
+		removeAllTasks(resource, owners, objectName, getDepth(resource));
+	}
+
+	protected static void removeAllTasks(IResource resource, String[] owners, String objectName, int depth) throws CoreException {
+		removeTaskSubset(resource, owners, objectName, null, depth); // null
+																		// means
+																		// no
+																		// group
+																		// name
+	}
+
+	/**
+	 * This method removes a subset of tasks from the project, including child
+	 * tasks. Every task which belongs to the group, identified by groupName,
+	 * will be removed.
+	 */
+	protected static void removeTaskSubset(IResource resource, String[] owners, String objectName, String groupName, int depth) throws CoreException {
+		if ((owners == null) || (resource == null)) {
+			return;
+		}
+
+		IMarker[] allTasks = getValidationTasks(resource, owners, objectName, groupName, depth);
+		if (allTasks.length > 0) {
+			ResourcesPlugin.getWorkspace().deleteMarkers(allTasks);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
new file mode 100644
index 0000000..a38409f
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
@@ -0,0 +1,269 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.ITextDoubleClickStrategy;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.formatter.IContentFormatter;
+import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.wst.css.core.text.ICSSPartitions;
+import org.eclipse.wst.css.ui.internal.style.LineStyleProviderForEmbeddedCSS;
+import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
+import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
+import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
+import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
+import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML;
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.ui.internal.autoedit.AutoEditStrategyForTabs;
+import org.eclipse.wst.html.ui.internal.contentassist.HTMLStructuredContentAssistProcessor;
+import org.eclipse.wst.html.ui.internal.style.LineStyleProviderForHTML;
+import org.eclipse.wst.sse.core.text.IStructuredPartitions;
+import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
+import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
+import org.eclipse.wst.xml.core.text.IXMLPartitions;
+import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
+
+/**
+ * Configuration for a source viewer which shows HTML content.
+ * <p>
+ * Clients can subclass and override just those methods which must be specific
+ * to their needs.
+ * </p>
+ * 
+ * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration
+ * @since 1.0
+ */
+public class StructuredTextViewerConfigurationHTML extends StructuredTextViewerConfiguration {
+	/*
+	 * One instance per configuration because not sourceviewer-specific and
+	 * it's a String array
+	 */
+	private String[] fConfiguredContentTypes;
+	/*
+	 * One instance per configuration
+	 */
+	private LineStyleProvider fLineStyleProviderForEmbeddedCSS;
+	/*
+	 * One instance per configuration
+	 */
+	private LineStyleProvider fLineStyleProviderForHTML;
+	/*
+	 * One instance per configuration
+	 */
+	private StructuredTextViewerConfiguration fXMLSourceViewerConfiguration;
+	private ILabelProvider fStatusLineLabelProvider;
+
+	/**
+	 * Create new instance of StructuredTextViewerConfigurationHTML
+	 */
+	public StructuredTextViewerConfigurationHTML() {
+		// Must have empty constructor to createExecutableExtension
+		super();
+	}
+
+	public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
+		List allStrategies = new ArrayList(0);
+
+		IAutoEditStrategy[] superStrategies = super.getAutoEditStrategies(sourceViewer, contentType);
+		for (int i = 0; i < superStrategies.length; i++) {
+			allStrategies.add(superStrategies[i]);
+		}
+
+		// be sure this is added last in list, so it has a change to modify
+		// previous results.
+		// add auto edit strategy that handles when tab key is pressed
+		allStrategies.add(new AutoEditStrategyForTabs());
+
+		return (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
+	}
+
+	public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+		if (fConfiguredContentTypes == null) {
+			String[] xmlTypes = StructuredTextPartitionerForXML.getConfiguredContentTypes();
+			String[] htmlTypes = StructuredTextPartitionerForHTML.getConfiguredContentTypes();
+			fConfiguredContentTypes = new String[2 + xmlTypes.length + htmlTypes.length];
+
+			fConfiguredContentTypes[0] = IStructuredPartitions.DEFAULT_PARTITION;
+			fConfiguredContentTypes[1] = IStructuredPartitions.UNKNOWN_PARTITION;
+
+			int index = 0;
+			System.arraycopy(xmlTypes, 0, fConfiguredContentTypes, index += 2, xmlTypes.length);
+			System.arraycopy(htmlTypes, 0, fConfiguredContentTypes, index += xmlTypes.length, htmlTypes.length);
+		}
+
+		return fConfiguredContentTypes;
+	}
+
+	protected IContentAssistProcessor[] getContentAssistProcessors(
+			ISourceViewer sourceViewer, String partitionType) {
+		
+		IContentAssistProcessor processor = new HTMLStructuredContentAssistProcessor(
+				this.getContentAssistant(), partitionType, sourceViewer);
+		return new IContentAssistProcessor[]{processor};
+	}
+
+	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
+		IContentFormatter formatter = super.getContentFormatter(sourceViewer);
+		// super was unable to create a formatter, probably because
+		// sourceViewer does not have document set yet, so just create a
+		// generic one
+		if (!(formatter instanceof MultiPassContentFormatter))
+			formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IHTMLPartitions.HTML_DEFAULT);
+		((MultiPassContentFormatter) formatter).setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
+
+		return formatter;
+	}
+
+	public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
+		if (contentType == IHTMLPartitions.HTML_DEFAULT) {
+			// use xml's doubleclick strategy
+			return getXMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, IXMLPartitions.XML_DEFAULT);
+		}
+		else
+			return super.getDoubleClickStrategy(sourceViewer, contentType);
+
+	}
+
+	public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
+		Vector vector = new Vector();
+
+		// prefix[0] is either '\t' or ' ' x tabWidth, depending on preference
+		Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
+		int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
+		String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
+		boolean useSpaces = HTMLCorePreferenceNames.SPACE.equals(indentCharPref);
+
+		for (int i = 0; i <= indentationWidth; i++) {
+			StringBuffer prefix = new StringBuffer();
+			boolean appendTab = false;
+
+			if (useSpaces) {
+				for (int j = 0; j + i < indentationWidth; j++)
+					prefix.append(' ');
+
+				if (i != 0)
+					appendTab = true;
+			}
+			else {
+				for (int j = 0; j < i; j++)
+					prefix.append(' ');
+
+				if (i != indentationWidth)
+					appendTab = true;
+			}
+
+			if (appendTab) {
+				prefix.append('\t');
+				vector.add(prefix.toString());
+				// remove the tab so that indentation - tab is also an indent
+				// prefix
+				prefix.deleteCharAt(prefix.length() - 1);
+			}
+			vector.add(prefix.toString());
+		}
+
+		vector.add(""); //$NON-NLS-1$
+
+		return (String[]) vector.toArray(new String[vector.size()]);
+	}
+
+	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
+		LineStyleProvider[] providers = null;
+
+		// workaround IXMLPartitions.XML_PI
+		if (partitionType == IHTMLPartitions.HTML_DEFAULT || partitionType == IHTMLPartitions.HTML_COMMENT || partitionType == IHTMLPartitions.HTML_DECLARATION || partitionType == IXMLPartitions.XML_PI) {
+			providers = new LineStyleProvider[]{getLineStyleProviderForHTML()};
+		}
+		else if (partitionType == ICSSPartitions.STYLE || partitionType == ICSSPartitions.COMMENT) {
+			providers = new LineStyleProvider[]{getLineStyleProviderForEmbeddedCSS()};
+		}
+
+		return providers;
+	}
+
+	private LineStyleProvider getLineStyleProviderForEmbeddedCSS() {
+		if (fLineStyleProviderForEmbeddedCSS == null) {
+			fLineStyleProviderForEmbeddedCSS = new LineStyleProviderForEmbeddedCSS();
+		}
+		return fLineStyleProviderForEmbeddedCSS;
+	}
+
+	private LineStyleProvider getLineStyleProviderForHTML() {
+		if (fLineStyleProviderForHTML == null) {
+			fLineStyleProviderForHTML = new LineStyleProviderForHTML();
+		}
+		return fLineStyleProviderForHTML;
+	}
+
+	public ILabelProvider getStatusLineLabelProvider(ISourceViewer sourceViewer) {
+		if (fStatusLineLabelProvider == null) {
+			fStatusLineLabelProvider = new JFaceNodeLabelProvider() {
+				public String getText(Object element) {
+					if (element == null)
+						return null;
+
+					StringBuffer s = new StringBuffer();
+					Node node = (Node) element;
+					while (node != null) {
+						if (node.getNodeType() != Node.DOCUMENT_NODE) {
+							s.insert(0, super.getText(node));
+						}
+
+						if (node.getNodeType() == Node.ATTRIBUTE_NODE)
+							node = ((Attr) node).getOwnerElement();
+						else
+							node = node.getParentNode();
+					
+						if (node != null && node.getNodeType() != Node.DOCUMENT_NODE) {
+							s.insert(0, IPath.SEPARATOR);
+						}
+					}
+					return s.toString();
+				}
+
+			};
+		}
+		return fStatusLineLabelProvider;
+	}
+
+	private StructuredTextViewerConfiguration getXMLSourceViewerConfiguration() {
+		if (fXMLSourceViewerConfiguration == null) {
+			fXMLSourceViewerConfiguration = new StructuredTextViewerConfigurationXML();
+		}
+		return fXMLSourceViewerConfiguration;
+	}
+
+	protected Map getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
+		Map targets = super.getHyperlinkDetectorTargets(sourceViewer);
+		targets.put(ContentTypeIdForHTML.ContentTypeID_HTML, null);
+
+		// also add xml since there could be xml content in html
+		// (just hope the hyperlink detectors will do additional checking)
+		targets.put(ContentTypeIdForXML.ContentTypeID_XML, null);
+		return targets;
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
new file mode 100644
index 0000000..71f86b4
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
@@ -0,0 +1,208 @@
+/**********************************************************************
+ * Copyright (c) 2005, 2010 IBM Corporation and others. All rights reserved.   This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors: 
+ * IBM - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.wst.html.ui.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Strings used by HTML UI
+ * 
+ * @plannedfor 1.0
+ */
+public class HTMLUIMessages extends NLS {
+	private static final String BUNDLE_NAME = "org.eclipse.wst.html.ui.internal.HTMLUIPluginResources";//$NON-NLS-1$
+	private static ResourceBundle fResourceBundle;
+
+	static {
+		// load message values from bundle file
+		NLS.initializeMessages(BUNDLE_NAME, HTMLUIMessages.class);
+	}
+	
+	private HTMLUIMessages() {
+		// cannot create new instance of this class
+	}
+	
+	public static ResourceBundle getResourceBundle() {
+		try {
+			if (fResourceBundle == null)
+				fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
+		}
+		catch (MissingResourceException x) {
+			fResourceBundle = null;
+		}
+		return fResourceBundle;
+	}
+	
+	public static String Sample_HTML_doc;
+	public static String HTMLFilesPreferencePage_0;
+	public static String _UI_WIZARD_NEW_TITLE;
+	public static String _UI_WIZARD_NEW_HEADING;
+	public static String _UI_WIZARD_NEW_DESCRIPTION;
+	public static String _ERROR_FILENAME_MUST_END_HTML;
+	public static String _WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT;
+	public static String ResourceGroup_nameExists;
+	public static String NewHTMLTemplatesWizardPage_0;
+	public static String NewHTMLTemplatesWizardPage_1;
+	public static String NewHTMLTemplatesWizardPage_2;
+	public static String NewHTMLTemplatesWizardPage_3;
+	public static String NewHTMLTemplatesWizardPage_4;
+	public static String NewHTMLTemplatesWizardPage_5;
+	public static String NewHTMLTemplatesWizardPage_6;
+	public static String NewHTMLTemplatesWizardPage_7;
+	public static String Creating_files_encoding;
+	public static String CleanupDocument_label; // resource bundle
+	public static String CleanupDocument_tooltip; // resource bundle
+	public static String CleanupDocument_description; // resource bundle
+	public static String ToggleComment_label; // resource bundle
+	public static String ToggleComment_tooltip; // resource bundle
+	public static String ToggleComment_description; // resource bundle
+	public static String AddBlockComment_label; // resource bundle
+	public static String AddBlockComment_tooltip; // resource bundle
+	public static String AddBlockComment_description; // resource bundle
+	public static String RemoveBlockComment_label; // resource bundle
+	public static String RemoveBlockComment_tooltip; // resource bundle
+	public static String RemoveBlockComment_description; // resource bundle
+	public static String FindOccurrences_label;	// resource bundle
+	public static String Creating_files;
+	public static String Encoding_desc;
+	public static String UI_Description_of_role_of_following_DOCTYPE;
+	public static String UI_Default_HTML_DOCTYPE_ID___1;
+	public static String UI_Public_ID;
+	public static String UI_System_ID;
+	public static String UI_none;
+	public static String UI_CSS_profile___2;
+	public static String WebContentSettingsPropertyPage_0;
+	public static String ProjectWebContentSettingsPropertyPage_0;
+	
+	public static String Auto_Activation_UI_;
+	public static String Automatically_make_suggest_UI_;
+	public static String Prompt_when_these_characte_UI_;
+	public static String Cycling_UI_;
+	public static String Formatting_UI_;
+	public static String Line_width__UI_;
+	public static String Split_multiple_attributes;
+	public static String Align_final_bracket;
+	public static String Indent_using_tabs;
+	public static String Indent_using_spaces;
+	public static String Indentation_size;
+	public static String Indentation_size_tip;
+	public static String Clear_all_blank_lines_UI_;
+	public static String Preferred_markup_case_UI_;
+	public static String Tag_names__UI_;
+	public static String Tag_names_Upper_case_UI_;
+	public static String Tag_names_Lower_case_UI_;
+	public static String Attribute_names__UI_;
+	public static String Attribute_names_Upper_case_UI_;
+	public static String Attribute_names_Lower_case_UI_;
+	public static String Cleanup_UI_;
+	public static String Tag_name_case_for_HTML_UI_;
+	public static String Tag_name_case_As_is_UI_;
+	public static String Tag_name_case_Lower_UI_;
+	public static String Tag_name_case_Upper_UI_;
+	public static String Attribute_name_case_for_HTML_UI_;
+	public static String Attribute_name_case_As_is_UI_;
+	public static String Attribute_name_case_Lower_UI_;
+	public static String Attribute_name_case_Upper_UI_;
+	public static String Insert_required_attributes_UI_;
+	public static String Insert_missing_tags_UI_;
+	public static String Quote_attribute_values_UI_;
+	public static String Format_source_UI_;
+	public static String Convert_EOL_codes_UI_;
+	public static String EOL_Windows_UI;
+	public static String EOL_Unix_UI;
+	public static String EOL_Mac_UI;
+	public static String SyntaxColoringPage_0;
+	public static String SyntaxColoringPage_2;
+	public static String SyntaxColoringPage_3;
+	public static String SyntaxColoringPage_4;
+	public static String SyntaxColoringPage_5;
+	public static String SyntaxColoringPage_6;
+	
+	// below are possibly unused strings that may be deleted
+	public static String HTMLFilesPreferencePage_1;
+	public static String HTMLFilesPreferencePage_2;
+	public static String HTMLFilesPreferencePage_3;
+	// above are possibly unused strings that may be deleted
+	public static String EmptyFilePreferencePage_0;
+	public static String _UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK;
+	
+	// HTML Typing Preferences
+	public static String HTMLTyping_Auto_Complete;
+	public static String HTMLTyping_Auto_Remove;
+	public static String HTMLTyping_Complete_Comments;
+	public static String HTMLTyping_Complete_End_Tags;
+	public static String HTMLTyping_Remove_End_Tags;
+	public static String HTMLTyping_Close_Strings;
+	public static String HTMLTyping_Close_Brackets;
+	
+	// below are the strings for the validation page
+	public static String Validation_description;
+	public static String Validation_Warning;
+	public static String Validation_Error;
+	public static String Validation_Ignore;
+	public static String Expandable_label_attributes;
+	public static String Expandable_label_elements;
+	public static String Expandable_label_document_type;
+	public static String Expandable_label_text;
+	public static String Expandable_label_comment;
+	public static String Expandable_label_cdata;
+	public static String Expandable_label_pi;
+	public static String Expandable_label_entity_ref;
+	
+	public static String HTMLValidationPreferencePage_0;
+	public static String HTMLValidationPreferencePage_1;
+	public static String HTMLValidationPreferencePage_10;
+	public static String HTMLValidationPreferencePage_11;
+	public static String HTMLValidationPreferencePage_12;
+	public static String HTMLValidationPreferencePage_13;
+	public static String HTMLValidationPreferencePage_14;
+	public static String HTMLValidationPreferencePage_15;
+	public static String HTMLValidationPreferencePage_16;
+	public static String HTMLValidationPreferencePage_17;
+	public static String HTMLValidationPreferencePage_18;
+	public static String HTMLValidationPreferencePage_19;
+	public static String HTMLValidationPreferencePage_2;
+	public static String HTMLValidationPreferencePage_20;
+	public static String HTMLValidationPreferencePage_21;
+	public static String HTMLValidationPreferencePage_22;
+	public static String HTMLValidationPreferencePage_23;
+	public static String HTMLValidationPreferencePage_24;
+	public static String HTMLValidationPreferencePage_25;
+	public static String HTMLValidationPreferencePage_26;
+	public static String HTMLValidationPreferencePage_27;
+	public static String HTMLValidationPreferencePage_28;
+	public static String HTMLValidationPreferencePage_29;
+	public static String HTMLValidationPreferencePage_3;
+	public static String HTMLValidationPreferencePage_30;
+	public static String HTMLValidationPreferencePage_31;
+	public static String HTMLValidationPreferencePage_32;
+	public static String HTMLValidationPreferencePage_33;
+	public static String HTMLValidationPreferencePage_34;
+	public static String HTMLValidationPreferencePage_35;
+	public static String HTMLValidationPreferencePage_4;
+	public static String HTMLValidationPreferencePage_5;
+	public static String HTMLValidationPreferencePage_6;
+	public static String HTMLValidationPreferencePage_7;
+	public static String HTMLValidationPreferencePage_8;
+	public static String HTMLValidationPreferencePage_9;
+	
+	// Validation
+	public static String Validation_Title;
+	public static String Validation_Workspace;
+	public static String Validation_Project;
+	public static String Validation_jobName;
+	
+	// Hyperlinks
+	public static String Hyperlink_line;
+	public static String Open;
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java
new file mode 100644
index 0000000..6d04933
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal;
+
+import java.io.IOException;
+
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
+import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
+import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
+import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
+import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistryImpl;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class HTMLUIPlugin extends AbstractUIPlugin {
+	public final static String ID = "org.eclipse.wst.html.ui"; //$NON-NLS-1$
+
+	protected static HTMLUIPlugin instance = null;	
+
+	/**
+	 * The template store for the html editor.
+	 */
+	private TemplateStore fTemplateStore;
+
+	/**
+	 * The template context type registry for the html editor.
+	 */
+	private ContextTypeRegistry fContextTypeRegistry;
+
+	public HTMLUIPlugin() {
+		super();
+		instance = this;
+	}
+
+	public static HTMLUIPlugin getDefault() {
+		return instance;
+	}
+
+	public synchronized static HTMLUIPlugin getInstance() {
+		return instance;
+	}
+
+	public AdapterFactoryRegistry getAdapterFactoryRegistry() {
+		return AdapterFactoryRegistryImpl.getInstance();
+
+	}
+
+	/**
+	 * Returns the template store for the html editor templates.
+	 * 
+	 * @return the template store for the html editor templates
+	 */
+	public TemplateStore getTemplateStore() {
+		if (fTemplateStore == null) {
+			fTemplateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), HTMLUIPreferenceNames.TEMPLATES_KEY);
+
+			try {
+				fTemplateStore.load();
+			} catch (IOException e) {
+				Logger.logException(e);
+			}
+		}
+		return fTemplateStore;
+	}
+
+	/**
+	 * Returns the template context type registry for the html plugin.
+	 * 
+	 * @return the template context type registry for the html plugin
+	 */
+	public ContextTypeRegistry getTemplateContextRegistry() {
+		if (fContextTypeRegistry == null) {
+			ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
+			registry.addContextType(TemplateContextTypeIdsHTML.ALL);
+			registry.addContextType(TemplateContextTypeIdsHTML.NEW);
+			registry.addContextType(TemplateContextTypeIdsHTML.TAG);
+			registry.addContextType(TemplateContextTypeIdsHTML.ATTRIBUTE);
+			registry.addContextType(TemplateContextTypeIdsHTML.ATTRIBUTE_VALUE);
+
+			fContextTypeRegistry = registry;
+		}
+
+		return fContextTypeRegistry;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
new file mode 100644
index 0000000..3caf87c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
@@ -0,0 +1,180 @@
+###############################################################################
+# Copyright (c) 2004, 2009 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#     IBM Corporation - initial API and implementation
+#     Benjamin Muskalla, b.muskalla@gmx.net - [158660] character entities should have their own syntax highlighting preference      
+###############################################################################
+## The following line is a sample HTML document.  Please translate only the following parts:
+## HTML Highlighting Preferences
+## we need a flaming logo
+Sample_HTML_doc=<!DOCTYPE html\n\tPUBLIC \"-//W3C/DTD/ HTML 4.01 Transitional//EN\"\n\t\"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n\t<head>\n\t\t<meta content=\"text/html\">\n\t\t<title>HTML Highlighting Preferences</title>\n\t</head>\n<body>\n\t<!--\n\t\twe need a flaming logo!\n\t-->\n\t<p>three&nbsp;&nbsp;&nbsp;spaces</p>\n</body>\n</html>
+
+HTMLFilesPreferencePage_0=Loading files
+#
+_UI_WIZARD_NEW_TITLE = New HTML File
+_UI_WIZARD_NEW_HEADING = HTML
+_UI_WIZARD_NEW_DESCRIPTION = Create a new HTML file.
+_ERROR_FILENAME_MUST_END_HTML = The file name must end in one of the following extensions {0}.
+_WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT = Files created outside of the Web Content folder will not be included in your deployed Web application. 
+ResourceGroup_nameExists = The same name already exists.
+NewHTMLTemplatesWizardPage_0=Select HTML Template
+NewHTMLTemplatesWizardPage_1=Select a template as initial content in the HTML page.
+NewHTMLTemplatesWizardPage_2=Name
+NewHTMLTemplatesWizardPage_3=Description
+NewHTMLTemplatesWizardPage_4=&Use HTML Template
+NewHTMLTemplatesWizardPage_5=&Preview:
+NewHTMLTemplatesWizardPage_6=Templates are 'New HTML' templates found in the <a>HTML Templates</a> preference page.
+NewHTMLTemplatesWizardPage_7=&Templates:
+#
+Creating_files_encoding=Creating files encoding preference
+# Copied from sse.ui
+CleanupDocument_label=Cleanup Document...
+CleanupDocument_tooltip=Cleanup Document
+CleanupDocument_description=Cleanup Document
+ToggleComment_label=Toggle Comment
+ToggleComment_tooltip=Toggle Comment
+ToggleComment_description=Toggle Comment
+AddBlockComment_label=Add Block Comment
+AddBlockComment_tooltip=Add Block Comment
+AddBlockComment_description=Add Block Comment
+RemoveBlockComment_label=Remove Block Comment
+RemoveBlockComment_tooltip=Remove Block Comment
+RemoveBlockComment_description=Remove Block Comment
+FindOccurrences_label=Occurrences in File
+Creating_files=Creating files
+Encoding_desc=The following encoding will apply:
+## HTML Source preference page
+Auto_Activation_UI_=Auto Activation
+Automatically_make_suggest_UI_=Automatically ma&ke suggestions
+Prompt_when_these_characte_UI_=P&rompt when these characters are inserted:
+Cycling_UI_=Cycling
+Formatting_UI_=Formatting
+Line_width__UI_=Line &width:
+Split_multiple_attributes=Split &multiple attributes each on a new line
+Align_final_bracket=&Align final bracket in multi-line element tags
+Indent_using_tabs=&Indent using tabs
+Indent_using_spaces=I&ndent using spaces
+Indentation_size=In&dentation size:
+Indentation_size_tip=Indentation size
+Clear_all_blank_lines_UI_=Clear all &blank lines
+Preferred_markup_case_UI_=Preferred markup case for content assist, and code generation
+Tag_names__UI_=Tag names:
+Tag_names_Upper_case_UI_=&Uppercase
+Tag_names_Lower_case_UI_=&Lowercase
+Attribute_names__UI_=Attribute names:
+Attribute_names_Upper_case_UI_=U&ppercase
+Attribute_names_Lower_case_UI_=L&owercase
+Cleanup_UI_=Cleanup
+Tag_name_case_for_HTML_UI_=Tag name case for HTML:
+Tag_name_case_As_is_UI_=&As-is
+Tag_name_case_Lower_UI_=&Lower
+Tag_name_case_Upper_UI_=&Upper
+Attribute_name_case_for_HTML_UI_=Attribute name case for HTML:
+Attribute_name_case_As_is_UI_=A&s-is
+Attribute_name_case_Lower_UI_=L&ower
+Attribute_name_case_Upper_UI_=U&pper
+Insert_required_attributes_UI_=Insert &required attributes
+Insert_missing_tags_UI_=&Insert missing tags
+Quote_attribute_values_UI_=&Quote attribute values
+Format_source_UI_=&Format source
+Convert_EOL_codes_UI_=Convert line &delimiters to
+EOL_Windows_UI=&Windows
+EOL_Unix_UI=U&NIX
+EOL_Mac_UI=&Mac
+
+# web content settings
+UI_Description_of_role_of_following_DOCTYPE=Use the following default document type when no DOCTYPE is declared in a file:
+UI_Default_HTML_DOCTYPE_ID___1=Document type:
+UI_Public_ID=Public ID:
+UI_System_ID=System ID:
+UI_none=none
+UI_CSS_profile___2=CSS profile:
+WebContentSettingsPropertyPage_0=The properties used that cannot or are not specified in web files.  The project setting is used if you specify "none."
+ProjectWebContentSettingsPropertyPage_0=These values are used when the corresponding properties are not specified within a web page.
+SyntaxColoringPage_0=Syntax Element:
+SyntaxColoringPage_2=Enable
+SyntaxColoringPage_3=&Bold
+SyntaxColoringPage_4=&Italic
+SyntaxColoringPage_5=&Strikethrough
+SyntaxColoringPage_6=&Underline
+# below are possibly unused strings that may be deleted
+HTMLFilesPreferencePage_1=Add this suffix (if not specified):
+HTMLFilesPreferencePage_2=Insert DOCTYPE declaration
+HTMLFilesPreferencePage_3=Insert GENERATOR with META tag
+EmptyFilePreferencePage_0=Expand the tree to edit preferences for a specific feature.
+_UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK=HTML editing preferences.  Note that some preferences may be set on the <a>{0}</a> preference page.
+# above are possibly unused strings that may be deleted
+
+# HTML Typing Preference Page
+HTMLTyping_Auto_Complete=Automatically close
+HTMLTyping_Auto_Remove=Automatically remove
+HTMLTyping_Complete_Comments=&Comments
+HTMLTyping_Close_Strings=A&ttribute values
+HTMLTyping_Close_Brackets=(Parentheses) and [square] brac&kets
+HTMLTyping_Complete_End_Tags=&End tags
+HTMLTyping_Remove_End_Tags=E&nd tags when creating empty self-closing tags
+
+
+# Validation strings
+Validation_description=Select the severity level for the following validation problems:
+Validation_Warning=Warning
+Validation_Error=Error
+Validation_Ignore=Ignore
+Expandable_label_attributes=Attributes
+Expandable_label_elements=Elements
+Expandable_label_document_type=Document Type
+Expandable_label_text=Text Regions
+Expandable_label_comment=Comments
+Expandable_label_cdata=CDATA Sections
+Expandable_label_pi=Processing Instructions
+Expandable_label_entity_ref=Entity References
+
+HTMLValidationPreferencePage_0=Undefined attribute name:
+HTMLValidationPreferencePage_1=Undefined attribute value:
+HTMLValidationPreferencePage_10=Start-tag uses invalid case:
+HTMLValidationPreferencePage_11=End tag uses invalid case:
+HTMLValidationPreferencePage_12=Missing start tag:
+HTMLValidationPreferencePage_13=Missing end tag:
+HTMLValidationPreferencePage_14=Unnecessary end tag:
+HTMLValidationPreferencePage_15=Invalid directive:
+HTMLValidationPreferencePage_16=Invalid tag location:
+HTMLValidationPreferencePage_17=Duplicate tag:
+HTMLValidationPreferencePage_18=Coexistence:
+HTMLValidationPreferencePage_19=Unclosed start tag:
+HTMLValidationPreferencePage_2=Attribute name using wrong case character:
+HTMLValidationPreferencePage_20=Unclosed end tag:
+HTMLValidationPreferencePage_21=Invalid empty element tag:
+HTMLValidationPreferencePage_22=Duplicate DOCTYPE declaration:
+HTMLValidationPreferencePage_23=Invalid location:
+HTMLValidationPreferencePage_24=DOCTYPE declaration unclosed:
+HTMLValidationPreferencePage_25=Invalid text string:
+HTMLValidationPreferencePage_26=Invalid characters used in text string:
+HTMLValidationPreferencePage_27=Invalid location:
+HTMLValidationPreferencePage_28=Unclosed comment:
+HTMLValidationPreferencePage_29=Invalid location:
+HTMLValidationPreferencePage_3=Invalid attribute name:
+HTMLValidationPreferencePage_30=Unclosed CDATA section:
+HTMLValidationPreferencePage_31=Invalid location:
+HTMLValidationPreferencePage_32=Unclosed processing instruction:
+HTMLValidationPreferencePage_33=Invalid location:
+HTMLValidationPreferencePage_34=Unknown entity:
+HTMLValidationPreferencePage_4=Invalid attribute:
+HTMLValidationPreferencePage_5=Multiple values specified for an attribute:
+HTMLValidationPreferencePage_6=Attribute value using wrong case character:
+HTMLValidationPreferencePage_7=Unclosed attribute value:
+HTMLValidationPreferencePage_8=Unknown tag name:
+HTMLValidationPreferencePage_9=Invalid tag name:
+HTMLValidationPreferencePage_35=Attribute value refers to missing resource:
+
+Validation_Title=Validation Settings Changed
+Validation_Workspace=The validation settings have changed. A full validation is required for changes to take effect. Validate now?
+Validation_Project=The validation settings have changed. A validation of the project is required for changes to take effect. Validate the project now?
+Validation_jobName=Validating...
+
+Hyperlink_line={0}={1} : line {2}
+Open=Open ''{0}''
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java
new file mode 100644
index 0000000..580f3fe
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal;
+
+
+
+import com.ibm.icu.util.StringTokenizer;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.osgi.framework.Bundle;
+
+
+/**
+ * Small convenience class to log messages to plugin's log file and also, if
+ * desired, the console. This class should only be used by classes in this
+ * plugin. Other plugins should make their own copy, with appropriate ID.
+ */
+public class Logger {
+	private static final String PLUGIN_ID = "org.eclipse.wst.html.ui"; //$NON-NLS-1$
+	
+	public static final int ERROR = IStatus.ERROR; // 4
+	public static final int ERROR_DEBUG = 200 + ERROR;
+	public static final int INFO = IStatus.INFO; // 1
+	public static final int INFO_DEBUG = 200 + INFO;
+
+	public static final int OK = IStatus.OK; // 0
+
+	public static final int OK_DEBUG = 200 + OK;
+
+	private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
+	public static final int WARNING = IStatus.WARNING; // 2
+	public static final int WARNING_DEBUG = 200 + WARNING;
+
+	/**
+	 * Adds message to log.
+	 * 
+	 * @param level
+	 *            severity level of the message (OK, INFO, WARNING, ERROR,
+	 *            OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
+	 * @param message
+	 *            text to add to the log
+	 * @param exception
+	 *            exception thrown
+	 */
+	protected static void _log(int level, String message, Throwable exception) {
+		if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
+			if (!isDebugging())
+				return;
+		}
+
+		int severity = IStatus.OK;
+		switch (level) {
+			case INFO_DEBUG :
+			case INFO :
+				severity = IStatus.INFO;
+				break;
+			case WARNING_DEBUG :
+			case WARNING :
+				severity = IStatus.WARNING;
+				break;
+			case ERROR_DEBUG :
+			case ERROR :
+				severity = IStatus.ERROR;
+		}
+		message = (message != null) ? message : "null"; //$NON-NLS-1$
+		Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
+		Bundle bundle = Platform.getBundle(PLUGIN_ID);
+		if (bundle != null) 
+			Platform.getLog(bundle).log(statusObj);
+	}
+
+	/**
+	 * Prints message to log if category matches /debug/tracefilter option.
+	 * 
+	 * @param message
+	 *            text to print
+	 * @param category
+	 *            category of the message, to be compared with
+	 *            /debug/tracefilter
+	 */
+	protected static void _trace(String category, String message, Throwable exception) {
+		if (isTracing(category)) {
+			message = (message != null) ? message : "null"; //$NON-NLS-1$
+			Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
+			Bundle bundle = Platform.getBundle(PLUGIN_ID);
+			if (bundle != null) 
+				Platform.getLog(bundle).log(statusObj);
+		}
+	}
+
+	/**
+	 * @return true if the platform is debugging
+	 */
+	public static boolean isDebugging() {
+		return Platform.inDebugMode();
+	}
+
+	/**
+	 * Determines if currently tracing a category
+	 * 
+	 * @param category
+	 * @return true if tracing category, false otherwise
+	 */
+	public static boolean isTracing(String category) {
+		if (!isDebugging())
+			return false;
+
+		String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
+		if (traceFilter != null) {
+			StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
+			while (tokenizer.hasMoreTokens()) {
+				String cat = tokenizer.nextToken().trim();
+				if (category.equals(cat)) {
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+
+	public static void log(int level, String message) {
+		_log(level, message, null);
+	}
+
+	public static void log(int level, String message, Throwable exception) {
+		_log(level, message, exception);
+	}
+
+	public static void logException(String message, Throwable exception) {
+		_log(ERROR, message, exception);
+	}
+
+	public static void logException(Throwable exception) {
+		_log(ERROR, exception.getMessage(), exception);
+	}
+
+	public static void trace(String category, String message) {
+		_trace(category, message, null);
+	}
+
+	public static void traceException(String category, String message, Throwable exception) {
+		_trace(category, message, exception);
+	}
+
+	public static void traceException(String category, Throwable exception) {
+		_trace(category, exception.getMessage(), exception);
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/AutoEditStrategyForTabs.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/AutoEditStrategyForTabs.java
new file mode 100644
index 0000000..bc89ee5
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/AutoEditStrategyForTabs.java
@@ -0,0 +1,188 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   IBM - Initial API and implementation
+ *   Jens Lukowski/Innoopract - initial renaming/restructuring
+ * 
+ *******************************************************************************/
+
+package org.eclipse.wst.html.ui.internal.autoedit;
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.ConfigurableLineTracker;
+import org.eclipse.jface.text.DocumentCommand;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ILineTracker;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension3;
+import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
+import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
+import org.eclipse.wst.html.ui.internal.Logger;
+
+/**
+ * AutoEditStrategy to handle characters inserted when Tab key is pressed
+ */
+public class AutoEditStrategyForTabs implements IAutoEditStrategy {
+	private final String TAB_CHARACTER = "\t";	//$NON-NLS-1$
+	
+	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
+		// if not in smart insert mode just ignore
+		if (!isSmartInsertMode())
+			return;
+		
+		// spaces for tab character
+		if (command.length == 0 && command.text != null && command.text.length() > 0 && command.text.indexOf(TAB_CHARACTER) != -1)
+			smartInsertForTab(command, document);
+	}
+
+	/**
+	 * Insert spaces for tabs
+	 * 
+	 * @param command
+	 */
+	private void smartInsertForTab(DocumentCommand command, IDocument document) {
+		// tab key was pressed. now check preferences to see if need to insert
+		// spaces instead of tab
+		int indentationWidth = getIndentationWidth();
+		if (indentationWidth > -1) {
+			String originalText = command.text;
+			StringBuffer newText = new StringBuffer(originalText);
+
+			// determine where in line this command begins
+			int lineOffset = -1;
+			try {
+				IRegion lineInfo = document.getLineInformationOfOffset(command.offset);
+				lineOffset = command.offset - lineInfo.getOffset();
+			} catch (BadLocationException e) {
+				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+			}
+
+			ILineTracker lineTracker = getLineTracker(document, originalText);
+
+			int startIndex = 0;
+			int index = newText.indexOf(TAB_CHARACTER);
+			while (index != -1) {
+				String indent = getIndentString(indentationWidth, lineOffset, lineTracker, index);
+
+				// replace \t character with spaces
+				newText.replace(index, index + 1, indent);
+				if (lineTracker != null) {
+					try {
+						lineTracker.replace(index, 1, indent);
+					} catch (BadLocationException e) {
+						// if something goes wrong with replacing text, just
+						// reset to current string
+						lineTracker.set(newText.toString());
+						Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+					}
+				}
+
+				startIndex = index + indent.length();
+				index = newText.indexOf(TAB_CHARACTER, startIndex);
+			}
+			command.text = newText.toString();
+		}
+	}
+
+	/**
+	 * Calculate number of spaces for next tab stop
+	 */
+	private String getIndentString(int indentationWidth, int lineOffset, ILineTracker lineTracker, int index) {
+		int indentSize = indentationWidth;
+		int offsetInLine = -1;
+		if (lineTracker != null) {
+			try {
+				IRegion lineInfo = lineTracker.getLineInformationOfOffset(index);
+				if (lineInfo.getOffset() == 0 && lineOffset > -1)
+					offsetInLine = lineOffset + index;
+				else
+					offsetInLine = index - lineInfo.getOffset();
+			} catch (BadLocationException e) {
+				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+			}
+		} else {
+			if (lineOffset > -1) {
+				offsetInLine = lineOffset + index;
+			}
+		}
+		if (offsetInLine > -1 && indentationWidth > 0) {
+			int remainder = offsetInLine % indentationWidth;
+			indentSize = indentationWidth - remainder;
+		}
+
+		StringBuffer indent = new StringBuffer();
+		for (int i = 0; i < indentSize; i++)
+			indent.append(' ');
+		return indent.toString();
+	}
+
+	/**
+	 * Set up a line tracker for text within command if text is multi-line
+	 */
+	private ILineTracker getLineTracker(IDocument document, String originalText) {
+		ConfigurableLineTracker lineTracker = null;
+		int[] delims = TextUtilities.indexOf(document.getLegalLineDelimiters(), originalText, 0);
+		if (delims[0] != -1 || delims[1] != -1) {
+			lineTracker = new ConfigurableLineTracker(document.getLegalLineDelimiters());
+			lineTracker.set(originalText);
+		}
+		return lineTracker;
+	}
+	
+	/**
+	 * Return true if active editor is in smart insert mode, false otherwise
+	 * 
+	 * @return
+	 */
+	private boolean isSmartInsertMode() {
+		boolean isSmartInsertMode = false;
+		
+		ITextEditor textEditor = null;
+		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+		if (window != null) {
+			IWorkbenchPage page = window.getActivePage();
+			if (page != null) {
+				IEditorPart editor = page.getActiveEditor();
+				if (editor != null) {
+					if (editor instanceof ITextEditor)
+						textEditor = (ITextEditor)editor;
+					else
+						textEditor = (ITextEditor)editor.getAdapter(ITextEditor.class);
+				}
+			}
+		}
+		
+		// check if smart insert mode
+		if (textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT)
+			isSmartInsertMode = true;
+		return isSmartInsertMode;
+	}
+	
+	/**
+	 * Returns indentation width if using spaces for indentation, -1 otherwise
+	 * 
+	 * @return
+	 */
+	private int getIndentationWidth() {
+		int width = -1;
+
+		Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
+		if (HTMLCorePreferenceNames.SPACE.equals(preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR)))
+			width = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
+
+		return width;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java
new file mode 100644
index 0000000..57e49df
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java
@@ -0,0 +1,349 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.autoedit;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DocumentCommand;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension3;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
+import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Automatically inserts closing comment tag or end tag when appropriate.
+ */
+public class StructuredAutoEditStrategyHTML implements IAutoEditStrategy {
+	/*
+	 * NOTE: copies of this class exists in
+	 * org.eclipse.wst.xml.ui.internal.autoedit
+	 * org.eclipse.wst.html.ui.internal.autoedit
+	 */
+	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
+		Object textEditor = getActiveTextEditor();
+		if (!(textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT))
+			return;
+
+		IStructuredModel model = null;
+		try {
+			model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+			if (model != null) {
+				if (command.text != null) {
+					smartInsertCloseElement(command, document, model);
+					smartInsertForComment(command, document, model);
+					smartInsertForEndTag(command, document, model);
+					smartRemoveEndTag(command, document, model);
+				}
+			}
+		}
+		finally {
+			if (model != null)
+				model.releaseFromRead();
+		}
+	}
+
+	private boolean isPreferenceEnabled(String key) {
+		return (key != null && HTMLUIPlugin.getDefault().getPreferenceStore().getBoolean(key));
+	}
+	
+	private boolean isCommentNode(IDOMNode node) {
+		return (node != null && node instanceof IDOMElement && ((IDOMElement) node).isCommentTag());
+	}
+
+	private boolean isDocumentNode(IDOMNode node) {
+		return (node != null && node.getNodeType() == Node.DOCUMENT_NODE);
+	}
+	
+	/**
+	 * Attempts to clean up an end-tag if a start-tag is converted into an empty-element
+	 * tag (e.g., <node />) and the original element was empty.
+	 * 
+	 * @param command the document command describing the change
+	 * @param document the document that will be changed
+	 * @param model the model based on the document
+	 */
+	private void smartRemoveEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
+		try {
+			// An opening tag is now a self-terminated end-tag
+			if ("/".equals(command.text) && ">".equals(document.get(command.offset, 1)) && command.length == 0 && isPreferenceEnabled(HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
+				IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
+				if (node != null && !node.hasChildNodes()) {
+					IStructuredDocumentRegion region = node.getFirstStructuredDocumentRegion();
+					if(region.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN && command.offset <= region.getEnd()) {
+						
+						/* if the region before the command offset is a an attribute value region
+						 * check to see if it has both and opening and closing quote
+						 */
+						ITextRegion prevTextRegion = region.getRegionAtCharacterOffset(command.offset-1);
+						boolean inUnclosedAttValueRegion = false;
+						if(prevTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+							//get the text of the attribute value region
+							String prevText = region.getText(prevTextRegion);
+							inUnclosedAttValueRegion = (prevText.startsWith("'") && ((prevText.length() == 1) || !prevText.endsWith("'"))) ||
+								(prevText.startsWith("\"") && ((prevText.length() == 1) || !prevText.endsWith("\"")));
+						} 
+					
+						//if command offset is in an unclosed attribute value region then done remove the end tag
+						if(!inUnclosedAttValueRegion) {
+							region = node.getEndStructuredDocumentRegion();
+							if (region != null && region.isEnded()) {
+								document.replace(region.getStartOffset(), region.getLength(), ""); //$NON-NLS-1$
+							}
+						}
+					}
+				}
+			}
+		}
+		catch (BadLocationException e) {
+			Logger.logException(e);
+		}
+	}
+
+	private void smartInsertForComment(DocumentCommand command, IDocument document, IStructuredModel model) {
+		try {
+			if (command.text.equals("-") && document.getLength() >= 3 && document.get(command.offset - 3, 3).equals("<!-") && isPreferenceEnabled(HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS)) { //$NON-NLS-1$ //$NON-NLS-2$
+				command.text += "  -->"; //$NON-NLS-1$
+				command.shiftsCaret = false;
+				command.caretOffset = command.offset + 2;
+				command.doit = false;
+			}
+		}
+		catch (BadLocationException e) {
+			Logger.logException(e);
+		}
+
+	}
+	
+	/**
+	 * Attempts to insert the end tag when completing a start-tag with the '&gt;' character.
+	 * 
+	 * @param command
+	 * @param document
+	 * @param model
+	 */
+	private void smartInsertCloseElement(DocumentCommand command, IDocument document, IStructuredModel model) {
+		try {
+			// Check terminating start tag, but ignore empty-element tags
+			if (command.text.equals(">") && document.getLength() > 0 && document.getChar(command.offset - 1) != '/' && isPreferenceEnabled(HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS)) { //$NON-NLS-1$
+				IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset - 1);
+				boolean isClosedByParent = false;
+				// Only insert an end-tag if necessary. Because of the way the document is parsed, it is possible for a child tag with the same
+				// name as an ancestor to be paired with the end-tag of an ancestor, so the ancestors must be checked for an unclosed tag.
+				if (node != null && node.getNodeType() == Node.ELEMENT_NODE && (!node.isClosed() || (isClosedByParent = hasUnclosedAncestor(node)))) {
+					IStructuredDocumentRegion region = node.getEndStructuredDocumentRegion();
+					if (region != null && region.getRegions().size() > 0 && region.getRegions().get(0).getType() == DOMRegionContext.XML_END_TAG_OPEN && !isClosedByParent)
+						return;
+					CMElementDeclaration decl = getCMElementDeclaration(node);
+					// If it's XHTML, always generate the end tag
+					if (isXHTML(node) || shouldGenerateEndTag(decl)) {
+						command.text += "</" + getElementName(node, command.offset) + ">"; //$NON-NLS-1$ //$NON-NLS-2$
+						command.shiftsCaret = false;
+						command.caretOffset = command.offset + 1;
+					}
+				}
+				
+			}
+		} catch (BadLocationException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Get the element name that will be created by closing the start tag. Defaults
+	 * to the node's nodeName.
+	 * @param node the node that is being edited
+	 * @param offset the offset in the document where the start tag is closed
+	 * @return The element name of the tag
+	 */
+	private String getElementName(IDOMNode node, int offset) {
+		String name = null;
+		
+		IStructuredDocumentRegion region = node.getFirstStructuredDocumentRegion();
+		ITextRegion textRegion = region.getRegionAtCharacterOffset(offset);
+		if (textRegion != null && textRegion.getType() == DOMRegionContext.XML_TAG_NAME) {
+			int nameStart = region.getStartOffset(textRegion);
+			String regionText = region.getText(textRegion);
+			int length = offset - nameStart;
+			if (length <= regionText.length())
+				name = regionText.substring(0, length);
+		}
+		
+		// Default to the node name
+		if (name == null)
+			name = node.getNodeName();
+		return name;
+	}
+
+	private void smartInsertForEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
+		try {
+			if (command.text.equals("/") && document.getLength() >= 1 && document.get(command.offset - 1, 1).equals("<") && isPreferenceEnabled(HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
+				IDOMNode parentNode = (IDOMNode) ((IDOMNode) model.getIndexedRegion(command.offset - 1)).getParentNode();
+				if (isCommentNode(parentNode)) {
+					// loop and find non comment node parent
+					while (parentNode != null && isCommentNode(parentNode)) {
+						parentNode = (IDOMNode) parentNode.getParentNode();
+					}
+				}
+
+				if (!isDocumentNode(parentNode)) {
+					// only add end tag if one does not already exist or if
+					// add '/' does not create one already
+					IStructuredDocumentRegion endTagStructuredDocumentRegion = parentNode.getEndStructuredDocumentRegion();
+					IDOMNode ancestor = parentNode;
+					boolean smartInsertForEnd = false;
+					if(endTagStructuredDocumentRegion != null) {
+						// Look for ancestors by the same name that are missing end tags
+						while((ancestor = (IDOMNode) ancestor.getParentNode()) != null) {
+							if(ancestor.getEndStructuredDocumentRegion() == null && parentNode.getNodeName().equals(ancestor.getNodeName())) {
+								smartInsertForEnd = true;
+								break;
+							}
+						}
+					}
+					if (endTagStructuredDocumentRegion == null || smartInsertForEnd) {
+						StringBuffer toAdd = new StringBuffer(parentNode.getNodeName());
+						if (toAdd.length() > 0) {
+							toAdd.append(">"); //$NON-NLS-1$
+							String suffix = toAdd.toString();
+							if ((document.getLength() < command.offset + suffix.length()) || (!suffix.equals(document.get(command.offset, suffix.length())))) {
+								command.text += suffix;
+							}
+						}
+					}
+				}
+			}
+		}
+		catch (BadLocationException e) {
+			Logger.logException(e);
+		}
+	}
+
+	/**
+	 * Checks if <code>node</code> has an unclosed ancestor by the same name
+	 * 
+	 * @param node the node to check
+	 * @return true if <code>node</code> has an unclosed parent with the same node name
+	 */
+	private boolean hasUnclosedAncestor(IDOMNode node) {
+		IDOMNode parent = (IDOMNode) node.getParentNode();
+		while (parent != null && parent.getNodeType() != Node.DOCUMENT_NODE && parent.getNodeName().equals(node.getNodeName())) {
+			if (!parent.isClosed())
+				return true;
+			parent = (IDOMNode) parent.getParentNode();
+		}
+		return false;
+	}
+
+	/**
+	 * Based on the content model, determine if an end tag should be generated
+	 * @param elementDecl the content model element declaration
+	 * @return true if the end tag should be generated; false otherwise.
+	 */
+	private boolean shouldGenerateEndTag(CMElementDeclaration elementDecl) {
+		if (elementDecl == null)
+			return false;
+		if (elementDecl instanceof HTMLElementDeclaration) {
+			if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
+				if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
+					return false;
+			}
+			else {
+				String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
+				if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
+					return false;
+				}
+			}
+		}
+
+		if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
+			return false;
+		return true;
+	}
+
+	private CMElementDeclaration getCMElementDeclaration(Node node) {
+		CMElementDeclaration result = null;
+		if (node.getNodeType() == Node.ELEMENT_NODE) {
+			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
+			if (modelQuery != null) {
+				result = modelQuery.getCMElementDeclaration((Element) node);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Is the node part of an XHTML document
+	 * @param node
+	 * @return
+	 */
+	private boolean isXHTML(Node node) {
+		Document doc = node.getOwnerDocument();
+		if (!(doc instanceof IDOMDocument))
+			return false;
+		String typeid = ((IDOMDocument) doc).getDocumentTypeId();
+		if (typeid != null) {
+			HTMLDocumentTypeEntry entry = HTMLDocumentTypeRegistry.getInstance().getEntry(typeid);
+			return (entry != null && entry.isXMLType());
+		}
+		return false;
+	}
+	
+	/**
+	 * Return the active text editor if possible, otherwise the active editor
+	 * part.
+	 * 
+	 * @return Object
+	 */
+	private Object getActiveTextEditor() {
+		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+		if (window != null) {
+			IWorkbenchPage page = window.getActivePage();
+			if (page != null) {
+				IEditorPart editor = page.getActiveEditor();
+				if (editor != null) {
+					if (editor instanceof ITextEditor)
+						return editor;
+					ITextEditor textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
+					if (textEditor != null)
+						return textEditor;
+					return editor;
+				}
+			}
+		}
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java
new file mode 100644
index 0000000..6bb0f20
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jface.text.templates.TemplateProposal;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
+
+/**
+ * Purpose of this class is to make the additional proposal info into content
+ * fit for an HTML viewer (by escaping characters)
+ */
+class CustomTemplateProposal extends TemplateProposal implements IRelevanceCompletionProposal {
+	// copies of this class exist in:
+	// org.eclipse.jst.jsp.ui.internal.contentassist
+	// org.eclipse.wst.html.ui.internal.contentassist
+	// org.eclipse.wst.xml.ui.internal.contentassist
+
+	public CustomTemplateProposal(Template template, TemplateContext context, IRegion region, Image image, int relevance) {
+		super(template, context, region, image, relevance);
+	}
+
+	public String getAdditionalProposalInfo() {
+		String additionalInfo = super.getAdditionalProposalInfo();
+		return StringUtils.convertToHTMLContent(additionalInfo);
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
new file mode 100644
index 0000000..63c2ced
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
@@ -0,0 +1,511 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocument;
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
+import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
+import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.ui.internal.IReleasable;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
+import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see HTMLStructuredContentAssistProcessor
+ */
+public class HTMLContentAssistProcessor extends AbstractContentAssistProcessor implements IPropertyChangeListener {
+	private INodeAdapterFactory factoryForCSS = null;
+	protected IPreferenceStore fPreferenceStore = null;
+	protected boolean isXHTML = false;
+	private HTMLTemplateCompletionProcessor fTemplateProcessor = null;
+	private IContentAssistProcessor fJSContentAssistProcessor = null;
+	private List fTemplateContexts = new ArrayList();
+
+	public HTMLContentAssistProcessor() {
+
+		super();
+	}
+
+	protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE);
+		super.addAttributeNameProposals(contentAssistRequest);
+	}
+
+	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE_VALUE);
+		super.addAttributeValueProposals(contentAssistRequest);
+	}
+
+	/**
+	 * Add the proposals for a completely empty document
+	 */
+	protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.NEW);
+	}
+
+	protected void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest) {
+		if (isXHTML)
+			super.addPCDATAProposal(nodeName, contentAssistRequest);
+	}
+
+	protected void addStartDocumentProposals(ContentAssistRequest contentAssistRequest) {
+		if (isXHTML)
+			addEmptyDocumentProposals(contentAssistRequest);
+	}
+
+	protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.TAG);
+		super.addTagInsertionProposals(contentAssistRequest, childPosition);
+	}
+
+	/**
+	 * Adds templates to the list of proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 */
+	private void addTemplates(ContentAssistRequest contentAssistRequest, String context) {
+		addTemplates(contentAssistRequest, context, contentAssistRequest.getReplacementBeginPosition());
+	}
+	
+	/**
+	 * Adds templates to the list of proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 * @param startOffset
+	 */
+	private void addTemplates(ContentAssistRequest contentAssistRequest, String context, int startOffset) {
+		if (contentAssistRequest == null)
+			return;
+		
+		// if already adding template proposals for a certain context type, do
+		// not add again
+		if (!fTemplateContexts.contains(context)) {
+			fTemplateContexts.add(context);
+			boolean useProposalList = !contentAssistRequest.shouldSeparate();
+
+			if (getTemplateCompletionProcessor() != null) {
+				getTemplateCompletionProcessor().setContextType(context);
+				ICompletionProposal[] proposals = getTemplateCompletionProcessor().computeCompletionProposals(fTextViewer, startOffset);
+				for (int i = 0; i < proposals.length; ++i) {
+					if (useProposalList)
+						contentAssistRequest.addProposal(proposals[i]);
+					else
+						contentAssistRequest.addMacro(proposals[i]);
+				}
+			}
+		}
+	}
+
+	protected boolean beginsWith(String aString, String prefix) {
+		if (aString == null || prefix == null || prefix.length() == 0)
+			return true;
+		int minimumLength = Math.min(prefix.length(), aString.length());
+		String beginning = aString.substring(0, minimumLength);
+		return beginning.equalsIgnoreCase(prefix);
+	}
+
+	protected ContentAssistRequest computeCompletionProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
+		ContentAssistRequest request = super.computeCompletionProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
+		// bug115927 use original document position for all/any region templates
+		addTemplates(request, TemplateContextTypeIdsHTML.ALL, documentPosition);
+		return request;
+	}
+
+	/**
+	 * Return a list of proposed code completions based on the specified
+	 * location within the document that corresponds to the current cursor
+	 * position within the text-editor control.
+	 * 
+	 * @param documentPosition
+	 *            a location within the document
+	 * @return an array of code-assist items
+	 */
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer textViewer, int documentPosition) {
+		fTemplateContexts.clear();
+
+		IndexedRegion treeNode = ContentAssistUtils.getNodeAt(textViewer, documentPosition);
+		IDOMNode node = (IDOMNode) treeNode;
+		setErrorMessage(null);
+
+		// check if it's in a comment node
+		IStructuredDocument structuredDocument = (IStructuredDocument) textViewer.getDocument();
+		IStructuredDocumentRegion fn = structuredDocument.getRegionAtCharacterOffset(documentPosition);
+		if (fn != null && fn.getType() == DOMRegionContext.XML_COMMENT_TEXT && documentPosition != fn.getStartOffset()) {
+			return new ICompletionProposal[0];
+		}
+
+		// CMVC 242695
+		// if it's a </script> tag, bounce back to JS ca processor...
+		if (fn != null && fn.getType() == DOMRegionContext.XML_TAG_NAME && documentPosition == fn.getStartOffset()) {
+			ITextRegionList v = fn.getRegions();
+			if (v.size() > 1) {
+				// determine that it's a close tag
+				if ((v.get(0)).getType() == DOMRegionContext.XML_END_TAG_OPEN) {
+					Iterator it = v.iterator();
+					ITextRegion region = null;
+					// search for script tag name
+					while (it.hasNext()) {
+						region = (ITextRegion) it.next();
+						if (fn.getText(region).equalsIgnoreCase("script")) { //$NON-NLS-1$
+							IContentAssistProcessor jsProcessor = getJSContentAssistProcessor();
+							if (jsProcessor != null) {
+								return jsProcessor.computeCompletionProposals(textViewer, documentPosition);
+							}
+							return new ICompletionProposal[0];
+						}
+					}
+				}
+			}
+		}
+
+		isXHTML = getXHTML(node);
+
+		fGenerator = null; // force reload of content generator
+
+		// handle blank HTML document case
+		if (treeNode == null || isViewerEmpty(textViewer)) {
+			// cursor is at the EOF
+			ICompletionProposal htmlTagProposal = getHTMLTagProposal(textViewer, documentPosition);
+			ICompletionProposal[] superResults = super.computeCompletionProposals(textViewer, documentPosition);
+			if (superResults != null && superResults.length > 0 && htmlTagProposal != null) {
+				ICompletionProposal[] blankHTMLDocResults = new ICompletionProposal[superResults.length + 1];
+				blankHTMLDocResults[0] = htmlTagProposal;
+				System.arraycopy(superResults, 0, blankHTMLDocResults, 1, superResults.length);
+				return blankHTMLDocResults;
+			}
+		}
+
+		if (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
+
+			// check embedded CSS proposals at the beginning of the STYLE end
+			// tag
+			Element element = (Element) node;
+			String tagName = element.getTagName();
+			if (tagName != null && tagName.equalsIgnoreCase(HTML40Namespace.ATTR_NAME_STYLE)) {//$NON-NLS-1$
+				IStructuredDocumentRegion endStructuredDocumentRegion = node.getEndStructuredDocumentRegion();
+				if (endStructuredDocumentRegion != null && endStructuredDocumentRegion.getStartOffset() == documentPosition) {
+					IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
+					if (startStructuredDocumentRegion != null) {
+						int offset = startStructuredDocumentRegion.getEndOffset();
+						int pos = documentPosition - offset;
+						ICompletionProposal[] proposals = getCSSProposals(textViewer, pos, node, offset, (char) 0);
+						if (proposals != null)
+							return proposals;
+					}
+				}
+			}
+
+			// check inline CSS proposals
+			// need to find attr region from sd region
+			IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion(textViewer, documentPosition);
+			Iterator regions = sdRegion.getRegions().iterator();
+			ITextRegion styleNameRegion = null;
+			ITextRegion styleValueRegion = null;
+			while (regions.hasNext()) {
+				styleNameRegion = (ITextRegion) regions.next();
+				if (styleNameRegion.getType().equals(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) && sdRegion.getText(styleNameRegion).equalsIgnoreCase(HTML40Namespace.ATTR_NAME_STYLE)) { //$NON-NLS-1$
+					// the next region should be "="
+					if (regions.hasNext()) {
+						regions.next(); // skip the "="
+						// next region should be attr value region
+						if (regions.hasNext()) {
+							styleValueRegion = (ITextRegion) regions.next();
+							break;
+						}
+					}
+				}
+			}
+
+			if (styleValueRegion != null) {
+				int offset = sdRegion.getStartOffset(styleValueRegion);
+				int end = sdRegion.getTextEndOffset(styleValueRegion);
+				if (documentPosition >= offset && documentPosition <= end) {
+					boolean askCSS = true;
+					char quote = (char) 0;
+					String text = sdRegion.getText(styleValueRegion);
+					int length = (text != null ? text.length() : 0);
+					if (length > 0) {
+						char firstChar = text.charAt(0);
+						if (firstChar == '"' || firstChar == '\'') {
+							if (documentPosition == offset) {
+								// before quote
+								askCSS = false;
+							}
+							else {
+								offset++;
+								quote = firstChar;
+							}
+						}
+						if (documentPosition == end) {
+							if (length > 1 && text.charAt(length - 1) == quote) {
+								// after quote
+								askCSS = false;
+							}
+						}
+					}
+					if (askCSS) {
+						int pos = documentPosition - offset;
+						ICompletionProposal[] proposals = getCSSProposals(textViewer, pos, node, offset, quote);
+						if (proposals != null)
+							return proposals;
+					}
+				}
+			}
+		}
+
+		return super.computeCompletionProposals(textViewer, documentPosition);
+	}
+
+	/**
+	 * Returns true if there is no text or it's all white space, otherwise
+	 * returns false
+	 * 
+	 * @param treeNode
+	 * @param textViewer
+	 * @return boolean
+	 */
+	private boolean isViewerEmpty(ITextViewer textViewer) {
+		boolean isEmpty = false;
+		String text = textViewer.getTextWidget().getText();
+		if (text == null || (text != null && text.trim().equals(""))) //$NON-NLS-1$
+			isEmpty = true;
+		return isEmpty;
+	}
+
+	/**
+	 * @return ICompletionProposal
+	 */
+	private ICompletionProposal getHTMLTagProposal(ITextViewer viewer, int documentPosition) {
+		IModelManager mm = StructuredModelManager.getModelManager();
+		IStructuredModel model = null;
+		ICompletionProposal result = null;
+		try {
+			if (mm != null) {
+				model = mm.getExistingModelForRead(viewer.getDocument());
+
+				if (model != null) {
+					IDOMDocument doc = ((IDOMModel) model).getDocument();
+
+					ModelQuery mq = ModelQueryUtil.getModelQuery(doc);
+					if (mq != null) {
+
+						// XHTML requires lowercase tagname for lookup
+						CMDocument correspondingCMDocument = mq.getCorrespondingCMDocument(doc);
+						if (correspondingCMDocument != null) {
+							CMElementDeclaration htmlDecl = (CMElementDeclaration) correspondingCMDocument.getElements().getNamedItem(HTML40Namespace.ElementName.HTML.toLowerCase());
+							if (htmlDecl != null) {
+								StringBuffer proposedTextBuffer = new StringBuffer();
+								getContentGenerator().generateTag(doc, htmlDecl, proposedTextBuffer);
+
+								String proposedText = proposedTextBuffer.toString();
+								String requiredName = getContentGenerator().getRequiredName(doc, htmlDecl);
+
+								CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, documentPosition,
+								/* start pos */
+								0, /* replace length */
+								requiredName.length() + 2, /*
+															 * cursor position
+															 * after
+															 * (relavtive to
+															 * start)
+															 */
+								HTMLEditorPluginImageHelper.getInstance().getImage(HTMLEditorPluginImages.IMG_OBJ_TAG_GENERIC), requiredName, null, null, XMLRelevanceConstants.R_TAG_NAME);
+								result = proposal;
+							}
+						}
+					}
+				}
+			}
+		}
+		finally {
+			if (model != null)
+				model.releaseFromRead();
+		}
+		return result;
+	}
+
+	/**
+	 * @see AbstractContentAssistProcessor#getContentGenerator()
+	 */
+	public XMLContentModelGenerator getContentGenerator() {
+		if (fGenerator == null) {
+			if (isXHTML)
+				fGenerator = XHTMLMinimalContentModelGenerator.getInstance();
+			else
+				fGenerator = HTMLMinimalContentModelGenerator.getInstance();
+		}
+		return fGenerator;
+	}
+
+	protected ICompletionProposal[] getCSSProposals(ITextViewer viewer, int pos, IDOMNode element, int offset, char quote) {
+
+		CSSContentAssistProcessor cssProcessor = new CSSContentAssistProcessor();
+		cssProcessor.setDocumentOffset(offset);
+		cssProcessor.setQuoteCharOfStyleAttribute(quote);
+
+		return cssProcessor.computeCompletionProposals(viewer, pos);
+	}
+
+	protected String getEmptyTagCloseString() {
+		if (isXHTML)
+			return " />"; //$NON-NLS-1$
+		return ">"; //$NON-NLS-1$
+	}
+	
+	private IContentAssistProcessor getJSContentAssistProcessor() {
+		if (fJSContentAssistProcessor == null) {
+			fJSContentAssistProcessor = new StructuredTextViewerConfigurationHTML().getContentAssistant(null).getContentAssistProcessor(IHTMLPartitions.SCRIPT);
+		}
+		return fJSContentAssistProcessor;
+	}
+
+	private HTMLTemplateCompletionProcessor getTemplateCompletionProcessor() {
+		if (fTemplateProcessor == null) {
+			fTemplateProcessor = new HTMLTemplateCompletionProcessor();
+		}
+		return fTemplateProcessor;
+	}
+
+	/**
+	 * Determine if this Document is an XHTML Document. Oprates solely off of
+	 * the Document Type declaration
+	 */
+	protected boolean getXHTML(Node node) {
+		if (node == null)
+			return false;
+
+		Document doc = null;
+		if (node.getNodeType() != Node.DOCUMENT_NODE)
+			doc = node.getOwnerDocument();
+		else
+			doc = ((Document) node);
+
+		if (doc instanceof IDOMDocument)
+			return ((IDOMDocument) doc).isXMLType();
+
+
+		if (doc instanceof INodeNotifier) {
+			ModelQueryAdapter adapter = (ModelQueryAdapter) ((INodeNotifier) doc).getAdapterFor(ModelQueryAdapter.class);
+			CMDocument cmdoc = null;
+			if (adapter != null && adapter.getModelQuery() != null)
+				cmdoc = adapter.getModelQuery().getCorrespondingCMDocument(doc);
+			if (cmdoc != null) {
+				// treat as XHTML unless we've got the in-code HTML content
+				// model
+				if (cmdoc instanceof HTMLCMDocument)
+					return false;
+				if (cmdoc.supports(HTMLCMProperties.IS_XHTML))
+					return Boolean.TRUE.equals(cmdoc.getProperty(HTMLCMProperties.IS_XHTML));
+			}
+		}
+		// this should never be reached
+		DocumentType docType = doc.getDoctype();
+		return docType != null && docType.getPublicId() != null && docType.getPublicId().indexOf("-//W3C//DTD XHTML ") == 0; //$NON-NLS-1$
+	}
+
+	protected void init() {
+		getPreferenceStore().addPropertyChangeListener(this);
+		reinit();
+	}
+
+	protected void reinit() {
+		String key = HTMLUIPreferenceNames.AUTO_PROPOSE;
+		boolean doAuto = getPreferenceStore().getBoolean(key);
+		if (doAuto) {
+			key = HTMLUIPreferenceNames.AUTO_PROPOSE_CODE;
+			completionProposalAutoActivationCharacters = getPreferenceStore().getString(key).toCharArray();
+		}
+		else {
+			completionProposalAutoActivationCharacters = null;
+		}
+	}
+
+	public void release() {
+		if (factoryForCSS != null) {
+			factoryForCSS.release();
+		}
+		if (fJSContentAssistProcessor instanceof IReleasable) {
+			((IReleasable)fJSContentAssistProcessor).release();
+		}
+		getPreferenceStore().removePropertyChangeListener(this);
+		super.release();
+	}
+
+	protected boolean stringsEqual(String a, String b) {
+		return a.equalsIgnoreCase(b);
+	}
+
+	public void propertyChange(PropertyChangeEvent event) {
+		String property = event.getProperty();
+
+		if (property.compareTo(HTMLUIPreferenceNames.AUTO_PROPOSE) == 0 || property.compareTo(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE) == 0) {
+			reinit();
+		}
+	}
+
+	protected IPreferenceStore getPreferenceStore() {
+		if (fPreferenceStore == null)
+			fPreferenceStore = HTMLUIPlugin.getDefault().getPreferenceStore();
+
+		return fPreferenceStore;
+	}
+
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition, IndexedRegion indexedNode, ITextRegion region) {
+		return computeCompletionProposals(viewer, documentPosition);
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java
new file mode 100644
index 0000000..0bdd85f
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
+import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
+import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
+import org.w3c.dom.Node;
+
+public class HTMLMinimalContentModelGenerator extends XMLContentModelGenerator {
+
+	private static HTMLMinimalContentModelGenerator instance = null;
+	protected int fTagCase;
+	protected int fAttrCase;
+
+	/**
+	 * HTMLMinimalContentModelGenerator constructor comment.
+	 */
+	private HTMLMinimalContentModelGenerator() {
+		super();
+	}
+
+	private void init() {
+		String qualifier = HTMLCorePlugin.getDefault().getBundle().getSymbolicName();
+		fTagCase = Platform.getPreferencesService().getInt(qualifier, HTMLCorePreferenceNames.TAG_NAME_CASE, 0, null);
+		fAttrCase = Platform.getPreferencesService().getInt(qualifier, HTMLCorePreferenceNames.ATTR_NAME_CASE, 0, null);
+	}
+
+	protected void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
+		if (elementDecl == null)
+			return;
+		if (elementDecl instanceof HTMLElementDeclaration) {
+			if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
+				if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
+					return;
+			}
+			else {
+				String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
+				if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
+					return;
+				}
+			}
+		}
+
+		if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
+			return;
+		buffer.append("</" + tagName + ">"); //$NON-NLS-2$//$NON-NLS-1$
+		return;
+	}
+
+	private boolean shouldIgnoreCase(CMNode cmnode) {
+		if (!cmnode.supports(HTMLCMProperties.SHOULD_IGNORE_CASE))
+			return false;
+		return ((Boolean) cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
+	}
+
+	public String getRequiredName(Node ownerNode, CMNode cmnode) {
+		String name = super.getRequiredName(ownerNode, cmnode);
+		// don't change the case unless we're certain it is meaningless
+		if (shouldIgnoreCase(cmnode)) {
+			int caseVal = -1;
+			if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION)
+				caseVal = fTagCase;
+			else if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION)
+				caseVal = fAttrCase;
+			switch (caseVal) {
+				case HTMLCorePreferenceNames.LOWER :
+					{
+						name = name.toLowerCase();
+					}
+					break;
+				case HTMLCorePreferenceNames.UPPER :
+					{
+						name = name.toUpperCase();
+					}
+					break;
+			}
+		}
+		return name;
+	}
+
+	public String getStartTagClose(Node parentNode, CMElementDeclaration elementDecl) {
+		String other = getOtherClose(parentNode);
+		if (other != null)
+			return other;
+		if (elementDecl == null)
+			return ">"; //$NON-NLS-1$
+		if (elementDecl instanceof HTMLElementDeclaration) {
+			if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
+				if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
+					return "/>"; //$NON-NLS-1$
+			}
+			else {
+				String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
+				if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
+					return ">"; //$NON-NLS-1$
+				}
+			}
+		}
+		
+		//if not an html element and empty, assume start tag needs to be closed
+		else if (elementDecl.getContentType() == CMElementDeclaration.EMPTY) {
+			return "/>"; //$NON-NLS-1$
+		}
+
+		return ">"; //$NON-NLS-1$
+	}
+
+	/**
+	 * Gets the instance.
+	 * @return Returns a HTMLMinimalContentModelGenerator
+	 */
+	public synchronized static HTMLMinimalContentModelGenerator getInstance() {
+		if (instance == null)
+			instance = new HTMLMinimalContentModelGenerator();
+		instance.init();
+		return instance;
+	}
+
+
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLStructuredContentAssistProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLStructuredContentAssistProcessor.java
new file mode 100644
index 0000000..034615c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLStructuredContentAssistProcessor.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
+import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
+import org.eclipse.wst.xml.ui.internal.contentassist.AttributeContextInformationPresenter;
+
+/**
+ * <p>Implementation of {@link StructuredContentAssistProcessor} for HTML documents</p>
+ * 
+ * <p>This implementation will react to user preference changes for auto activation
+ * characters for HTML pages</p>
+ */
+public class HTMLStructuredContentAssistProcessor extends StructuredContentAssistProcessor {
+	/** the auto activation characters for this processor, set by user preference */
+	private char[] fCompletionPropoaslAutoActivationCharacters;
+
+	/** the context information validator for this processor */
+	private IContextInformationValidator fContextInformationValidator;
+	
+	/**
+	 * <p>Constructor</p>
+	 * 
+	 * @param assistant {@link ContentAssistant} to use
+	 * @param partitionTypeID the partition type this processor is for
+	 * @param viewer {@link ITextViewer} this processor is acting in
+	 */
+	public HTMLStructuredContentAssistProcessor(ContentAssistant assistant,
+			String partitionTypeID, ITextViewer viewer) {
+		
+		super(assistant, partitionTypeID, viewer, HTMLUIPlugin.getDefault().getPreferenceStore());
+		getAutoActivationCharacterPreferences();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getContextInformationValidator()
+	 */
+	public IContextInformationValidator getContextInformationValidator() {
+		if (this.fContextInformationValidator == null) {
+			this.fContextInformationValidator = new AttributeContextInformationPresenter();
+		}
+		return this.fContextInformationValidator;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
+	 */
+	public char[] getCompletionProposalAutoActivationCharacters() {
+		return this.fCompletionPropoaslAutoActivationCharacters;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#propertyChange(
+	 * 	org.eclipse.jface.util.PropertyChangeEvent)
+	 */
+	public void propertyChange(PropertyChangeEvent event) {
+		if(event.getProperty().equals(HTMLUIPreferenceNames.AUTO_PROPOSE) ||
+				event.getProperty().equals(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE)) {
+			getAutoActivationCharacterPreferences();
+		}
+	}
+	
+	/**
+	 * <p>Gets the auto activation character user preferences and stores them for later use</p>
+	 */
+	private void getAutoActivationCharacterPreferences() {
+		String key = HTMLUIPreferenceNames.AUTO_PROPOSE;
+		boolean doAuto = getPreferenceStore().getBoolean(key);
+		if (doAuto) {
+			key = HTMLUIPreferenceNames.AUTO_PROPOSE_CODE;
+			this.fCompletionPropoaslAutoActivationCharacters = getPreferenceStore().getString(key).toCharArray();
+		}
+		else {
+			this.fCompletionPropoaslAutoActivationCharacters = null;
+		}
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTagsCompletionProposalComputer.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTagsCompletionProposalComputer.java
new file mode 100644
index 0000000..337e2e6
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTagsCompletionProposalComputer.java
@@ -0,0 +1,338 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocument;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
+import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMElementDeclarationImpl;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
+import org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer;
+import org.eclipse.wst.xml.ui.internal.contentassist.AttributeContextInformationPresenter;
+import org.eclipse.wst.xml.ui.internal.contentassist.AttributeContextInformationProvider;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Node;
+
+/**
+ * <p>{@link AbstractXMLModelQueryCompletionProposalComputer} for HTML tag proposals</p>
+ */
+public class HTMLTagsCompletionProposalComputer extends
+		AbstractXMLModelQueryCompletionProposalComputer {
+	
+	/** <code>true</code> if the document the proposal request is on is XHTML */
+	protected boolean isXHTML = false;
+	
+	/** the context information validator for this computer */
+	private IContextInformationValidator fContextInformationValidator;
+	
+	/**
+	 * TODO: IAN: Comment me
+	 */
+	public HTMLTagsCompletionProposalComputer() {
+		this.fContextInformationValidator = null;
+	}
+	
+	/**
+	 * <p>Determine if the document is XHTML or not, then compute the proposals</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		//determine if the content is XHTML or not
+		IndexedRegion treeNode = ContentAssistUtils.getNodeAt(context.getViewer(),
+				context.getInvocationOffset());
+		IDOMNode node = (IDOMNode) treeNode;
+		boolean isXHTMLNode = isXHTMLNode(node);
+		if(this.isXHTML != isXHTMLNode) {
+			this.isXHTML = isXHTMLNode;
+		}
+		
+		//compute the completion proposals
+		return super.computeCompletionProposals(context, monitor);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeContextInformation(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		AttributeContextInformationProvider attributeInfoProvider =
+			new AttributeContextInformationProvider((IStructuredDocument)context.getDocument(),
+					(AttributeContextInformationPresenter) getContextInformationValidator());
+		return Arrays.asList(attributeInfoProvider.getAttributeInformation(context.getInvocationOffset()));
+	}
+	
+	/**
+	 * <p>Dependent on if the document is XHTML or not</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getContentGenerator()
+	 */
+	protected XMLContentModelGenerator getContentGenerator() {
+		if (isXHTML) {
+			return XHTMLMinimalContentModelGenerator.getInstance();
+		} else {
+			return HTMLMinimalContentModelGenerator.getInstance();
+		}
+	}
+	
+	/**
+	 * <p>Filter out all {@link CMNode}s except those specific to HTML documents</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#validModelQueryNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)
+	 */
+	protected boolean validModelQueryNode(CMNode node) {
+		boolean isValid = false;
+		Object cmdoc = node.getProperty("CMDocument"); //$NON-NLS-1$
+		if (cmdoc instanceof CMNode) {
+			String name = ((CMNode) cmdoc).getNodeName();
+			isValid = name != null && name.endsWith(".dtd") && name.indexOf("html") != -1; //$NON-NLS-1$ //$NON-NLS-2$
+		} else if (node.supports(HTMLAttributeDeclaration.IS_HTML)) {
+			Boolean isHTML = (Boolean) node.getProperty(HTMLAttributeDeclaration.IS_HTML);
+			isValid = isHTML == null || isHTML.booleanValue();
+		} else if(node instanceof HTMLPropertyDeclaration) {
+			HTMLPropertyDeclaration propDec = (HTMLPropertyDeclaration)node;
+			isValid = !propDec.isJSP();
+		} else if (node instanceof CMAttributeDeclaration || node instanceof CMElementDeclarationImpl) {
+			isValid = true;
+		} else if(node instanceof CMElementDeclaration) {
+			Boolean isXHTML = ((Boolean)node.getProperty(HTMLCMProperties.IS_XHTML));
+			isValid = isXHTML != null && isXHTML.booleanValue();
+		}
+
+		// Do not propose obsolete tags, regardless
+		if (isValid && node.supports(HTMLCMProperties.IS_OBSOLETE)) {
+			Boolean isObsolete = ((Boolean) node.getProperty(HTMLCMProperties.IS_OBSOLETE));
+			isValid = !(isObsolete != null && isObsolete.booleanValue());
+		}
+
+		return isValid;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEmptyDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addHTMLTagProposal(contentAssistRequest, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addStartDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addStartDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		//determine if XMLPI is first element
+		Node aNode = contentAssistRequest.getNode();
+		Document owningDocument = aNode.getOwnerDocument();
+		Node first = owningDocument.getFirstChild();
+		boolean xmlpiIsFirstElement = ((first != null) && (first.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE));
+		
+		//if there is an XMLPI then XHTML doctype, else HTML doctype
+		if (xmlpiIsFirstElement && (owningDocument.getDoctype() == null) &&
+				isCursorAfterXMLPI(contentAssistRequest)) {
+			
+			addDocTypeProposal(contentAssistRequest, true);
+		} else {
+			addDocTypeProposal(contentAssistRequest,  false);
+		}
+	}
+	
+	/**
+	 * 
+	 * @param contentAssistRequest
+	 * @param isXHTML
+	 */
+	private void addDocTypeProposal(ContentAssistRequest contentAssistRequest, boolean isXHTML) {
+		// if a DocumentElement exists, use that for the root Element name
+		String rootname = "unspecified"; //$NON-NLS-1$
+		if (contentAssistRequest.getNode().getOwnerDocument().getDocumentElement() != null) {
+			rootname = contentAssistRequest.getNode().getOwnerDocument().getDocumentElement().getNodeName();
+		}
+		
+		//decide which entry to use
+		HTMLDocumentTypeEntry entry;
+		if(isXHTML) {
+			entry = HTMLDocumentTypeRegistry.getInstance().getXHTMLDefaultEntry();
+		} else {
+			entry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry();
+		}
+
+		//create the content assist string and proposal
+		String proposedText = "<!DOCTYPE " + rootname + " PUBLIC \"" + //$NON-NLS-1$ //$NON-NLS-2$
+				entry.getPublicId() + "\" \"" + entry.getSystemId() + "\">"; //$NON-NLS-1$ //$NON-NLS-2$
+		ICompletionProposal proposal = new CustomCompletionProposal(
+				proposedText, contentAssistRequest.getReplacementBeginPosition(),
+				contentAssistRequest.getReplacementLength(), 10,
+				XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DOCTYPE),
+				entry.getDisplayName() + " " + HTMLUIMessages.Expandable_label_document_type, //$NON-NLS-1$ 
+				null, null, XMLRelevanceConstants.R_DOCTYPE);
+		contentAssistRequest.addProposal(proposal);
+	}
+	
+	/**
+	 * <p>adds HTML tag proposal for empty document</p>
+	 * 
+	 * @param contentAssistRequest request to add proposal too
+	 * @param context context of the completion request
+	 */
+	private void addHTMLTagProposal(ContentAssistRequest contentAssistRequest, CompletionProposalInvocationContext context) {
+		IStructuredModel model = null;
+		try {
+			if(context.getDocument() instanceof IStructuredDocument) {
+				model = StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument)context.getDocument());
+			}
+			if (model != null) {
+				IDOMDocument doc = ((IDOMModel) model).getDocument();
+
+				ModelQuery mq = ModelQueryUtil.getModelQuery(doc);
+				if (mq != null) {
+
+					// XHTML requires lowercase tagname for lookup
+					CMDocument correspondingCMDocument = mq.getCorrespondingCMDocument(doc);
+					if (correspondingCMDocument != null) {
+						CMElementDeclaration htmlDecl = (CMElementDeclaration) correspondingCMDocument.getElements().getNamedItem(HTML40Namespace.ElementName.HTML.toLowerCase());
+						if (htmlDecl != null) {
+							StringBuffer proposedTextBuffer = new StringBuffer();
+							getContentGenerator().generateTag(doc, htmlDecl, proposedTextBuffer);
+
+							String proposedText = proposedTextBuffer.toString();
+							String requiredName = getContentGenerator().getRequiredName(doc, htmlDecl);
+							
+							IStructuredDocumentRegion region = contentAssistRequest.getDocumentRegion();
+							if (region != null) {
+								if (region.getFirstRegion() != null && 
+										region.getFirstRegion().getType().equals(DOMRegionContext.XML_TAG_OPEN)) {
+									//in order to differentiate between content assist on 
+									//completely empty document and the one with xml open tag
+									proposedText = proposedText.substring(1);
+								}
+							}
+							if (!beginsWith(proposedText, contentAssistRequest.getMatchString())) {
+								return;
+							}
+							int cursorAdjustment = getCursorPositionForProposedText(proposedText);
+							CustomCompletionProposal proposal = new CustomCompletionProposal(
+									proposedText, contentAssistRequest.getReplacementBeginPosition(),
+									contentAssistRequest.getReplacementLength(), cursorAdjustment, 
+									HTMLEditorPluginImageHelper.getInstance().getImage(HTMLEditorPluginImages.IMG_OBJ_TAG_GENERIC),
+									requiredName, null, null, XMLRelevanceConstants.R_TAG_NAME);
+							contentAssistRequest.addProposal(proposal);
+						}
+					}
+				}
+			}
+		}
+		finally {
+			if (model != null)
+				model.releaseFromRead();
+		}
+	}
+	
+	/**
+	 * Determine if this Document is an XHTML Document. Operates solely off of
+	 * the Document Type declaration
+	 */
+	private static boolean isXHTMLNode(Node node) {
+		if (node == null) {
+			return false;
+		}
+
+		Document doc = null;
+		if (node.getNodeType() != Node.DOCUMENT_NODE)
+			doc = node.getOwnerDocument();
+		else
+			doc = ((Document) node);
+
+		if (doc instanceof IDOMDocument) {
+			return ((IDOMDocument) doc).isXMLType();
+		}
+
+		if (doc instanceof INodeNotifier) {
+			ModelQueryAdapter adapter = (ModelQueryAdapter) ((INodeNotifier) doc).getAdapterFor(ModelQueryAdapter.class);
+			CMDocument cmdoc = null;
+			if (adapter != null && adapter.getModelQuery() != null)
+				cmdoc = adapter.getModelQuery().getCorrespondingCMDocument(doc);
+			if (cmdoc != null) {
+				// treat as XHTML unless we've got the in-code HTML content
+				// model
+				if (cmdoc instanceof HTMLCMDocument)
+					return false;
+				if (cmdoc.supports(HTMLCMProperties.IS_XHTML))
+					return Boolean.TRUE.equals(cmdoc.getProperty(HTMLCMProperties.IS_XHTML));
+			}
+		}
+		// this should never be reached
+		DocumentType docType = doc.getDoctype();
+		return docType != null && docType.getPublicId() != null && docType.getPublicId().indexOf("-//W3C//DTD XHTML ") == 0; //$NON-NLS-1$
+	}
+	
+	/**
+	 * Returns a validator used to determine when displayed context
+	 * information should be dismissed. May only return <code>null</code> if
+	 * the processor is incapable of computing context information.
+	 * 
+	 * a context information validator, or <code>null</code> if the
+	 * processor is incapable of computing context information
+	 */
+	private IContextInformationValidator getContextInformationValidator() {
+		if (fContextInformationValidator == null) {
+			fContextInformationValidator = new AttributeContextInformationPresenter();
+		}
+		return fContextInformationValidator;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
new file mode 100644
index 0000000..25d9a43
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.TemplateException;
+import org.eclipse.jface.text.templates.TemplateProposal;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
+import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
+
+
+/**
+ * <p>Completion computer for HTML templates</p>
+ */
+public class HTMLTemplateCompletionProcessor extends TemplateCompletionProcessor {
+	private static final class ProposalComparator implements Comparator {
+		public int compare(Object o1, Object o2) {
+			return ((TemplateProposal) o2).getRelevance() - ((TemplateProposal) o1).getRelevance();
+		}
+	}
+
+	private static final Comparator fgProposalComparator = new ProposalComparator();
+	private String fContextTypeId = null;
+
+	/*
+	 * Copied from super class except instead of calling createContext(viewer,
+	 * region) call createContext(viewer, region, offset) instead
+	 */
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
+
+		ITextSelection selection = (ITextSelection) viewer.getSelectionProvider().getSelection();
+
+		// adjust offset to end of normalized selection
+		if (selection.getOffset() == offset)
+			offset = selection.getOffset() + selection.getLength();
+
+		String prefix = extractPrefix(viewer, offset);
+		Region region = new Region(offset - prefix.length(), prefix.length());
+		TemplateContext context = createContext(viewer, region, offset);
+		if (context == null)
+			return new ICompletionProposal[0];
+		// name of the selection variables {line, word}_selection
+		context.setVariable("selection", selection.getText()); //$NON-NLS-1$
+
+		Template[] templates = getTemplates(context.getContextType().getId());
+
+		List matches = new ArrayList();
+		for (int i = 0; i < templates.length; i++) {
+			Template template = templates[i];
+			try {
+				context.getContextType().validate(template.getPattern());
+			}
+			catch (TemplateException e) {
+				continue;
+			}
+			if (template.matches(prefix, context.getContextType().getId()))
+				matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
+		}
+
+		Collections.sort(matches, fgProposalComparator);
+
+		return (ICompletionProposal[]) matches.toArray(new ICompletionProposal[matches.size()]);
+	}
+
+	/**
+	 * Creates a concrete template context for the given region in the
+	 * document. This involves finding out which context type is valid at the
+	 * given location, and then creating a context of this type. The default
+	 * implementation returns a <code>SmartReplaceTemplateContext</code> for
+	 * the context type at the given location. This takes the offset at which
+	 * content assist was invoked into consideration.
+	 * 
+	 * @param viewer
+	 *            the viewer for which the context is created
+	 * @param region
+	 *            the region into <code>document</code> for which the
+	 *            context is created
+	 * @param offset
+	 *            the original offset where content assist was invoked
+	 * @return a template context that can handle template insertion at the
+	 *         given location, or <code>null</code>
+	 */
+	private TemplateContext createContext(ITextViewer viewer, IRegion region, int offset) {
+		// pretty much same code as super.createContext except create
+		// SmartReplaceTemplateContext
+		TemplateContextType contextType = getContextType(viewer, region);
+		if (contextType != null) {
+			IDocument document = viewer.getDocument();
+			return new ReplaceNameTemplateContext(contextType, document, region.getOffset(), region.getLength(), offset);
+		}
+		return null;
+	}
+
+	protected ICompletionProposal createProposal(Template template, TemplateContext context, IRegion region, int relevance) {
+		return new CustomTemplateProposal(template, context, region, getImage(template), relevance);
+	}
+
+	protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
+		TemplateContextType type = null;
+
+		ContextTypeRegistry registry = getTemplateContextRegistry();
+		if (registry != null)
+			type = registry.getContextType(fContextTypeId);
+
+		return type;
+	}
+
+	protected Image getImage(Template template) {
+		// just return the same image for now
+		return HTMLEditorPluginImageHelper.getInstance().getImage(HTMLEditorPluginImages.IMG_OBJ_TAG_TEMPLATE);
+	}
+
+	private ContextTypeRegistry getTemplateContextRegistry() {
+		return HTMLUIPlugin.getDefault().getTemplateContextRegistry();
+	}
+
+	protected Template[] getTemplates(String contextTypeId) {
+		Template templates[] = null;
+
+		TemplateStore store = getTemplateStore();
+		if (store != null)
+			templates = store.getTemplates(contextTypeId);
+
+		return templates;
+	}
+
+	private TemplateStore getTemplateStore() {
+		return HTMLUIPlugin.getDefault().getTemplateStore();
+	}
+
+	public void setContextType(String contextTypeId) {
+		fContextTypeId = contextTypeId;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplatesCompletionProposalComputer.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplatesCompletionProposalComputer.java
new file mode 100644
index 0000000..2fe72d1
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplatesCompletionProposalComputer.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+
+/**
+ * <p>XML type proposal computer to create HTML template proposals</p>
+ */
+public class HTMLTemplatesCompletionProposalComputer extends
+		DefaultXMLCompletionProposalComputer {
+
+	/** template processor used to create template proposals */
+	private HTMLTemplateCompletionProcessor fTemplateProcessor = null;
+
+	/**
+	 * <p>Create the computer</p>
+	 */
+	public HTMLTemplatesCompletionProposalComputer() {
+		fTemplateProcessor = new HTMLTemplateCompletionProcessor();
+	}
+
+	/**
+	 * <p>Calls super to add templates based on context and then
+	 * adds templates not specific to a context</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		//get the templates specific to the context
+		List proposals = new ArrayList(super.computeCompletionProposals(context, monitor));
+		
+		//get templates not specific to the context
+		proposals.addAll(this.getTemplateProposals(TemplateContextTypeIdsHTML.ALL, context));
+		
+		return proposals;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeNameProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE, context);
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE_VALUE, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEmptyDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.NEW, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagInsertionProposals(
+			ContentAssistRequest contentAssistRequest, int childPosition,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.TAG, context);
+	}
+	
+	/**
+	 * <p>Get the template proposals from the template processor</p>
+	 * 
+	 * @param templateContext
+	 * @param context
+	 * @return
+	 */
+	private List getTemplateProposals(String templateContext,
+			CompletionProposalInvocationContext context) {
+		
+		List templateProposals = new ArrayList();
+		
+		if (fTemplateProcessor != null) {
+			fTemplateProcessor.setContextType(templateContext);
+			ICompletionProposal[] proposals =
+				fTemplateProcessor.computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
+		
+			templateProposals.addAll(Arrays.asList(proposals));
+		}
+		
+		return templateProposals;
+	}
+	
+	/**
+	 * Adds templates to the list of proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param templateContext
+	 * @param context
+	 */
+	private void addTemplates(ContentAssistRequest contentAssistRequest, String templateContext,
+			CompletionProposalInvocationContext context) {
+		
+		if (contentAssistRequest != null) {
+			boolean useProposalList = !contentAssistRequest.shouldSeparate();
+			List proposals = this.getTemplateProposals(templateContext, context);
+	
+			for (int i = 0; i < proposals.size(); ++i) {
+				if (useProposalList) {
+					contentAssistRequest.addProposal((ICompletionProposal)proposals.get(i));
+				}
+				else {
+					contentAssistRequest.addMacro((ICompletionProposal)proposals.get(i));
+				}
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java
new file mode 100644
index 0000000..748a54d
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.wst.css.core.text.ICSSPartitions;
+import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
+import org.eclipse.wst.xml.ui.internal.contentassist.NoRegionContentAssistProcessor;
+
+/**
+ * 
+ * @author pavery
+ */
+public class NoRegionContentAssistProcessorForHTML extends NoRegionContentAssistProcessor {
+	protected void initPartitionToProcessorMap() {
+		
+		super.initPartitionToProcessorMap();
+		IContentAssistProcessor htmlProcessor = new HTMLContentAssistProcessor();
+		addPartitionProcessor(IHTMLPartitions.HTML_DEFAULT, htmlProcessor);
+		addPartitionProcessor(IHTMLPartitions.HTML_COMMENT, htmlProcessor);
+
+		IContentAssistProcessor jsContentAssistProcessor = new StructuredTextViewerConfigurationHTML().getContentAssistant(null).getContentAssistProcessor(IHTMLPartitions.SCRIPT);
+		addPartitionProcessor(IHTMLPartitions.SCRIPT, jsContentAssistProcessor);
+
+		IContentAssistProcessor cssContentAssistProcessor = new CSSContentAssistProcessor();
+		addPartitionProcessor(ICSSPartitions.STYLE, cssContentAssistProcessor);
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java
new file mode 100644
index 0000000..764a915
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.templates.DocumentTemplateContext;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateBuffer;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.TemplateException;
+import org.eclipse.jface.text.templates.TemplateVariable;
+
+/**
+ * Just like DocumentTemplateContext except if an insert offset is passed in,
+ * during evaluation, the "prefix" before the template will be checked to see
+ * if it matches the template name. If so, overwrite the template name.
+ * Otherwise, just insert the template at the insert offset location (by not
+ * overwriting the prefix text)
+ */
+public class ReplaceNameTemplateContext extends DocumentTemplateContext {
+	private int fInsertOffset = -1;
+
+	/**
+	 * Creates a document template context.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param offset
+	 *            the offset of the document region
+	 * @param length
+	 *            the length of the document region
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length) {
+		this(type, document, new Position(offset, length));
+	}
+
+	/**
+	 * Creates a document template context. The supplied <code>Position</code>
+	 * will be queried to compute the <code>getStart</code> and
+	 * <code>getEnd</code> methods, which will therefore answer updated
+	 * position data if it is registered with the document.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param position
+	 *            the position describing the area of the document which forms
+	 *            the template context
+	 * @since 3.1
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, Position position) {
+		super(type, document, position);
+	}
+
+	/**
+	 * Creates a document template context.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param offset
+	 *            the offset of the document region
+	 * @param length
+	 *            the length of the document region
+	 * @param insertOffset
+	 *            the offset of the document region where insert was
+	 *            originally requested
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length, int insertOffset) {
+		this(type, document, new Position(offset, length));
+		fInsertOffset = insertOffset;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.templates.TemplateContext#evaluate(org.eclipse.jface.text.templates.Template)
+	 */
+	public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException {
+		TemplateBuffer buffer = super.evaluate(template);
+		if (buffer != null) {
+			if (fInsertOffset > -1 && fInsertOffset > getStart()) {
+				String prefix = getDocument().get(getStart(), fInsertOffset - getStart());
+				if (!template.getName().startsWith(prefix)) {
+					// generate a new buffer that actually contains the
+					// text that was going to be overwritten
+					int prefixSize = prefix.length();
+					TemplateVariable[] newTemplateVar = buffer.getVariables();
+					for (int i =0; i < newTemplateVar.length; i++ ){
+						int[] offsets = newTemplateVar[i].getOffsets();
+						for (int j=0; j<offsets.length ;j++){
+							offsets[j] += prefixSize;
+						}
+					}
+					buffer = new TemplateBuffer(prefix + buffer.getString(), newTemplateVar);
+				}
+			}
+		}
+		return buffer;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java
new file mode 100644
index 0000000..2a9607e
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+
+
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
+import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
+import org.w3c.dom.Node;
+
+public class XHTMLMinimalContentModelGenerator extends XMLContentModelGenerator {
+
+	private static XHTMLMinimalContentModelGenerator instance = null;
+
+	private XHTMLMinimalContentModelGenerator() {
+		super();
+	}
+
+	protected void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
+		if (elementDecl == null)
+			return;
+		if (elementDecl instanceof HTMLElementDeclaration) {
+			if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
+				if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
+					return;
+			}
+			else {
+				String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
+				if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
+					return;
+				}
+			}
+		}
+
+		if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
+			return;
+		buffer.append("</" + tagName + ">"); //$NON-NLS-2$//$NON-NLS-1$
+		return;
+	}
+
+
+	public String getStartTagClose(Node parentNode, CMElementDeclaration elementDecl) {
+		String other = getOtherClose(parentNode);
+		if (other != null)
+			return other;
+		if (elementDecl == null)
+			return ">"; //$NON-NLS-1$
+		// EMPTY tag, do a self-close
+		if (elementDecl.getContentType() == CMElementDeclaration.EMPTY) {
+			// if it's a JSP element, don't add the space since the JSP container doesn't/shouldn't care
+			if (elementDecl instanceof HTMLElementDeclaration && (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()))
+				// if it's not JSP, conform to XHTML guidelines and add the space
+				return "/>"; //$NON-NLS-1$
+			else
+				return " />"; //$NON-NLS-1$
+		}
+		// not defined as EMPTY, but should be treated as such anyway
+		else if (elementDecl instanceof HTMLElementDeclaration) {
+			String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
+			if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
+				return " />"; //$NON-NLS-1$
+			}
+		}
+
+		return ">"; //$NON-NLS-1$
+	}
+
+	public synchronized static XHTMLMinimalContentModelGenerator getInstance() {
+		if (instance == null)
+			instance = new XHTMLMinimalContentModelGenerator();
+		return instance;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/HTMLNodeActionManager.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/HTMLNodeActionManager.java
new file mode 100644
index 0000000..b59c954
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/HTMLNodeActionManager.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentoutline;
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.wst.html.core.internal.HTMLContentBuilder;
+import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
+import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
+import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
+import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
+import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
+import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilder;
+import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+/**
+ * 
+ */
+public class HTMLNodeActionManager extends XMLNodeActionManager {
+	protected int fTagCase;
+	protected int fAttrCase;
+
+	public HTMLNodeActionManager(IStructuredModel model, Viewer viewer) {
+		super(model, viewer);
+		updateCase();
+	}
+
+	/**
+	 * If neccessary, employ a DOMContentBuilder that understands how to
+	 * change the case of HTML tags (but NOT taglib derived tags).
+	 */
+	public DOMContentBuilder createDOMContentBuilder(Document document) {
+		DOMContentBuilder builder = null;
+		String one = fModel.getModelHandler().getAssociatedContentTypeId();
+		String modelContentTypeId = fModel.getContentTypeIdentifier();
+		if (one != modelContentTypeId) {
+			System.out.println("not equal"); //$NON-NLS-1$
+		}
+		if (modelContentTypeId.equals(ContentTypeIdForHTML.ContentTypeID_HTML))
+			builder = new HTMLContentBuilder(document);
+		else
+			builder = super.createDOMContentBuilder(document);
+
+		return builder;
+	}
+
+	private boolean shouldIgnoreCase(CMNode cmnode) {
+		if (!cmnode.supports(HTMLCMProperties.SHOULD_IGNORE_CASE))
+			return false;
+		return ((Boolean) cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
+	}
+
+	/**
+	 * Modify the displayed menuitem label to change the case of HTML children
+	 * but neither XML nor taglib-derived children.
+	 */
+	public String getLabel(Node parent, CMNode cmnode) {
+		String result = null;
+		// CMNode cmnode = action.getCMNode();
+		// don't change the case unless we're certain it is meaningless
+		if (shouldIgnoreCase(cmnode)) {
+			String name = cmnode.getNodeName();
+			if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION) {
+				if (fTagCase == HTMLCorePreferenceNames.LOWER)
+					name = name.toLowerCase();
+				else if (fTagCase == HTMLCorePreferenceNames.UPPER)
+					name = name.toUpperCase();
+				// else do nothing
+			}
+			else if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
+				if (fAttrCase == HTMLCorePreferenceNames.LOWER)
+					name = name.toLowerCase();
+				else if (fAttrCase == HTMLCorePreferenceNames.UPPER)
+					name = name.toUpperCase();
+				// else do nothing
+			}
+			result = name;
+		}
+		else {
+			result = super.getLabel(parent, cmnode);
+		}
+
+		return result;
+	}
+
+	/**
+	 * Another HTML specific detail.
+	 */
+	protected void updateCase() {
+		if (fModel != null) {
+			String modelContentTypeId = fModel.getContentTypeIdentifier();
+			if (modelContentTypeId != null) {
+				if (modelContentTypeId.equals(ContentTypeIdForHTML.ContentTypeID_HTML)) {
+					Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences(); //$NON-NLS-1$
+					fTagCase = prefs.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
+					fAttrCase = prefs.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
+				}
+			}
+		}
+	}
+
+	public void reformat(Node newElement, boolean deep) {
+		try {
+			// tell the model that we are about to make a big model change
+			fModel.aboutToChangeModel();
+
+			// format selected node
+			IStructuredFormatProcessor formatProcessor = new HTMLFormatProcessorImpl();
+			formatProcessor.formatNode(newElement);
+		}
+		finally {
+			// tell the model that we are done with the big model change
+			fModel.changedModel();
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java
new file mode 100644
index 0000000..ea1dddd
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentoutline;
+
+
+
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
+
+/**
+ * An adapter factory to create JFaceNodeAdapters.  Use this
+ * adapter factory with a JFaceAdapterContentProvider to display
+ * DOM nodes in a tree.
+ */
+public class JFaceNodeAdapterFactoryForHTML extends JFaceNodeAdapterFactory {
+
+
+	public JFaceNodeAdapterFactoryForHTML() {
+		this(IJFaceNodeAdapter.class, true);
+	}
+
+	public JFaceNodeAdapterFactoryForHTML(Object adapterKey, boolean registerAdapters) {
+		super(adapterKey, registerAdapters);
+	}
+
+	protected INodeAdapter createAdapter(INodeNotifier node) {
+		if (singletonAdapter == null) {
+			// create the JFaceNodeAdapter
+			singletonAdapter = new JFaceNodeAdapterForHTML(this);
+			initAdapter(singletonAdapter, node);
+		}
+		return singletonAdapter;
+	}
+
+	public INodeAdapterFactory copy() {
+		return new JFaceNodeAdapterFactoryForHTML(getAdapterKey(), isShouldRegisterAdapter());
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java
new file mode 100644
index 0000000..1b494c5
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentoutline;
+
+
+
+import java.util.Locale;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
+import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapter;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
+import org.w3c.dom.Node;
+
+/**
+ * Adapts a DOM node to a JFace viewer.
+ */
+public class JFaceNodeAdapterForHTML extends JFaceNodeAdapter {
+
+	private Image createHTMLImage(String imageResourceName) {
+		return HTMLEditorPluginImageHelper.getInstance().getImage(imageResourceName);
+	}
+
+	/**
+	 * Constructor for JFaceNodeAdapterForHTML.
+	 * 
+	 * @param adapterFactory
+	 */
+	public JFaceNodeAdapterForHTML(JFaceNodeAdapterFactory adapterFactory) {
+		super(adapterFactory);
+	}
+
+	protected Image createImage(Object object) {
+		Image image = null;
+
+		Node node = (Node) object;
+		if (node.getNodeType() == Node.ELEMENT_NODE) {
+			String lowerName = node.getNodeName().toLowerCase(Locale.US);
+			if (lowerName.equals("table") || lowerName.endsWith(":table")) //$NON-NLS-1$
+				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TABLE);
+			else if (lowerName.equals("a") || lowerName.endsWith(":a")) //$NON-NLS-1$
+				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_ANCHOR);
+			else if (lowerName.equals("body") || lowerName.endsWith(":body")) //$NON-NLS-1$
+				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_BODY);
+			else if (lowerName.equals("button") || lowerName.endsWith(":button")) //$NON-NLS-1$
+				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_BUTTON);
+			else if (lowerName.equals("font") || lowerName.endsWith(":font")) //$NON-NLS-1$
+				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_FONT);
+			else if (lowerName.equals("form") || lowerName.endsWith(":form")) //$NON-NLS-1$
+				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_FORM);
+			else if (lowerName.equals("html") || lowerName.endsWith(":html")) //$NON-NLS-1$
+				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_HTML);
+			else if (lowerName.equals("img") || lowerName.endsWith(":img")) //$NON-NLS-1$
+				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE);
+			else if (lowerName.equals("map") || lowerName.endsWith(":map")) //$NON-NLS-1$
+				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE_MAP);
+			else if (lowerName.equals("title") || lowerName.endsWith(":title")) //$NON-NLS-1$
+				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_TITLE);
+			else
+				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG);
+		}
+		if (image == null) {
+			image = super.createImage(node);
+		}
+		return image;
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java
new file mode 100644
index 0000000..b123df9
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentproperties.ui;
+
+/**
+ * @deprecated Not needed. See BUG118359
+ */
+public class AbstractDeviceProfileEntry implements DeviceProfileEntry {
+
+	public AbstractDeviceProfileEntry() {
+		super();
+	}
+
+	public String getEntryId() {
+		return null;
+	}
+
+	public String getEntryName() {
+		return null;
+	}
+
+	public void release() {
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java
new file mode 100644
index 0000000..664084c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentproperties.ui;
+
+import java.util.Iterator;
+
+/**
+ * @deprecated Not needed.  See BUG118359
+ */
+public class AbstractDeviceProfileEntryProvider implements
+		DeviceProfileEntryProvider {
+
+	public AbstractDeviceProfileEntryProvider() {
+		super();
+	}
+
+	public Iterator getDeviceProfileEntries() {
+		return null;
+	}
+
+	public void release() {
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java
new file mode 100644
index 0000000..75b272d
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentproperties.ui;
+
+import java.util.Enumeration;
+import java.util.Iterator;
+
+import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
+import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
+import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboList;
+
+/**
+ * @deprecated This class only contains helper methods that you should
+ *             actually implement yourself.
+ */
+public final class ContentSettingsRegistry {
+
+	private static final String NONE = HTMLUIMessages.UI_none;
+
+	public static String maxLengthStringInHTMLDocumentTypeRegistry = ""; //$NON-NLS-1$
+	public static String maxLengthStringInCharacterCodeRegistry = ""; //$NON-NLS-1$
+
+	private ContentSettingsRegistry() {
+	}
+
+	public static void setHTMLDocumentTypeRegistryInto(ComboList combo) {
+		combo.add(NONE, ""); //$NON-NLS-1$
+		HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
+		Enumeration e = reg.getEntries();
+		while (e.hasMoreElements()) {
+			HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
+			String publicId = entry.getPublicId();
+			String displayName = entry.getDisplayName();
+			if (displayName != null) {
+				combo.add(displayName, publicId);
+				if (displayName.length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
+					maxLengthStringInHTMLDocumentTypeRegistry = displayName;
+			}
+			else
+				combo.add(publicId, publicId);
+			if (publicId.length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
+				maxLengthStringInHTMLDocumentTypeRegistry = publicId;
+			if (entry.getSystemId() == null)
+				continue; // if HTML entry
+			if (entry.getSystemId().length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
+				maxLengthStringInHTMLDocumentTypeRegistry = entry.getSystemId();
+		}
+
+		combo.sortByKey(1);
+	}
+
+	public static void setCSSMetaModelRegistryInto(ComboList combo) {
+		combo.add(NONE, ""); //$NON-NLS-1$
+		CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
+		Iterator i = reg.getProfiles();
+		while (i.hasNext()) {
+			CSSProfile profile = (CSSProfile) i.next();
+			String id = profile.getProfileID();
+			String name = profile.getProfileName();
+			combo.add(name, id);
+		}
+		combo.sortByKey(1);
+	}
+
+	public static void setDeviceProfileRegistryInto(ComboList combo) {
+		combo.add(NONE, ""); //$NON-NLS-1$
+		DeviceProfileEntryProvider reg = DeviceProfileEntryProviderBuilder.getEntryProvider();
+		if (reg == null) {
+			return;
+		}
+		Iterator profiles = reg.getDeviceProfileEntries();
+		if (profiles == null) {
+			reg.release();
+			return;
+		}
+		DeviceProfileEntry entry;
+		while (profiles.hasNext()) {
+			entry = (DeviceProfileEntry) profiles.next();
+			combo.add(entry.getEntryName(), entry.getEntryId());
+			entry.release();
+		}
+		reg.release();
+		combo.sortByKey(1);
+	}
+
+	public static String getSystemIdFrom(String publicId) {
+		if (publicId == null || publicId.length() == 0)
+			return null;
+		HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
+		Enumeration e = reg.getEntries();
+		while (e.hasMoreElements()) {
+			HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
+			if (entry.getPublicId().equals(publicId))
+				return entry.getSystemId();
+		}
+		return null;
+	}
+
+	public static void setContentTypeInto(ComboList combo) {
+		String[] type = {"", //$NON-NLS-1$
+					"application/xhtml+xml", //$NON-NLS-1$
+					"application/xml", //$NON-NLS-1$
+					"text/html", //$NON-NLS-1$
+					"text/xml",}; //$NON-NLS-1$
+		String[] displayName = {NONE, "application/xhtml+xml", //$NON-NLS-1$
+					//$NON-NLS-1$
+					"application/xml", //$NON-NLS-1$
+					"text/html", //$NON-NLS-1$
+					"text/xml",}; //$NON-NLS-1$
+		for (int i = 0; i < type.length; i++) {
+			if (displayName[i] != null && displayName[i].length() != 0)
+				combo.add(displayName[i], type[i]);
+			else
+				combo.add(type[i], type[i]);
+		}
+
+	}
+
+	public static void setCharacterCodeInto(ComboList combo) {
+		combo.add(NONE, ""); //$NON-NLS-1$
+		String max = ""; //$NON-NLS-1$
+		// CommonCharsetNames encoding = new CommonCharsetNames();
+		String[] charCode = CommonCharsetNames.getCommonCharsetNames();
+		for (int i = 0; i < charCode.length; i++) {
+			String displayName = CommonCharsetNames.getDisplayString(charCode[i]);
+			if (displayName != null && displayName.length() != 0) {
+				combo.add(displayName, charCode[i]);
+				int n_byte = displayName.getBytes().length;
+				if (max.getBytes().length < n_byte)
+					max = displayName;
+			}
+			else
+				combo.add(charCode[i], charCode[i]);
+		}
+		/*
+		 * charCode = encoding.getSupportedJavaEncodings(); for(int i=0;i<charCode.length;i++){
+		 * String displayName = encoding.getDisplayString(charCode[i]); if
+		 * (displayName!=null && displayName.length()!=0)
+		 * combo.add(displayName,charCode[i]); else
+		 * combo.add(charCode[i],charCode[i]); }
+		 */
+		// combo.sortByKey(1);
+		maxLengthStringInCharacterCodeRegistry = max;
+	}
+
+	public static void setLanguageInto(ComboList combo) {
+		String[] lang = {"", //$NON-NLS-1$
+					"java", //$NON-NLS-1$
+					"javascript",}; //$NON-NLS-1$
+		String[] displayName = {NONE, "java", //$NON-NLS-1$
+					//$NON-NLS-1$
+					"javascript",}; //$NON-NLS-1$
+		for (int i = 0; i < lang.length; i++) {
+			if (displayName[i] != null && displayName[i].length() != 0)
+				combo.add(displayName[i], lang[i]);
+			else
+				combo.add(lang[i], lang[i]);
+		}
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java
new file mode 100644
index 0000000..c42cb15
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentproperties.ui;
+
+/**
+ * <p>
+ * This interface is not intended to be implemented by clients directly.
+ * Instead, please use abstract class(AbstractDeviceProfileEntry) instead.
+ * </p>
+ * 
+ * @deprecated Not needed. See BUG118359
+ */
+public interface DeviceProfileEntry {
+	public String getEntryId();
+
+	public String getEntryName();
+
+	public void release();
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java
new file mode 100644
index 0000000..fe60779
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentproperties.ui;
+
+import java.util.Iterator;
+
+/**
+ * <p>
+ * This interface is not intended to be implemented by clients directly.
+ * Instead, please use abstract class(AbstractDeviceProfileEntryProvider)
+ * instead.
+ * </p>
+ * 
+ * @deprecated Not needed. See BUG118359
+ */
+public interface DeviceProfileEntryProvider {
+	public Iterator getDeviceProfileEntries();
+
+	public void release();
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java
new file mode 100644
index 0000000..3263eaa
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentproperties.ui;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * @deprecated Not needed.  See BUG118359
+ */
+public class DeviceProfileEntryProviderBuilder {
+	private static final String EXTENSION_POINT_PLUGINID = "org.eclipse.wst.html.ui";  //$NON-NLS-1$
+	private static final String EXTENSION_POINT_NAME = "deviceProfileEntryProvider"; //$NON-NLS-1$
+	private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
+
+	public DeviceProfileEntryProviderBuilder() {
+		super();
+	}
+	static public DeviceProfileEntryProvider getEntryProvider() {
+		IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_PLUGINID, EXTENSION_POINT_NAME);
+		if (point != null) {
+			IExtension extensions[] = point.getExtensions();
+			if ((extensions != null) && (extensions.length > 0)) {
+				for (int i = 0; i < extensions.length; i++) {
+					IConfigurationElement elements[] = extensions[i].getConfigurationElements();
+					if ((elements != null) && (elements.length > 0)) {
+						for (int j = 0; j < elements.length; j++) {
+							IConfigurationElement config = elements[j];
+							if ((config != null) && (config.getName().equals(EXTENSION_POINT_NAME) == true)) {
+								String className = config.getAttribute(ATTR_CLASS);
+								if (className != null) {
+									try {
+										DeviceProfileEntryProvider provider = (DeviceProfileEntryProvider)config.createExecutableExtension(ATTR_CLASS);
+										if (provider != null) {
+											return provider;
+										}
+									} catch (CoreException ignored) {
+									}
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java
new file mode 100644
index 0000000..395fded
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java
@@ -0,0 +1,280 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentproperties.ui;
+
+import java.util.Map;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.Logger;
+import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
+import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
+import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboListOnPropertyPage;
+import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ContentSettingsPropertyPage;
+
+/**
+ * @deprecated Use WebContentSettingsPropertyPage instead
+ */
+public final class HTMLContentSettingsPropertyPage extends ContentSettingsPropertyPage implements org.eclipse.swt.events.SelectionListener {
+
+
+	private final int N_DOCUMENT_TYPE = 0;
+	private final int N_CSS_PROFILE = 1;
+	private final int N_TARGET_DEVICE = 2;
+
+	private Text publicIdText;
+	private Text systemIdText;
+
+	public HTMLContentSettingsPropertyPage() {
+		super();
+		numberOfCombo = 3;
+		numCols = 2;
+		numRows = 8;
+		combo = new ComboListOnPropertyPage[super.numberOfCombo];
+
+	}
+
+
+
+	protected void createDocumentTypeComboBox() {
+
+		// create description of implecit DOCTYPE	
+		Label label = new Label(propertyPage, SWT.LEFT);
+		label.setText(HTMLUIMessages.UI_Description_of_role_of_following_DOCTYPE);
+		GridData data = new GridData();
+		data.horizontalAlignment = GridData.FILL;
+		data.horizontalSpan = numCols;
+		label.setLayoutData(data);
+
+		// create combobox
+		super.combo[N_DOCUMENT_TYPE] = super.createComboBoxOf(DOCUMENT_LABEL);
+		super.combo[this.N_DOCUMENT_TYPE].addSelectionListener(this);
+		// set entry list into Combo
+		ContentSettingsRegistry.setHTMLDocumentTypeRegistryInto(combo[N_DOCUMENT_TYPE]);
+		//	create TextField
+		createIDTextField();
+		if (combo[N_DOCUMENT_TYPE].getItemCount() <= 0)
+			return;
+
+		String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
+		// when either .contentsettings or element doesn't exist
+		// when attribute doesn't exists,getProperty returns empty string.
+		if (initValue == null)
+			initValue = ""; //$NON-NLS-1$
+		// set init selectionItem in Combo
+		super.setSelectionItem(combo[N_DOCUMENT_TYPE], initValue);
+		this.publicIdText.setText(initValue);
+		if (!initValue.equals("")) {//$NON-NLS-1$
+			// toro D210260
+			if (ContentSettingsRegistry.getSystemIdFrom(initValue) != null)
+				this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(initValue));
+			else
+				this.systemIdText.setText("");//$NON-NLS-1$
+		}
+		else
+			this.systemIdText.setText("");//$NON-NLS-1$
+
+		// create separator
+		label = new Label(propertyPage, SWT.SEPARATOR | SWT.HORIZONTAL);
+		data = new GridData();
+		data.horizontalAlignment = GridData.FILL;
+		data.horizontalSpan = numCols;
+		data.verticalSpan = 8;
+		label.setLayoutData(data);
+
+	}
+
+
+
+	protected void createCSSComboBox() {
+		super.combo[N_CSS_PROFILE] = super.createComboBoxOf(CSS_LABEL);
+
+		ContentSettingsRegistry.setCSSMetaModelRegistryInto(combo[N_CSS_PROFILE]);
+		if (combo[N_CSS_PROFILE].getItemCount() <= 0)
+			return;
+		String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
+		// when either .contentsettings or element doesn't exist
+		// when attribute doesn't exists,getProperty returns empty string.
+		if (initValue == null)
+			initValue = ""; //$NON-NLS-1$
+		// set init selectionItem in Combo
+		super.setSelectionItem(combo[N_CSS_PROFILE], initValue);
+	}
+
+
+
+	protected void createDeviceComboBox() {
+		super.combo[N_TARGET_DEVICE] = super.createComboBoxOf(DEVICE_LABEL);
+
+		ContentSettingsRegistry.setDeviceProfileRegistryInto(combo[N_TARGET_DEVICE]);
+		if (combo[N_TARGET_DEVICE].getItemCount() <= 0)
+			return;
+		String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
+		// when either .contentsettings or element doesn't exist
+		// when attribute doesn't exists,getProperty returns empty string.
+		if (initValue == null)
+			initValue = ""; //$NON-NLS-1$
+		// set init selectionItem in Combo
+		super.setSelectionItem(combo[N_TARGET_DEVICE], initValue);
+	}
+
+
+	protected void createSettingsPageGUI() {
+		int type = ((IResource) getElement()).getType();
+		switch (type) {
+			case IResource.FILE :
+				//	composite = createComposite(propertyPage,numCols,numRows);
+				createDocumentTypeComboBox();
+				createCSSComboBox();
+				createDeviceComboBox();
+				computeMaxWidthHint();
+				PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.WEB_CONTENT_SETTINGS_HELPID);
+				break;
+
+			default :
+				Logger.log(Logger.WARNING, "HTMLContentSettingsPropertyPage is instantiated by resource except FILE");//$NON-NLS-1$
+				break;
+		}
+
+	}
+
+
+
+	protected void putSelectedPropertyInto(Map properties, String valueInCombo, int index) {
+
+		switch (index) {
+			case N_DOCUMENT_TYPE :
+				// doc type
+				properties.put(IContentSettings.HTML_DOCUMENT_TYPE, valueInCombo);
+				break;
+			case N_CSS_PROFILE :
+				// css
+				properties.put(IContentSettings.CSS_PROFILE, valueInCombo);
+				break;
+			case N_TARGET_DEVICE :
+				// device
+				properties.put(IContentSettings.DEVICE_PROFILE, valueInCombo);
+				break;
+			default :
+				Logger.log(Logger.ERROR, "Index is out of range in putSelectedPropertyInto() in class HTMLContentSettingsPropertyPage");//$NON-NLS-1$
+				break;
+		}
+
+	}
+
+	protected void deleteNoneProperty(int index) {
+		switch (index) {
+			case N_DOCUMENT_TYPE :
+				// doc type
+				contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
+				break;
+			case N_CSS_PROFILE :
+				// css
+				contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
+				break;
+			case N_TARGET_DEVICE :
+				// device
+				contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
+				break;
+			default :
+				Logger.log(Logger.ERROR, "Index is out of range in deleteNoneProperty() in class HTMLContentSettingsPropertyPage");//$NON-NLS-1$
+				break;
+		}
+	}
+
+	private void createIDTextField() {
+		// public ID & System ID
+		Label publicLabel = new Label(super.propertyPage, SWT.NONE);
+		GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
+		data.horizontalIndent = 10;
+		publicLabel.setLayoutData(data);
+		publicLabel.setText(HTMLUIMessages.UI_Public_ID);
+		publicIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
+		data = new GridData();
+
+		publicIdText.setLayoutData(data);
+
+		Label systemLabel = new Label(super.propertyPage, SWT.NONE);
+		data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
+		data.horizontalIndent = 10;
+		systemLabel.setLayoutData(data);
+		systemLabel.setText(HTMLUIMessages.UI_System_ID);
+		systemIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
+		data = new GridData();
+
+		systemIdText.setLayoutData(data);
+	}
+
+
+
+	private void computeMaxWidthHint() {
+		// maxLengthString was set when HTMLDocumentTypeEntry was set in class ContentSettingsRegistry.
+		String maxLengthString = ContentSettingsRegistry.maxLengthStringInHTMLDocumentTypeRegistry;
+		String backup = this.systemIdText.getText();
+		this.systemIdText.setText(maxLengthString);
+		int maxWidthHint = this.systemIdText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
+		this.systemIdText.setText(backup);
+
+		if (this.combo[this.N_DOCUMENT_TYPE].getLayoutData() != null)
+			((GridData) this.combo[this.N_DOCUMENT_TYPE].getLayoutData()).widthHint = maxWidthHint;
+		if (this.publicIdText.getLayoutData() != null)
+			((GridData) this.publicIdText.getLayoutData()).widthHint = maxWidthHint;
+		if (this.systemIdText.getLayoutData() != null)
+			((GridData) this.systemIdText.getLayoutData()).widthHint = maxWidthHint;
+		if (this.combo[this.N_CSS_PROFILE].getLayoutData() != null)
+			((GridData) this.combo[this.N_CSS_PROFILE].getLayoutData()).widthHint = maxWidthHint;
+		if (this.combo[this.N_TARGET_DEVICE].getLayoutData() != null)
+			((GridData) this.combo[this.N_TARGET_DEVICE].getLayoutData()).widthHint = maxWidthHint;
+
+	}
+
+
+	public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
+	}
+
+	public void widgetSelected(org.eclipse.swt.events.SelectionEvent event) {
+		Widget source = event.widget;
+
+		if (this.combo[this.N_DOCUMENT_TYPE].equals(source)) {
+			ComboListOnPropertyPage combo = this.combo[this.N_DOCUMENT_TYPE];
+			if (combo.getSelectionIndex() < 0)
+				return;
+			if (!combo.getSelectedValue().equals("")) {//$NON-NLS-1$
+				this.publicIdText.setText(combo.getSelectedValue());
+				if (ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()) != null)
+					this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()));
+				else
+					this.systemIdText.setText("");//$NON-NLS-1$
+			}
+			else {
+				this.publicIdText.setText("");//$NON-NLS-1$
+				this.systemIdText.setText(""); //$NON-NLS-1$
+			}
+
+		}
+	}
+
+	protected void performDefaults() {
+		super.performDefaults();
+		this.publicIdText.setText("");//$NON-NLS-1$
+		this.systemIdText.setText(""); //$NON-NLS-1$
+
+	}
+
+
+}
+
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java
new file mode 100644
index 0000000..333c615
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java
@@ -0,0 +1,282 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentproperties.ui;
+
+import java.util.Map;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.Logger;
+import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
+import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
+import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboListOnPropertyPage;
+import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ContentSettingsPropertyPage;
+
+/**
+ * @deprecated Use ProjectHTMLContentSettingsPropertyPage instead
+ */
+public final class ProjectContentSettingsPropertyPage extends ContentSettingsPropertyPage implements org.eclipse.swt.events.SelectionListener {
+
+
+	private final int N_DOCUMENT_TYPE = 0;
+	private final int N_CSS_PROFILE = 1;
+	private final int N_TARGET_DEVICE = 2;
+
+	private Text publicIdText;
+	private Text systemIdText;
+
+	public ProjectContentSettingsPropertyPage() {
+		super();
+		numberOfCombo = 3;
+		numCols = 2;
+		numRows = 8;
+		combo = new ComboListOnPropertyPage[super.numberOfCombo];
+
+	}
+
+
+
+	protected void createDocumentTypeComboBox() {
+
+		// create description of implecit DOCTYPE
+		Label label = new Label(propertyPage, SWT.LEFT);
+		label.setText(HTMLUIMessages.UI_Description_of_role_of_following_DOCTYPE);
+		GridData data = new GridData();
+		data.horizontalAlignment = GridData.FILL;
+		data.horizontalSpan = numCols;
+		label.setLayoutData(data);
+
+		// create combobox
+		super.combo[N_DOCUMENT_TYPE] = super.createComboBoxOf(DOCUMENT_LABEL);
+		super.combo[this.N_DOCUMENT_TYPE].addSelectionListener(this);
+		// set entry list into Combo
+		ContentSettingsRegistry.setHTMLDocumentTypeRegistryInto(combo[N_DOCUMENT_TYPE]);
+		// create TextField
+		createIDTextField();
+		if (combo[N_DOCUMENT_TYPE].getItemCount() <= 0)
+			return;
+
+		String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
+		// when either .contentsettings or element doesn't exist
+		// when attribute doesn't exists,getProperty returns empty string.
+		if (initValue == null)
+			initValue = ""; //$NON-NLS-1$
+		// set init selectionItem in Combo
+		super.setSelectionItem(combo[N_DOCUMENT_TYPE], initValue);
+		this.publicIdText.setText(initValue);
+		if (!initValue.equals("")) {//$NON-NLS-1$
+			// toro D210260
+			if (ContentSettingsRegistry.getSystemIdFrom(initValue) != null)
+				this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(initValue));
+			else
+				this.systemIdText.setText("");//$NON-NLS-1$
+		}
+		else
+			this.systemIdText.setText("");//$NON-NLS-1$
+
+		// create separator
+		label = new Label(propertyPage, SWT.SEPARATOR | SWT.HORIZONTAL);
+		data = new GridData();
+		data.horizontalAlignment = GridData.FILL;
+		data.horizontalSpan = numCols;
+		data.verticalSpan = 8;
+		label.setLayoutData(data);
+
+	}
+
+
+
+	protected void createCSSComboBox() {
+		super.combo[N_CSS_PROFILE] = super.createComboBoxOf(CSS_LABEL);
+
+		ContentSettingsRegistry.setCSSMetaModelRegistryInto(combo[N_CSS_PROFILE]);
+		if (combo[N_CSS_PROFILE].getItemCount() <= 0)
+			return;
+		String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
+		// when either .contentsettings or element doesn't exist
+		// when attribute doesn't exists,getProperty returns empty string.
+		if (initValue == null)
+			initValue = ""; //$NON-NLS-1$
+		// set init selectionItem in Combo
+		super.setSelectionItem(combo[N_CSS_PROFILE], initValue);
+	}
+
+
+
+	protected void createDeviceComboBox() {
+		super.combo[N_TARGET_DEVICE] = super.createComboBoxOf(DEVICE_LABEL);
+
+		ContentSettingsRegistry.setDeviceProfileRegistryInto(combo[N_TARGET_DEVICE]);
+		if (combo[N_TARGET_DEVICE].getItemCount() <= 0)
+			return;
+		String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
+		// when either .contentsettings or element doesn't exist
+		// when attribute doesn't exists,getProperty returns empty string.
+		if (initValue == null)
+			initValue = ""; //$NON-NLS-1$
+		// set init selectionItem in Combo
+		super.setSelectionItem(combo[N_TARGET_DEVICE], initValue);
+	}
+
+
+	protected void createSettingsPageGUI() {
+		int type = ((IResource) getElement()).getType();
+		switch (type) {
+			case IResource.PROJECT :
+				// composite = createComposite(propertyPage,numCols,numRows);
+				createDocumentTypeComboBox();
+				createCSSComboBox();
+				createDeviceComboBox();
+				computeMaxWidthHint();
+				PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.WEB_CONTENT_SETTINGS_HELPID);
+				break;
+
+			default :
+				Logger.log(Logger.WARNING, "ProjectContentSettingsPropertyPage is instantiated by resource except PROJECT");//$NON-NLS-1$
+				break;
+		}
+
+	}
+
+
+
+	protected void putSelectedPropertyInto(Map properties, String valueInCombo, int index) {
+
+		switch (index) {
+			case N_DOCUMENT_TYPE :
+				// doc type
+				properties.put(IContentSettings.HTML_DOCUMENT_TYPE, valueInCombo);
+				break;
+			case N_CSS_PROFILE :
+				// css
+				properties.put(IContentSettings.CSS_PROFILE, valueInCombo);
+				break;
+			case N_TARGET_DEVICE :
+				// device
+				properties.put(IContentSettings.DEVICE_PROFILE, valueInCombo);
+				break;
+			default :
+				Logger.log(Logger.ERROR, "Index is out of range in putSelectedPropertyInto() in class ProjectContentSettingsPropertyPage");//$NON-NLS-1$
+				break;
+		}
+
+	}
+
+	protected void deleteNoneProperty(int index) {
+		switch (index) {
+			case N_DOCUMENT_TYPE :
+				// doc type
+				contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
+				break;
+
+			case N_CSS_PROFILE :
+				// css
+				contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
+				break;
+
+			case N_TARGET_DEVICE :
+				// device
+				contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
+				break;
+
+			default :
+				Logger.log(Logger.ERROR, "Index is out of range in deleteNoneProperty() in class ProjectContentSettingsPropertyPage");//$NON-NLS-1$
+				break;
+		}
+	}
+
+	private void createIDTextField() {
+		// public ID & System ID
+		Label publicLabel = new Label(super.propertyPage, SWT.NONE);
+		GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
+		data.horizontalIndent = 10;
+		publicLabel.setLayoutData(data);
+		publicLabel.setText(HTMLUIMessages.UI_Public_ID);
+		publicIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
+		data = new GridData();
+
+		publicIdText.setLayoutData(data);
+
+		Label systemLabel = new Label(super.propertyPage, SWT.NONE);
+		data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
+		data.horizontalIndent = 10;
+		systemLabel.setLayoutData(data);
+		systemLabel.setText(HTMLUIMessages.UI_System_ID);
+		systemIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
+		data = new GridData();
+
+		systemIdText.setLayoutData(data);
+	}
+
+
+
+	private void computeMaxWidthHint() {
+		// maxLengthString was set when HTMLDocumentTypeEntry was set in class
+		// ContentSettingsRegistry.
+		String maxLengthString = ContentSettingsRegistry.maxLengthStringInHTMLDocumentTypeRegistry;
+		String backup = this.systemIdText.getText();
+		this.systemIdText.setText(maxLengthString);
+		int maxWidthHint = this.systemIdText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
+		this.systemIdText.setText(backup);
+
+		if (this.combo[this.N_DOCUMENT_TYPE].getLayoutData() != null)
+			((GridData) this.combo[this.N_DOCUMENT_TYPE].getLayoutData()).widthHint = maxWidthHint;
+		if (this.publicIdText.getLayoutData() != null)
+			((GridData) this.publicIdText.getLayoutData()).widthHint = maxWidthHint;
+		if (this.systemIdText.getLayoutData() != null)
+			((GridData) this.systemIdText.getLayoutData()).widthHint = maxWidthHint;
+		if (this.combo[this.N_CSS_PROFILE].getLayoutData() != null)
+			((GridData) this.combo[this.N_CSS_PROFILE].getLayoutData()).widthHint = maxWidthHint;
+		if (this.combo[this.N_TARGET_DEVICE].getLayoutData() != null)
+			((GridData) this.combo[this.N_TARGET_DEVICE].getLayoutData()).widthHint = maxWidthHint;
+
+	}
+
+
+	public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
+	}
+
+	public void widgetSelected(org.eclipse.swt.events.SelectionEvent event) {
+		Widget source = event.widget;
+
+		if (this.combo[this.N_DOCUMENT_TYPE].equals(source)) {
+			ComboListOnPropertyPage combo = this.combo[this.N_DOCUMENT_TYPE];
+			if (combo.getSelectionIndex() < 0)
+				return;
+			if (!combo.getSelectedValue().equals("")) {//$NON-NLS-1$
+				this.publicIdText.setText(combo.getSelectedValue());
+				if (ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()) != null)
+					this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()));
+				else
+					this.systemIdText.setText("");//$NON-NLS-1$
+			}
+			else {
+				this.publicIdText.setText("");//$NON-NLS-1$
+				this.systemIdText.setText(""); //$NON-NLS-1$
+			}
+
+		}
+	}
+
+	protected void performDefaults() {
+		super.performDefaults();
+		this.publicIdText.setText("");//$NON-NLS-1$
+		this.systemIdText.setText(""); //$NON-NLS-1$
+
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectWebContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectWebContentSettingsPropertyPage.java
new file mode 100644
index 0000000..6ccbe4c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectWebContentSettingsPropertyPage.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentproperties.ui;
+
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+
+public class ProjectWebContentSettingsPropertyPage extends WebContentSettingsPropertyPage {
+	public ProjectWebContentSettingsPropertyPage() {
+		setDescription(HTMLUIMessages.ProjectWebContentSettingsPropertyPage_0);
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java
new file mode 100644
index 0000000..7f0d67e
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java
@@ -0,0 +1,384 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentproperties.ui;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PropertyPage;
+import org.eclipse.wst.css.core.internal.contentproperties.CSSContentProperties;
+import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
+import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
+import org.eclipse.wst.html.core.internal.contentproperties.HTMLContentProperties;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.Logger;
+import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
+
+public class WebContentSettingsPropertyPage extends PropertyPage {
+	private static final String SELECT_NONE = HTMLUIMessages.UI_none;
+	private String maxLengthStringInHTMLDocumentTypeRegistry = ""; //$NON-NLS-1$
+
+	private class ComboSelectionListener implements SelectionListener {
+		public void widgetDefaultSelected(SelectionEvent e) {
+			// do nothing
+		}
+
+		public void widgetSelected(SelectionEvent e) {
+			int index = fDocumentTypeCombo.getSelectionIndex();
+			String doctype = (String) fDocumentTypeIds.get(index);
+			updateDoctypeText(index, doctype);
+		}
+	}
+
+	Combo fDocumentTypeCombo;
+	List fDocumentTypeIds;
+	private Text fPublicIdText;
+	private Text fSystemIdText;
+	private Combo fProfileCombo;
+	private List fProfileIds;
+	private SelectionListener fListener;
+
+	public WebContentSettingsPropertyPage() {
+		super();
+		setDescription(HTMLUIMessages.WebContentSettingsPropertyPage_0);
+	}
+
+	private Composite createComposite(Composite parent, int numColumns) {
+		Composite composite = new Composite(parent, SWT.NULL);
+
+		// GridLayout
+		GridLayout layout = new GridLayout();
+		layout.numColumns = numColumns;
+		composite.setLayout(layout);
+
+		// GridData
+		GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
+		data.horizontalIndent = 0;
+		composite.setLayoutData(data);
+
+		return composite;
+	}
+
+	protected Control createContents(Composite parent) {
+		Composite propertyPage = createComposite(parent, 2);
+
+		createDoctypeContents(propertyPage);
+		createCSSProfileContents(propertyPage);
+
+		populateValues();
+		initializeValues();
+		computeMaxWidthHint();
+
+		fListener = new ComboSelectionListener();
+		fDocumentTypeCombo.addSelectionListener(fListener);
+
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.WEB_CONTENT_SETTINGS_HELPID);
+		Dialog.applyDialogFont(parent);
+		return propertyPage;
+	}
+
+	private void createCSSProfileContents(Composite parent) {
+		// CSS Profile
+		Label languageLabel = new Label(parent, SWT.NONE);
+		languageLabel.setText(HTMLUIMessages.UI_CSS_profile___2);
+		fProfileCombo = new Combo(parent, SWT.READ_ONLY);
+		GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
+		data.horizontalIndent = 0;
+		fProfileCombo.setLayoutData(data);
+	}
+
+	private void createDoctypeContents(Composite parent) {
+		// create description of implicit DOCTYPE
+		Text doctypeLabel = new Text(parent, SWT.READ_ONLY);
+		doctypeLabel.setText(HTMLUIMessages.UI_Description_of_role_of_following_DOCTYPE);
+		GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
+		data.horizontalIndent = 0;
+		data.horizontalSpan = 2;
+		doctypeLabel.setLayoutData(data);
+
+		// document type
+		Label languageLabel = new Label(parent, SWT.NONE);
+		languageLabel.setText(HTMLUIMessages.UI_Default_HTML_DOCTYPE_ID___1);
+		fDocumentTypeCombo = new Combo(parent, SWT.READ_ONLY);
+		data = new GridData(GridData.FILL, GridData.FILL, true, false);
+		data.horizontalIndent = 0;
+		fDocumentTypeCombo.setLayoutData(data);
+
+		// public ID
+		Label publicIdLabel = new Label(parent, SWT.NONE);
+		publicIdLabel.setText(HTMLUIMessages.UI_Public_ID);
+		fPublicIdText = new Text(parent, SWT.READ_ONLY | SWT.BORDER);
+		data = new GridData(GridData.FILL, GridData.FILL, true, false);
+		data.horizontalIndent = 0;
+		fPublicIdText.setLayoutData(data);
+
+		// system ID
+		Label systemIdLabel = new Label(parent, SWT.NONE);
+		systemIdLabel.setText(HTMLUIMessages.UI_System_ID);
+		fSystemIdText = new Text(parent, SWT.READ_ONLY | SWT.BORDER);
+		data = new GridData(GridData.FILL, GridData.FILL, true, false);
+		data.horizontalIndent = 0;
+		fSystemIdText.setLayoutData(data);
+
+		// create separator
+		Label label = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
+		data = new GridData();
+		data.horizontalAlignment = GridData.FILL;
+		data.horizontalSpan = 2;
+		data.verticalSpan = 8;
+		label.setLayoutData(data);
+
+	}
+
+	/**
+	 * Get the resource this properties page is for
+	 * 
+	 * @return IResource for this properties page or null if there is no
+	 *         IResource
+	 */
+	private IResource getResource() {
+		IResource resource = null;
+		IAdaptable adaptable = getElement();
+		if (adaptable instanceof IResource) {
+			resource = (IResource) adaptable;
+		} else if (adaptable != null) {
+			Object o = adaptable.getAdapter(IResource.class);
+			if (o instanceof IResource) {
+				resource = (IResource)o;
+			}
+		}
+		return resource;
+	}
+
+	private String getSystemIdFrom(String publicId) {
+		if (publicId == null || publicId.length() == 0)
+			return null;
+		HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
+		Enumeration e = reg.getEntries();
+		while (e.hasMoreElements()) {
+			HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
+			if (entry.getPublicId().equals(publicId))
+				return entry.getSystemId();
+		}
+		return null;
+	}
+
+	private void initializeValues() {
+		initializeDoctypeValues();
+		initializeCSSProfileValues();
+	}
+
+	private void initializeCSSProfileValues() {
+		int index = 0;
+		String profile = CSSContentProperties.getProperty(CSSContentProperties.CSS_PROFILE, getResource(), false);
+		if (profile != null && profile.length() > 0) {
+			/*
+			 * If item is already part of combo, select it. Otherwise, select
+			 * none.
+			 */
+			index = fProfileIds.indexOf(profile);
+		}
+		index = index >= 0 ? index : 0;
+		fProfileCombo.select(index);
+	}
+
+	private void initializeDoctypeValues() {
+		int index = 0;
+		String doctype = HTMLContentProperties.getProperty(HTMLContentProperties.DOCUMENT_TYPE, getResource(), false);
+		if (doctype != null && doctype.length() > 0) {
+			/*
+			 * If item is already part of combo, select it. Otherwise, select
+			 * none.
+			 */
+			index = fDocumentTypeIds.indexOf(doctype);
+		}
+
+		// set combobox
+		index = index >= 0 ? index : 0;
+		fDocumentTypeCombo.select(index);
+
+		updateDoctypeText(index, doctype);
+	}
+
+	void updateDoctypeText(int index, String doctype) {
+		if (index > 0) {
+			// set public/system id text
+			fPublicIdText.setText(doctype);
+			String systemId = getSystemIdFrom(doctype);
+			if (systemId != null)
+				fSystemIdText.setText(systemId);
+			else
+				fSystemIdText.setText(""); //$NON-NLS-1$
+		}
+		else {
+			// set public/system id text
+			fPublicIdText.setText(""); //$NON-NLS-1$
+			fSystemIdText.setText(""); //$NON-NLS-1$
+		}
+	}
+
+	private void populateValues() {
+		populateDoctypeValues();
+		populateCSSProfileValues();
+	}
+
+	private void populateCSSProfileValues() {
+		fProfileIds = new ArrayList();
+		// add none first
+		fProfileCombo.add(SELECT_NONE);
+		fProfileIds.add(null);
+
+		CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
+		Iterator i = reg.getProfiles();
+		while (i.hasNext()) {
+			CSSProfile profile = (CSSProfile) i.next();
+			String id = profile.getProfileID();
+			String name = profile.getProfileName();
+			fProfileCombo.add(name);
+			fProfileIds.add(id);
+		}
+	}
+
+	private void populateDoctypeValues() {
+		fDocumentTypeIds = new ArrayList();
+		// add none first
+		fDocumentTypeCombo.add(SELECT_NONE);
+		fDocumentTypeIds.add(null);
+
+		HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
+		Enumeration e = reg.getEntries();
+		while (e.hasMoreElements()) {
+			HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
+			String publicId = entry.getPublicId();
+			String displayName = entry.getDisplayName();
+			displayName = displayName != null ? displayName : publicId;
+
+			fDocumentTypeCombo.add(displayName);
+			fDocumentTypeIds.add(publicId);
+
+			if (displayName.length() > maxLengthStringInHTMLDocumentTypeRegistry.length()) {
+				maxLengthStringInHTMLDocumentTypeRegistry = displayName;
+			}
+
+			if (entry.getSystemId() == null)
+				continue; // if HTML entry
+
+
+			if (entry.getSystemId().length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
+				maxLengthStringInHTMLDocumentTypeRegistry = entry.getSystemId();
+		}
+	}
+
+	private void computeMaxWidthHint() {
+		// maxLengthString was set populateDoctypeValues was called
+		String maxLengthString = maxLengthStringInHTMLDocumentTypeRegistry;
+		String backup = fSystemIdText.getText();
+		fSystemIdText.setText(maxLengthString);
+		int maxWidthHint = fSystemIdText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
+		fSystemIdText.setText(backup);
+
+		if (fDocumentTypeCombo.getLayoutData() != null)
+			((GridData) fDocumentTypeCombo.getLayoutData()).widthHint = maxWidthHint;
+		if (fPublicIdText.getLayoutData() != null)
+			((GridData) fPublicIdText.getLayoutData()).widthHint = maxWidthHint;
+		if (fSystemIdText.getLayoutData() != null)
+			((GridData) fSystemIdText.getLayoutData()).widthHint = maxWidthHint;
+		if (fProfileCombo.getLayoutData() != null)
+			((GridData) fProfileCombo.getLayoutData()).widthHint = maxWidthHint;
+	}
+
+	private void performCSSProfileDefaults() {
+		int index = fProfileCombo.indexOf(SELECT_NONE);
+		if (index > -1)
+			fProfileCombo.select(index);
+
+		super.performDefaults();
+	}
+
+	private boolean performCSSProfileOk() {
+		int index = fProfileCombo.getSelectionIndex();
+		if (index > -1) {
+			String id = (String) fProfileIds.get(index);
+			if (id == null || id.length() == 0 || id.equalsIgnoreCase(SELECT_NONE)) {
+				// if none, use null
+				id = null;
+			}
+			try {
+				CSSContentProperties.setProperty(CSSContentProperties.CSS_PROFILE, getResource(), id);
+			}
+			catch (CoreException e) {
+				// maybe in future, let user know there was a problem saving
+				// file
+				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+			}
+		}
+		return true;
+	}
+
+	protected void performDefaults() {
+		super.performDefaults();
+
+		performDoctypeDefaults();
+		performCSSProfileDefaults();
+	}
+
+	private void performDoctypeDefaults() {
+		fPublicIdText.setText("");//$NON-NLS-1$
+		fSystemIdText.setText(""); //$NON-NLS-1$
+	}
+
+	private boolean performDoctypeOk() {
+		int index = fDocumentTypeCombo.getSelectionIndex();
+		if (index > -1) {
+			String id = (String) fDocumentTypeIds.get(index);
+			if (id == null || id.length() == 0 || id.equalsIgnoreCase(SELECT_NONE)) {
+				// if none, use null
+				id = null;
+			}
+			try {
+				HTMLContentProperties.setProperty(HTMLContentProperties.DOCUMENT_TYPE, getResource(), id);
+			}
+			catch (CoreException e) {
+				// maybe in future, let user know there was a problem saving
+				// file
+				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+			}
+		}
+		return true;
+	}
+
+	public boolean performOk() {
+		performDoctypeOk();
+		performCSSProfileOk();
+
+		return super.performOk();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java
new file mode 100644
index 0000000..3ddb028
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   IBM - Initial API and implementation
+ *   Jens Lukowski/Innoopract - initial renaming/restructuring
+ * 
+ *******************************************************************************/
+
+package org.eclipse.wst.html.ui.internal.correction;
+
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.sse.ui.internal.correction.CorrectionAssistantProvider;
+import org.eclipse.wst.xml.core.text.IXMLPartitions;
+import org.eclipse.wst.xml.ui.internal.correction.CorrectionProcessorXML;
+
+/**
+ * Correction assistant for HTML
+ * 
+ * @deprecated since 2.0 RC0 Use
+ *             org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
+ */
+public class CorrectionAssistantProviderHTML extends CorrectionAssistantProvider {
+
+	public IContentAssistant getCorrectionAssistant(ISourceViewer sourceViewer) {
+		IContentAssistant ca = null;
+
+		if (sourceViewer != null) {
+			ContentAssistant assistant = new ContentAssistant();
+
+			if (sourceViewer != null) {
+				IContentAssistProcessor correctionProcessor = new CorrectionProcessorXML(sourceViewer);
+				assistant.setContentAssistProcessor(correctionProcessor, IHTMLPartitions.HTML_DEFAULT);
+				assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_CDATA);
+				assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_COMMENT);
+				assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_DECLARATION);
+				assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_PI);
+				assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.DTD_SUBSET);
+			}
+			ca = assistant;
+		}
+
+		return ca;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/derived/SingleCharReader.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/derived/SingleCharReader.java
new file mode 100644
index 0000000..3860bbc
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/derived/SingleCharReader.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   IBM - Initial API and implementation
+ *   Jens Lukowski/Innoopract - initial renaming/restructuring
+ * 
+ *******************************************************************************/
+
+package org.eclipse.wst.html.ui.internal.derived;
+
+import java.io.IOException;
+import java.io.Reader;
+
+/*
+ * Copied from org.eclipse.jdt.internal.corext.javadoc.SingleCharReader.
+ * Modification was made to fix statement unnecessarily nested within else
+ * clause warning in read(..).
+ */
+public abstract class SingleCharReader extends Reader {
+
+	/**
+	 * @see Reader#read()
+	 */
+	public abstract int read() throws IOException;
+
+	/**
+	 * @see Reader#read(char[],int,int)
+	 */
+	public int read(char cbuf[], int off, int len) throws IOException {
+		int end = off + len;
+		for (int i = off; i < end; i++) {
+			int ch = read();
+			if (ch == -1) {
+				if (i == off) {
+					return -1;
+				}
+				return i - off;
+			}
+			cbuf[i] = (char) ch;
+		}
+		return len;
+	}
+
+	/**
+	 * @see Reader#ready()
+	 */
+	public boolean ready() throws IOException {
+		return true;
+	}
+
+	/**
+	 * Gets the content as a String
+	 */
+	public String getString() throws IOException {
+		StringBuffer buf = new StringBuffer();
+		int ch;
+		while ((ch = read()) != -1) {
+			buf.append((char) ch);
+		}
+		return buf.toString();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java
new file mode 100644
index 0000000..c471d06
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.edit.ui;
+
+import org.eclipse.wst.xml.ui.internal.actions.ActionContributorXML;
+
+/**
+ *
+ * Instead, use SourcePageActionContributor for source page contributor
+ * of multi page editor.
+ * 
+ * Note that this class is still valid for single page editor.
+ */
+public class ActionContributorHTML extends ActionContributorXML {
+	private static final String[] EDITOR_IDS = {"org.eclipse.wst.html.core.htmlsource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
+
+
+	protected String[] getExtensionIDs() {
+		return EDITOR_IDS;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java
new file mode 100644
index 0000000..6d8fd56
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+
+package org.eclipse.wst.html.ui.internal.edit.ui;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IActionDelegate2;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.html.core.internal.cleanup.HTMLCleanupProcessorImpl;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+/**
+ * Cleanup action delegate for HTML editor
+ */
+public class CleanupActionHTMLDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
+	private IEditorPart fEditor;
+	private IStructuredCleanupProcessor fCleanupProcessor;
+
+	public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+		fEditor = targetEditor;
+	}
+
+	public void dispose() {
+		// nulling out just in case
+		fEditor = null;
+		fCleanupProcessor = null;
+	}
+
+	public void init(IAction action) {
+		if (action != null) {
+			action.setText(HTMLUIMessages.CleanupDocument_label);
+			action.setToolTipText(HTMLUIMessages.CleanupDocument_tooltip);
+			action.setDescription(HTMLUIMessages.CleanupDocument_description);
+		}
+	}
+
+	public void runWithEvent(IAction action, Event event) {
+		run(action);
+	}
+
+	public void init(IViewPart view) {
+		// do nothing
+	}
+
+	public void run(IAction action) {
+		if (fEditor instanceof ITextEditor) {
+			final ITextEditor editor = (ITextEditor) fEditor;
+			CleanupDialogHTML cleanupDialog = new CleanupDialogHTML(editor.getSite().getShell());
+			cleanupDialog.setisXHTMLType(isXHTML());
+			if (cleanupDialog.open() == Window.OK) {
+				// setup runnable
+				Runnable runnable = new Runnable() {
+					public void run() {
+						IStructuredCleanupProcessor cleanupProcessor = getCleanupProcessor();
+						if (cleanupProcessor != null) {
+							IStructuredModel model = null;
+							try {
+								model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
+								if (model != null)
+									cleanupProcessor.cleanupModel(model);
+							}
+							finally {
+								if (model != null)
+									model.releaseFromEdit();
+							}
+						}
+					}
+				};
+
+				// TODO: make independent of 'model'.
+				IStructuredModel model = null;
+				try {
+					model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
+					if (model != null) {
+						// begin recording
+						ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
+						model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength()); //$NON-NLS-1$ //$NON-NLS-2$
+
+						// tell the model that we are about to make a big
+						// model change
+						model.aboutToChangeModel();
+
+						// run
+						BusyIndicator.showWhile(fEditor.getEditorSite().getWorkbenchWindow().getShell().getDisplay(), runnable);
+					}
+				}
+				finally {
+					if (model != null) {
+						// tell the model that we are done with the big
+						// model
+						// change
+						model.changedModel();
+
+						// end recording
+						ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
+						model.endRecording(this, selection.getOffset(), selection.getLength());
+						model.releaseFromEdit();
+					}
+				}
+			}
+		}
+	}
+
+	public void selectionChanged(IAction action, ISelection selection) {
+		// do nothing
+	}
+
+	IStructuredCleanupProcessor getCleanupProcessor() {
+		if (fCleanupProcessor == null)
+			fCleanupProcessor = new HTMLCleanupProcessorImpl();
+
+		return fCleanupProcessor;
+	}
+
+	private boolean isXHTML() {
+		boolean isxhtml = false;
+		if (fEditor instanceof ITextEditor) {
+			ITextEditor textEditor = (ITextEditor) fEditor;
+			IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
+			IStructuredModel model = null;
+			try {
+				model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+				if (model instanceof IDOMModel) {
+					IDOMDocument domDocument = ((IDOMModel) model).getDocument();
+					if (domDocument != null)
+						isxhtml = domDocument.isXMLType();
+				}
+			}
+			finally {
+				if (model != null) {
+					model.releaseFromRead();
+				}
+			}
+		}
+		return isxhtml;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java
new file mode 100644
index 0000000..9764210
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java
@@ -0,0 +1,333 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.edit.ui;
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
+import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
+import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+
+public class CleanupDialogHTML extends Dialog implements SelectionListener {
+
+	protected Button fRadioButtonTagNameCaseAsis;
+	protected Button fRadioButtonTagNameCaseLower;
+	protected Button fRadioButtonTagNameCaseUpper;
+	protected Button fRadioButtonAttrNameCaseAsis;
+	protected Button fRadioButtonAttrNameCaseLower;
+	protected Button fRadioButtonAttrNameCaseUpper;
+	protected Button fCheckBoxCompressEmptyElementTags;
+	protected Button fCheckBoxInsertRequiredAttrs;
+	protected Button fCheckBoxInsertMissingTags;
+	protected Button fCheckBoxQuoteAttrValues;
+	protected Button fCheckBoxFormatSource;
+	protected Button fCheckBoxConvertEOLCodes;
+	protected Button fRadioButtonConvertEOLWindows;
+	protected Button fRadioButtonConvertEOLUnix;
+	protected Button fRadioButtonConvertEOLMac;
+	protected Preferences fPreferences = null;
+	private boolean fIsXHTML = false;
+	private Group fTagNameCase;
+	private Group fAttrNameCase;
+
+	public CleanupDialogHTML(Shell shell) {
+		super(shell);
+	}
+
+	protected Control createDialogArea(Composite parent) {
+		getShell().setText(HTMLUIMessages.Cleanup_UI_);
+		Composite composite = new Composite(parent, SWT.NULL);
+
+		createDialogAreaInComposite(composite);
+		initializeOptions();
+
+		return composite;
+	}
+
+	protected Control createButtonBar(Composite parent) {
+		Control c = super.createButtonBar(parent);
+		okButtonEnablement();
+		return c;
+	}
+
+	protected void createDialogAreaInCompositeForHTML(Composite composite) {
+		// Convert tag name case
+		// d257064 need to associate group w/ radio buttons so radio buttons
+		// header can be read
+		fTagNameCase = new Group(composite, SWT.NONE);
+		fTagNameCase.setText(HTMLUIMessages.Tag_name_case_for_HTML_UI_);
+		GridLayout hLayout = new GridLayout();
+		hLayout.numColumns = 3;
+		fTagNameCase.setLayout(hLayout);
+		fRadioButtonTagNameCaseAsis = new Button(fTagNameCase, SWT.RADIO);
+		fRadioButtonTagNameCaseAsis.setText(HTMLUIMessages.Tag_name_case_As_is_UI_);
+		fRadioButtonTagNameCaseAsis.addSelectionListener(this);
+		fRadioButtonTagNameCaseLower = new Button(fTagNameCase, SWT.RADIO);
+		fRadioButtonTagNameCaseLower.setText(HTMLUIMessages.Tag_name_case_Lower_UI_);
+		fRadioButtonTagNameCaseLower.addSelectionListener(this);
+		fRadioButtonTagNameCaseUpper = new Button(fTagNameCase, SWT.RADIO);
+		fRadioButtonTagNameCaseUpper.setText(HTMLUIMessages.Tag_name_case_Upper_UI_);
+		fRadioButtonTagNameCaseUpper.addSelectionListener(this);
+
+		// Convert attr name case
+		// d257064 need to associate group w/ radio buttons so radio buttons
+		// header can be read
+		fAttrNameCase = new Group(composite, SWT.NONE);
+		fAttrNameCase.setText(HTMLUIMessages.Attribute_name_case_for_HTML_UI_);
+		fAttrNameCase.setLayout(hLayout);
+		fRadioButtonAttrNameCaseAsis = new Button(fAttrNameCase, SWT.RADIO);
+		fRadioButtonAttrNameCaseAsis.setText(HTMLUIMessages.Attribute_name_case_As_is_UI_);
+		fRadioButtonAttrNameCaseAsis.addSelectionListener(this);
+		fRadioButtonAttrNameCaseLower = new Button(fAttrNameCase, SWT.RADIO);
+		fRadioButtonAttrNameCaseLower.setText(HTMLUIMessages.Attribute_name_case_Lower_UI_);
+		fRadioButtonAttrNameCaseLower.addSelectionListener(this);
+		fRadioButtonAttrNameCaseUpper = new Button(fAttrNameCase, SWT.RADIO);
+		fRadioButtonAttrNameCaseUpper.setText(HTMLUIMessages.Attribute_name_case_Upper_UI_);
+		fRadioButtonAttrNameCaseUpper.addSelectionListener(this);
+	}
+
+	protected void createDialogAreaInComposite(Composite composite) {
+		createDialogAreaInCompositeForHTML(composite);
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.CLEANUP_HTML_HELPID); // use
+		// HTML
+		// specific
+		// help
+
+		GridLayout layout = new GridLayout();
+		layout.numColumns = 1;
+		layout.makeColumnsEqualWidth = true;
+		composite.setLayout(layout);
+
+		// Compress empty element tags
+		fCheckBoxCompressEmptyElementTags = new Button(composite, SWT.CHECK);
+		fCheckBoxCompressEmptyElementTags.setText(XMLUIMessages.Compress_empty_element_tags_UI_);
+		fCheckBoxCompressEmptyElementTags.addSelectionListener(this);
+
+		// Insert missing required attrs
+		fCheckBoxInsertRequiredAttrs = new Button(composite, SWT.CHECK);
+		fCheckBoxInsertRequiredAttrs.setText(HTMLUIMessages.Insert_required_attributes_UI_);
+		fCheckBoxInsertRequiredAttrs.addSelectionListener(this);
+
+		// Insert missing begin/end tags
+		fCheckBoxInsertMissingTags = new Button(composite, SWT.CHECK);
+		fCheckBoxInsertMissingTags.setText(HTMLUIMessages.Insert_missing_tags_UI_);
+		fCheckBoxInsertMissingTags.addSelectionListener(this);
+
+		// Quote attribute values
+		fCheckBoxQuoteAttrValues = new Button(composite, SWT.CHECK);
+		fCheckBoxQuoteAttrValues.setText(HTMLUIMessages.Quote_attribute_values_UI_);
+		fCheckBoxQuoteAttrValues.addSelectionListener(this);
+
+		// Format source
+		fCheckBoxFormatSource = new Button(composite, SWT.CHECK);
+		fCheckBoxFormatSource.setText(HTMLUIMessages.Format_source_UI_);
+		fCheckBoxFormatSource.addSelectionListener(this);
+
+		// Convert EOL code
+		fCheckBoxConvertEOLCodes = new Button(composite, SWT.CHECK);
+		fCheckBoxConvertEOLCodes.setText(HTMLUIMessages.Convert_EOL_codes_UI_);
+		fCheckBoxConvertEOLCodes.addSelectionListener(this);
+		Composite EOLCodes = new Composite(composite, SWT.NULL);
+		GridLayout hLayout = new GridLayout();
+		hLayout.numColumns = 3;
+		EOLCodes.setLayout(hLayout);
+		fRadioButtonConvertEOLWindows = new Button(EOLCodes, SWT.RADIO);
+		fRadioButtonConvertEOLWindows.setText(HTMLUIMessages.EOL_Windows_UI);
+		fRadioButtonConvertEOLWindows.addSelectionListener(this);
+		fRadioButtonConvertEOLUnix = new Button(EOLCodes, SWT.RADIO);
+		fRadioButtonConvertEOLUnix.setText(HTMLUIMessages.EOL_Unix_UI);
+		fRadioButtonConvertEOLUnix.addSelectionListener(this);
+		fRadioButtonConvertEOLMac = new Button(EOLCodes, SWT.RADIO);
+		fRadioButtonConvertEOLMac.setText(HTMLUIMessages.EOL_Mac_UI);
+		fRadioButtonConvertEOLMac.addSelectionListener(this);
+	}
+
+	protected void okPressed() {
+		storeOptions();
+
+		super.okPressed();
+	}
+
+	protected void initializeOptionsForHTML() {
+		boolean caseSensitive = isXHTMLType();
+
+		if (caseSensitive) {
+			fRadioButtonTagNameCaseLower.setSelection(true);
+		} else {
+			int tagNameCase = getModelPreferences().getInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE);
+			if (tagNameCase == HTMLCorePreferenceNames.UPPER) {
+				fRadioButtonTagNameCaseUpper.setSelection(true);
+			} else if (tagNameCase == HTMLCorePreferenceNames.LOWER)
+				fRadioButtonTagNameCaseLower.setSelection(true);
+			else
+				fRadioButtonTagNameCaseAsis.setSelection(true);
+		}
+
+		if (caseSensitive) {
+			fRadioButtonAttrNameCaseLower.setSelection(true);
+		} else {
+			int attrNameCase = getModelPreferences().getInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE);
+			if (attrNameCase == HTMLCorePreferenceNames.UPPER) {
+				fRadioButtonAttrNameCaseUpper.setSelection(true);
+			} else if (attrNameCase == HTMLCorePreferenceNames.LOWER)
+				fRadioButtonAttrNameCaseLower.setSelection(true);
+			else
+				fRadioButtonAttrNameCaseAsis.setSelection(true);
+		}
+
+		enableCaseControls(!caseSensitive);
+	}
+
+	protected void initializeOptions() {
+		initializeOptionsForHTML();
+
+		fCheckBoxCompressEmptyElementTags.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
+		fCheckBoxInsertRequiredAttrs.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
+		fCheckBoxInsertMissingTags.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS));
+		fCheckBoxQuoteAttrValues.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES));
+		fCheckBoxFormatSource.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE));
+		fCheckBoxConvertEOLCodes.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES));
+		if (fCheckBoxConvertEOLCodes.getSelection()) {
+			String EOLCode = getModelPreferences().getString(HTMLCorePreferenceNames.CLEANUP_EOL_CODE);
+			if (EOLCode == CommonEncodingPreferenceNames.LF)
+				fRadioButtonConvertEOLUnix.setSelection(true);
+			else if (EOLCode == CommonEncodingPreferenceNames.CR)
+				fRadioButtonConvertEOLMac.setSelection(true);
+			else
+				fRadioButtonConvertEOLWindows.setSelection(true);
+		}
+		enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
+	}
+
+	protected void storeOptionsForHTML() {
+		if (!isXHTMLType() && fRadioButtonTagNameCaseUpper.getSelection())
+			getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE, HTMLCorePreferenceNames.UPPER);
+		else if (fRadioButtonTagNameCaseLower.getSelection())
+			getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE, HTMLCorePreferenceNames.LOWER);
+		else
+			getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE, HTMLCorePreferenceNames.ASIS);
+
+		if (!isXHTMLType() && fRadioButtonAttrNameCaseUpper.getSelection())
+			getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE, HTMLCorePreferenceNames.UPPER);
+		else if (fRadioButtonAttrNameCaseLower.getSelection())
+			getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE, HTMLCorePreferenceNames.LOWER);
+		else
+			getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE, HTMLCorePreferenceNames.ASIS);
+
+		// explicitly save plugin preferences so values are stored
+		HTMLCorePlugin.getDefault().savePluginPreferences();
+	}
+
+	protected void storeOptions() {
+		storeOptionsForHTML();
+
+		getModelPreferences().setValue(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS, fCheckBoxCompressEmptyElementTags.getSelection());
+		getModelPreferences().setValue(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, fCheckBoxInsertRequiredAttrs.getSelection());
+		getModelPreferences().setValue(HTMLCorePreferenceNames.INSERT_MISSING_TAGS, fCheckBoxInsertMissingTags.getSelection());
+		getModelPreferences().setValue(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES, fCheckBoxQuoteAttrValues.getSelection());
+		getModelPreferences().setValue(HTMLCorePreferenceNames.FORMAT_SOURCE, fCheckBoxFormatSource.getSelection());
+		getModelPreferences().setValue(HTMLCorePreferenceNames.CONVERT_EOL_CODES, fCheckBoxConvertEOLCodes.getSelection());
+
+		if (fCheckBoxConvertEOLCodes.getSelection()) {
+			if (fRadioButtonConvertEOLUnix.getSelection()) {
+				getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.LF);
+			} else if (fRadioButtonConvertEOLMac.getSelection()) {
+				getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CR);
+			} else {
+				getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CRLF);
+			}
+		}
+
+		// explicitly save plugin preferences so values are stored
+		HTMLCorePlugin.getDefault().savePluginPreferences();
+	}
+
+	public void widgetDefaultSelected(SelectionEvent e) {
+		widgetSelected(e);
+	}
+
+	public void widgetSelected(SelectionEvent e) {
+		if (e.widget == fCheckBoxConvertEOLCodes)
+			enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
+
+		okButtonEnablement();
+	}
+
+	protected Preferences getModelPreferences() {
+		return HTMLCorePlugin.getDefault().getPluginPreferences();
+	}
+
+	private boolean isXHTMLType() {
+		return fIsXHTML;
+	}
+
+	protected void enableEOLCodeRadios(boolean enable) {
+		if ((fRadioButtonConvertEOLWindows != null) && (fRadioButtonConvertEOLUnix != null) && (fRadioButtonConvertEOLMac != null)) {
+			fRadioButtonConvertEOLWindows.setEnabled(enable);
+			fRadioButtonConvertEOLUnix.setEnabled(enable);
+			fRadioButtonConvertEOLMac.setEnabled(enable);
+
+			if (!fRadioButtonConvertEOLWindows.getSelection() && !fRadioButtonConvertEOLUnix.getSelection() && !fRadioButtonConvertEOLMac.getSelection())
+				fRadioButtonConvertEOLWindows.setSelection(true);
+		}
+	}
+
+	/**
+	 * Enables/disables the tag/attr case radio buttons
+	 */
+	private void enableCaseControls(boolean enable) {
+		fTagNameCase.setEnabled(enable);
+		fRadioButtonTagNameCaseAsis.setEnabled(enable);
+		fRadioButtonTagNameCaseLower.setEnabled(enable);
+		fRadioButtonTagNameCaseUpper.setEnabled(enable);
+
+		fAttrNameCase.setEnabled(enable);
+		fRadioButtonAttrNameCaseAsis.setEnabled(enable);
+		fRadioButtonAttrNameCaseLower.setEnabled(enable);
+		fRadioButtonAttrNameCaseUpper.setEnabled(enable);
+	}
+
+	/**
+	 * Enables/disables OK button
+	 * 
+	 */
+	private void okButtonEnablement() {
+		boolean tagNameCaseCheck = ((fRadioButtonTagNameCaseUpper != null && fRadioButtonTagNameCaseUpper.getSelection()) || fRadioButtonTagNameCaseLower.getSelection());
+		boolean attrNameCaseCheck = ((fRadioButtonAttrNameCaseUpper != null && fRadioButtonAttrNameCaseUpper.getSelection()) || fRadioButtonAttrNameCaseLower.getSelection());
+		boolean eolCheck = fCheckBoxConvertEOLCodes.getSelection() && (fRadioButtonConvertEOLUnix.getSelection() || fRadioButtonConvertEOLMac.getSelection() || fRadioButtonConvertEOLWindows.getSelection());
+		boolean buttonEnabled = false;
+		if (isXHTMLType()){
+			buttonEnabled = fCheckBoxInsertRequiredAttrs.getSelection() || fCheckBoxInsertMissingTags.getSelection() || fCheckBoxQuoteAttrValues.getSelection() || fCheckBoxFormatSource.getSelection() || eolCheck;
+		}
+		else {
+			buttonEnabled = tagNameCaseCheck || attrNameCaseCheck || fCheckBoxInsertRequiredAttrs.getSelection() || fCheckBoxInsertMissingTags.getSelection() || fCheckBoxQuoteAttrValues.getSelection() || fCheckBoxFormatSource.getSelection() || eolCheck;
+		}
+		getButton(IDialogConstants.OK_ID).setEnabled(buttonEnabled);
+	}
+
+	void setisXHTMLType(boolean isXHTML) {
+		fIsXHTML = isXHTML;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDocumentHandler.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDocumentHandler.java
new file mode 100644
index 0000000..75c5267
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDocumentHandler.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.edit.ui;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.html.core.internal.cleanup.HTMLCleanupProcessorImpl;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+public class CleanupDocumentHandler extends AbstractHandler implements IHandler {
+	private IStructuredCleanupProcessor fCleanupProcessor;
+
+	public void dispose() {
+		// nulling out just in case
+		fCleanupProcessor = null;
+	}
+
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
+		ITextEditor textEditor = null;
+		if (editorPart instanceof ITextEditor)
+			textEditor = (ITextEditor) editorPart;
+		else {
+			Object o = editorPart.getAdapter(ITextEditor.class);
+			if (o != null)
+				textEditor = (ITextEditor) o;
+		}
+		if (textEditor != null) {
+			final ITextEditor editor = textEditor;
+			CleanupDialogHTML cleanupDialog = new CleanupDialogHTML(editor.getSite().getShell());
+			cleanupDialog.setisXHTMLType(isXHTML(editor));
+			if (cleanupDialog.open() == Window.OK) {
+				// setup runnable
+				Runnable runnable = new Runnable() {
+					public void run() {
+						IStructuredCleanupProcessor cleanupProcessor = getCleanupProcessor();
+						if (cleanupProcessor != null) {
+							IStructuredModel model = null;
+							try {
+								model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
+								if (model != null)
+									cleanupProcessor.cleanupModel(model);
+							}
+							finally {
+								if (model != null)
+									model.releaseFromEdit();
+							}
+						}
+					}
+				};
+
+				// TODO: make independent of 'model'.
+				IStructuredModel model = null;
+				try {
+					model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
+					if (model != null) {
+						// begin recording
+						ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
+						model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength()); //$NON-NLS-1$ //$NON-NLS-2$
+
+						// tell the model that we are about to make a big
+						// model change
+						model.aboutToChangeModel();
+
+						// run
+						BusyIndicator.showWhile(editor.getEditorSite().getWorkbenchWindow().getShell().getDisplay(), runnable);
+					}
+				}
+				finally {
+					if (model != null) {
+						// tell the model that we are done with the big
+						// model
+						// change
+						model.changedModel();
+
+						// end recording
+						ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
+						model.endRecording(this, selection.getOffset(), selection.getLength());
+						model.releaseFromEdit();
+					}
+				}
+			}
+		}
+		return null;
+	}
+
+	IStructuredCleanupProcessor getCleanupProcessor() {
+		if (fCleanupProcessor == null)
+			fCleanupProcessor = new HTMLCleanupProcessorImpl();
+
+		return fCleanupProcessor;
+	}
+	
+	private boolean isXHTML(ITextEditor editor) {
+		boolean isxhtml = false;
+		if (editor != null) {
+			IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
+			IStructuredModel model = null;
+			try {
+				model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+				if (model instanceof IDOMModel) {
+					IDOMDocument domDocument = ((IDOMModel) model).getDocument();
+					if (domDocument != null)
+						isxhtml = domDocument.isXMLType();
+				}
+			}
+			finally {
+				if (model != null) {
+					model.releaseFromRead();
+				}
+			}
+		}
+		return isxhtml;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java
new file mode 100644
index 0000000..ab6450a
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.editor;
+
+import java.util.HashMap;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+
+
+/**
+ * Helper class to handle images provided by this plug-in.
+ */
+public class HTMLEditorPluginImageHelper {
+	private final String PLUGINID = HTMLUIPlugin.ID;
+	private static HTMLEditorPluginImageHelper instance = null;
+
+	//	 save a descriptor for each image
+	private HashMap fImageDescRegistry = null;
+
+	/**
+	 * Gets the instance.
+	 * 
+	 * @return Returns a HTMLEditorPluginImageHelper
+	 */
+	public synchronized static HTMLEditorPluginImageHelper getInstance() {
+		if (instance == null)
+			instance = new HTMLEditorPluginImageHelper();
+		return instance;
+	}
+
+	/**
+	 * Retrieves the image associated with resource from the image registry.
+	 * If the image cannot be retrieved, attempt to find and load the image at
+	 * the location specified in resource.
+	 * 
+	 * @param resource
+	 *            the image to retrieve
+	 * @return Image the image associated with resource or null if one could
+	 *         not be found
+	 */
+	public Image getImage(String resource) {
+		Image image = getImageRegistry().get(resource);
+		if (image == null) {
+			// create an image
+			image = createImage(resource);
+		}
+		return image;
+	}
+
+	/**
+	 * Retrieves the image descriptor associated with resource from the image
+	 * descriptor registry. If the image descriptor cannot be retrieved,
+	 * attempt to find and load the image descriptor at the location specified
+	 * in resource.
+	 * 
+	 * @param resource
+	 *            the image descriptor to retrieve
+	 * @return ImageDescriptor the image descriptor assocated with resource or
+	 *         the default "missing" image descriptor if one could not be
+	 *         found
+	 */
+	public ImageDescriptor getImageDescriptor(String resource) {
+		ImageDescriptor imageDescriptor = null;
+		Object o = getImageDescriptorRegistry().get(resource);
+		if (o == null) {
+			//create a descriptor
+			imageDescriptor = createImageDescriptor(resource);
+		}
+		else {
+			imageDescriptor = (ImageDescriptor) o;
+		}
+		return imageDescriptor;
+	}
+
+	/**
+	 * Returns the image descriptor registry for this plugin.
+	 * 
+	 * @return HashMap - image descriptor registry for this plugin
+	 */
+	private HashMap getImageDescriptorRegistry() {
+		if (fImageDescRegistry == null)
+			fImageDescRegistry = new HashMap();
+		return fImageDescRegistry;
+	}
+
+	/**
+	 * Returns the image registry for this plugin.
+	 * 
+	 * @return ImageRegistry - image registry for this plugin
+	 */
+	private ImageRegistry getImageRegistry() {
+		return HTMLUIPlugin.getInstance().getImageRegistry();
+	}
+
+	/**
+	 * Creates an image from the given resource and adds the image to the
+	 * image registry.
+	 * 
+	 * @param resource
+	 * @return Image
+	 */
+	private Image createImage(String resource) {
+		ImageDescriptor desc = getImageDescriptor(resource);
+		Image image = null;
+		
+		if (desc != null) {
+			image = desc.createImage();
+			// dont add the missing image descriptor image to the image registry
+			if (!desc.equals(ImageDescriptor.getMissingImageDescriptor()))
+				getImageRegistry().put(resource, image);
+		}
+		return image;
+	}
+
+	/**
+	 * Creates an image descriptor from the given imageFilePath and adds the
+	 * image descriptor to the image descriptor registry. If an image
+	 * descriptor could not be created, the default "missing" image descriptor
+	 * is returned but not added to the image descriptor registry.
+	 * 
+	 * @param imageFilePath
+	 * @return ImageDescriptor image descriptor for imageFilePath or default
+	 *         "missing" image descriptor if resource could not be found
+	 */
+	private ImageDescriptor createImageDescriptor(String imageFilePath) {
+		ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGINID, imageFilePath);
+		if (imageDescriptor != null) {
+			getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
+		}
+		else {
+			imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
+		}
+
+		return imageDescriptor;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java
new file mode 100644
index 0000000..1fa0f24
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.editor;
+
+/**
+ * Bundle of most images used by the HTML Editor plug-in.
+ */
+public class HTMLEditorPluginImages { 	
+	public static final String IMG_OBJ_TABLE = "icons/full/obj16/table.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_ANCHOR = "icons/full/obj16/tag-anchor.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_BODY = "icons/full/obj16/tag-body.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_BUTTON = "icons/full/obj16/tag-button.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_FONT = "icons/full/obj16/tag-font.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_FORM = "icons/full/obj16/tag-form.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_GENERIC = "icons/full/obj16/tag-generic.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_HTML = "icons/full/obj16/tag-html.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_IMAGE_MAP = "icons/full/obj16/tag-image-map.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_IMAGE = "icons/full/obj16/tag-image.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_JSP = "icons/full/obj16/tag-jsp.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_TEMPLATE = "icons/full/obj16/tag-template.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG_TITLE = "icons/full/obj16/tag-title.gif";			//$NON-NLS-1$
+	public static final String IMG_OBJ_TAG = "icons/full/obj16/tag.gif";			//$NON-NLS-1$
+	public static final String IMG_WIZBAN_NEWHTMLFILE = "icons/full/wizban/newhfile_wiz.png";			//$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java
new file mode 100644
index 0000000..569b724
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.editor;
+
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+
+/**
+ * Help context ids for the HTML Source Editor.
+ * <p>
+ * This interface contains constants only; it is not intended to be implemented.
+ * </p>
+ * 
+ */
+public interface IHelpContextIds {
+	// org.eclipse.wst.html.ui.
+	public static final String PREFIX = HTMLUIPlugin.ID + "."; //$NON-NLS-1$
+
+	// // figured out on the fly
+	// // HTML Source page editor
+	// public static final String HTML_SOURCEVIEW_HELPID =
+	// ContentTypeIdForHTML.ContentTypeID_HTML +"_source_HelpId";
+	// //$NON-NLS-1$
+	
+	// HTML Files Preference page
+	public static final String HTML_PREFWEBX_FILES_HELPID = PREFIX + "webx0030"; //$NON-NLS-1$
+	// HTML Source Preference page
+	public static final String HTML_PREFWEBX_SOURCE_HELPID = PREFIX + "webx0031"; //$NON-NLS-1$
+	// HTML Styles Preference page
+	public static final String HTML_PREFWEBX_STYLES_HELPID = PREFIX + "webx0032"; //$NON-NLS-1$
+	// HTML Templates Preference page
+	public static final String HTML_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0033"; //$NON-NLS-1$
+		
+	// HTML Cleanup dialog
+	public static final String CLEANUP_HTML_HELPID = PREFIX + "xmlm1100"; //$NON-NLS-1$
+	
+	// HTML Content Settings
+	public static final String WEB_CONTENT_SETTINGS_HELPID = PREFIX + "misc0170"; //$NON-NLS-1$
+	
+	// HTML New File Wizard - Template Page
+	public static final String HTML_NEWWIZARD_TEMPLATE_HELPID = PREFIX + "htmlw0010"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/handlers/HTMLFindOccurrencesHandler.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/handlers/HTMLFindOccurrencesHandler.java
new file mode 100644
index 0000000..68cc317
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/handlers/HTMLFindOccurrencesHandler.java
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.handlers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesProcessor;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
+import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
+import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
+import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
+
+public class HTMLFindOccurrencesHandler extends AbstractHandler implements IHandler {
+	private List fProcessors;
+
+	
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		IEditorPart editor = HandlerUtil.getActiveEditor(event);
+		ITextEditor textEditor = null;
+		boolean okay = false;
+		
+		if (editor instanceof ITextEditor)
+			textEditor = (ITextEditor) editor;
+		else {
+			Object o = editor.getAdapter(ITextEditor.class);
+			if (o != null)
+				textEditor = (ITextEditor) o;
+		}
+		
+		if (textEditor != null) {
+			IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
+			if (document != null) {
+				ITextSelection textSelection = getTextSelection(textEditor);
+				FindOccurrencesProcessor findOccurrenceProcessor = getProcessorForCurrentSelection(document, textSelection);
+				if (findOccurrenceProcessor != null) {
+					if (textEditor.getEditorInput() instanceof IFileEditorInput) {
+						IFile file = ((IFileEditorInput) textEditor.getEditorInput()).getFile();
+						okay = findOccurrenceProcessor.findOccurrences(document, textSelection, file);
+					}
+				}
+			}
+		}
+		if (okay) {
+			// clear status message
+			PlatformStatusLineUtil.clearStatusLine();
+		}
+		else {
+			String errorMessage = SSEUIMessages.FindOccurrencesActionProvider_0; //$NON-NLS-1$
+			if (textEditor instanceof StructuredTextEditor) {
+				PlatformStatusLineUtil.displayTemporaryErrorMessage(((StructuredTextEditor) textEditor).getTextViewer(), errorMessage);
+			}
+			else {
+				PlatformStatusLineUtil.displayErrorMessage(errorMessage);
+				PlatformStatusLineUtil.addOneTimeClearListener();
+			}
+		}
+		return null;
+	}
+	
+	/**
+	 * Get the appropriate find occurrences processor
+	 * 
+	 * @param document -
+	 *            assumes not null
+	 * @param textSelection
+	 * @return
+	 */
+	private FindOccurrencesProcessor getProcessorForCurrentSelection(IDocument document, ITextSelection textSelection) {
+		// check if we have an action that's enabled on the current partition
+		ITypedRegion tr = getPartition(document, textSelection);
+		String partition = tr != null ? tr.getType() : ""; //$NON-NLS-1$
+
+		Iterator it = getProcessors().iterator();
+		FindOccurrencesProcessor processor = null;
+		while (it.hasNext()) {
+			processor = (FindOccurrencesProcessor) it.next();
+			// we just choose the first action that can handle the partition
+			if (processor.enabledForParitition(partition))
+				return processor;
+		}
+
+		List extendedFindOccurrencesProcessors = ExtendedConfigurationBuilder.getInstance().getConfigurations(FindOccurrencesProcessor.class.getName(), partition);
+		for (int i = 0; i < extendedFindOccurrencesProcessors.size(); i++) {
+			Object o = extendedFindOccurrencesProcessors.get(i);
+			if (o instanceof FindOccurrencesProcessor) {
+				/*
+				 * We just choose the first registered processor that
+				 * explicitly says it can handle the partition
+				 */
+				processor = (FindOccurrencesProcessor) o;
+				if (processor.enabledForParitition(partition))
+					return processor;
+			}
+		}
+		return null;
+	}
+	
+	private ITypedRegion getPartition(IDocument document, ITextSelection textSelection) {
+		ITypedRegion region = null;
+		if (textSelection != null) {
+			try {
+				region = document.getPartition(textSelection.getOffset());
+			}
+			catch (BadLocationException e) {
+				region = null;
+			}
+		}
+		return region;
+	}
+	
+	private ITextSelection getTextSelection(ITextEditor textEditor) {
+		ITextSelection textSelection = null;
+		ISelection selection = textEditor.getSelectionProvider().getSelection();
+		if (selection instanceof ITextSelection && !selection.isEmpty()) {
+			textSelection = (ITextSelection) selection;
+		}
+		return textSelection;
+	}
+	
+	protected List getProcessors() {
+		if (fProcessors == null) {
+			fProcessors = new ArrayList();
+			HTMLFindOccurrencesProcessor htmlProcessor = new HTMLFindOccurrencesProcessor();
+			fProcessors.add(htmlProcessor);
+		}
+		return fProcessors;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java
new file mode 100644
index 0000000..4d8ab98
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java
@@ -0,0 +1,511 @@
+/*******************************************************************************

+ * Copyright (c) 2008 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+

+package org.eclipse.wst.html.ui.internal.hyperlink;

+

+import java.util.ArrayList;

+import java.util.List;

+import java.util.NoSuchElementException;

+

+import org.eclipse.core.resources.IFile;

+import org.eclipse.core.resources.IMarker;

+import org.eclipse.core.resources.ResourcesPlugin;

+import org.eclipse.core.runtime.CoreException;

+import org.eclipse.core.runtime.IPath;

+import org.eclipse.core.runtime.IProgressMonitor;

+import org.eclipse.core.runtime.IStatus;

+import org.eclipse.core.runtime.Path;

+import org.eclipse.core.runtime.Status;

+import org.eclipse.core.runtime.jobs.Job;

+import org.eclipse.jface.text.BadLocationException;

+import org.eclipse.jface.text.IDocument;

+import org.eclipse.jface.text.IRegion;

+import org.eclipse.jface.text.ITextViewer;

+import org.eclipse.jface.text.ITextViewerExtension5;

+import org.eclipse.jface.text.Region;

+import org.eclipse.jface.text.TextSelection;

+import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;

+import org.eclipse.jface.text.hyperlink.IHyperlink;

+import org.eclipse.osgi.util.NLS;

+import org.eclipse.swt.widgets.Display;

+import org.eclipse.ui.IEditorPart;

+import org.eclipse.ui.IWorkbenchPage;

+import org.eclipse.ui.PartInitException;

+import org.eclipse.ui.PlatformUI;

+import org.eclipse.ui.ide.IDE;

+import org.eclipse.ui.progress.UIJob;

+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;

+import org.eclipse.wst.html.core.internal.validate.ModuleCoreSupport;

+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;

+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;

+import org.eclipse.wst.html.ui.internal.Logger;

+import org.eclipse.wst.sse.core.StructuredModelManager;

+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;

+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;

+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;

+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;

+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;

+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;

+import org.eclipse.wst.sse.core.utils.StringUtils;

+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;

+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;

+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;

+import org.w3c.dom.Element;

+import org.w3c.dom.Node;

+import org.w3c.dom.NodeList;

+

+import com.ibm.icu.util.StringTokenizer;

+

+public class AnchorHyperlinkDetector extends AbstractHyperlinkDetector {

+	static class ExternalElementHyperlink implements IHyperlink {

+		private String fAnchorName = null;

+		private Element fBaseElement = null;

+		private Display fDisplay = null;

+		private IRegion fHyperlinkRegion = null;

+

+		/**

+		 * @param hyperlinkRegion

+		 * @param anchorName

+		 */

+		public ExternalElementHyperlink(Display display, IRegion hyperlinkRegion, String anchorName, Element baseElement) {

+			super();

+			fDisplay = display;

+			fHyperlinkRegion = hyperlinkRegion;

+			fAnchorName = anchorName;

+			fBaseElement = baseElement;

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

+		 * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()

+		 */

+		IStatus _open() {

+			if (fBaseElement instanceof IDOMNode) {

+				StringTokenizer tokenizer = new StringTokenizer(fAnchorName, "#"); //$NON-NLS-1$

+				String filename = null;

+				String anchorName = null;

+				if (tokenizer.hasMoreTokens()) {

+					try {

+						filename = tokenizer.nextToken();

+						anchorName = tokenizer.nextToken();

+					}

+					catch (NoSuchElementException e) {

+						// poorly formed value

+					}

+				}

+				if (filename != null && anchorName != null) {

+					// System.out.println(filename + ":" + anchorName + "-" +

+					// fBaseElement);

+

+					IPath basePath = new Path(((IDOMNode) fBaseElement).getModel().getBaseLocation());

+					if (basePath.segmentCount() > 1) {

+						IPath resolved = ModuleCoreSupport.resolve(basePath, filename);

+						IFile targetFile = ResourcesPlugin.getWorkspace().getRoot().getFile(resolved);

+						if (targetFile.isAccessible()) {

+							IStructuredModel model = null;

+							int start = -1;

+							int end = -1;

+							try {

+								model = StructuredModelManager.getModelManager().getModelForRead(targetFile);

+								if (model instanceof IDOMModel) {

+									NodeList anchors = ((IDOMModel) model).getDocument().getElementsByTagNameNS("*", HTML40Namespace.ElementName.A); //$NON-NLS-1$

+									for (int i = 0; i < anchors.getLength() && start < 0; i++) {

+										Node item = anchors.item(i);

+										Node nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_NAME);

+										if (nameNode == null)

+											nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_ID);

+										if (nameNode != null) {

+											String name = nameNode.getNodeValue();

+											if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {

+												start = ((IndexedRegion) nameNode).getStartOffset();

+												end = ((IndexedRegion) nameNode).getEndOffset();

+											}

+										}

+									}

+									anchors = ((IDOMModel) model).getDocument().getElementsByTagName(HTML40Namespace.ElementName.A);

+									for (int i = 0; i < anchors.getLength() && start < 0; i++) {

+										Node item = anchors.item(i);

+										Node nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_NAME);

+										if (nameNode == null)

+											nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_ID);

+										if (nameNode != null) {

+											String name = nameNode.getNodeValue();

+											if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {

+												start = ((IndexedRegion) nameNode).getStartOffset();

+												end = ((IndexedRegion) nameNode).getEndOffset();

+											}

+										}

+									}

+

+									anchors = ((IDOMModel) model).getDocument().getElementsByTagName("*"); //$NON-NLS-1$

+									for (int i = 0; i < anchors.getLength() && start < 0; i++) {

+										Node item = anchors.item(i);

+										Node nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_NAME);

+										if (nameNode == null)

+											nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_ID);

+										if (nameNode != null) {

+											String name = nameNode.getNodeValue();

+											if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {

+												start = ((IndexedRegion) nameNode).getStartOffset();

+												end = ((IndexedRegion) nameNode).getEndOffset();

+											}

+										}

+									}

+

+								}

+								return open(basePath.toString(), targetFile, start, end);

+							}

+							catch (Exception e) {

+								Logger.logException(e);

+								return new Status(IStatus.ERROR, HTMLUIPlugin.ID, e.getMessage());

+

+							}

+							finally {

+								if (model != null)

+									model.releaseFromRead();

+							}

+						}

+					}

+				}

+			}

+			return Status.OK_STATUS;

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

+		 * @see

+		 * org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()

+		 */

+		public IRegion getHyperlinkRegion() {

+			return fHyperlinkRegion;

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

+		 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()

+		 */

+		public String getHyperlinkText() {

+			return NLS.bind(HTMLUIMessages.Open, fAnchorName);

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

+		 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()

+		 */

+		public String getTypeLabel() {

+			return null;

+		}

+

+		public void open() {

+			scheduleOpen();

+		}

+

+		/**

+		 * @param targetFile

+		 * @param start

+		 * @param end

+		 */

+		private IStatus open(String base, IFile targetFile, int start, int end) throws CoreException, PartInitException {

+			IMarker temporaryMarker = null;

+			try {

+				IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();

+

+				IEditorPart editor = IDE.openEditor(page, targetFile);

+

+				if (0 <= start && start <= end) {

+					temporaryMarker = targetFile.createMarker(IMarker.BOOKMARK);

+					temporaryMarker.setAttribute(IMarker.MESSAGE, base);

+					temporaryMarker.setAttribute(IMarker.CHAR_START, start);

+					temporaryMarker.setAttribute(IMarker.CHAR_END, end);

+					IDE.gotoMarker(editor, temporaryMarker);

+				}

+				return Status.OK_STATUS;

+			}

+			finally {

+				if (temporaryMarker != null)

+					try {

+						temporaryMarker.delete();

+					}

+					catch (CoreException e) {

+						Logger.logException(e);

+					}

+			}

+		}

+

+		void scheduleOpen() {

+			Job opener = new UIJob(fDisplay, fAnchorName) {

+				public IStatus runInUIThread(IProgressMonitor monitor) {

+					return _open();

+				}

+

+			};

+			opener.setSystem(true);

+			opener.setUser(false);

+			opener.schedule();

+		}

+	}

+

+	/**

+	 * Links to the given target node within the text viewer. The target node

+	 * is expected to implement IndexedNode and appear in that text viewer

+	 * (i.e. same editor).

+	 * 

+	 */

+	static class InternalElementHyperlink implements IHyperlink {

+		private IRegion fHyperlinkRegion;

+		private Node fTarget = null;

+		private ITextViewer fViewer = null;

+

+		/**

+		 * 

+		 */

+		public InternalElementHyperlink(ITextViewer textViewer, IRegion hyperlinkRegion, Node targetNode) {

+			fHyperlinkRegion = hyperlinkRegion;

+			fTarget = targetNode;

+			fViewer = textViewer;

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

+		 * @see

+		 * org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()

+		 */

+		public IRegion getHyperlinkRegion() {

+			return fHyperlinkRegion;

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

+		 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()

+		 */

+		public String getHyperlinkText() {

+			if (fTarget instanceof IndexedRegion) {

+				try {

+					int line = fViewer.getDocument().getLineOfOffset(((IndexedRegion) fTarget).getStartOffset()) + 1;

+					return NLS.bind(HTMLUIMessages.Hyperlink_line, new String[]{fTarget.getNodeName(), fTarget.getNodeValue(), String.valueOf(line)});

+				}

+				catch (BadLocationException e) {

+					Logger.logException(e);

+				}

+			}

+			return NLS.bind(HTMLUIMessages.Open, fTarget.getNodeName());

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

+		 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()

+		 */

+		public String getTypeLabel() {

+			return null;

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

+		 * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()

+		 */

+		public void open() {

+			if (fTarget instanceof IndexedRegion) {

+				int offset = ((IndexedRegion) fTarget).getStartOffset();

+				if (fViewer instanceof ITextViewerExtension5) {

+					offset = ((ITextViewerExtension5) fViewer).modelOffset2WidgetOffset(offset);

+				}

+				fViewer.getSelectionProvider().setSelection(new TextSelection(offset, 0));

+				fViewer.revealRange(offset, 0);

+			}

+		}

+	}

+

+	public AnchorHyperlinkDetector() {

+		super();

+	}

+

+	private void addHyperLinkForHref(ITextViewer textViewer, IRegion linkRegion, Element element, String hrefValue, List links, Node anchor) {

+		Node nameNode = anchor.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_HREF);

+		if (nameNode != null) {

+			String name = nameNode.getNodeValue();

+			if (hrefValue.equals(name) && nameNode instanceof IndexedRegion) {

+				links.add(new InternalElementHyperlink(textViewer, linkRegion, nameNode));

+			}

+		}

+	}

+

+	private void addHyperLinkForName(ITextViewer textViewer, IRegion linkRegion, Element element, String anchorName, List links, Node anchor) {

+		Node nameNode = anchor.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_NAME);

+		if (nameNode != null) {

+			String name = nameNode.getNodeValue();

+			if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {

+				links.add(new InternalElementHyperlink(textViewer, linkRegion, nameNode));

+			}

+		}

+		nameNode = anchor.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_ID);

+		if (nameNode != null) {

+			String name = nameNode.getNodeValue();

+			if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {

+				links.add(new InternalElementHyperlink(textViewer, linkRegion, nameNode));

+			}

+		}

+	}

+

+	/**

+	 * @param documentRegion

+	 * @param valueRegion

+	 * @return

+	 */

+	private IRegion createHyperlinkRegion(IStructuredDocumentRegion documentRegion, ITextRegion valueRegion) {

+		return new Region(documentRegion.getStartOffset(valueRegion), valueRegion.getTextLength());

+	}

+

+	// link to anchors with the given name (value includes the '#')

+	IHyperlink[] createHyperlinksToAnchorNamed(ITextViewer textViewer, IRegion hyperlinkRegion, Element element, String anchorName, boolean canShowMultipleHyperlinks) {

+		List links = new ArrayList(1);

+		// >1 guards the substring-ing

+		if (anchorName.length() > 1 && anchorName.startsWith("#")) { //$NON-NLS-1$

+			// an anchor in this document

+			NodeList anchors = null;//element.getOwnerDocument().getElementsByTagNameNS("*", HTML40Namespace.ElementName.A); //$NON-NLS-1$

+			String internalAnchorName = anchorName.substring(1);

+//			for (int i = 0; i < anchors.getLength(); i++) {

+//				addHyperLinkForName(textViewer, hyperlinkRegion, element, internalAnchorName, links, anchors.item(i));

+//			}

+//			anchors = element.getOwnerDocument().getElementsByTagName(HTML40Namespace.ElementName.A);

+//			for (int i = 0; i < anchors.getLength(); i++) {

+//				addHyperLinkForName(textViewer, hyperlinkRegion, element, internalAnchorName, links, anchors.item(i));

+//			}

+			anchors = element.getOwnerDocument().getElementsByTagName("*"); //$NON-NLS-1$

+			for (int i = 0; i < anchors.getLength(); i++) {

+				addHyperLinkForName(textViewer, hyperlinkRegion, element, internalAnchorName, links, anchors.item(i));

+			}

+		}

+		else {

+			// another file, possibly very slow to compute ahead of time

+			links.add(new ExternalElementHyperlink(textViewer.getTextWidget().getDisplay(), hyperlinkRegion, anchorName, element));

+		}

+		if (!links.isEmpty()) {

+			return (IHyperlink[]) links.toArray(new IHyperlink[links.size()]);

+		}

+		return null;

+	}

+

+	// link to anchors that link to this target

+	IHyperlink[] createReferrerHyperlinks(ITextViewer textViewer, IRegion hyperlinkRegion, Element element, String nameValue, boolean canShowMultipleHyperlinks) {

+		List links = new ArrayList(1);

+		if (nameValue.length() > 0) {

+			String target = "#" + nameValue; //$NON-NLS-1$

+			NodeList anchors = null;//element.getOwnerDocument().getElementsByTagNameNS("*", HTML40Namespace.ElementName.A); //$NON-NLS-1$

+//			for (int i = 0; i < anchors.getLength(); i++) {

+//				addHyperLinkForHref(textViewer, hyperlinkRegion, element, target, links, anchors.item(i));

+//			}

+//			anchors = element.getOwnerDocument().getElementsByTagName(HTML40Namespace.ElementName.A);

+//			for (int i = 0; i < anchors.getLength(); i++) {

+//				addHyperLinkForHref(textViewer, hyperlinkRegion, element, target, links, anchors.item(i));

+//			}

+			anchors = element.getOwnerDocument().getElementsByTagName("*"); //$NON-NLS-1$

+			for (int i = 0; i < anchors.getLength(); i++) {

+				addHyperLinkForHref(textViewer, hyperlinkRegion, element, target, links, anchors.item(i));

+			}

+		}

+		if (!links.isEmpty()) {

+			return (IHyperlink[]) links.toArray(new IHyperlink[links.size()]);

+		}

+		return null;

+	}

+

+	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {

+		if (textViewer != null && region != null) {

+			IDocument document = textViewer.getDocument();

+			if (document != null) {

+				Node currentNode = getCurrentNode(document, region.getOffset());

+				if (currentNode != null && currentNode.getNodeType() == Node.ELEMENT_NODE) {

+					Element element = (Element) currentNode;

+						IStructuredDocumentRegion documentRegion = ((IStructuredDocument) document).getRegionAtCharacterOffset(region.getOffset());

+						ITextRegion textRegion = documentRegion.getRegionAtCharacterOffset(region.getOffset());

+						ITextRegion nameRegion = null;

+						ITextRegion valueRegion = null;

+						String name = null;

+						String value = null;

+						if (DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(textRegion.getType())) {

+							ITextRegionList regions = documentRegion.getRegions();

+							/*

+							 * Could use 2, but there needs to be the tag open

+							 * and name regions

+							 */

+							int index = regions.indexOf(textRegion);

+							if (index >= 4) {

+								nameRegion = regions.get(index - 2);

+								valueRegion = textRegion;

+								name = documentRegion.getText(nameRegion);

+								value = StringUtils.strip(documentRegion.getText(valueRegion));

+							}

+						}

+						else if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(textRegion.getType())) {

+							ITextRegionList regions = documentRegion.getRegions();

+							int index = regions.indexOf(textRegion);

+							// minus 3 to leave equal and value regions

+							if (index <= regions.size() - 3) {

+								nameRegion = textRegion;

+								valueRegion = regions.get(index + 2);

+								name = documentRegion.getText(nameRegion);

+								value = StringUtils.strip(documentRegion.getText(valueRegion));

+							}

+						}

+						if (name != null && value != null) {

+							if (HTML40Namespace.ATTR_NAME_HREF.equalsIgnoreCase(name) && value.indexOf("#") >= 0) { //$NON-NLS-1$

+								return createHyperlinksToAnchorNamed(textViewer, createHyperlinkRegion(documentRegion, valueRegion), element, value, canShowMultipleHyperlinks);

+							}

+							if (HTML40Namespace.ATTR_NAME_NAME.equalsIgnoreCase(name)||HTML40Namespace.ATTR_NAME_ID.equalsIgnoreCase(name)) {

+								return createReferrerHyperlinks(textViewer, createHyperlinkRegion(documentRegion, valueRegion), element, value, canShowMultipleHyperlinks);

+							}

+						}

+				}

+			}

+		}

+		return null;

+	}

+

+	/**

+	 * Returns the node the cursor is currently on in the document. null if no

+	 * node is selected

+	 * 

+	 * @param offset

+	 * @return Node either element, doctype, text, or null

+	 */

+	private Node getCurrentNode(IDocument document, int offset) {

+		// get the current node at the offset (returns either: element,

+		// doctype, text)

+		IndexedRegion inode = null;

+		IStructuredModel sModel = null;

+		try {

+			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);

+			if (sModel != null) {

+				inode = sModel.getIndexedRegion(offset);

+				if (inode == null) {

+					inode = sModel.getIndexedRegion(offset - 1);

+				}

+			}

+		}

+		finally {

+			if (sModel != null)

+				sModel.releaseFromRead();

+		}

+

+		if (inode instanceof Node) {

+			return (Node) inode;

+		}

+		return null;

+	}

+}

diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLCompletionProposalCategoriesConfiguration.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLCompletionProposalCategoriesConfiguration.java
new file mode 100644
index 0000000..11cb1d0
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLCompletionProposalCategoriesConfiguration.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 20109 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration;
+
+/**
+ * <p>The readable and writable completion proposal categories configuration
+ * for the HTML content type</p>
+ */
+public class HTMLCompletionProposalCategoriesConfiguration extends AbstractCompletionProposalCategoriesConfiguration {
+
+	/** the ID of the preference page where users can change the preferences */
+	private static final String PREFERENCES_PAGE_ID = "org.eclipse.wst.html.ui.preferences.contentassist"; //$NON-NLS-1$
+	
+	/**
+	 * <p>Creates the configuration</p>
+	 */
+	public HTMLCompletionProposalCategoriesConfiguration() {
+		//nothing to do.
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPreferenceStore()
+	 */
+	protected IPreferenceStore getPreferenceStore() {
+		return HTMLUIPlugin.getDefault().getPreferenceStore();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#hasAssociatedPropertiesPage()
+	 */
+	public boolean hasAssociatedPropertiesPage() {
+		return true;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#getPropertiesPageID()
+	 */
+	public String getPropertiesPageID() {
+		return PREFERENCES_PAGE_ID;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnDefaultPagePrefKey()
+	 */
+	protected String getShouldNotDisplayOnDefaultPagePrefKey() {
+		return HTMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnOwnPagePrefKey()
+	 */
+	protected String getShouldNotDisplayOnOwnPagePrefKey() {
+		return HTMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPageSortOrderPrefKey()
+	 */
+	protected String getPageSortOrderPrefKey() {
+		return HTMLUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getDefaultPageSortOrderPrefKey()
+	 */
+	protected String getDefaultPageSortOrderPrefKey() {
+		return HTMLUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER;
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java
new file mode 100644
index 0000000..6ddbb67
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Benjamin Muskalla, b.muskalla@gmx.net - [158660] character entities should have their own syntax highlighting preference      
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
+import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
+
+/**
+ * Sets default values for HTML UI preferences
+ */
+public class HTMLUIPreferenceInitializer extends AbstractPreferenceInitializer {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+	 */
+	public void initializeDefaultPreferences() {
+		IPreferenceStore store = HTMLUIPlugin.getDefault().getPreferenceStore();
+		ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
+		
+		store.setDefault(HTMLUIPreferenceNames.AUTO_PROPOSE, true);
+		store.setDefault(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE, "<=");//$NON-NLS-1$
+
+		// HTML Style Preferences
+		String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
+		String JUSTITALIC = " | null | false | true"; //$NON-NLS-1$
+		String styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_ATTRIBUTE_NAME, 127, 0, 127) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, 42, 0, 255) + JUSTITALIC;
+		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, styleValue);
+
+		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
+		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, styleValue); // specified value is black; leaving as widget default
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.COMMENT_BORDER, 63, 95, 191) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.COMMENT_BORDER, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.COMMENT_TEXT, 63, 95, 191) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.COMMENT_TEXT, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DECL_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.DECL_BORDER, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_NAME, 0, 0, 128) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.DOCTYPE_NAME, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, 0, 0, 128) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, 128, 128, 128) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, 63, 127, 95) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, styleValue);
+
+		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
+		store.setDefault(IStyleConstantsXML.XML_CONTENT, styleValue);	// specified value is black; leaving as widget default
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.TAG_BORDER, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_NAME, 63, 127, 127) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.TAG_NAME, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.PI_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.PI_BORDER, styleValue);
+
+		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
+		store.setDefault(IStyleConstantsXML.PI_CONTENT, styleValue);	// specified value is black; leaving as widget default
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.CDATA_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.CDATA_BORDER, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.CDATA_TEXT, 0, 0, 0) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.CDATA_TEXT, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsHTML.SCRIPT_AREA_BORDER, 191, 95, 63) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsHTML.SCRIPT_AREA_BORDER, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.ENTITY_REFERENCE, 42, 0, 255) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsXML.ENTITY_REFERENCE, styleValue);
+
+		// set default new html file template to use in new file wizard
+		/*
+		 * Need to find template name that goes with default template id (name
+		 * may change for different language)
+		 */
+		store.setDefault(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_ID, "org.eclipse.wst.html.ui.templates.html"); //$NON-NLS-1$
+		
+		// Defaults for the Typing preference page
+		store.setDefault(HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS, true);
+		store.setDefault(HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS, true);
+		store.setDefault(HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS, true);
+		store.setDefault(HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS, true);
+		store.setDefault(HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS, true);
+		store.setDefault(HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS, true);
+		
+		// Defaults for Content Assist preference page
+		store.setDefault(HTMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE, "");
+		store.setDefault(HTMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE, "");
+		store.setDefault(HTMLUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER,
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTags\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.css\0" +
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTemplates\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.cssTemplates");
+		store.setDefault(HTMLUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER,
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTemplates\0"+
+				"org.eclipse.wst.css.ui.proposalCategory.cssTemplates\0" +
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTags\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.css");
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java
new file mode 100644
index 0000000..4f8b012
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences;
+
+/**
+ * Preference keys for HTML UI
+ */
+public class HTMLUIPreferenceNames {
+	/**
+	 * A named preference that controls if code assist gets auto activated.
+	 * <p>
+	 * Value is of type <code>Boolean</code>.
+	 * </p>
+	 */
+	public static final String AUTO_PROPOSE = getAutoProposeKey();
+
+	private static String getAutoProposeKey() {
+		return "autoPropose";//$NON-NLS-1$
+	}
+
+	/**
+	 * A named preference that holds the characters that auto activate code
+	 * assist.
+	 * <p>
+	 * Value is of type <code>String</code>. All characters that trigger
+	 * auto code assist.
+	 * </p>
+	 */
+	public static final String AUTO_PROPOSE_CODE = getAutoProposeCodeKey();
+
+	private static String getAutoProposeCodeKey() {
+		return "autoProposeCode";//$NON-NLS-1$
+	}
+
+	/**
+	 * The key to store customized templates.
+	 * <p>
+	 * Value is of type <code>String</code>.
+	 * </p>
+	 */
+	public static final String TEMPLATES_KEY = getTemplatesKey();
+
+	private static String getTemplatesKey() {
+		return "org.eclipse.wst.sse.ui.custom_templates"; //$NON-NLS-1$
+	}
+	
+	/**
+	 * The key to store the last template name used in new HTML file wizard.
+	 * Template name is stored instead of template id because user-created
+	 * templates do not have template ids.
+	 * <p>
+	 * Value is of type <code>String</code>.
+	 * </p>
+	 */
+	public static final String NEW_FILE_TEMPLATE_NAME = "newFileTemplateName"; //$NON-NLS-1$
+
+	/**
+	 * The initial template ID to be used in the new HTML file wizard. In the absence
+	 * of {@link NEW_FILE_TEMPLATE_NAME}, this ID is used to find a template name
+	 */
+	public static final String NEW_FILE_TEMPLATE_ID = "newFileTemplateId"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the option for auto-completing comments while
+	 * typing.
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_COMPLETE_COMMENTS = "completeComments"; //$NON-NLS-1$
+	
+	/**
+	 * The key to store the option for auto-completing end-tags after entering
+	 * <code>&lt;/</code>
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_COMPLETE_END_TAGS = "completeEndTags"; //$NON-NLS-1$
+	
+	/**
+	 * The key to store the option for auto-completing the element after entering
+	 * <code>&gt;</code>
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_COMPLETE_ELEMENTS = "completeElements"; //$NON-NLS-1$
+	
+	/**
+	 * The key to store the option for removing an end-tag if the start tag is
+	 * converted to an empty-tag.
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_REMOVE_END_TAGS = "removeEndTags"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the option for auto-completing strings (" and ') while
+	 * typing.
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_CLOSE_STRINGS = "closeStrings"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the option for auto-completing brackets ([ and () while
+	 * typing.
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_CLOSE_BRACKETS = "closeBrackets"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key used for saving which categories should not display on the default page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>), ordered is ignored</p>
+	 */
+	public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE = "html_content_assist_display_on_default_page"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key used for saving which categories should not display on their own page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>), order is ignored</p>
+	 */
+	public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE = "html_content_assist_display_on_own_page"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key for saving the sort order of the categories when displaying them on their own page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>) in the desired sort order.</p>
+	 */
+	public static final String CONTENT_ASSIST_OWN_PAGE_SORT_ORDER= "html_content_assist_own_page_sort_order"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key for saving the sort order of the categories when displaying them on the default page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>) in the desired sort order.</p>
+	 */
+	public static final String CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER= "html_content_assist_default_page_sort_order"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/AbstractValidationSettingsPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
new file mode 100644
index 0000000..f2ab08d
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
@@ -0,0 +1,400 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences.ui;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IPreferencesService;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.ScrolledPageContent;
+import org.eclipse.wst.validation.ValidationFramework;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ * Based on org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock
+ */
+abstract class AbstractValidationSettingsPage extends PropertyPreferencePage {
+
+	private List fCombos;
+	private List fExpandables;
+	
+	private SelectionListener fSelectionListener;
+	
+	private IPreferencesService fPreferencesService = null;
+	
+	private static final String SETTINGS_EXPANDED = "expanded"; //$NON-NLS-1$
+	
+	private ValidationFramework fValidation;
+	
+	private class ComboData {
+		private String fKey;
+		private int[] fSeverities;
+		private int fIndex;
+		int originalSeverity = -2;
+		
+		public ComboData(String key, int[] severities, int index) {
+			fKey = key;
+			fSeverities = severities;
+			fIndex = index;
+		}
+		
+		public String getKey() {
+			return fKey;
+		}
+		
+		public void setIndex(int index) {
+			fIndex = index;
+		}
+		
+		public int getIndex() {
+			return fIndex;
+		}
+		
+		/**
+		 * Sets the severity index based on <code>severity</code>.
+		 * If the severity doesn't exist, the index is set to -1.
+		 * 
+		 * @param severity the severity level
+		 */
+		public void setSeverity(int severity) {
+			for(int i = 0; fSeverities != null && i < fSeverities.length; i++) {
+				if(fSeverities[i] == severity) {
+					fIndex = i;
+					return;
+				}
+			}
+			
+			fIndex = -1;
+		}
+		
+		public int getSeverity() {
+			return (fIndex >= 0 && fSeverities != null && fIndex < fSeverities.length) ? fSeverities[fIndex] : -1;
+		}
+		
+		boolean isChanged() {
+			return fSeverities[fIndex] != originalSeverity;
+		}
+	}
+	
+	public AbstractValidationSettingsPage() {
+		super();
+		fCombos = new ArrayList();
+		fExpandables = new ArrayList();
+		fPreferencesService = Platform.getPreferencesService();
+		fValidation = ValidationFramework.getDefault();
+	}
+	
+	/**
+	 * Creates a Combo widget in the composite <code>parent</code>. The data
+	 * in the Combo is associated with <code>key</code>. The Combo data is
+	 * generated based on the integer <code>values</code> where the index
+	 * of <code>values</code> corresponds to the index of <code>valueLabels</code>
+	 * 
+	 * @param parent the composite to create the combo box in
+	 * @param label the label to give the combo box
+	 * @param key the unique key to identify the combo box
+	 * @param values the values represented by the combo options
+	 * @param valueLabels the calues displayed in the combo box
+	 * @param indent how far to indent the combo box label
+	 * 
+	 * @return the generated combo box
+	 */
+	protected Combo addComboBox(Composite parent, String label, String key, int[] values, String[] valueLabels, int indent) {
+		GridData gd= new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1);
+		gd.horizontalIndent= indent;
+				
+		Label labelControl= new Label(parent, SWT.LEFT);
+		labelControl.setFont(JFaceResources.getDialogFont());
+		labelControl.setText(label);
+		labelControl.setLayoutData(gd);
+				
+		Combo comboBox= newComboControl(parent, key, values, valueLabels);
+		comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
+
+		return comboBox;
+	}
+	
+	/**
+	 * Creates a combo box and associates the combo data with the
+	 * combo box.
+	 * 
+	 * @param composite the composite to create the combo box in
+	 * @param key the unique key to identify the combo box
+	 * @param values the values represented by the combo options
+	 * @param valueLabels the values displayed in the combo box
+	 * 
+	 * @return the generated combo box
+	 */
+	protected Combo newComboControl(Composite composite, String key, int[] values, String[] valueLabels) {
+		ComboData data = new ComboData(key, values, -1);
+		
+		Combo comboBox= new Combo(composite, SWT.READ_ONLY);
+		comboBox.setItems(valueLabels);
+		comboBox.setData(data);
+		comboBox.addSelectionListener(getSelectionListener());
+		comboBox.setFont(JFaceResources.getDialogFont());
+			
+		makeScrollableCompositeAware(comboBox);
+		
+		int severity = -1;
+		if(key != null)
+			severity = fPreferencesService.getInt(getPreferenceNodeQualifier(), key, ValidationMessage.WARNING, createPreferenceScopes());
+
+		if (severity == ValidationMessage.ERROR || severity == ValidationMessage.WARNING || severity == ValidationMessage.IGNORE) {
+			data.setSeverity(severity);
+			data.originalSeverity = severity;
+		}
+		
+		if(data.getIndex() >= 0)
+			comboBox.select(data.getIndex());
+		
+		fCombos.add(comboBox);
+		return comboBox;
+	}
+	
+	protected SelectionListener getSelectionListener() {
+		if (fSelectionListener == null) {
+			fSelectionListener= new SelectionListener() {
+				public void widgetDefaultSelected(SelectionEvent e) {}
+	
+				public void widgetSelected(SelectionEvent e) {
+					controlChanged(e.widget);
+				}
+			};
+		}
+		return fSelectionListener;
+	}
+	
+	protected void controlChanged(Widget widget) {
+		ComboData data= (ComboData) widget.getData();
+		if (widget instanceof Combo) {
+			data.setIndex(((Combo)widget).getSelectionIndex());
+		} else {
+			return;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSettingsPage#storeValues()
+	 */
+	protected void storeValues() {
+		if(fCombos == null || fCombos.size() == 0)
+			return;
+		
+		Iterator it = fCombos.iterator();
+		
+		IScopeContext[] contexts = createPreferenceScopes();
+
+		while(it.hasNext()) {
+			ComboData data = (ComboData) ((Combo)it.next()).getData();
+			if(data.getKey() != null) {
+				contexts[0].getNode(getPreferenceNodeQualifier()).putInt(data.getKey(), data.getSeverity());
+			}
+		}
+		
+		for(int i = 0; i < contexts.length; i++) {
+			try {
+				contexts[i].getNode(getPreferenceNodeQualifier()).flush();
+			}
+			catch (BackingStoreException e) {
+				
+			}
+		}
+	}
+	
+	protected ExpandableComposite getParentExpandableComposite(Control control) {
+		Control parent= control.getParent();
+		while (!(parent instanceof ExpandableComposite) && parent != null) {
+			parent= parent.getParent();
+		}
+		if (parent instanceof ExpandableComposite) {
+			return (ExpandableComposite) parent;
+		}
+		return null;
+	}
+	
+	protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) {
+		ExpandableComposite excomposite= new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
+		excomposite.setText(label);
+		excomposite.setExpanded(false);
+		excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
+		excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1));
+		excomposite.addExpansionListener(new ExpansionAdapter() {
+			public void expansionStateChanged(ExpansionEvent e) {
+				expandedStateChanged((ExpandableComposite) e.getSource());
+			}
+		});
+		fExpandables.add(excomposite);
+		makeScrollableCompositeAware(excomposite);
+		return excomposite;
+	}
+	
+	protected final void expandedStateChanged(ExpandableComposite expandable) {
+		ScrolledPageContent parentScrolledComposite= getParentScrolledComposite(expandable);
+		if (parentScrolledComposite != null) {
+			parentScrolledComposite.reflow(true);
+		}
+	}
+	
+	private void makeScrollableCompositeAware(Control control) {
+		ScrolledPageContent parentScrolledComposite= getParentScrolledComposite(control);
+		if (parentScrolledComposite != null) {
+			parentScrolledComposite.adaptChild(control);
+		}
+	}
+	
+	protected ScrolledPageContent getParentScrolledComposite(Control control) {
+		Control parent= control.getParent();
+		while (!(parent instanceof ScrolledPageContent) && parent != null) {
+			parent= parent.getParent();
+		}
+		if (parent instanceof ScrolledPageContent) {
+			return (ScrolledPageContent) parent;
+		}
+		return null;
+	}
+	
+	protected void storeSectionExpansionStates(IDialogSettings section) {
+		for(int i = 0; i < fExpandables.size(); i++) {
+			ExpandableComposite comp = (ExpandableComposite) fExpandables.get(i);
+			section.put(SETTINGS_EXPANDED + String.valueOf(i), comp.isExpanded());
+		}
+	}
+	
+	protected void restoreSectionExpansionStates(IDialogSettings settings) {
+		for (int i= 0; i < fExpandables.size(); i++) {
+			ExpandableComposite excomposite= (ExpandableComposite) fExpandables.get(i);
+			if (settings == null) {
+				excomposite.setExpanded(i == 0); // only expand the first node by default
+			} else {
+				excomposite.setExpanded(settings.getBoolean(SETTINGS_EXPANDED + String.valueOf(i)));
+			}
+		}
+	}
+	
+	protected void resetSeverities() {
+		IEclipsePreferences defaultContext = new DefaultScope().getNode(getPreferenceNodeQualifier());
+		for(int i = 0; i < fCombos.size(); i++) {
+			ComboData data = (ComboData)((Combo)fCombos.get(i)).getData();
+			int severity = defaultContext.getInt(data.getKey(), ValidationMessage.WARNING);
+			data.setSeverity(severity);
+			((Combo)fCombos.get(i)).select(data.getIndex());
+		}
+	}
+	
+	protected boolean shouldRevalidateOnSettingsChange() {
+		Iterator it = fCombos.iterator();
+
+		while (it.hasNext()) {
+			ComboData data = (ComboData) ((Combo) it.next()).getData();
+			if (data.isChanged())
+				return true;
+		}
+		return false;
+	}
+	
+	public boolean performOk() {
+		if(super.performOk() && shouldRevalidateOnSettingsChange()) {
+			MessageBox mb = new MessageBox(this.getShell(), SWT.APPLICATION_MODAL | SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_INFORMATION | SWT.RIGHT);
+			mb.setText(HTMLUIMessages.Validation_Title);
+			/* Choose which message to use based on if its project or workspace settings */
+			String msg = (getProject() == null) ? HTMLUIMessages.Validation_Workspace : HTMLUIMessages.Validation_Project;
+			mb.setMessage(msg);
+			switch(mb.open()) {
+				case SWT.CANCEL:
+					return false;
+				case SWT.YES:
+					storeValues();
+					ValidateJob job = new ValidateJob(HTMLUIMessages.Validation_jobName);
+					job.schedule();
+				case SWT.NO:
+					storeValues();
+				default:
+					return true;
+			}
+		}
+		return true;
+	}
+	
+	/**
+	 * Performs validation after validation preferences have been modified.
+	 */
+	private class ValidateJob extends Job {
+		
+		public ValidateJob(String name) {
+			super(name);
+		}
+
+		protected IStatus run(IProgressMonitor monitor) {
+			IStatus status = Status.OK_STATUS;
+			try {
+				IProject[] projects = null;
+				/* Changed preferences for a single project, only validate it */
+				if(getProject() != null)
+					projects = new IProject[] {getProject()};
+				/* Workspace-wide preferences changed */
+				else {
+					/* Get all of the projects in the workspace */
+					projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+					IEclipsePreferences prefs = null;
+					List projectList = new ArrayList();
+					
+					/* Filter out projects that use project-specific settings or have been closed */
+					for(int i = 0; i < projects.length; i++) {
+						prefs = new ProjectScope(projects[i]).getNode(getPreferenceNodeQualifier());
+						if(projects[i].isAccessible() && !prefs.getBoolean(getProjectSettingsKey(), false))
+							projectList.add(projects[i]);
+					}
+					projects = (IProject[]) projectList.toArray(new IProject[projectList.size()]);
+				}
+				fValidation.validate(projects, true, false, monitor);
+			}
+			catch (CoreException ce) {
+				status = Status.CANCEL_STATUS;
+			}
+			
+			return status;
+		}
+		
+	}
+	
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/EmptyFilePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/EmptyFilePreferencePage.java
new file mode 100644
index 0000000..cc3ca1b
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/EmptyFilePreferencePage.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences.ui;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+
+public class EmptyFilePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+	private Composite createComposite(Composite parent, int numColumns) {
+		noDefaultAndApplyButton();
+
+		Composite composite = new Composite(parent, SWT.NULL);
+
+		// GridLayout
+		GridLayout layout = new GridLayout();
+		layout.numColumns = numColumns;
+		composite.setLayout(layout);
+
+		// GridData
+		GridData data = new GridData(GridData.FILL);
+		data.horizontalIndent = 0;
+		data.verticalAlignment = GridData.FILL;
+		data.horizontalAlignment = GridData.FILL;
+		composite.setLayoutData(data);
+
+		return composite;
+	}
+
+	protected Control createContents(Composite parent) {
+		Composite composite = createScrolledComposite(parent);
+
+		String description = HTMLUIMessages.EmptyFilePreferencePage_0; 
+		Text text = new Text(composite, SWT.READ_ONLY);
+		// some themes on GTK have different background colors for Text and Labels
+		text.setBackground(composite.getBackground());
+		text.setText(description);
+
+		setSize(composite);
+		return composite;
+	}
+
+	private Composite createScrolledComposite(Composite parent) {
+		// create scrollbars for this parent when needed
+		final ScrolledComposite sc1 = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
+		sc1.setLayoutData(new GridData(GridData.FILL_BOTH));
+		Composite composite = createComposite(sc1, 1);
+		sc1.setContent(composite);
+
+		// not calling setSize for composite will result in a blank composite,
+		// so calling it here initially
+		// setSize actually needs to be called after all controls are created,
+		// so scrolledComposite
+		// has correct minSize
+		setSize(composite);
+		return composite;
+	}
+
+	public void init(IWorkbench workbench) {
+	}
+
+	private void setSize(Composite composite) {
+		if (composite != null) {
+			// Note: The font is set here in anticipation that the class inheriting
+			//       this base class may add widgets to the dialog.   setSize
+			//       is assumed to be called just before we go live.
+			applyDialogFont(composite);
+			Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+			composite.setSize(minSize);
+			// set scrollbar composite's min size so page is expandable but
+			// has scrollbars when needed
+			if (composite.getParent() instanceof ScrolledComposite) {
+				ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
+				sc1.setMinSize(minSize);
+				sc1.setExpandHorizontal(true);
+				sc1.setExpandVertical(true);
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java
new file mode 100644
index 0000000..c299dac
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2004,2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences.ui;
+
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
+import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;
+import org.eclipse.wst.xml.ui.internal.preferences.XMLColorPage;
+
+/**
+ * @deprecated
+ */
+public class HTMLColorPage extends XMLColorPage {
+
+	/**
+	 * Set up all the style preference keys in the overlay store
+	 */
+	protected OverlayKey[] createOverlayStoreKeys() {
+		ArrayList overlayKeys = new ArrayList();
+		
+		ArrayList styleList = new ArrayList();
+		initStyleList(styleList);
+		Iterator i = styleList.iterator();
+		while (i.hasNext()) {
+			overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, (String)i.next()));	
+		}
+
+		OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
+		overlayKeys.toArray(keys);
+		return keys;
+	}
+
+	public String getSampleText() {
+		return HTMLUIMessages.Sample_HTML_doc;
+
+	}
+
+	protected void initContextStyleMap(Dictionary contextStyleMap) {
+
+		initCommonContextStyleMap(contextStyleMap);
+		initDocTypeContextStyleMap(contextStyleMap);
+		// FIXME: these were "brute forced" commented out when moving XMLJSPRegionContexts
+		// effect is unknown, but thought just to effect preference page
+		//contextStyleMap.put(XMLJSPRegionContexts.JSP_DIRECTIVE_NAME, IStyleConstantsXML.TAG_NAME);
+		//contextStyleMap.put(XMLJSPRegionContexts.JSP_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
+		//contextStyleMap.put(XMLJSPRegionContexts.JSP_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
+		//contextStyleMap.put(XMLJSPRegionContexts.JSP_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
+	}
+
+	protected void initDescriptions(Dictionary descriptions) {
+
+		initCommonDescriptions(descriptions);
+		initDocTypeDescriptions(descriptions);
+	}
+
+	protected void initStyleList(ArrayList list) {
+		initCommonStyleList(list);
+		initDocTypeStyleList(list);
+		//	list.add(HTMLColorManager.SCRIPT_AREA_BORDER);
+
+	}
+
+	protected void setupPicker(StyledTextColorPicker picker) {
+		IModelManager mmanager = StructuredModelManager.getModelManager();
+		picker.setParser(mmanager.createStructuredDocumentFor(ContentTypeIdForHTML.ContentTypeID_HTML).getParser());
+
+		// create descriptions for hilighting types
+		Dictionary descriptions = new Hashtable();
+		initDescriptions(descriptions);
+
+		// map region types to hilighting types
+		Dictionary contextStyleMap = new Hashtable();
+		initContextStyleMap(contextStyleMap);
+
+		ArrayList styleList = new ArrayList();
+		initStyleList(styleList);
+
+		picker.setContextStyleMap(contextStyleMap);
+		picker.setDescriptions(descriptions);
+		picker.setStyleList(styleList);
+
+		//	updatePickerFont(picker);
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	protected Control createContents(Composite parent) {
+		Control c = super.createContents(parent);
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.HTML_PREFWEBX_STYLES_HELPID);
+		return c;
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
+	 */
+	protected IPreferenceStore doGetPreferenceStore() {
+		return HTMLUIPlugin.getDefault().getPreferenceStore();
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractColorPage#savePreferences()
+	 */
+	protected void savePreferences() {
+		HTMLUIPlugin.getDefault().savePluginPreferences();
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLContentAssistPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLContentAssistPreferencePage.java
new file mode 100644
index 0000000..c1fc2b6
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLContentAssistPreferencePage.java
@@ -0,0 +1,200 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences.ui;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposoalCatigoriesConfigurationRegistry;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
+import org.eclipse.wst.sse.ui.preferences.CodeAssistCyclingConfigurationBlock;
+import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
+
+/**
+ * <p>Defines the preference page for allowing the user to change the content
+ * assist preferences</p>
+ */
+public class HTMLContentAssistPreferencePage extends AbstractPreferencePage implements
+		IWorkbenchPreferencePage {
+
+	private static final String HTML_CONTENT_TYPE_ID = "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
+	
+	// Auto Activation
+	private Button fAutoPropose;
+	private Label fAutoProposeLabel;
+	private Text fAutoProposeText;
+	
+	/** configuration block for changing preference having to do with the content assist categories */
+	private CodeAssistCyclingConfigurationBlock fConfigurationBlock;
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	protected Control createContents(Composite parent) {
+		final Composite composite = super.createComposite(parent, 1);
+		
+		createContentsForAutoActivationGroup(composite);
+		createContentsForCyclingGroup(composite);
+		
+		setSize(composite);
+		loadPreferences();
+		
+		return composite;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#performDefaults()
+	 */
+	protected void performDefaults() {
+		performDefaultsForAutoActivationGroup();
+		performDefaultsForCyclingGroup();
+
+		validateValues();
+		enableValues();
+
+		super.performDefaults();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#initializeValues()
+	 */
+	protected void initializeValues() {
+		initializeValuesForAutoActivationGroup();
+		initializeValuesForCyclingGroup();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#storeValues()
+	 */
+	protected void storeValues() {
+		storeValuesForAutoActivationGroup();
+		storeValuesForCyclingGroup();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#enableValues()
+	 */
+	protected void enableValues() {
+		if (fAutoPropose != null) {
+			if (fAutoPropose.getSelection()) {
+				fAutoProposeLabel.setEnabled(true);
+				fAutoProposeText.setEnabled(true);
+			}
+			else {
+				fAutoProposeLabel.setEnabled(false);
+				fAutoProposeText.setEnabled(false);
+			}
+		}
+	}
+	
+	/**
+	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
+	 */
+	protected IPreferenceStore doGetPreferenceStore() {
+		return HTMLUIPlugin.getDefault().getPreferenceStore();
+	}
+
+	/**
+	 * <p>Create contents for the auto activation preference group</p>
+	 * @param parent {@link Composite} parent of the group
+	 */
+	private void createContentsForAutoActivationGroup(Composite parent) {
+		Group contentAssistGroup = createGroup(parent, 2);
+		contentAssistGroup.setText(HTMLUIMessages.Auto_Activation_UI_);
+
+		fAutoPropose = createCheckBox(contentAssistGroup, HTMLUIMessages.Automatically_make_suggest_UI_);
+		((GridData) fAutoPropose.getLayoutData()).horizontalSpan = 2;
+		fAutoPropose.addSelectionListener(this);
+
+		fAutoProposeLabel = createLabel(contentAssistGroup, HTMLUIMessages.Prompt_when_these_characte_UI_);
+		fAutoProposeText = createTextField(contentAssistGroup);
+	}
+	
+	/**
+	 * <p>Create the contents for the content assist cycling preference group</p>
+	 * @param parent {@link Composite} parent of the group
+	 */
+	private void createContentsForCyclingGroup(Composite parent) {
+		ICompletionProposalCategoriesConfigurationWriter configurationWriter = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getWritableConfiguration(HTML_CONTENT_TYPE_ID);
+		
+		if(configurationWriter != null) {
+			fConfigurationBlock = new CodeAssistCyclingConfigurationBlock(HTML_CONTENT_TYPE_ID, configurationWriter);
+			fConfigurationBlock.createContents(parent, HTMLUIMessages.Cycling_UI_);
+		} else {
+			Logger.log(Logger.ERROR, "There should be an ICompletionProposalCategoriesConfigurationWriter" + //$NON-NLS-1$
+					" specified for the HTML content type, but can't fine it, thus can't create user" + //$NON-NLS-1$
+					" preference block for editing proposal categories preferences."); //$NON-NLS-1$
+		}
+	}
+	
+	/**
+	 * <p>Store the values for the auto activation group</p>
+	 */
+	private void storeValuesForAutoActivationGroup() {
+		getPreferenceStore().setValue(HTMLUIPreferenceNames.AUTO_PROPOSE, fAutoPropose.getSelection());
+		getPreferenceStore().setValue(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE, fAutoProposeText.getText());
+	}
+	
+	/**
+	 * <p>Store the values for the cycling group</p>
+	 */
+	private void storeValuesForCyclingGroup() {
+		if (fConfigurationBlock != null) {
+			fConfigurationBlock.storeValues();
+		}
+	}
+	
+	/**
+	 * <p>Initialize the values for the auto activation group</p>
+	 */
+	private void initializeValuesForAutoActivationGroup() {
+		// Content Assist
+		fAutoPropose.setSelection(getPreferenceStore().getBoolean(HTMLUIPreferenceNames.AUTO_PROPOSE));
+		fAutoProposeText.setText(getPreferenceStore().getString(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE));
+	}
+	
+	/**
+	 * <p>Initialize the values for the cycling group</p>
+	 */
+	private void initializeValuesForCyclingGroup() {
+		if(fConfigurationBlock != null) {
+			fConfigurationBlock.initializeValues();
+		}
+	}
+	
+	/**
+	 * <p>Load the defaults for the auto activation group</p>
+	 */
+	private void performDefaultsForAutoActivationGroup() {
+		// Content Assist
+		fAutoPropose.setSelection(getPreferenceStore().getDefaultBoolean(HTMLUIPreferenceNames.AUTO_PROPOSE));
+		fAutoProposeText.setText(getPreferenceStore().getDefaultString(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE));
+	}
+	
+	/**
+	 * <p>Load the defaults of the cycling group</p>
+	 */
+	private void performDefaultsForCyclingGroup() {
+		if(fConfigurationBlock != null) {
+			fConfigurationBlock.performDefaults();
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
new file mode 100644
index 0000000..1aa3304
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences.ui;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
+import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
+import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
+import org.eclipse.wst.xml.ui.internal.preferences.WorkbenchDefaultEncodingSettings;
+import org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage;
+
+public class HTMLFilesPreferencePage extends XMLFilesPreferencePage {
+	private WorkbenchDefaultEncodingSettings fInputEncodingSettings = null;
+
+	protected Preferences getModelPreferences() {
+		return HTMLCorePlugin.getDefault().getPluginPreferences();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
+	 */
+	protected IPreferenceStore doGetPreferenceStore() {
+		return HTMLUIPlugin.getDefault().getPreferenceStore();
+	}
+
+	protected void doSavePreferenceStore() {
+		HTMLCorePlugin.getDefault().savePluginPreferences(); // model
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	protected Control createContents(Composite parent) {
+		Composite scrolledComposite = createScrolledComposite(parent);
+		createContentsForCreatingGroup(scrolledComposite);
+		createContentsForLoadingGroup(scrolledComposite);
+
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(scrolledComposite, IHelpContextIds.HTML_PREFWEBX_FILES_HELPID);
+
+		setSize(scrolledComposite);
+		loadPreferences();
+
+		return scrolledComposite;
+	}
+
+	protected void createContentsForLoadingGroup(Composite parent) {
+		Group group = createGroup(parent, 1);
+		group.setText(HTMLUIMessages.HTMLFilesPreferencePage_0);
+
+		fInputEncodingSettings = new WorkbenchDefaultEncodingSettings(group);
+	}
+
+	protected IContentType getContentType() {
+		return Platform.getContentTypeManager().getContentType(ContentTypeIdForHTML.ContentTypeID_HTML);
+	}
+
+	protected void initializeValues() {
+		super.initializeValues();
+		initializeValuesForLoadingGroup();
+	}
+
+	protected void initializeValuesForLoadingGroup() {
+		String encoding = getModelPreferences().getString(CommonEncodingPreferenceNames.INPUT_CODESET);
+
+		fInputEncodingSettings.setIANATag(encoding);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+	 */
+	protected void performDefaults() {
+		super.performDefaults();
+		performDefaultsForLoadingGroup();
+	}
+
+	protected void performDefaultsForLoadingGroup() {
+		String encoding = getModelPreferences().getDefaultString(CommonEncodingPreferenceNames.INPUT_CODESET);
+
+		fInputEncodingSettings.setIANATag(encoding);
+	}
+
+	protected void storeValues() {
+		super.storeValues();
+		storeValuesForLoadingGroup();
+	}
+
+	protected void storeValuesForLoadingGroup() {
+		getModelPreferences().setValue(CommonEncodingPreferenceNames.INPUT_CODESET, fInputEncodingSettings.getIANATag());
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java
new file mode 100644
index 0000000..a5e711a
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java
@@ -0,0 +1,284 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences.ui;
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferenceLinkArea;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
+import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
+
+public class HTMLSourcePreferencePage extends AbstractPreferencePage {
+	private Button fTagNameUpper = null;
+	private Button fTagNameLower = null;
+	private Button fAttrNameUpper = null;
+	private Button fAttrNameLower = null;
+
+	private final int MIN_INDENTATION_SIZE = 0;
+	private final int MAX_INDENTATION_SIZE = 16;
+
+	private Button fClearAllBlankLines;
+
+	// Formatting
+	private Text fLineWidthText;
+	private Button fSplitMultiAttrs;
+	private Button fAlignEndBracket;
+	private Button fIndentUsingTabs;
+	private Button fIndentUsingSpaces;
+	private Spinner fIndentationSize;
+
+	private Composite createContentsForPreferredCaseGroup(Composite parent, int columnSpan) {
+		Group caseGroup = createGroup(parent, columnSpan);
+		caseGroup.setText(HTMLUIMessages.Preferred_markup_case_UI_);
+
+		// d257064 need to associate group w/ radio buttons so radio buttons
+		// header can be read
+		Group tagNameGroup = createGroup(caseGroup, 1);
+		tagNameGroup.setText(HTMLUIMessages.Tag_names__UI_);
+		fTagNameUpper = createRadioButton(tagNameGroup, HTMLUIMessages.Tag_names_Upper_case_UI_);
+		fTagNameLower = createRadioButton(tagNameGroup, HTMLUIMessages.Tag_names_Lower_case_UI_);
+
+		// d257064 need to associate group w/ radio buttons so radio buttons
+		// header can be read
+		Group attrNameGroup = createGroup(caseGroup, 1);
+		attrNameGroup.setText(HTMLUIMessages.Attribute_names__UI_);
+		fAttrNameUpper = createRadioButton(attrNameGroup, HTMLUIMessages.Attribute_names_Upper_case_UI_);
+		fAttrNameLower = createRadioButton(attrNameGroup, HTMLUIMessages.Attribute_names_Lower_case_UI_);
+
+		return parent;
+
+	}
+
+	private void createContentsForFormattingGroup(Composite parent) {
+		Group formattingGroup = createGroup(parent, 2);
+		formattingGroup.setText(HTMLUIMessages.Formatting_UI_);
+
+		createLabel(formattingGroup, HTMLUIMessages.Line_width__UI_);
+		fLineWidthText = new Text(formattingGroup, SWT.SINGLE | SWT.BORDER);
+		GridData gData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.BEGINNING);
+		gData.widthHint = 25;
+		fLineWidthText.setLayoutData(gData);
+		fLineWidthText.addModifyListener(this);
+
+		fSplitMultiAttrs = createCheckBox(formattingGroup, HTMLUIMessages.Split_multiple_attributes);
+		((GridData) fSplitMultiAttrs.getLayoutData()).horizontalSpan = 2;
+		fAlignEndBracket = createCheckBox(formattingGroup, HTMLUIMessages.Align_final_bracket);
+		((GridData) fAlignEndBracket.getLayoutData()).horizontalSpan = 2;
+		fClearAllBlankLines = createCheckBox(formattingGroup, HTMLUIMessages.Clear_all_blank_lines_UI_);
+		((GridData) fClearAllBlankLines.getLayoutData()).horizontalSpan = 2;
+
+		// [269224] - Place the indent controls in their own composite for proper tab ordering
+		Composite indentComposite = createComposite(formattingGroup, 1);
+		((GridData) indentComposite.getLayoutData()).horizontalSpan = 2;
+		((GridLayout) indentComposite.getLayout()).marginWidth = 0;
+		((GridLayout) indentComposite.getLayout()).marginHeight = 0;
+
+		fIndentUsingTabs = createRadioButton(indentComposite, HTMLUIMessages.Indent_using_tabs);
+		((GridData) fIndentUsingTabs.getLayoutData()).horizontalSpan = 1;
+
+		fIndentUsingSpaces = createRadioButton(indentComposite, HTMLUIMessages.Indent_using_spaces);
+		((GridData) fIndentUsingSpaces.getLayoutData()).horizontalSpan = 1;
+
+		createLabel(formattingGroup, HTMLUIMessages.Indentation_size);
+		fIndentationSize = new Spinner(formattingGroup, SWT.READ_ONLY | SWT.BORDER);
+		GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+		fIndentationSize.setLayoutData(gd);
+		fIndentationSize.setToolTipText(HTMLUIMessages.Indentation_size_tip);
+		fIndentationSize.setMinimum(MIN_INDENTATION_SIZE);
+		fIndentationSize.setMaximum(MAX_INDENTATION_SIZE);
+		fIndentationSize.setIncrement(1);
+		fIndentationSize.setPageIncrement(4);
+		fIndentationSize.addModifyListener(this);
+	}
+
+	protected void performDefaults() {
+		fTagNameUpper.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.TAG_NAME_CASE) == HTMLCorePreferenceNames.UPPER);
+		fTagNameLower.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.TAG_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
+		fAttrNameUpper.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.UPPER);
+		fAttrNameLower.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
+
+		performDefaultsForFormattingGroup();
+
+		validateValues();
+		enableValues();
+
+		super.performDefaults();
+	}
+
+	private void performDefaultsForFormattingGroup() {
+		// Formatting
+		fLineWidthText.setText(getModelPreferences().getDefaultString(HTMLCorePreferenceNames.LINE_WIDTH));
+		fSplitMultiAttrs.setSelection(getModelPreferences().getDefaultBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
+		fAlignEndBracket.setSelection(getModelPreferences().getDefaultBoolean(HTMLCorePreferenceNames.ALIGN_END_BRACKET));
+		fClearAllBlankLines.setSelection(getModelPreferences().getDefaultBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
+
+		if (HTMLCorePreferenceNames.TAB.equals(getModelPreferences().getDefaultString(HTMLCorePreferenceNames.INDENTATION_CHAR))) {
+			fIndentUsingTabs.setSelection(true);
+			fIndentUsingSpaces.setSelection(false);
+		}
+		else {
+			fIndentUsingSpaces.setSelection(true);
+			fIndentUsingTabs.setSelection(false);
+		}
+		fIndentationSize.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.INDENTATION_SIZE));
+	}
+
+	protected void initializeValues() {
+		fTagNameUpper.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.TAG_NAME_CASE) == HTMLCorePreferenceNames.UPPER);
+		fTagNameLower.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.TAG_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
+		fAttrNameUpper.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.UPPER);
+		fAttrNameLower.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
+
+		initializeValuesForFormattingGroup();
+	}
+
+	private void initializeValuesForFormattingGroup() {
+		// Formatting
+		fLineWidthText.setText(getModelPreferences().getString(HTMLCorePreferenceNames.LINE_WIDTH));
+		fSplitMultiAttrs.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
+		fAlignEndBracket.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.ALIGN_END_BRACKET));
+		fClearAllBlankLines.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
+
+		if (HTMLCorePreferenceNames.TAB.equals(getModelPreferences().getString(HTMLCorePreferenceNames.INDENTATION_CHAR))) {
+			fIndentUsingTabs.setSelection(true);
+			fIndentUsingSpaces.setSelection(false);
+		}
+		else {
+			fIndentUsingSpaces.setSelection(true);
+			fIndentUsingTabs.setSelection(false);
+		}
+
+		fIndentationSize.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.INDENTATION_SIZE));
+	}
+
+	protected void storeValues() {
+		if (fTagNameUpper.getSelection())
+			getModelPreferences().setValue(HTMLCorePreferenceNames.TAG_NAME_CASE, HTMLCorePreferenceNames.UPPER);
+		else
+			getModelPreferences().setValue(HTMLCorePreferenceNames.TAG_NAME_CASE, HTMLCorePreferenceNames.LOWER);
+		if (fAttrNameUpper.getSelection())
+			getModelPreferences().setValue(HTMLCorePreferenceNames.ATTR_NAME_CASE, HTMLCorePreferenceNames.UPPER);
+		else
+			getModelPreferences().setValue(HTMLCorePreferenceNames.ATTR_NAME_CASE, HTMLCorePreferenceNames.LOWER);
+
+		storeValuesForFormattingGroup();
+	}
+
+	private void storeValuesForFormattingGroup() {
+		// Formatting
+		getModelPreferences().setValue(HTMLCorePreferenceNames.LINE_WIDTH, fLineWidthText.getText());
+		getModelPreferences().setValue(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS, fSplitMultiAttrs.getSelection());
+		getModelPreferences().setValue(HTMLCorePreferenceNames.ALIGN_END_BRACKET, fAlignEndBracket.getSelection());
+		getModelPreferences().setValue(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES, fClearAllBlankLines.getSelection());
+
+		if (fIndentUsingTabs.getSelection()) {
+			getModelPreferences().setValue(HTMLCorePreferenceNames.INDENTATION_CHAR, HTMLCorePreferenceNames.TAB);
+		}
+		else {
+			getModelPreferences().setValue(HTMLCorePreferenceNames.INDENTATION_CHAR, HTMLCorePreferenceNames.SPACE);
+		}
+		getModelPreferences().setValue(HTMLCorePreferenceNames.INDENTATION_SIZE, fIndentationSize.getSelection());
+	}
+
+	public boolean performOk() {
+		boolean result = super.performOk();
+
+		doSavePreferenceStore();
+
+		return result;
+	}
+
+	protected Preferences getModelPreferences() {
+		return HTMLCorePlugin.getDefault().getPluginPreferences();
+	}
+
+	protected IPreferenceStore doGetPreferenceStore() {
+		return HTMLUIPlugin.getDefault().getPreferenceStore();
+	}
+
+	private void doSavePreferenceStore() {
+		HTMLUIPlugin.getDefault().savePluginPreferences(); // UI
+		HTMLCorePlugin.getDefault().savePluginPreferences(); // model
+	}
+
+	protected Control createContents(Composite parent) {
+		final Composite composite = super.createComposite(parent, 1);
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.HTML_PREFWEBX_SOURCE_HELPID);
+
+		new PreferenceLinkArea(composite, SWT.WRAP | SWT.MULTI, "org.eclipse.wst.sse.ui.preferences.editor", HTMLUIMessages._UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK,//$NON-NLS-1$
+					(IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).create());
+		new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
+
+		createContentsForFormattingGroup(composite);
+		createContentsForPreferredCaseGroup(composite, 2);
+		setSize(composite);
+		loadPreferences();
+
+		return composite;
+	}
+
+	protected void validateValues() {
+		boolean isError = false;
+		String widthText = null;
+
+		if (fLineWidthText != null) {
+			try {
+				widthText = fLineWidthText.getText();
+				int formattingLineWidth = Integer.parseInt(widthText);
+				if ((formattingLineWidth < WIDTH_VALIDATION_LOWER_LIMIT) || (formattingLineWidth > WIDTH_VALIDATION_UPPER_LIMIT)) {
+					throw new NumberFormatException();
+				}
+			}
+			catch (NumberFormatException nfexc) {
+				setInvalidInputMessage(widthText);
+				setValid(false);
+				isError = true;
+			}
+		}
+
+		int indentSize = 0;
+		if (fIndentationSize != null) {
+			try {
+				indentSize = fIndentationSize.getSelection();
+				if ((indentSize < MIN_INDENTATION_SIZE) || (indentSize > MAX_INDENTATION_SIZE)) {
+					throw new NumberFormatException();
+				}
+			}
+			catch (NumberFormatException nfexc) {
+				setInvalidInputMessage(Integer.toString(indentSize));
+				setValid(false);
+				isError = true;
+			}
+		}
+
+		if (!isError) {
+			setErrorMessage(null);
+			setValid(true);
+		}
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSyntaxColoringPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSyntaxColoringPage.java
new file mode 100644
index 0000000..ef0f01d
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSyntaxColoringPage.java
@@ -0,0 +1,874 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences.ui;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.preference.ColorSelector;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
+import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
+import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
+
+import com.ibm.icu.text.Collator;
+
+/**
+ * A preference page to configure our XML syntax color. It resembles the JDT
+ * and CDT pages far more than our original color page while retaining the
+ * extra "click-to-find" functionality.
+ */
+public final class HTMLSyntaxColoringPage extends PreferencePage implements IWorkbenchPreferencePage {
+
+	private Button fBold;
+	private Label fForegroundLabel;
+	private Label fBackgroundLabel;
+	private Button fClearStyle;
+	private Map fContextToStyleMap;
+	private Color fDefaultForeground = null;
+	private Color fDefaultBackground = null;
+	private IStructuredDocument fDocument;
+	private ColorSelector fForegroundColorEditor;
+	private ColorSelector fBackgroundColorEditor;
+	private Button fItalic;
+	private OverlayPreferenceStore fOverlayStore;
+	private Button fStrike;
+	private Collection fStylePreferenceKeys;
+	private StructuredViewer fStylesViewer = null;
+	private Map fStyleToDescriptionMap;
+	private StyledText fText;
+	private Button fUnderline;
+
+	// activate controls based on the given local color type
+	private void activate(String namedStyle) {
+		Color foreground = fDefaultForeground;
+		Color background = fDefaultBackground;
+		if (namedStyle == null) {
+			fClearStyle.setEnabled(false);
+			fBold.setEnabled(false);
+			fItalic.setEnabled(false);
+			fStrike.setEnabled(false);
+			fUnderline.setEnabled(false);
+			fForegroundLabel.setEnabled(false);
+			fBackgroundLabel.setEnabled(false);
+			fForegroundColorEditor.setEnabled(false);
+			fBackgroundColorEditor.setEnabled(false);
+			fBold.setSelection(false);
+			fItalic.setSelection(false);
+			fStrike.setSelection(false);
+			fUnderline.setSelection(false);
+		}
+		else {
+			TextAttribute attribute = getAttributeFor(namedStyle);
+			fClearStyle.setEnabled(true);
+			fBold.setEnabled(true);
+			fItalic.setEnabled(true);
+			fStrike.setEnabled(true);
+			fUnderline.setEnabled(true);
+			fForegroundLabel.setEnabled(true);
+			fBackgroundLabel.setEnabled(true);
+			fForegroundColorEditor.setEnabled(true);
+			fBackgroundColorEditor.setEnabled(true);
+			fBold.setSelection((attribute.getStyle() & SWT.BOLD) != 0);
+			fItalic.setSelection((attribute.getStyle() & SWT.ITALIC) != 0);
+			fStrike.setSelection((attribute.getStyle() & TextAttribute.STRIKETHROUGH) != 0);
+			fUnderline.setSelection((attribute.getStyle() & TextAttribute.UNDERLINE) != 0);
+			if (attribute.getForeground() != null) {
+				foreground = attribute.getForeground();
+			}
+			if (attribute.getBackground() != null) {
+				background = attribute.getBackground();
+			}
+		}
+
+		fForegroundColorEditor.setColorValue(foreground.getRGB());
+		fBackgroundColorEditor.setColorValue(background.getRGB());
+	}
+
+	/**
+	 * Color the text in the sample area according to the current preferences
+	 */
+	void applyStyles() {
+		if (fText == null || fText.isDisposed())
+			return;
+		IStructuredDocumentRegion documentRegion = fDocument.getFirstStructuredDocumentRegion();
+		while (documentRegion != null) {
+			ITextRegionList regions = documentRegion.getRegions();
+			for (int i = 0; i < regions.size(); i++) {
+				ITextRegion currentRegion = regions.get(i);
+				// lookup the local coloring type and apply it
+				String namedStyle = (String) fContextToStyleMap.get(currentRegion.getType());
+				if (namedStyle == null)
+					continue;
+				TextAttribute attribute = getAttributeFor(namedStyle);
+				if (attribute == null)
+					continue;
+				StyleRange style = new StyleRange(documentRegion.getStartOffset(currentRegion), currentRegion.getTextLength(), attribute.getForeground(), attribute.getBackground(), attribute.getStyle());
+				style.strikeout = (attribute.getStyle() & TextAttribute.STRIKETHROUGH) != 0;
+				style.underline = (attribute.getStyle() & TextAttribute.UNDERLINE) != 0;
+				fText.setStyleRange(style);
+			}
+			documentRegion = documentRegion.getNext();
+		}
+	}
+
+	Button createCheckbox(Composite parent, String label) {
+		Button button = new Button(parent, SWT.CHECK);
+		button.setText(label);
+		button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+		return button;
+	}
+
+	/**
+	 * Creates composite control and sets the default layout data.
+	 */
+	private Composite createComposite(Composite parent, int numColumns) {
+		Composite composite = new Composite(parent, SWT.NULL);
+
+		// GridLayout
+		GridLayout layout = new GridLayout();
+		layout.numColumns = numColumns;
+		layout.makeColumnsEqualWidth = false;
+		layout.marginHeight = 0;
+		layout.marginWidth = 0;
+		composite.setLayout(layout);
+
+		// GridData
+		GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
+		composite.setLayoutData(data);
+		return composite;
+	}
+
+	protected Control createContents(final Composite parent) {
+		initializeDialogUnits(parent);
+
+		fDefaultForeground = parent.getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
+		fDefaultBackground = parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
+		Composite pageComponent = createComposite(parent, 2);
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.HTML_PREFWEBX_STYLES_HELPID);
+
+		Link link = new Link(pageComponent, SWT.WRAP);
+		link.setText(SSEUIMessages.SyntaxColoring_Link);
+		link.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				PreferencesUtil.createPreferenceDialogOn(parent.getShell(), e.text, null, null);
+			}
+		});
+
+		GridData linkData= new GridData(SWT.FILL, SWT.BEGINNING, true, false, 2, 1);
+		linkData.widthHint= 150; // only expand further if anyone else requires it
+		link.setLayoutData(linkData);
+
+		new Label(pageComponent, SWT.NONE).setLayoutData(new GridData());
+		new Label(pageComponent, SWT.NONE).setLayoutData(new GridData());
+
+		SashForm editor = new SashForm(pageComponent, SWT.VERTICAL);
+		GridData gridData2 = new GridData(SWT.FILL, SWT.FILL, true, true);
+		gridData2.horizontalSpan = 2;
+		editor.setLayoutData(gridData2);
+		SashForm top = new SashForm(editor, SWT.HORIZONTAL);
+		Composite styleEditor = createComposite(top, 1);
+		((GridLayout) styleEditor.getLayout()).marginRight = 5;
+		((GridLayout) styleEditor.getLayout()).marginLeft = 0;
+		createLabel(styleEditor, HTMLUIMessages.SyntaxColoringPage_0);
+		fStylesViewer = createStylesViewer(styleEditor);
+		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+		gridData.horizontalIndent = 0;
+		Iterator iterator = fStyleToDescriptionMap.values().iterator();
+		while (iterator.hasNext()) {
+			gridData.widthHint = Math.max(gridData.widthHint, convertWidthInCharsToPixels(iterator.next().toString().length()));
+		}
+		gridData.heightHint = convertHeightInCharsToPixels(5);
+		fStylesViewer.getControl().setLayoutData(gridData);
+
+		Composite editingComposite = createComposite(top, 1);
+		((GridLayout) styleEditor.getLayout()).marginLeft = 5;
+		createLabel(editingComposite, ""); //$NON-NLS-1$
+		Button enabler = createCheckbox(editingComposite, HTMLUIMessages.SyntaxColoringPage_2);
+		enabler.setEnabled(false);
+		enabler.setSelection(true);
+		Composite editControls = createComposite(editingComposite, 2);
+		((GridLayout) editControls.getLayout()).marginLeft = 20;
+
+		fForegroundLabel = createLabel(editControls, SSEUIMessages.Foreground_UI_);
+		((GridData) fForegroundLabel.getLayoutData()).verticalAlignment = SWT.CENTER;
+		fForegroundLabel.setEnabled(false);
+
+		fForegroundColorEditor = new ColorSelector(editControls);
+		Button fForegroundColor = fForegroundColorEditor.getButton();
+		GridData gd = new GridData(SWT.BEGINNING, SWT.FILL, false, false);
+		fForegroundColor.setLayoutData(gd);
+		fForegroundColorEditor.setEnabled(false);
+
+		fBackgroundLabel = createLabel(editControls, SSEUIMessages.Background_UI_);
+		((GridData) fBackgroundLabel.getLayoutData()).verticalAlignment = SWT.CENTER;
+		fBackgroundLabel.setEnabled(false);
+
+		fBackgroundColorEditor = new ColorSelector(editControls);
+		Button fBackgroundColor = fBackgroundColorEditor.getButton();
+		gd = new GridData(SWT.BEGINNING, SWT.FILL, false, false);
+		fBackgroundColor.setLayoutData(gd);
+		fBackgroundColorEditor.setEnabled(false);
+
+		fBold = createCheckbox(editControls, HTMLUIMessages.SyntaxColoringPage_3);
+		fBold.setEnabled(false);
+		((GridData) fBold.getLayoutData()).horizontalSpan = 2;
+		fItalic = createCheckbox(editControls, HTMLUIMessages.SyntaxColoringPage_4);
+		fItalic.setEnabled(false);
+		((GridData) fItalic.getLayoutData()).horizontalSpan = 2;
+		fStrike = createCheckbox(editControls, HTMLUIMessages.SyntaxColoringPage_5);
+		fStrike.setEnabled(false);
+		((GridData) fStrike.getLayoutData()).horizontalSpan = 2;
+		fUnderline = createCheckbox(editControls, HTMLUIMessages.SyntaxColoringPage_6);
+		fUnderline.setEnabled(false);
+		((GridData) fUnderline.getLayoutData()).horizontalSpan = 2;
+		fClearStyle = new Button(editingComposite, SWT.PUSH);
+		fClearStyle.setText(SSEUIMessages.Restore_Default_UI_); //$NON-NLS-1$ = "Restore Default"
+		fClearStyle.setLayoutData(new GridData(SWT.BEGINNING));
+		((GridData)fClearStyle.getLayoutData()).horizontalIndent = 20;
+		fClearStyle.setEnabled(false);
+
+		Composite sampleArea = createComposite(editor, 1);
+
+		((GridLayout) sampleArea.getLayout()).marginLeft = 5;
+		((GridLayout) sampleArea.getLayout()).marginTop = 5;
+		createLabel(sampleArea, SSEUIMessages.Sample_text__UI_); //$NON-NLS-1$ = "&Sample text:"
+		SourceViewer viewer = new SourceViewer(sampleArea, null, SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY);
+		fText = viewer.getTextWidget();
+		GridData gridData3 = new GridData(SWT.FILL, SWT.FILL, true, true);
+		gridData3.widthHint = convertWidthInCharsToPixels(20);
+		gridData3.heightHint = convertHeightInCharsToPixels(5);
+		gridData3.horizontalSpan = 2;
+		fText.setLayoutData(gridData3);
+		fText.setEditable(false);
+		fText.setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		fText.addKeyListener(getTextKeyListener());
+		fText.addSelectionListener(getTextSelectionListener());
+		fText.addMouseListener(getTextMouseListener());
+		fText.addTraverseListener(getTraverseListener());
+		setAccessible(fText, SSEUIMessages.Sample_text__UI_);
+		fDocument = StructuredModelManager.getModelManager().createStructuredDocumentFor(ContentTypeIdForHTML.ContentTypeID_HTML);
+		fDocument.set(getExampleText());
+		viewer.setDocument(fDocument);
+
+		top.setWeights(new int[]{1, 1});
+		editor.setWeights(new int[]{1, 1});
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.HTML_PREFWEBX_STYLES_HELPID);
+
+		fStylesViewer.setInput(getStylePreferenceKeys());
+
+		applyStyles();
+
+		fStylesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+			public void selectionChanged(SelectionChangedEvent event) {
+				if (!event.getSelection().isEmpty()) {
+					Object o = ((IStructuredSelection) event.getSelection()).getFirstElement();
+					String namedStyle = o.toString();
+					activate(namedStyle);
+					if (namedStyle == null)
+						return;
+				}
+			}
+		});
+
+		fForegroundColorEditor.addListener(new IPropertyChangeListener() {
+			public void propertyChange(PropertyChangeEvent event) {
+				if (event.getProperty().equals(ColorSelector.PROP_COLORCHANGE)) {
+					Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
+					String namedStyle = o.toString();
+					String prefString = getOverlayStore().getString(namedStyle);
+					String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+					if (stylePrefs != null) {
+						String oldValue = stylePrefs[0];
+						// open color dialog to get new color
+						String newValue = ColorHelper.toRGBString(fForegroundColorEditor.getColorValue());
+
+						if (!newValue.equals(oldValue)) {
+							stylePrefs[0] = newValue;
+							String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
+							getOverlayStore().setValue(namedStyle, newPrefString);
+							applyStyles();
+							fText.redraw();
+						}
+					}
+				}
+			}
+		});
+
+		fBackgroundColorEditor.addListener(new IPropertyChangeListener() {
+			public void propertyChange(PropertyChangeEvent event) {
+				if (event.getProperty().equals(ColorSelector.PROP_COLORCHANGE)) {
+					Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
+					String namedStyle = o.toString();
+					String prefString = getOverlayStore().getString(namedStyle);
+					String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+					if (stylePrefs != null) {
+						String oldValue = stylePrefs[1];
+						// open color dialog to get new color
+						String newValue = ColorHelper.toRGBString(fBackgroundColorEditor.getColorValue());
+
+						if (!newValue.equals(oldValue)) {
+							stylePrefs[1] = newValue;
+							String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
+							getOverlayStore().setValue(namedStyle, newPrefString);
+							applyStyles();
+							fText.redraw();
+							activate(namedStyle);
+						}
+					}
+				}
+			}
+		});
+
+		fBold.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				super.widgetSelected(e);
+				// get current (newly old) style
+				Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
+				String namedStyle = o.toString();
+				String prefString = getOverlayStore().getString(namedStyle);
+				String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+				if (stylePrefs != null) {
+					String oldValue = stylePrefs[2];
+					String newValue = String.valueOf(fBold.getSelection());
+					if (!newValue.equals(oldValue)) {
+						stylePrefs[2] = newValue;
+						String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
+						getOverlayStore().setValue(namedStyle, newPrefString);
+						applyStyles();
+						fText.redraw();
+					}
+				}
+			}
+		});
+
+		fItalic.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				super.widgetSelected(e);
+				// get current (newly old) style
+				Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
+				String namedStyle = o.toString();
+				String prefString = getOverlayStore().getString(namedStyle);
+				String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+				if (stylePrefs != null) {
+					String oldValue = stylePrefs[3];
+					String newValue = String.valueOf(fItalic.getSelection());
+					if (!newValue.equals(oldValue)) {
+						stylePrefs[3] = newValue;
+						String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
+						getOverlayStore().setValue(namedStyle, newPrefString);
+						applyStyles();
+						fText.redraw();
+					}
+				}
+			}
+		});
+
+		fStrike.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				super.widgetSelected(e);
+				// get current (newly old) style
+				Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
+				String namedStyle = o.toString();
+				String prefString = getOverlayStore().getString(namedStyle);
+				String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+				if (stylePrefs != null) {
+					String oldValue = stylePrefs[4];
+					String newValue = String.valueOf(fStrike.getSelection());
+					if (!newValue.equals(oldValue)) {
+						stylePrefs[4] = newValue;
+						String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
+						getOverlayStore().setValue(namedStyle, newPrefString);
+						applyStyles();
+						fText.redraw();
+					}
+				}
+			}
+		});
+
+		fUnderline.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				super.widgetSelected(e);
+				// get current (newly old) style
+				Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
+				String namedStyle = o.toString();
+				String prefString = getOverlayStore().getString(namedStyle);
+				String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+				if (stylePrefs != null) {
+					String oldValue = stylePrefs[5];
+					String newValue = String.valueOf(fUnderline.getSelection());
+					if (!newValue.equals(oldValue)) {
+						stylePrefs[5] = newValue;
+						String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
+						getOverlayStore().setValue(namedStyle, newPrefString);
+						applyStyles();
+						fText.redraw();
+					}
+				}
+			}
+		});
+		
+		fClearStyle.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				if (fStylesViewer.getSelection().isEmpty())
+					return;
+				String namedStyle = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement().toString();
+				getOverlayStore().setToDefault(namedStyle);
+				applyStyles();
+				fText.redraw();
+				activate(namedStyle);
+			}
+		});
+
+		return pageComponent;
+	}
+
+	private Label createLabel(Composite parent, String text) {
+		Label label = new Label(parent, SWT.WRAP);
+		label.setText(text);
+		GridData data = new GridData(SWT.FILL, SWT.FILL, false, false);
+		label.setLayoutData(data);
+		label.setBackground(parent.getBackground());
+		return label;
+	}
+
+	// protected Label createDescriptionLabel(Composite parent) {
+	// return null;
+	// }
+
+	/**
+	 * Set up all the style preference keys in the overlay store
+	 */
+	private OverlayKey[] createOverlayStoreKeys() {
+		List overlayKeys = new ArrayList();
+
+		Iterator i = getStylePreferenceKeys().iterator();
+		while (i.hasNext()) {
+			overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, (String) i.next()));
+		}
+
+		OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
+		overlayKeys.toArray(keys);
+		return keys;
+	}
+
+	/**
+	 * Creates the List viewer where we see the various syntax element display
+	 * names--would it ever be a Tree like JDT's?
+	 * 
+	 * @param parent
+	 * @return
+	 */
+	private StructuredViewer createStylesViewer(Composite parent) {
+		StructuredViewer stylesViewer = new ListViewer(parent, SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
+		stylesViewer.setComparator(new ViewerComparator(Collator.getInstance()));
+		stylesViewer.setLabelProvider(new LabelProvider() {
+			public String getText(Object element) {
+				Object description = fStyleToDescriptionMap.get(element);
+				if (description != null)
+					return description.toString();
+				return super.getText(element);
+			}
+		});
+		stylesViewer.setContentProvider(new ITreeContentProvider() {
+			public void dispose() {
+			}
+
+			public Object[] getChildren(Object parentElement) {
+				return getStylePreferenceKeys().toArray();
+			}
+
+			public Object[] getElements(Object inputElement) {
+				return getChildren(inputElement);
+			}
+
+			public Object getParent(Object element) {
+				return getStylePreferenceKeys();
+			}
+
+			public boolean hasChildren(Object element) {
+				return false;
+			}
+
+			public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+			}
+		});
+		return stylesViewer;
+	}
+
+	public void dispose() {
+		if (fOverlayStore != null) {
+			fOverlayStore.stop();
+		}
+		super.dispose();
+	}
+
+	protected IPreferenceStore doGetPreferenceStore() {
+		return HTMLUIPlugin.getDefault().getPreferenceStore();
+	}
+
+	private TextAttribute getAttributeFor(String namedStyle) {
+		TextAttribute ta = new TextAttribute(fDefaultForeground, fDefaultBackground, SWT.NORMAL);
+
+		if (namedStyle != null && fOverlayStore != null) {
+			// note: "namedStyle" *is* the preference key
+			String prefString = getOverlayStore().getString(namedStyle);
+			String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
+			if (stylePrefs != null) {
+				RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
+				RGB background = ColorHelper.toRGB(stylePrefs[1]);
+
+				int fontModifier = SWT.NORMAL;
+
+				if (stylePrefs.length > 2) {
+					boolean on = Boolean.valueOf(stylePrefs[2]).booleanValue();
+					if (on)
+						fontModifier = fontModifier | SWT.BOLD;
+				}
+				if (stylePrefs.length > 3) {
+					boolean on = Boolean.valueOf(stylePrefs[3]).booleanValue();
+					if (on)
+						fontModifier = fontModifier | SWT.ITALIC;
+				}
+				if (stylePrefs.length > 4) {
+					boolean on = Boolean.valueOf(stylePrefs[4]).booleanValue();
+					if (on)
+						fontModifier = fontModifier | TextAttribute.STRIKETHROUGH;
+				}
+				if (stylePrefs.length > 5) {
+					boolean on = Boolean.valueOf(stylePrefs[5]).booleanValue();
+					if (on)
+						fontModifier = fontModifier | TextAttribute.UNDERLINE;
+				}
+
+				ta = new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, fontModifier);
+			}
+		}
+		return ta;
+	}
+
+	private String getExampleText() {
+		return HTMLUIMessages.Sample_HTML_doc;
+	}
+
+	private String getNamedStyleAtOffset(int offset) {
+		// ensure the offset is clean
+		if (offset >= fDocument.getLength())
+			return getNamedStyleAtOffset(fDocument.getLength() - 1);
+		else if (offset < 0)
+			return getNamedStyleAtOffset(0);
+		IStructuredDocumentRegion documentRegion = fDocument.getFirstStructuredDocumentRegion();
+		while (documentRegion != null && !documentRegion.containsOffset(offset)) {
+			documentRegion = documentRegion.getNext();
+		}
+		if (documentRegion != null) {
+			// find the ITextRegion's Context at this offset
+			ITextRegion interest = documentRegion.getRegionAtCharacterOffset(offset);
+			if (interest == null)
+				return null;
+			if (offset > documentRegion.getTextEndOffset(interest))
+				return null;
+			String regionContext = interest.getType();
+			if (regionContext == null)
+				return null;
+			// find the named style (internal/selectable name) for that
+			// context
+			String namedStyle = (String) fContextToStyleMap.get(regionContext);
+			if (namedStyle != null) {
+				return namedStyle;
+			}
+		}
+		return null;
+	}
+
+	private OverlayPreferenceStore getOverlayStore() {
+		return fOverlayStore;
+	}
+
+	private Collection getStylePreferenceKeys() {
+		if (fStylePreferenceKeys == null) {
+			List styles = new ArrayList();
+			styles.add(IStyleConstantsXML.ENTITY_REFERENCE);
+			styles.add(IStyleConstantsXML.TAG_BORDER);
+			styles.add(IStyleConstantsXML.TAG_NAME);
+			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
+			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+			styles.add(IStyleConstantsXML.COMMENT_BORDER);
+			styles.add(IStyleConstantsXML.COMMENT_TEXT);
+			styles.add(IStyleConstantsXML.DECL_BORDER);
+			styles.add(IStyleConstantsXML.XML_CONTENT);
+			styles.add(IStyleConstantsXML.DOCTYPE_NAME);
+			styles.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
+			styles.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
+			styles.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
+//			styles.add(IStyleConstantsXML.CDATA_BORDER);
+//			styles.add(IStyleConstantsXML.CDATA_TEXT);
+//			styles.add(IStyleConstantsXML.PI_BORDER);
+//			styles.add(IStyleConstantsXML.PI_CONTENT);
+			fStylePreferenceKeys = styles;
+		}
+		return fStylePreferenceKeys;
+	}
+
+	private KeyListener getTextKeyListener() {
+		return new KeyListener() {
+			public void keyPressed(KeyEvent e) {
+				if (e.widget instanceof StyledText) {
+					int x = ((StyledText) e.widget).getCaretOffset();
+					selectColorAtOffset(x);
+				}
+			}
+
+			public void keyReleased(KeyEvent e) {
+				if (e.widget instanceof StyledText) {
+					int x = ((StyledText) e.widget).getCaretOffset();
+					selectColorAtOffset(x);
+				}
+			}
+		};
+	}
+
+	private MouseListener getTextMouseListener() {
+		return new MouseListener() {
+			public void mouseDoubleClick(MouseEvent e) {
+			}
+
+			public void mouseDown(MouseEvent e) {
+			}
+
+			public void mouseUp(MouseEvent e) {
+				if (e.widget instanceof StyledText) {
+					int x = ((StyledText) e.widget).getCaretOffset();
+					selectColorAtOffset(x);
+				}
+			}
+		};
+	}
+
+	private SelectionListener getTextSelectionListener() {
+		return new SelectionListener() {
+			public void widgetDefaultSelected(SelectionEvent e) {
+				selectColorAtOffset(e.x);
+				if (e.widget instanceof StyledText) {
+					((StyledText) e.widget).setSelection(e.x);
+				}
+			}
+
+			public void widgetSelected(SelectionEvent e) {
+				selectColorAtOffset(e.x);
+				if (e.widget instanceof StyledText) {
+					((StyledText) e.widget).setSelection(e.x);
+				}
+			}
+		};
+	}
+
+	private TraverseListener getTraverseListener() {
+		return new TraverseListener() {
+			/**
+			 * @see org.eclipse.swt.events.TraverseListener#keyTraversed(TraverseEvent)
+			 */
+			public void keyTraversed(TraverseEvent e) {
+				if (e.widget instanceof StyledText) {
+					if ((e.detail == SWT.TRAVERSE_TAB_NEXT) || (e.detail == SWT.TRAVERSE_TAB_PREVIOUS))
+						e.doit = true;
+				}
+			}
+		};
+	}
+
+	public void init(IWorkbench workbench) {
+		setDescription(SSEUIMessages.SyntaxColoring_Description);
+
+		fStyleToDescriptionMap = new HashMap();
+		fContextToStyleMap = new HashMap();
+
+		initStyleToDescriptionMap();
+		initRegionContextToStyleMap();
+
+		fOverlayStore = new OverlayPreferenceStore(getPreferenceStore(), createOverlayStoreKeys());
+		fOverlayStore.load();
+		fOverlayStore.start();
+	}
+
+	private void initRegionContextToStyleMap() {
+		fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
+		fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
+		fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
+
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
+		fContextToStyleMap.put(DOMRegionContext.XML_END_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_NAME, IStyleConstantsXML.TAG_NAME);
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS, IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
+		fContextToStyleMap.put(DOMRegionContext.XML_EMPTY_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
+
+		fContextToStyleMap.put(DOMRegionContext.XML_DECLARATION_OPEN, IStyleConstantsXML.DECL_BORDER);
+		fContextToStyleMap.put(DOMRegionContext.XML_DECLARATION_CLOSE, IStyleConstantsXML.DECL_BORDER);
+		fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECLARATION, IStyleConstantsXML.DECL_BORDER);
+		fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_CLOSE, IStyleConstantsXML.DECL_BORDER);
+
+		fContextToStyleMap.put(DOMRegionContext.XML_CHAR_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
+		fContextToStyleMap.put(DOMRegionContext.XML_ENTITY_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
+		fContextToStyleMap.put(DOMRegionContext.XML_PE_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
+
+		fContextToStyleMap.put(DOMRegionContext.XML_CONTENT, IStyleConstantsXML.XML_CONTENT);
+
+		fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_NAME, IStyleConstantsXML.DOCTYPE_NAME);
+		fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION, IStyleConstantsXML.TAG_NAME);
+		fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE, IStyleConstantsXML.DECL_BORDER);
+
+		fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_NAME, IStyleConstantsXML.DOCTYPE_NAME);
+		fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBLIC, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
+		fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
+		fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSTEM, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
+		fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
+
+//		fContextToStyleMap.put(DOMRegionContext.XML_PI_OPEN, IStyleConstantsXML.PI_BORDER);
+//		fContextToStyleMap.put(DOMRegionContext.XML_PI_CONTENT, IStyleConstantsXML.PI_CONTENT);
+//		fContextToStyleMap.put(DOMRegionContext.XML_CDATA_OPEN, IStyleConstantsXML.CDATA_BORDER);
+//		fContextToStyleMap.put(DOMRegionContext.XML_CDATA_TEXT, IStyleConstantsXML.CDATA_TEXT);
+//		fContextToStyleMap.put(DOMRegionContext.XML_CDATA_CLOSE, IStyleConstantsXML.CDATA_BORDER);
+	}
+
+	private void initStyleToDescriptionMap() {
+		fStyleToDescriptionMap.put(IStyleConstantsXML.COMMENT_BORDER, XMLUIMessages.Comment_Delimiters_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.COMMENT_TEXT, XMLUIMessages.Comment_Content_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_BORDER, XMLUIMessages.Tag_Delimiters_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_NAME, XMLUIMessages.Tag_Names_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, XMLUIMessages.Attribute_Names_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, XMLUIMessages.Attribute_Equals_UI_);
+		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, XMLUIMessages.Attribute_Values_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.DECL_BORDER, XMLUIMessages.Declaration_Delimiters_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.XML_CONTENT, XMLUIMessages.Content_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.ENTITY_REFERENCE, XMLUIMessages.Entity_Reference_UI_); //$NON-NLS-1$ = "Entity References"
+		fStyleToDescriptionMap.put(IStyleConstantsXML.DOCTYPE_NAME, XMLUIMessages.DOCTYPE_Name_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, XMLUIMessages.DOCTYPE_SYSTEM_PUBLIC_Keyw_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, XMLUIMessages.DOCTYPE_Public_Reference_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, XMLUIMessages.DOCTYPE_System_Reference_UI_); // =
+//		fStyleToDescriptionMap.put(IStyleConstantsXML.PI_BORDER, XMLUIMessages.Processing_Instruction_Del_UI_);
+//		fStyleToDescriptionMap.put(IStyleConstantsXML.PI_CONTENT, XMLUIMessages.Processing_Instruction_Con_UI__UI_);
+//		fStyleToDescriptionMap.put(IStyleConstantsXML.CDATA_BORDER, XMLUIMessages.CDATA_Delimiters_UI_);
+//		fStyleToDescriptionMap.put(IStyleConstantsXML.CDATA_TEXT, XMLUIMessages.CDATA_Content_UI_);
+}
+
+	protected void performDefaults() {
+		super.performDefaults();
+		getOverlayStore().loadDefaults();
+		applyStyles();
+		fStylesViewer.setSelection(StructuredSelection.EMPTY);
+		activate(null);
+		fText.redraw();
+	}
+
+	public boolean performOk() {
+		getOverlayStore().propagate();
+
+		HTMLUIPlugin.getDefault().savePluginPreferences();
+		SSEUIPlugin.getDefault().savePluginPreferences();
+		return true;
+	}
+
+	private void selectColorAtOffset(int offset) {
+		String namedStyle = getNamedStyleAtOffset(offset);
+		if (namedStyle != null) {
+			fStylesViewer.setSelection(new StructuredSelection(namedStyle));
+			fStylesViewer.reveal(namedStyle);
+		}
+		else {
+			fStylesViewer.setSelection(StructuredSelection.EMPTY);
+		}
+		activate(namedStyle);
+	}
+
+	/**
+	 * Specifically set the reporting name of a control for accessibility
+	 */
+	private void setAccessible(Control control, String name) {
+		if (control == null)
+			return;
+		final String n = name;
+		control.getAccessible().addAccessibleListener(new AccessibleAdapter() {
+			public void getName(AccessibleEvent e) {
+				if (e.childID == ACC.CHILDID_SELF)
+					e.result = n;
+			}
+		});
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java
new file mode 100644
index 0000000..0700d82
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences.ui;
+
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
+import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
+import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+
+
+/**
+ * Preference page for HTML templates
+ */
+public class HTMLTemplatePreferencePage extends TemplatePreferencePage {
+		class HTMLEditTemplateDialog extends EditTemplateDialog {
+		public HTMLEditTemplateDialog(Shell parent, Template template, boolean edit, boolean isNameModifiable, ContextTypeRegistry registry) {
+			super(parent, template, edit, isNameModifiable, registry);
+		}
+
+		protected SourceViewer createViewer(Composite parent) {
+			SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
+				StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationHTML();
+
+				public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+					return baseConfiguration.getConfiguredContentTypes(sourceViewer);
+				}
+
+				public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
+					return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
+				}
+
+				public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
+					ContentAssistant assistant = new ContentAssistant();
+					assistant.enableAutoActivation(true);
+					assistant.enableAutoInsert(true);
+					assistant.setContentAssistProcessor(getTemplateProcessor(), IDocument.DEFAULT_CONTENT_TYPE);
+					return assistant;
+				}
+			};
+			return doCreateViewer(parent, sourceViewerConfiguration);
+		}
+	}
+
+	public HTMLTemplatePreferencePage() {
+		HTMLUIPlugin htmlEditorPlugin = HTMLUIPlugin.getDefault();
+		
+		setPreferenceStore(htmlEditorPlugin.getPreferenceStore());
+		setTemplateStore(htmlEditorPlugin.getTemplateStore());
+		setContextTypeRegistry(htmlEditorPlugin.getTemplateContextRegistry());
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.IPreferencePage#performOk()
+	 */
+	public boolean performOk() {
+  	  boolean ok = super.performOk();
+  	  HTMLUIPlugin.getDefault().savePluginPreferences();
+	  return ok;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.texteditor.templates.TemplatePreferencePage#isShowFormatterSetting()
+	 */
+	protected boolean isShowFormatterSetting() {
+		// template formatting has not been implemented
+		return false;
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	protected Control createContents(Composite ancestor) {
+		Control c = super.createContents(ancestor);
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.HTML_PREFWEBX_TEMPLATES_HELPID);
+		return c;
+	}
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.texteditor.templates.TemplatePreferencePage#createViewer(org.eclipse.swt.widgets.Composite)
+	 */
+	protected SourceViewer createViewer(Composite parent) {
+		SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
+			StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationHTML();
+
+			public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+				return baseConfiguration.getConfiguredContentTypes(sourceViewer);
+			}
+
+			public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
+				return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
+			}
+		};
+		return doCreateViewer(parent, sourceViewerConfiguration);
+	}
+
+	SourceViewer doCreateViewer(Composite parent, SourceViewerConfiguration viewerConfiguration) {
+		SourceViewer viewer = null;
+		String contentTypeID = ContentTypeIdForHTML.ContentTypeID_HTML;
+		viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(contentTypeID);
+		IDocument document = scratchModel.getStructuredDocument();
+		viewer.configure(viewerConfiguration);
+		viewer.setDocument(document);
+		return viewer;
+	}
+
+	/**
+	 * Creates the edit dialog. Subclasses may override this method to provide
+	 * a custom dialog.
+	 * 
+	 * @param template
+	 *            the template being edited
+	 * @param edit
+	 *            whether the dialog should be editable
+	 * @param isNameModifiable
+	 *            whether the template name may be modified
+	 * @return the created or modified template, or <code>null</code> if the
+	 *         edition failed
+	 * @since 3.1
+	 */
+	protected Template editTemplate(Template template, boolean edit, boolean isNameModifiable) {
+		EditTemplateDialog dialog = new HTMLEditTemplateDialog(getShell(), template, edit, isNameModifiable, getContextTypeRegistry());
+		if (dialog.open() == Window.OK) {
+			return dialog.getTemplate();
+		}
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTypingPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTypingPreferencePage.java
new file mode 100644
index 0000000..8942dfe
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTypingPreferencePage.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences.ui;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+
+public class HTMLTypingPreferencePage extends AbstractPreferencePage {
+
+	private Button fCloseComment;
+	private Button fCloseEndTag;
+	private Button fRemoveEndTag;
+	private Button fCloseElement;
+	private Button fCloseStrings;
+	private Button fCloseBrackets;
+	
+	protected Control createContents(Composite parent) {
+		Composite composite = super.createComposite(parent, 1);
+		
+		createStartTagGroup(composite);
+		createEndTagGroup(composite);
+		createAutoComplete(composite);
+		createAutoRemove(composite);
+		
+		setSize(composite);
+		loadPreferences();
+		
+		return composite;
+	}
+	
+	private void createStartTagGroup(Composite parent) {
+		Group group = createGroup(parent, 2);
+
+		group.setText(XMLUIMessages.XMLTyping_Start_Tag);
+
+		fCloseElement = createCheckBox(group, XMLUIMessages.XMLTyping_Complete_Elements);
+		((GridData) fCloseElement.getLayoutData()).horizontalSpan = 2;
+	}
+	
+	private void createEndTagGroup(Composite parent) {
+		Group group = createGroup(parent, 2);
+
+		group.setText(XMLUIMessages.XMLTyping_End_Tag);
+
+		fCloseEndTag = createCheckBox(group, XMLUIMessages.XMLTyping_Complete_End_Tags);
+		((GridData) fCloseEndTag.getLayoutData()).horizontalSpan = 2;
+	}
+	
+	private void createAutoComplete(Composite parent) {
+		Group group = createGroup(parent, 2);
+
+		group.setText(HTMLUIMessages.HTMLTyping_Auto_Complete);
+
+		fCloseComment = createCheckBox(group, HTMLUIMessages.HTMLTyping_Complete_Comments);
+		((GridData) fCloseComment.getLayoutData()).horizontalSpan = 2;
+
+		fCloseStrings = createCheckBox(group, HTMLUIMessages.HTMLTyping_Close_Strings);
+		((GridData) fCloseStrings.getLayoutData()).horizontalSpan = 2;
+
+		fCloseBrackets = createCheckBox(group, HTMLUIMessages.HTMLTyping_Close_Brackets);
+		((GridData) fCloseBrackets.getLayoutData()).horizontalSpan = 2;
+	}
+	
+	private void createAutoRemove(Composite parent) {
+		Group group = createGroup(parent, 2);
+		
+		group.setText(HTMLUIMessages.HTMLTyping_Auto_Remove);
+		
+		fRemoveEndTag = createCheckBox(group, HTMLUIMessages.HTMLTyping_Remove_End_Tags);
+		((GridData) fRemoveEndTag.getLayoutData()).horizontalSpan = 2;
+	}
+	
+	public boolean performOk() {
+		boolean result = super.performOk();
+		
+		HTMLUIPlugin.getDefault().savePluginPreferences();
+		
+		return result;
+	}
+	
+	protected void initializeValues() {
+		initCheckbox(fCloseComment, HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
+		initCheckbox(fCloseEndTag, HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS);
+		initCheckbox(fCloseElement, HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS);
+		initCheckbox(fRemoveEndTag, HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS);
+		initCheckbox(fCloseStrings, HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS);
+		initCheckbox(fCloseBrackets, HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);
+	}
+	
+	protected void performDefaults() {
+		defaultCheckbox(fCloseComment, HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
+		defaultCheckbox(fCloseEndTag, HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS);
+		defaultCheckbox(fCloseElement, HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS);
+		defaultCheckbox(fRemoveEndTag, HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS);
+		defaultCheckbox(fCloseStrings, HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS);
+		defaultCheckbox(fCloseBrackets, HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);
+	}
+	
+	protected void storeValues() {
+		getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS, (fCloseComment != null) ? fCloseComment.getSelection() : false);
+		getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS, (fCloseEndTag != null) ? fCloseEndTag.getSelection() : false);
+		getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS, (fCloseElement != null) ? fCloseElement.getSelection() : false);
+		getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS, (fRemoveEndTag != null) ? fRemoveEndTag.getSelection() : false);
+		getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS, (fCloseStrings != null) ? fCloseStrings.getSelection() : false);
+		getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS, (fCloseBrackets != null) ? fCloseBrackets.getSelection() : false);
+	}
+	
+	protected IPreferenceStore doGetPreferenceStore() {
+		return HTMLUIPlugin.getDefault().getPreferenceStore();
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java
new file mode 100644
index 0000000..1a1f612
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java
@@ -0,0 +1,326 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences.ui;
+
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.layout.PixelConverter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
+import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.ScrolledPageContent;
+
+public class HTMLValidationPreferencePage extends AbstractValidationSettingsPage {
+	
+	private static final int[] SEVERITIES = {ValidationMessage.ERROR, ValidationMessage.WARNING, ValidationMessage.IGNORE};
+	
+	private static final String SETTINGS_SECTION_NAME = "HTMLValidationSeverities";//$NON-NLS-1$
+	
+	public HTMLValidationPreferencePage() {
+		super();
+	}
+	
+	private PixelConverter fPixelConverter;
+	
+	protected Control createCommonContents(Composite parent) {
+		final Composite page = new Composite(parent, SWT.NULL);
+		
+		//GridLayout
+		GridLayout layout = new GridLayout();
+		layout.numColumns = 1;
+		page.setLayout(layout);
+		
+		fPixelConverter = new PixelConverter(parent);
+		
+		final Composite content = createValidationSection(page);
+
+		GridData gridData= new GridData(GridData.FILL, GridData.FILL, true, true);
+		gridData.heightHint = fPixelConverter.convertHeightInCharsToPixels(20);
+		content.setLayoutData(gridData);
+		
+		return page;
+	}
+	
+	private Composite createValidationSection(Composite page) {
+		int nColumns = 3;
+		
+		final ScrolledPageContent spContent = new ScrolledPageContent(page);
+		
+		Composite composite = spContent.getBody();
+		
+		GridLayout layout= new GridLayout(nColumns, false);
+		layout.marginHeight= 0;
+		layout.marginWidth= 0;
+		composite.setLayout(layout);
+		
+		Label description = new Label(composite, SWT.NONE);
+		description.setText(HTMLUIMessages.Validation_description);
+		description.setFont(page.getFont());
+
+		
+		ExpandableComposite ec;
+		Composite inner;
+		String label;
+		
+		String[] errorWarningIgnoreLabel = new String[] { HTMLUIMessages.Validation_Error, HTMLUIMessages.Validation_Warning, HTMLUIMessages.Validation_Ignore };
+		
+		// Element section
+		
+		ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_elements, nColumns);
+		
+		inner = new Composite(ec, SWT.NONE);
+		inner.setFont(composite.getFont());
+		inner.setLayout(new GridLayout(nColumns, false));
+		ec.setClient(inner);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_8;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_UNKNOWN_NAME, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_9;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_INVALID_NAME, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_10;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_START_INVALID_CASE, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_11;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_END_INVALID_CASE, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_12;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_MISSING_START, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_13;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_MISSING_END, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_14;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_UNNECESSARY_END, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_15;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_INVALID_DIRECTIVE, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_16;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_17;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_DUPLICATE, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_18;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_COEXISTENCE, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_19;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_UNCLOSED_START_TAG, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_20;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_UNCLOSED_END_TAG, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_21;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_INVALID_EMPTY_TAG, SEVERITIES, errorWarningIgnoreLabel, 0);
+		// End Element Section
+		
+		// The Attribute validation section
+		
+		ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_attributes, nColumns);
+		inner = new Composite(ec, SWT.NONE);
+		inner.setFont(composite.getFont());
+		inner.setLayout(new GridLayout(nColumns, false));
+		ec.setClient(inner);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_0;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_UNDEFINED_NAME, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_1;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_UNDEFINED_VALUE, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_2;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_NAME_MISMATCH, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_3;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_INVALID_NAME, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_4;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_INVALID_VALUE, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_5;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_DUPLICATE, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_6;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_VALUE_MISMATCH, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_7;
+		addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_VALUE_UNCLOSED, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_35;
+		// TODO: validate resources?
+		// addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_VALUE_RESOURCE_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabel, 0);
+
+		// End Attribute section
+		
+		
+		// Document Type
+		ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_document_type, nColumns);
+		
+		inner = new Composite(ec, SWT.NONE);
+		inner.setFont(composite.getFont());
+		inner.setLayout(new GridLayout(nColumns, false));
+		ec.setClient(inner);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_22;
+		addComboBox(inner, label, HTMLCorePreferenceNames.DOC_DUPLICATE, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_23;
+		addComboBox(inner, label, HTMLCorePreferenceNames.DOC_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_24;
+		addComboBox(inner, label, HTMLCorePreferenceNames.DOC_DOCTYPE_UNCLOSED, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		// End Document Type
+		
+		// Comments
+		ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_comment, nColumns);
+		
+		inner = new Composite(ec, SWT.NONE);
+		inner.setFont(composite.getFont());
+		inner.setLayout(new GridLayout(nColumns, false));
+		ec.setClient(inner);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_27;
+		addComboBox(inner, label, HTMLCorePreferenceNames.COMMENT_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_28;
+		addComboBox(inner, label, HTMLCorePreferenceNames.COMMENT_UNCLOSED, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		// End Comments
+		
+		
+		// CDATA Sections
+		ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_cdata, nColumns);
+		
+		inner = new Composite(ec, SWT.NONE);
+		inner.setFont(composite.getFont());
+		inner.setLayout(new GridLayout(nColumns, false));
+		ec.setClient(inner);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_29;
+		addComboBox(inner, label, HTMLCorePreferenceNames.CDATA_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_30;
+		addComboBox(inner, label, HTMLCorePreferenceNames.CDATA_UNCLOSED, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		// End CDATA Sections
+		
+		// Processing Instructions
+		ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_pi, nColumns);
+		
+		inner = new Composite(ec, SWT.NONE);
+		inner.setFont(composite.getFont());
+		inner.setLayout(new GridLayout(nColumns, false));
+		ec.setClient(inner);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_31;
+		addComboBox(inner, label, HTMLCorePreferenceNames.PI_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_32;
+		addComboBox(inner, label, HTMLCorePreferenceNames.PI_UNCLOSED, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		// End Processing Instructions
+		
+		// Entity References
+		ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_entity_ref, nColumns);
+		
+		inner = new Composite(ec, SWT.NONE);
+		inner.setFont(composite.getFont());
+		inner.setLayout(new GridLayout(nColumns, false));
+		ec.setClient(inner);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_33;
+		addComboBox(inner, label, HTMLCorePreferenceNames.REF_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_34;
+		addComboBox(inner, label, HTMLCorePreferenceNames.REF_UNDEFINED, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		
+		// End Entity References
+		
+		
+		// Text Content
+		ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_text, nColumns);
+		
+		inner = new Composite(ec, SWT.NONE);
+		inner.setFont(composite.getFont());
+		inner.setLayout(new GridLayout(nColumns, false));
+		ec.setClient(inner);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_25;
+		addComboBox(inner, label, HTMLCorePreferenceNames.TEXT_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_26;
+		addComboBox(inner, label, HTMLCorePreferenceNames.TEXT_INVALID_CHAR, SEVERITIES, errorWarningIgnoreLabel, 0);
+		
+		// End Text Content
+		
+		restoreSectionExpansionStates(getDialogSettings().getSection(SETTINGS_SECTION_NAME));
+		
+		return spContent;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+	 */
+	protected void performDefaults() {
+		resetSeverities();
+		super.performDefaults();
+	}
+	
+	protected IDialogSettings getDialogSettings() {
+		return HTMLUIPlugin.getDefault().getDialogSettings();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.jface.dialogs.DialogPage#dispose()
+	 */
+	public void dispose() {
+		storeSectionExpansionStates(getDialogSettings().addNewSection(SETTINGS_SECTION_NAME));
+		super.dispose();
+	}
+	
+	protected String getQualifier() {
+		return HTMLCorePlugin.getDefault().getBundle().getSymbolicName();
+	}
+	
+	protected String getPreferenceNodeQualifier() {
+		return HTMLCorePlugin.getDefault().getBundle().getSymbolicName();
+	}
+
+	protected String getPreferencePageID() {
+		return "org.eclipse.wst.html.ui.preferences.validation";//$NON-NLS-1$
+	}
+
+	protected String getProjectSettingsKey() {
+		return HTMLCorePreferenceNames.USE_PROJECT_SETTINGS;
+	}
+
+	protected String getPropertyPageID() {
+		return "org.eclipse.wst.html.ui.propertyPage.project.validation";//$NON-NLS-1$
+	}
+
+	public void init(IWorkbench workbench) {
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/PropertyPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/PropertyPreferencePage.java
new file mode 100644
index 0000000..ae95c84
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/PropertyPreferencePage.java
@@ -0,0 +1,300 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences.ui;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.dialogs.ControlEnableState;
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.dialogs.ListDialog;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.dialogs.PropertyPage;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.ui.views.navigator.ResourceSorter;
+import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
+import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+
+/**
+ * Based loosely on org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage
+ */
+abstract class PropertyPreferencePage extends PropertyPage implements IWorkbenchPreferencePage {
+	private static final boolean _debugPreferences = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/preferences-properties")); //$NON-NLS-1$ //$NON-NLS-2$
+	/*
+	 * Disable link data, prevents the display of a "workspace" or "project"
+	 * settings link to prevent recursive dialog launching
+	 */
+	private static final Object DISABLE_LINK = "DISABLE_LINK"; //$NON-NLS-1$
+
+	private Map fData = null;
+
+	private Button fEnableProjectSettings;
+
+	private Link fProjectSettingsLink;
+	
+	private Control fCommon;
+	
+	private ControlEnableState fEnablements;
+
+	public PropertyPreferencePage() {
+		super();
+	}
+
+	public final void applyData(Object data) {
+		super.applyData(data);
+		if (data instanceof Map) {
+			fData = (Map) data;
+			updateLinkEnablement();
+		}
+	}
+
+	protected abstract Control createCommonContents(Composite composite);
+
+	public final Control createContents(Composite parent) {
+		Composite composite = new Composite(parent, SWT.NULL);
+
+		GridLayout layout = new GridLayout();
+		composite.setLayout(layout);
+		GridData data = new GridData(GridData.FILL_BOTH);
+		composite.setLayoutData(data);
+
+		Composite checkLinkComposite = new Composite(composite, SWT.NONE);
+		checkLinkComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+		checkLinkComposite.setLayout(new GridLayout(2, false));
+
+		if (getProject() != null) {
+			fEnableProjectSettings = new Button(checkLinkComposite, SWT.CHECK);
+			fEnableProjectSettings.setText(SSEUIMessages.EnableProjectSettings); //$NON-NLS-1$//$NON-NLS-2$
+			fEnableProjectSettings.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
+			boolean enabledForProject = createPreferenceScopes()[0].getNode(getPreferenceNodeQualifier()).getBoolean(getProjectSettingsKey(), false);
+			fEnableProjectSettings.setSelection(enabledForProject);
+		}
+		else {
+			Label spacer = new Label(checkLinkComposite, SWT.CHECK);
+			spacer.setLayoutData(new GridData());
+		}
+
+		fProjectSettingsLink = new Link(checkLinkComposite, SWT.NONE);
+		fProjectSettingsLink.setLayoutData(new GridData(SWT.END, SWT.BEGINNING, true, false));
+
+		/*
+		 * "element" should be a project, if null, link to per-project
+		 * properties
+		 */
+		if (getProject() != null) {
+			fProjectSettingsLink.setText("<a>" + SSEUIMessages.ConfigureWorkspaceSettings + "</a>"); //$NON-NLS-1$//$NON-NLS-2$
+		}
+		else {
+			fProjectSettingsLink.setText("<a>" + SSEUIMessages.ConfigureProjectSettings + "</a>"); //$NON-NLS-1$//$NON-NLS-2$
+		}
+
+		updateLinkEnablement();
+
+		fProjectSettingsLink.addSelectionListener(new SelectionListener() {
+			public void widgetDefaultSelected(SelectionEvent e) {
+				widgetSelected(e);
+			}
+
+			public void widgetSelected(SelectionEvent e) {
+				if (getProject() == null) {
+					openProjectSettings();
+				}
+				else {
+					openWorkspaceSettings();
+				}
+			}
+
+		});
+
+		if (getProject() != null) {
+			Label line = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
+			line.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
+		}
+
+//		final Control common = createCommonContents(composite);
+		fCommon = createCommonContents(composite);
+		
+		fCommon.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+		if (fEnableProjectSettings != null) {
+			SelectionAdapter selectionAdapter = new SelectionAdapter() {
+				public void widgetSelected(SelectionEvent e) {
+					super.widgetSelected(e);
+					enablePreferenceContent(fEnableProjectSettings.getSelection());
+				}
+			};
+			selectionAdapter.widgetSelected(null);
+			fEnableProjectSettings.addSelectionListener(selectionAdapter);
+		}
+		
+		applyDialogFont(composite);
+		return composite;
+	}
+
+	protected IScopeContext[] createPreferenceScopes() {
+		IProject project = getProject();
+		if (project != null) {
+			return new IScopeContext[]{new ProjectScope(project), new InstanceScope(), new DefaultScope()};
+		}
+		return new IScopeContext[]{new InstanceScope(), new DefaultScope()};
+	}
+
+	protected abstract String getPreferenceNodeQualifier();
+
+	protected abstract String getPreferencePageID();
+
+	protected IProject getProject() {
+		if (getElement() != null) {
+			if (getElement() instanceof IProject) {
+				return (IProject) getElement();
+			}
+			Object adapter = getElement().getAdapter(IProject.class);
+			if (adapter instanceof IProject) {
+				return (IProject) adapter;
+			}
+			adapter = getElement().getAdapter(IResource.class);
+			if (adapter instanceof IProject) {
+				return (IProject) adapter;
+			}
+		}
+		return null;
+	}
+
+	protected abstract String getProjectSettingsKey();
+
+	protected abstract String getPropertyPageID();
+
+	protected boolean isElementSettingsEnabled() {
+		return fEnableProjectSettings != null && fEnableProjectSettings.getSelection();
+	}
+
+	void openProjectSettings() {
+		ListDialog dialog = new ListDialog(getShell()) {
+
+			protected Control createDialogArea(Composite container) {
+				Control area = super.createDialogArea(container);
+				getTableViewer().setSorter(new ResourceSorter(ResourceSorter.NAME));
+				return area;
+			}
+		};
+		dialog.setMessage(SSEUIMessages.PropertyPreferencePage_02);
+		dialog.setContentProvider(new IStructuredContentProvider() {
+			public void dispose() {
+			}
+
+			public Object[] getElements(Object inputElement) {
+				return ((IWorkspace) inputElement).getRoot().getProjects();
+			}
+
+			public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+			}
+		});
+		dialog.setLabelProvider(new DecoratingLabelProvider(new WorkbenchLabelProvider(), SSEUIPlugin.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
+		dialog.setInput(ResourcesPlugin.getWorkspace());
+		dialog.setTitle(SSEUIMessages.PropertyPreferencePage_01);
+		if (dialog.open() == Window.OK) {
+			Object[] result = dialog.getResult();
+			if (result.length > 0) {
+				IProject project = (IProject) dialog.getResult()[0];
+				Map data = new HashMap();
+				data.put(DISABLE_LINK, Boolean.TRUE);
+				PreferencesUtil.createPropertyDialogOn(getShell(), project, getPropertyPageID(), new String[]{getPropertyPageID()}, data).open();
+			}
+		}
+	}
+
+	void openWorkspaceSettings() {
+		Map data = new HashMap();
+		data.put(DISABLE_LINK, Boolean.TRUE);
+		PreferencesUtil.createPreferenceDialogOn(getShell(), getPreferencePageID(), new String[]{getPreferencePageID()}, data).open();
+	}
+
+	public boolean performOk() {
+		boolean ok = super.performOk();
+		IScopeContext[] preferenceScopes = createPreferenceScopes();
+		if (getProject() != null) {
+			if (isElementSettingsEnabled()) {
+				if (_debugPreferences) {
+					System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT + " (" + true + ") in scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$  
+				}
+				preferenceScopes[0].getNode(getPreferenceNodeQualifier()).putBoolean(getProjectSettingsKey(), fEnableProjectSettings.getSelection());
+			}
+			else {
+				if (_debugPreferences) {
+					System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT + " from scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+				}
+				preferenceScopes[0].getNode(getPreferenceNodeQualifier()).remove(getProjectSettingsKey());
+			}
+		}
+		return ok;
+	}
+	
+	protected void performDefaults() {
+		if(getProject() != null && fEnableProjectSettings != null) {
+			fEnableProjectSettings.setSelection(false);
+			enablePreferenceContent(false);
+		}
+		super.performDefaults();
+	}
+
+	private void updateLinkEnablement() {
+		if (fData != null && fProjectSettingsLink != null) {
+			fProjectSettingsLink.setEnabled(!Boolean.TRUE.equals(fData.get(DISABLE_LINK)));
+		}
+	}
+	
+	/**
+	 * Controls the enablement of the common content region
+	 * of a property or preference page
+	 * 
+	 * @param enable the enabled state of the common content
+	 * area
+	 */
+	protected void enablePreferenceContent(boolean enable) {
+		if(enable) {
+			if(fEnablements != null) {
+				fEnablements.restore();
+				fEnablements = null;
+			}
+		}
+		else {
+			if(fEnablements == null)
+				fEnablements = ControlEnableState.disable(fCommon);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java
new file mode 100644
index 0000000..145ab9a
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.registry;
+
+import org.eclipse.wst.html.core.internal.modelhandler.ModelHandlerForHTML;
+import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterFactoryForHTML;
+import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
+import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
+import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
+import org.eclipse.wst.sse.ui.internal.util.Assert;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+
+public class AdapterFactoryProviderForHTML implements AdapterFactoryProvider {
+
+
+	public void addAdapterFactories(IStructuredModel structuredModel) {
+
+		// these are the normal edit side content based factories
+		addContentBasedFactories(structuredModel);
+		// Must update/add to propagating adapter here too
+		if (structuredModel instanceof IDOMModel) {
+			addPropagatingAdapters(structuredModel);
+		}
+	}
+
+	protected void addContentBasedFactories(IStructuredModel structuredModel) {
+
+		FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
+		Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
+		INodeAdapterFactory factory = null;
+
+		factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
+		if (factory == null) {
+			factory = new JFaceNodeAdapterFactoryForHTML();
+			factoryRegistry.addFactory(factory);
+		}
+	}
+
+	protected void addPropagatingAdapters(IStructuredModel structuredModel) {
+		// no propagating to add
+	}
+
+	/*
+	 * @see AdapterFactoryProvider#isFor(ContentTypeDescription)
+	 */
+	public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
+		return (contentTypeDescription instanceof ModelHandlerForHTML);
+	}
+
+	public void reinitializeFactories(IStructuredModel structuredModel) {
+		// nothing to do, since no embedded type
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java
new file mode 100644
index 0000000..23c2c49
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+
+package org.eclipse.wst.html.ui.internal.search;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionDelegate;
+
+/**
+ * Sets up FindOccurrencesActionDelegate for html find occurrences processors
+ */
+public class HTMLFindOccurrencesActionDelegate extends FindOccurrencesActionDelegate {
+	private List fProcessors;
+
+	protected List getProcessors() {
+		if (fProcessors == null) {
+			fProcessors = new ArrayList();
+			HTMLFindOccurrencesProcessor htmlProcessor = new HTMLFindOccurrencesProcessor();
+			fProcessors.add(htmlProcessor);
+		}
+		return fProcessors;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java
new file mode 100644
index 0000000..c20efa1
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+
+package org.eclipse.wst.html.ui.internal.search;
+
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.core.text.IXMLPartitions;
+
+/**
+ * Configures a FindOccurrencesProcessor with HTML partitions and regions
+ */
+public class HTMLFindOccurrencesProcessor extends FindOccurrencesProcessor {
+
+	protected String[] getPartitionTypes() {
+		return new String[]{IHTMLPartitions.HTML_DEFAULT, IXMLPartitions.XML_DEFAULT};
+	}
+
+	protected String[] getRegionTypes() {
+		return new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE};
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java
new file mode 100644
index 0000000..81f765c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.style;
+
+import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
+
+/**
+ * Contains the symbolic name of styles used by LineStyleProvider, ColorManager, and
+ * any others who may be interested
+ */
+public interface IStyleConstantsHTML extends IStyleConstantsXML {
+	public static final String SCRIPT_AREA_BORDER = "SCRIPT_AREA_BORDER";//$NON-NLS-1$
+	public static final String SCRIPT_AREA = "SCRIPT_AREA";//$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java
new file mode 100644
index 0000000..4db6f64
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.style;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
+import org.eclipse.wst.xml.ui.internal.style.LineStyleProviderForXML;
+
+public class LineStyleProviderForHTML extends LineStyleProviderForXML implements LineStyleProvider {
+
+	public LineStyleProviderForHTML() {
+		super();
+	}
+
+	/**
+	 * a method to centralize all the "format rules" for regions 
+	 * specifically associated for how to "open" the region.
+	 */
+	// NOTE: this method was just copied down form LineStyleProviderForXML
+	public TextAttribute getAttributeFor(ITextRegion region) {
+		// not sure why this is coming through null, but just to catch it
+		if (region == null) {
+			return (TextAttribute)getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
+		}
+		String type = region.getType();
+		if (type == DOMRegionContext.BLOCK_TEXT) {
+			return (TextAttribute)getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
+		}
+		// workaround: make PI edges the same color as tag edges
+		else if ((type == DOMRegionContext.XML_PI_OPEN) || (type == DOMRegionContext.XML_PI_CLOSE)) {
+			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_BORDER);
+		}
+		// first try "standard" tag attributes from super class
+		return super.getAttributeFor(region);
+	}
+
+	protected void loadColors() {
+		super.loadColors();
+
+		addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+	}
+	
+	
+	protected void handlePropertyChange(PropertyChangeEvent event) {
+		if (event != null) {
+			String prefKey = event.getProperty();
+			// check if preference changed is a style preference
+			if (IStyleConstantsHTML.SCRIPT_AREA_BORDER.equals(prefKey)) {
+				addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+
+				// this is what AbstractLineStyleProvider.propertyChange() does
+				getHighlighter().refreshDisplay();
+			} else {
+				super.handlePropertyChange(event);
+			}
+		} else {
+			super.handlePropertyChange(event);
+		}
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.ui.style.AbstractLineStyleProvider#getColorPreferences()
+	 */
+	protected IPreferenceStore getColorPreferences() {
+		return HTMLUIPlugin.getDefault().getPreferenceStore();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java
new file mode 100644
index 0000000..5f859c7
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.taginfo;
+
+
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.information.IInformationProvider;
+import org.eclipse.jface.text.information.IInformationProviderExtension;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+
+/**
+ * Provides context information for HTML tags (Shows tooltip description)
+ * 
+ * @deprecated StructuredTextViewerConfiguration creates the appropriate
+ *             information provider
+ */
+public class HTMLInformationProvider implements IInformationProvider, IInformationProviderExtension {
+
+	private ITextHover fTextHover = null;
+
+	public HTMLInformationProvider() {
+		fTextHover = SSEUIPlugin.getDefault().getTextHoverManager().createBestMatchHover(new HTMLTagInfoHoverProcessor());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer,
+	 *      int)
+	 */
+	public IRegion getSubject(ITextViewer textViewer, int offset) {
+		return fTextHover.getHoverRegion(textViewer, offset);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.information.IInformationProvider#getInformation(org.eclipse.jface.text.ITextViewer,
+	 *      org.eclipse.jface.text.IRegion)
+	 */
+	public String getInformation(ITextViewer textViewer, IRegion subject) {
+		return (String) getInformation2(textViewer, subject);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.information.IInformationProviderExtension#getInformation2(org.eclipse.jface.text.ITextViewer,
+	 *      org.eclipse.jface.text.IRegion)
+	 */
+	public Object getInformation2(ITextViewer textViewer, IRegion subject) {
+		return fTextHover.getHoverInfo(textViewer, subject);
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLTagInfoHoverProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLTagInfoHoverProcessor.java
new file mode 100644
index 0000000..a99186a
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLTagInfoHoverProcessor.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.taginfo;
+
+
+
+import org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor;
+
+/**
+ * Provides hover help documentation for HTML tags
+ * 
+ * @author amywu
+ */
+public class HTMLTagInfoHoverProcessor extends XMLTagInfoHoverProcessor {
+	//	currently empty because XMLTagInfoHoverProcessor handles all cases relevant to HTML
+	public HTMLTagInfoHoverProcessor() {
+		super();
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java
new file mode 100644
index 0000000..aca7d17
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.templates;
+
+import org.eclipse.jface.text.templates.SimpleTemplateVariableResolver;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
+
+
+public class EncodingTemplateVariableResolverHTML extends SimpleTemplateVariableResolver {
+	private static final String ENCODING_TYPE = getEncodingType();
+
+	private static String getEncodingType() {
+		return "encoding"; //$NON-NLS-1$
+	}
+
+	/**
+	 * Creates a new encoding variable
+	 */
+	public EncodingTemplateVariableResolverHTML() {
+		super(ENCODING_TYPE, HTMLUIMessages.Creating_files_encoding);
+	}
+
+	protected String resolve(TemplateContext context) {
+		return HTMLCorePlugin.getDefault().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java
new file mode 100644
index 0000000..2a18055
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.templates;
+
+import org.eclipse.jface.text.templates.GlobalTemplateVariables;
+import org.eclipse.jface.text.templates.TemplateContextType;
+
+/**
+ * Base class for HTML template context types. Templates of this context type
+ * apply to any place within HTML content type.
+ */
+public class TemplateContextTypeHTML extends TemplateContextType {
+
+	public TemplateContextTypeHTML() {
+		super();
+		addResolver(new GlobalTemplateVariables.Cursor());
+		addResolver(new GlobalTemplateVariables.Date());
+		addResolver(new GlobalTemplateVariables.Dollar());
+		addResolver(new GlobalTemplateVariables.LineSelection());
+		addResolver(new GlobalTemplateVariables.Time());
+		addResolver(new GlobalTemplateVariables.User());
+		addResolver(new GlobalTemplateVariables.WordSelection());
+		addResolver(new GlobalTemplateVariables.Year());
+		addResolver(new EncodingTemplateVariableResolverHTML());
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java
new file mode 100644
index 0000000..794b13d
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.templates;
+
+
+public class TemplateContextTypeIdsHTML {
+
+	public static final String ALL = getAll();
+
+	public static final String ATTRIBUTE = getAttribute();
+
+	public static final String ATTRIBUTE_VALUE = getAttributeValue();
+
+	public static final String NEW = getNew();
+
+	public static final String TAG = getTag();
+
+	private static String getAll() {
+		return getPrefix() + "_all"; //$NON-NLS-1$
+	}
+
+	private static String getAttribute() {
+		return getPrefix() + "_attribute"; //$NON-NLS-1$
+	}
+
+	private static String getAttributeValue() {
+		return getPrefix() + "_attribute_value"; //$NON-NLS-1$
+	}
+
+	private static String getNew() {
+		return getPrefix() + "_new"; //$NON-NLS-1$
+	}
+
+	private static String getTag() {
+		return getPrefix() + "_tag"; //$NON-NLS-1$
+	}
+
+	private static String getPrefix() {
+		return "html"; //$NON-NLS-1$
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/CharacterPairInserter.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/CharacterPairInserter.java
new file mode 100644
index 0000000..b418adc
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/CharacterPairInserter.java
@@ -0,0 +1,106 @@
+/*******************************************************************************

+ * Copyright (c) 2009, 2010 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+package org.eclipse.wst.html.ui.internal.text;

+

+import org.eclipse.jface.preference.IPreferenceStore;

+import org.eclipse.jface.text.IDocument;

+import org.eclipse.jface.text.source.ISourceViewer;

+import org.eclipse.jface.util.IPropertyChangeListener;

+import org.eclipse.jface.util.PropertyChangeEvent;

+import org.eclipse.swt.graphics.Point;

+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;

+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;

+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;

+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;

+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;

+import org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter;

+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;

+

+public class CharacterPairInserter extends AbstractCharacterPairInserter implements IPropertyChangeListener {

+

+	// preferences

+	private boolean fCloseStrings = true;

+	private boolean fCloseBrackets = true;

+

+	protected boolean shouldPair(ISourceViewer viewer, char c) {

+		switch (c) {

+			case '\'':

+			case '"':

+				return fCloseStrings ? checkRegion(viewer) : false;

+			default:

+				return fCloseBrackets;

+		}

+	}

+

+	/**

+	 * Checks if the region should support paired quotes

+	 * @param viewer the viewer

+	 * @return true if the region is not in an XML attribute value

+	 */

+	private boolean checkRegion(ISourceViewer viewer) {

+		final IDocument doc = viewer.getDocument();

+		final Point selection = viewer.getSelectedRange();

+		final int offset = selection.x;

+

+		if (doc instanceof IStructuredDocument) {

+			IStructuredDocumentRegion[] regions = ((IStructuredDocument) doc).getStructuredDocumentRegions(offset, 0);

+			if (regions != null && regions.length > 0) {

+				ITextRegion region = regions[0].getRegionAtCharacterOffset(offset);

+				return region != null && region.getType() != DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE;

+			}

+		}

+		return true;

+	}

+

+	public boolean hasPair(char c) {

+		switch (c) {

+			case '"':

+			case '\'':

+			case '[':

+			case '(':

+				return true;

+			default:

+				return false;

+		}

+	}

+

+	protected char getPair(char c) {

+		switch (c) {

+			case '\'':

+			case '"':

+				return c;

+			case '(':

+				return ')';

+			case '[':

+				return ']';

+			default:

+				throw new IllegalArgumentException();

+		}

+	}

+

+	public void initialize() {

+		IPreferenceStore store = HTMLUIPlugin.getInstance().getPreferenceStore();

+		fCloseStrings = store.getBoolean(HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS);

+		fCloseBrackets = store.getBoolean(HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);

+		store.addPropertyChangeListener(this);

+	}

+

+	public void dispose() {

+		HTMLUIPlugin.getInstance().getPreferenceStore().removePropertyChangeListener(this);

+	}

+

+	public void propertyChange(PropertyChangeEvent event) {

+		if (HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS.equals(event.getProperty()))

+			fCloseBrackets = ((Boolean) event.getNewValue()).booleanValue();

+		else if (HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS.equals(event.getProperty()))

+			fCloseStrings = ((Boolean) event.getNewValue()).booleanValue();

+	}

+}

diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java
new file mode 100644
index 0000000..aa75cdb
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.text;
+
+import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+
+public class HTMLDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
+
+	protected final static char[] BRACKETS = {'{', '}', '(', ')', '[', ']','"','"','\'','\''};
+	/**
+	 * @param validContexts
+	 * @param nextMatcher
+	 */
+	public HTMLDocumentRegionEdgeMatcher() {
+		super(new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_COMMENT_TEXT, DOMRegionContext.XML_CDATA_TEXT, DOMRegionContext.XML_PI_OPEN, DOMRegionContext.XML_PI_CONTENT}, new JavaPairMatcher(BRACKETS));
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/IJavaPartitions.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/IJavaPartitions.java
new file mode 100644
index 0000000..b9d8561
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/IJavaPartitions.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.text;
+
+// taken from package org.eclipse.jdt.ui.text;
+
+/**
+ * Definition of Java partitioning and its partitions.
+ * 
+ * @see Eclipse 3.1
+ */
+interface IJavaPartitions {
+
+	/**
+	 * The identifier of the Java partitioning.
+	 */
+	String JAVA_PARTITIONING = "___java_partitioning"; //$NON-NLS-1$
+
+	/**
+	 * The identifier of the single-line (JLS2: EndOfLineComment) end comment
+	 * partition content type.
+	 */
+	String JAVA_SINGLE_LINE_COMMENT = "__java_singleline_comment"; //$NON-NLS-1$
+
+	/**
+	 * The identifier multi-line (JLS2: TraditionalComment) comment partition
+	 * content type.
+	 */
+	String JAVA_MULTI_LINE_COMMENT = "__java_multiline_comment"; //$NON-NLS-1$
+
+	/**
+	 * The identifier of the Javadoc (JLS2: DocumentationComment) partition
+	 * content type.
+	 */
+	String JAVA_DOC = "__java_javadoc"; //$NON-NLS-1$
+
+	/**
+	 * The identifier of the Java string partition content type.
+	 */
+	String JAVA_STRING = "__java_string"; //$NON-NLS-1$
+
+	/**
+	 * The identifier of the Java character partition content type.
+	 */
+	String JAVA_CHARACTER = "__java_character"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaCodeReader.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaCodeReader.java
new file mode 100644
index 0000000..e3cace3
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaCodeReader.java
@@ -0,0 +1,244 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.text;
+
+// taken from package org.eclipse.jdt.ui.text;
+
+import java.io.IOException;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.wst.html.ui.internal.derived.SingleCharReader;
+
+/**
+ * Reads from a document either forwards or backwards. May be configured to
+ * skip comments and strings.
+ */
+class JavaCodeReader extends SingleCharReader {
+
+	/** The EOF character */
+	public static final int EOF = -1;
+
+	private boolean fSkipComments = false;
+	private boolean fSkipStrings = false;
+	private boolean fForward = false;
+
+	private IDocument fDocument;
+	private int fOffset;
+
+	private int fEnd = -1;
+	private int fCachedLineNumber = -1;
+	private int fCachedLineOffset = -1;
+
+
+	public JavaCodeReader() {
+	}
+
+	/**
+	 * Returns the offset of the last read character. Should only be called
+	 * after read has been called.
+	 */
+	public int getOffset() {
+		return fForward ? fOffset - 1 : fOffset;
+	}
+
+	public void configureForwardReader(IDocument document, int offset, int length, boolean skipComments, boolean skipStrings) throws IOException {
+		fDocument = document;
+		fOffset = offset;
+		fSkipComments = skipComments;
+		fSkipStrings = skipStrings;
+
+		fForward = true;
+		fEnd = Math.min(fDocument.getLength(), fOffset + length);
+	}
+
+	public void configureBackwardReader(IDocument document, int offset, boolean skipComments, boolean skipStrings) throws IOException {
+		fDocument = document;
+		fOffset = offset;
+		fSkipComments = skipComments;
+		fSkipStrings = skipStrings;
+
+		fForward = false;
+		try {
+			fCachedLineNumber = fDocument.getLineOfOffset(fOffset);
+		}
+		catch (BadLocationException x) {
+			throw new IOException(x.getMessage());
+		}
+	}
+
+	/*
+	 * @see Reader#close()
+	 */
+	public void close() throws IOException {
+		fDocument = null;
+	}
+
+	/*
+	 * @see SingleCharReader#read()
+	 */
+	public int read() throws IOException {
+		try {
+			return fForward ? readForwards() : readBackwards();
+		}
+		catch (BadLocationException x) {
+			throw new IOException(x.getMessage());
+		}
+	}
+
+	private void gotoCommentEnd() throws BadLocationException {
+		while (fOffset < fEnd) {
+			char current = fDocument.getChar(fOffset++);
+			if (current == '*') {
+				if (fOffset < fEnd && fDocument.getChar(fOffset) == '/') {
+					++fOffset;
+					return;
+				}
+			}
+		}
+	}
+
+	private void gotoStringEnd(char delimiter) throws BadLocationException {
+		while (fOffset < fEnd) {
+			char current = fDocument.getChar(fOffset++);
+			if (current == '\\') {
+				// ignore escaped characters
+				++fOffset;
+			}
+			else if (current == delimiter) {
+				return;
+			}
+		}
+	}
+
+	private void gotoLineEnd() throws BadLocationException {
+		int line = fDocument.getLineOfOffset(fOffset);
+		fOffset = fDocument.getLineOffset(line + 1);
+	}
+
+	private int readForwards() throws BadLocationException {
+		while (fOffset < fEnd) {
+			char current = fDocument.getChar(fOffset++);
+
+			switch (current) {
+				case '/' :
+
+					if (fSkipComments && fOffset < fEnd) {
+						char next = fDocument.getChar(fOffset);
+						if (next == '*') {
+							// a comment starts, advance to the comment end
+							++fOffset;
+							gotoCommentEnd();
+							continue;
+						}
+						else if (next == '/') {
+							// '//'-comment starts, advance to the line end
+							gotoLineEnd();
+							continue;
+						}
+					}
+
+					return current;
+
+				case '"' :
+				case '\'' :
+
+					if (fSkipStrings) {
+						gotoStringEnd(current);
+						continue;
+					}
+
+					return current;
+			}
+
+			return current;
+		}
+
+		return EOF;
+	}
+
+	private void handleSingleLineComment() throws BadLocationException {
+		int line = fDocument.getLineOfOffset(fOffset);
+		if (line < fCachedLineNumber) {
+			fCachedLineNumber = line;
+			fCachedLineOffset = fDocument.getLineOffset(line);
+			int offset = fOffset;
+			while (fCachedLineOffset < offset) {
+				char current = fDocument.getChar(offset--);
+				if (current == '/' && fCachedLineOffset <= offset && fDocument.getChar(offset) == '/') {
+					fOffset = offset;
+					return;
+				}
+			}
+		}
+	}
+
+	private void gotoCommentStart() throws BadLocationException {
+		while (0 < fOffset) {
+			char current = fDocument.getChar(fOffset--);
+			if (current == '*' && 0 <= fOffset && fDocument.getChar(fOffset) == '/')
+				return;
+		}
+	}
+
+	private void gotoStringStart(char delimiter) throws BadLocationException {
+		while (0 < fOffset) {
+			char current = fDocument.getChar(fOffset);
+			if (current == delimiter) {
+				if (!(0 <= fOffset && fDocument.getChar(fOffset - 1) == '\\'))
+					return;
+			}
+			--fOffset;
+		}
+	}
+
+	private int readBackwards() throws BadLocationException {
+
+		while (0 < fOffset) {
+			--fOffset;
+
+			handleSingleLineComment();
+
+			char current = fDocument.getChar(fOffset);
+			switch (current) {
+				case '/' :
+
+					if (fSkipComments && fOffset > 1) {
+						char next = fDocument.getChar(fOffset - 1);
+						if (next == '*') {
+							// a comment ends, advance to the comment start
+							fOffset -= 2;
+							gotoCommentStart();
+							continue;
+						}
+					}
+
+					return current;
+
+				case '"' :
+				case '\'' :
+
+					if (fSkipStrings) {
+						--fOffset;
+						gotoStringStart(current);
+						continue;
+					}
+
+					return current;
+			}
+
+			return current;
+		}
+
+		return EOF;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaHeuristicScanner.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaHeuristicScanner.java
new file mode 100644
index 0000000..01602a2
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaHeuristicScanner.java
@@ -0,0 +1,986 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.text;
+
+// taken from package org.eclipse.jdt.internal.ui.text;
+
+import java.util.Arrays;
+
+import org.eclipse.jface.text.Assert;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.TypedRegion;
+
+/**
+ * Utility methods for heuristic based Java manipulations in an incomplete
+ * Java source file.
+ * 
+ * <p>
+ * An instance holds some internal position in the document and is therefore
+ * not threadsafe.
+ * </p>
+ * 
+ * @see Eclipse 3.0
+ */
+final class JavaHeuristicScanner implements Symbols {
+	/**
+	 * Returned by all methods when the requested position could not be found,
+	 * or if a {@link BadLocationException} was thrown while scanning.
+	 */
+	public static final int NOT_FOUND = -1;
+
+	/**
+	 * Special bound parameter that means either -1 (backward scanning) or
+	 * <code>fDocument.getLength()</code> (forward scanning).
+	 */
+	public static final int UNBOUND = -2;
+
+
+	/* character constants */
+	private static final char LBRACE = '{';
+	private static final char RBRACE = '}';
+	private static final char LPAREN = '(';
+	private static final char RPAREN = ')';
+	private static final char SEMICOLON = ';';
+	private static final char COLON = ':';
+	private static final char COMMA = ',';
+	private static final char LBRACKET = '[';
+	private static final char RBRACKET = ']';
+	private static final char QUESTIONMARK = '?';
+	private static final char EQUAL = '=';
+	private static final char LANGLE = '<';
+	private static final char RANGLE = '>';
+
+	/**
+	 * Specifies the stop condition, upon which the <code>scanXXX</code>
+	 * methods will decide whether to keep scanning or not. This interface may
+	 * implemented by clients.
+	 */
+	private static abstract class StopCondition {
+		/**
+		 * Instructs the scanner to return the current position.
+		 * 
+		 * @param ch
+		 *            the char at the current position
+		 * @param position
+		 *            the current position
+		 * @param forward
+		 *            the iteration direction
+		 * @return <code>true</code> if the stop condition is met.
+		 */
+		public abstract boolean stop(char ch, int position, boolean forward);
+
+		/**
+		 * Asks the condition to return the next position to query. The
+		 * default is to return the next/previous position.
+		 * 
+		 * @return the next position to scan
+		 */
+		public int nextPosition(int position, boolean forward) {
+			return forward ? position + 1 : position - 1;
+		}
+	}
+
+	/**
+	 * Stops upon a non-whitespace (as defined by
+	 * {@link Character#isWhitespace(char)}) character.
+	 */
+	private static class NonWhitespace extends StopCondition {
+		/*
+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
+		 */
+		public boolean stop(char ch, int position, boolean forward) {
+			return !Character.isWhitespace(ch);
+		}
+	}
+
+	/**
+	 * Stops upon a non-whitespace character in the default partition.
+	 * 
+	 * @see NonWhitespace
+	 */
+	private final class NonWhitespaceDefaultPartition extends NonWhitespace {
+		/*
+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
+		 */
+		public boolean stop(char ch, int position, boolean forward) {
+			return super.stop(ch, position, true) && isDefaultPartition(position);
+		}
+
+		/*
+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int,
+		 *      boolean)
+		 */
+		public int nextPosition(int position, boolean forward) {
+			ITypedRegion partition = getPartition(position);
+			if (fPartition.equals(partition.getType()))
+				return super.nextPosition(position, forward);
+
+			if (forward) {
+				int end = partition.getOffset() + partition.getLength();
+				if (position < end)
+					return end;
+			}
+			else {
+				int offset = partition.getOffset();
+				if (position > offset)
+					return offset - 1;
+			}
+			return super.nextPosition(position, forward);
+		}
+	}
+
+	/**
+	 * Stops upon a non-java identifier (as defined by
+	 * {@link Character#isJavaIdentifierPart(char)}) character.
+	 */
+	private static class NonJavaIdentifierPart extends StopCondition {
+		/*
+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
+		 */
+		public boolean stop(char ch, int position, boolean forward) {
+			return !Character.isJavaIdentifierPart(ch);
+		}
+	}
+
+	/**
+	 * Stops upon a non-java identifier character in the default partition.
+	 * 
+	 * @see NonJavaIdentifierPart
+	 */
+	private final class NonJavaIdentifierPartDefaultPartition extends NonJavaIdentifierPart {
+		/*
+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
+		 */
+		public boolean stop(char ch, int position, boolean forward) {
+			return super.stop(ch, position, true) || !isDefaultPartition(position);
+		}
+
+		/*
+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int,
+		 *      boolean)
+		 */
+		public int nextPosition(int position, boolean forward) {
+			ITypedRegion partition = getPartition(position);
+			if (fPartition.equals(partition.getType()))
+				return super.nextPosition(position, forward);
+
+			if (forward) {
+				int end = partition.getOffset() + partition.getLength();
+				if (position < end)
+					return end;
+			}
+			else {
+				int offset = partition.getOffset();
+				if (position > offset)
+					return offset - 1;
+			}
+			return super.nextPosition(position, forward);
+		}
+	}
+
+	/**
+	 * Stops upon a character in the default partition that matches the given
+	 * character list.
+	 */
+	private final class CharacterMatch extends StopCondition {
+		private final char[] fChars;
+
+		/**
+		 * Creates a new instance.
+		 * 
+		 * @param ch
+		 *            the single character to match
+		 */
+		public CharacterMatch(char ch) {
+			this(new char[]{ch});
+		}
+
+		/**
+		 * Creates a new instance.
+		 * 
+		 * @param chars
+		 *            the chars to match.
+		 */
+		public CharacterMatch(char[] chars) {
+			Assert.isNotNull(chars);
+			Assert.isTrue(chars.length > 0);
+			fChars = chars;
+			Arrays.sort(chars);
+		}
+
+		/*
+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char,
+		 *      int)
+		 */
+		public boolean stop(char ch, int position, boolean forward) {
+			return Arrays.binarySearch(fChars, ch) >= 0 && isDefaultPartition(position);
+		}
+
+		/*
+		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int,
+		 *      boolean)
+		 */
+		public int nextPosition(int position, boolean forward) {
+			ITypedRegion partition = getPartition(position);
+			if (fPartition.equals(partition.getType()))
+				return super.nextPosition(position, forward);
+
+			if (forward) {
+				int end = partition.getOffset() + partition.getLength();
+				if (position < end)
+					return end;
+			}
+			else {
+				int offset = partition.getOffset();
+				if (position > offset)
+					return offset - 1;
+			}
+			return super.nextPosition(position, forward);
+		}
+	}
+
+	/** The document being scanned. */
+	private IDocument fDocument;
+	/** The partitioning being used for scanning. */
+	private String fPartitioning;
+	/** The partition to scan in. */
+	private String fPartition;
+
+	/* internal scan state */
+
+	/** the most recently read character. */
+	private char fChar;
+	/** the most recently read position. */
+	private int fPos;
+
+	/* preset stop conditions */
+	private final StopCondition fNonWSDefaultPart = new NonWhitespaceDefaultPartition();
+	private final static StopCondition fNonWS = new NonWhitespace();
+	private final StopCondition fNonIdent = new NonJavaIdentifierPartDefaultPartition();
+
+	/**
+	 * Creates a new instance.
+	 * 
+	 * @param document
+	 *            the document to scan
+	 * @param partitioning
+	 *            the partitioning to use for scanning
+	 * @param partition
+	 *            the partition to scan in
+	 */
+	public JavaHeuristicScanner(IDocument document, String partitioning, String partition) {
+		Assert.isNotNull(document);
+		Assert.isNotNull(partitioning);
+		Assert.isNotNull(partition);
+		fDocument = document;
+		fPartitioning = partitioning;
+		fPartition = partition;
+	}
+
+	/**
+	 * Calls
+	 * <code>this(document, IJavaPartitions.JAVA_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE)</code>.
+	 * 
+	 * @param document
+	 *            the document to scan.
+	 */
+	public JavaHeuristicScanner(IDocument document) {
+		this(document, IJavaPartitions.JAVA_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE);
+	}
+
+	/**
+	 * Returns the most recent internal scan position.
+	 * 
+	 * @return the most recent internal scan position.
+	 */
+	public int getPosition() {
+		return fPos;
+	}
+
+	/**
+	 * Returns the next token in forward direction, starting at
+	 * <code>start</code>, and not extending further than
+	 * <code>bound</code>. The return value is one of the constants defined
+	 * in {@link Symbols}. After a call, {@link #getPosition()} will return
+	 * the position just after the scanned token (i.e. the next position that
+	 * will be scanned).
+	 * 
+	 * @param start
+	 *            the first character position in the document to consider
+	 * @param bound
+	 *            the first position not to consider any more
+	 * @return a constant from {@link Symbols} describing the next token
+	 */
+	public int nextToken(int start, int bound) {
+		int pos = scanForward(start, bound, fNonWSDefaultPart);
+		if (pos == NOT_FOUND)
+			return TokenEOF;
+
+		fPos++;
+
+		switch (fChar) {
+			case LBRACE :
+				return TokenLBRACE;
+			case RBRACE :
+				return TokenRBRACE;
+			case LBRACKET :
+				return TokenLBRACKET;
+			case RBRACKET :
+				return TokenRBRACKET;
+			case LPAREN :
+				return TokenLPAREN;
+			case RPAREN :
+				return TokenRPAREN;
+			case SEMICOLON :
+				return TokenSEMICOLON;
+			case COMMA :
+				return TokenCOMMA;
+			case QUESTIONMARK :
+				return TokenQUESTIONMARK;
+			case EQUAL :
+				return TokenEQUAL;
+			case LANGLE :
+				return TokenLESSTHAN;
+			case RANGLE :
+				return TokenGREATERTHAN;
+		}
+
+		// else
+		if (Character.isJavaIdentifierPart(fChar)) {
+			// assume an ident or keyword
+			int from = pos, to;
+			pos = scanForward(pos + 1, bound, fNonIdent);
+			if (pos == NOT_FOUND)
+				to = bound == UNBOUND ? fDocument.getLength() : bound;
+			else
+				to = pos;
+
+			String identOrKeyword;
+			try {
+				identOrKeyword = fDocument.get(from, to - from);
+			}
+			catch (BadLocationException e) {
+				return TokenEOF;
+			}
+
+			return getToken(identOrKeyword);
+
+
+		}
+		else {
+			// operators, number literals etc
+			return TokenOTHER;
+		}
+	}
+
+	/**
+	 * Returns the next token in backward direction, starting at
+	 * <code>start</code>, and not extending further than
+	 * <code>bound</code>. The return value is one of the constants defined
+	 * in {@link Symbols}. After a call, {@link #getPosition()} will return
+	 * the position just before the scanned token starts (i.e. the next
+	 * position that will be scanned).
+	 * 
+	 * @param start
+	 *            the first character position in the document to consider
+	 * @param bound
+	 *            the first position not to consider any more
+	 * @return a constant from {@link Symbols} describing the previous token
+	 */
+	public int previousToken(int start, int bound) {
+		int pos = scanBackward(start, bound, fNonWSDefaultPart);
+		if (pos == NOT_FOUND)
+			return TokenEOF;
+
+		fPos--;
+
+		switch (fChar) {
+			case LBRACE :
+				return TokenLBRACE;
+			case RBRACE :
+				return TokenRBRACE;
+			case LBRACKET :
+				return TokenLBRACKET;
+			case RBRACKET :
+				return TokenRBRACKET;
+			case LPAREN :
+				return TokenLPAREN;
+			case RPAREN :
+				return TokenRPAREN;
+			case SEMICOLON :
+				return TokenSEMICOLON;
+			case COLON :
+				return TokenCOLON;
+			case COMMA :
+				return TokenCOMMA;
+			case QUESTIONMARK :
+				return TokenQUESTIONMARK;
+			case EQUAL :
+				return TokenEQUAL;
+			case LANGLE :
+				return TokenLESSTHAN;
+			case RANGLE :
+				return TokenGREATERTHAN;
+		}
+
+		// else
+		if (Character.isJavaIdentifierPart(fChar)) {
+			// assume an ident or keyword
+			int from, to = pos + 1;
+			pos = scanBackward(pos - 1, bound, fNonIdent);
+			if (pos == NOT_FOUND)
+				from = bound == UNBOUND ? 0 : bound + 1;
+			else
+				from = pos + 1;
+
+			String identOrKeyword;
+			try {
+				identOrKeyword = fDocument.get(from, to - from);
+			}
+			catch (BadLocationException e) {
+				return TokenEOF;
+			}
+
+			return getToken(identOrKeyword);
+
+
+		}
+		else {
+			// operators, number literals etc
+			return TokenOTHER;
+		}
+
+	}
+
+	/**
+	 * Returns one of the keyword constants or <code>TokenIDENT</code> for a
+	 * scanned identifier.
+	 * 
+	 * @param s
+	 *            a scanned identifier
+	 * @return one of the constants defined in {@link Symbols}
+	 */
+	private int getToken(String s) {
+		Assert.isNotNull(s);
+
+		switch (s.length()) {
+			case 2 :
+				if ("if".equals(s)) //$NON-NLS-1$
+					return TokenIF;
+				if ("do".equals(s)) //$NON-NLS-1$
+					return TokenDO;
+				break;
+			case 3 :
+				if ("for".equals(s)) //$NON-NLS-1$
+					return TokenFOR;
+				if ("try".equals(s)) //$NON-NLS-1$
+					return TokenTRY;
+				if ("new".equals(s)) //$NON-NLS-1$
+					return TokenNEW;
+				break;
+			case 4 :
+				if ("case".equals(s)) //$NON-NLS-1$
+					return TokenCASE;
+				if ("else".equals(s)) //$NON-NLS-1$
+					return TokenELSE;
+				if ("enum".equals(s)) //$NON-NLS-1$
+					return TokenENUM;
+				if ("goto".equals(s)) //$NON-NLS-1$
+					return TokenGOTO;
+				break;
+			case 5 :
+				if ("break".equals(s)) //$NON-NLS-1$
+					return TokenBREAK;
+				if ("catch".equals(s)) //$NON-NLS-1$
+					return TokenCATCH;
+				if ("class".equals(s)) //$NON-NLS-1$
+					return TokenCLASS;
+				if ("while".equals(s)) //$NON-NLS-1$
+					return TokenWHILE;
+				break;
+			case 6 :
+				if ("return".equals(s)) //$NON-NLS-1$
+					return TokenRETURN;
+				if ("static".equals(s)) //$NON-NLS-1$
+					return TokenSTATIC;
+				if ("switch".equals(s)) //$NON-NLS-1$
+					return TokenSWITCH;
+				break;
+			case 7 :
+				if ("default".equals(s)) //$NON-NLS-1$
+					return TokenDEFAULT;
+				if ("finally".equals(s)) //$NON-NLS-1$
+					return TokenFINALLY;
+				break;
+			case 9 :
+				if ("interface".equals(s)) //$NON-NLS-1$
+					return TokenINTERFACE;
+				break;
+			case 12 :
+				if ("synchronized".equals(s)) //$NON-NLS-1$
+					return TokenSYNCHRONIZED;
+				break;
+		}
+		return TokenIDENT;
+	}
+
+	/**
+	 * Returns the position of the closing peer character (forward search).
+	 * Any scopes introduced by opening peers are skipped. All peers accounted
+	 * for must reside in the default partition.
+	 * 
+	 * <p>
+	 * Note that <code>start</code> must not point to the opening peer, but
+	 * to the first character being searched.
+	 * </p>
+	 * 
+	 * @param start
+	 *            the start position
+	 * @param openingPeer
+	 *            the opening peer character (e.g. '{')
+	 * @param closingPeer
+	 *            the closing peer character (e.g. '}')
+	 * @return the matching peer character position, or <code>NOT_FOUND</code>
+	 */
+	public int findClosingPeer(int start, final char openingPeer, final char closingPeer) {
+		Assert.isNotNull(fDocument);
+		Assert.isTrue(start >= 0);
+
+		try {
+			int depth = 1;
+			start -= 1;
+			while (true) {
+				start = scanForward(start + 1, UNBOUND, new CharacterMatch(new char[]{openingPeer, closingPeer}));
+				if (start == NOT_FOUND)
+					return NOT_FOUND;
+
+				if (fDocument.getChar(start) == openingPeer)
+					depth++;
+				else
+					depth--;
+
+				if (depth == 0)
+					return start;
+			}
+
+		}
+		catch (BadLocationException e) {
+			return NOT_FOUND;
+		}
+	}
+
+	/**
+	 * Returns the position of the opening peer character (backward search).
+	 * Any scopes introduced by closing peers are skipped. All peers accounted
+	 * for must reside in the default partition.
+	 * 
+	 * <p>
+	 * Note that <code>start</code> must not point to the closing peer, but
+	 * to the first character being searched.
+	 * </p>
+	 * 
+	 * @param start
+	 *            the start position
+	 * @param openingPeer
+	 *            the opening peer character (e.g. '{')
+	 * @param closingPeer
+	 *            the closing peer character (e.g. '}')
+	 * @return the matching peer character position, or <code>NOT_FOUND</code>
+	 */
+	public int findOpeningPeer(int start, char openingPeer, char closingPeer) {
+		Assert.isTrue(start < fDocument.getLength());
+
+		try {
+			int depth = 1;
+			start += 1;
+			while (true) {
+				start = scanBackward(start - 1, UNBOUND, new CharacterMatch(new char[]{openingPeer, closingPeer}));
+				if (start == NOT_FOUND)
+					return NOT_FOUND;
+
+				if (fDocument.getChar(start) == closingPeer)
+					depth++;
+				else
+					depth--;
+
+				if (depth == 0)
+					return start;
+			}
+
+		}
+		catch (BadLocationException e) {
+			return NOT_FOUND;
+		}
+	}
+
+	/**
+	 * Computes the surrounding block around <code>offset</code>. The
+	 * search is started at the beginning of <code>offset</code>, i.e. an
+	 * opening brace at <code>offset</code> will not be part of the
+	 * surrounding block, but a closing brace will.
+	 * 
+	 * @param offset
+	 *            the offset for which the surrounding block is computed
+	 * @return a region describing the surrounding block, or <code>null</code>
+	 *         if none can be found
+	 */
+	public IRegion findSurroundingBlock(int offset) {
+		if (offset < 1 || offset >= fDocument.getLength())
+			return null;
+
+		int begin = findOpeningPeer(offset - 1, LBRACE, RBRACE);
+		int end = findClosingPeer(offset, LBRACE, RBRACE);
+		if (begin == NOT_FOUND || end == NOT_FOUND)
+			return null;
+		return new Region(begin, end + 1 - begin);
+	}
+
+	/**
+	 * Finds the smallest position in <code>fDocument</code> such that the
+	 * position is &gt;= <code>position</code> and &lt; <code>bound</code>
+	 * and <code>Character.isWhitespace(fDocument.getChar(pos))</code>
+	 * evaluates to <code>false</code> and the position is in the default
+	 * partition.
+	 * 
+	 * @param position
+	 *            the first character position in <code>fDocument</code> to
+	 *            be considered
+	 * @param bound
+	 *            the first position in <code>fDocument</code> to not
+	 *            consider any more, with <code>bound</code> &gt;
+	 *            <code>position</code>, or <code>UNBOUND</code>
+	 * @return the smallest position of a non-whitespace character in [<code>position</code>,
+	 *         <code>bound</code>) that resides in a Java partition, or
+	 *         <code>NOT_FOUND</code> if none can be found
+	 */
+	public int findNonWhitespaceForward(int position, int bound) {
+		return scanForward(position, bound, fNonWSDefaultPart);
+	}
+
+	/**
+	 * Finds the smallest position in <code>fDocument</code> such that the
+	 * position is &gt;= <code>position</code> and &lt; <code>bound</code>
+	 * and <code>Character.isWhitespace(fDocument.getChar(pos))</code>
+	 * evaluates to <code>false</code>.
+	 * 
+	 * @param position
+	 *            the first character position in <code>fDocument</code> to
+	 *            be considered
+	 * @param bound
+	 *            the first position in <code>fDocument</code> to not
+	 *            consider any more, with <code>bound</code> &gt;
+	 *            <code>position</code>, or <code>UNBOUND</code>
+	 * @return the smallest position of a non-whitespace character in [<code>position</code>,
+	 *         <code>bound</code>), or <code>NOT_FOUND</code> if none can
+	 *         be found
+	 */
+	public int findNonWhitespaceForwardInAnyPartition(int position, int bound) {
+		return scanForward(position, bound, fNonWS);
+	}
+
+	/**
+	 * Finds the highest position in <code>fDocument</code> such that the
+	 * position is &lt;= <code>position</code> and &gt; <code>bound</code>
+	 * and <code>Character.isWhitespace(fDocument.getChar(pos))</code>
+	 * evaluates to <code>false</code> and the position is in the default
+	 * partition.
+	 * 
+	 * @param position
+	 *            the first character position in <code>fDocument</code> to
+	 *            be considered
+	 * @param bound
+	 *            the first position in <code>fDocument</code> to not
+	 *            consider any more, with <code>bound</code> &lt;
+	 *            <code>position</code>, or <code>UNBOUND</code>
+	 * @return the highest position of a non-whitespace character in (<code>bound</code>,
+	 *         <code>position</code>] that resides in a Java partition, or
+	 *         <code>NOT_FOUND</code> if none can be found
+	 */
+	public int findNonWhitespaceBackward(int position, int bound) {
+		return scanBackward(position, bound, fNonWSDefaultPart);
+	}
+
+	/**
+	 * Finds the lowest position <code>p</code> in <code>fDocument</code>
+	 * such that <code>start</code> &lt;= p &lt; <code>bound</code> and
+	 * <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to
+	 * <code>true</code>.
+	 * 
+	 * @param start
+	 *            the first character position in <code>fDocument</code> to
+	 *            be considered
+	 * @param bound
+	 *            the first position in <code>fDocument</code> to not
+	 *            consider any more, with <code>bound</code> &gt;
+	 *            <code>start</code>, or <code>UNBOUND</code>
+	 * @param condition
+	 *            the <code>StopCondition</code> to check
+	 * @return the lowest position in [<code>start</code>,
+	 *         <code>bound</code>) for which <code>condition</code>
+	 *         holds, or <code>NOT_FOUND</code> if none can be found
+	 */
+	public int scanForward(int start, int bound, StopCondition condition) {
+		Assert.isTrue(start >= 0);
+
+		if (bound == UNBOUND)
+			bound = fDocument.getLength();
+
+		Assert.isTrue(bound <= fDocument.getLength());
+
+		try {
+			fPos = start;
+			while (fPos < bound) {
+
+				fChar = fDocument.getChar(fPos);
+				if (condition.stop(fChar, fPos, true))
+					return fPos;
+
+				fPos = condition.nextPosition(fPos, true);
+			}
+		}
+		catch (BadLocationException e) {
+		}
+		return NOT_FOUND;
+	}
+
+
+	/**
+	 * Finds the lowest position in <code>fDocument</code> such that the
+	 * position is &gt;= <code>position</code> and &lt; <code>bound</code>
+	 * and <code>fDocument.getChar(position) == ch</code> evaluates to
+	 * <code>true</code> and the position is in the default partition.
+	 * 
+	 * @param position
+	 *            the first character position in <code>fDocument</code> to
+	 *            be considered
+	 * @param bound
+	 *            the first position in <code>fDocument</code> to not
+	 *            consider any more, with <code>bound</code> &gt;
+	 *            <code>position</code>, or <code>UNBOUND</code>
+	 * @param ch
+	 *            the <code>char</code> to search for
+	 * @return the lowest position of <code>ch</code> in (<code>bound</code>,
+	 *         <code>position</code>] that resides in a Java partition, or
+	 *         <code>NOT_FOUND</code> if none can be found
+	 */
+	public int scanForward(int position, int bound, char ch) {
+		return scanForward(position, bound, new CharacterMatch(ch));
+	}
+
+	/**
+	 * Finds the lowest position in <code>fDocument</code> such that the
+	 * position is &gt;= <code>position</code> and &lt; <code>bound</code>
+	 * and <code>fDocument.getChar(position) == ch</code> evaluates to
+	 * <code>true</code> for at least one ch in <code>chars</code> and the
+	 * position is in the default partition.
+	 * 
+	 * @param position
+	 *            the first character position in <code>fDocument</code> to
+	 *            be considered
+	 * @param bound
+	 *            the first position in <code>fDocument</code> to not
+	 *            consider any more, with <code>bound</code> &gt;
+	 *            <code>position</code>, or <code>UNBOUND</code>
+	 * @param chars
+	 *            an array of <code>char</code> to search for
+	 * @return the lowest position of a non-whitespace character in [<code>position</code>,
+	 *         <code>bound</code>) that resides in a Java partition, or
+	 *         <code>NOT_FOUND</code> if none can be found
+	 */
+	public int scanForward(int position, int bound, char[] chars) {
+		return scanForward(position, bound, new CharacterMatch(chars));
+	}
+
+	/**
+	 * Finds the highest position <code>p</code> in <code>fDocument</code>
+	 * such that <code>bound</code> &lt; <code>p</code> &lt;=
+	 * <code>start</code> and
+	 * <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to
+	 * <code>true</code>.
+	 * 
+	 * @param start
+	 *            the first character position in <code>fDocument</code> to
+	 *            be considered
+	 * @param bound
+	 *            the first position in <code>fDocument</code> to not
+	 *            consider any more, with <code>bound</code> &lt;
+	 *            <code>start</code>, or <code>UNBOUND</code>
+	 * @param condition
+	 *            the <code>StopCondition</code> to check
+	 * @return the highest position in (<code>bound</code>,
+	 *         <code>start</code> for which <code>condition</code> holds,
+	 *         or <code>NOT_FOUND</code> if none can be found
+	 */
+	public int scanBackward(int start, int bound, StopCondition condition) {
+		if (bound == UNBOUND)
+			bound = -1;
+
+		Assert.isTrue(bound >= -1);
+		Assert.isTrue(start < fDocument.getLength());
+
+		try {
+			fPos = start;
+			while (fPos > bound) {
+
+				fChar = fDocument.getChar(fPos);
+				if (condition.stop(fChar, fPos, false))
+					return fPos;
+
+				fPos = condition.nextPosition(fPos, false);
+			}
+		}
+		catch (BadLocationException e) {
+		}
+		return NOT_FOUND;
+	}
+
+	/**
+	 * Finds the highest position in <code>fDocument</code> such that the
+	 * position is &lt;= <code>position</code> and &gt; <code>bound</code>
+	 * and <code>fDocument.getChar(position) == ch</code> evaluates to
+	 * <code>true</code> for at least one ch in <code>chars</code> and the
+	 * position is in the default partition.
+	 * 
+	 * @param position
+	 *            the first character position in <code>fDocument</code> to
+	 *            be considered
+	 * @param bound
+	 *            the first position in <code>fDocument</code> to not
+	 *            consider any more, with <code>bound</code> &lt;
+	 *            <code>position</code>, or <code>UNBOUND</code>
+	 * @param ch
+	 *            the <code>char</code> to search for
+	 * @return the highest position of one element in <code>chars</code> in (<code>bound</code>,
+	 *         <code>position</code>] that resides in a Java partition, or
+	 *         <code>NOT_FOUND</code> if none can be found
+	 */
+	public int scanBackward(int position, int bound, char ch) {
+		return scanBackward(position, bound, new CharacterMatch(ch));
+	}
+
+	/**
+	 * Finds the highest position in <code>fDocument</code> such that the
+	 * position is &lt;= <code>position</code> and &gt; <code>bound</code>
+	 * and <code>fDocument.getChar(position) == ch</code> evaluates to
+	 * <code>true</code> for at least one ch in <code>chars</code> and the
+	 * position is in the default partition.
+	 * 
+	 * @param position
+	 *            the first character position in <code>fDocument</code> to
+	 *            be considered
+	 * @param bound
+	 *            the first position in <code>fDocument</code> to not
+	 *            consider any more, with <code>bound</code> &lt;
+	 *            <code>position</code>, or <code>UNBOUND</code>
+	 * @param chars
+	 *            an array of <code>char</code> to search for
+	 * @return the highest position of one element in <code>chars</code> in (<code>bound</code>,
+	 *         <code>position</code>] that resides in a Java partition, or
+	 *         <code>NOT_FOUND</code> if none can be found
+	 */
+	public int scanBackward(int position, int bound, char[] chars) {
+		return scanBackward(position, bound, new CharacterMatch(chars));
+	}
+
+	/**
+	 * Checks whether <code>position</code> resides in a default (Java)
+	 * partition of <code>fDocument</code>.
+	 * 
+	 * @param position
+	 *            the position to be checked
+	 * @return <code>true</code> if <code>position</code> is in the
+	 *         default partition of <code>fDocument</code>,
+	 *         <code>false</code> otherwise
+	 */
+	public boolean isDefaultPartition(int position) {
+		Assert.isTrue(position >= 0);
+		Assert.isTrue(position <= fDocument.getLength());
+
+		try {
+			return fPartition.equals(TextUtilities.getContentType(fDocument, fPartitioning, position, false));
+		}
+		catch (BadLocationException e) {
+			return false;
+		}
+	}
+
+	/**
+	 * Returns the partition at <code>position</code>.
+	 * 
+	 * @param position
+	 *            the position to get the partition for
+	 * @return the partition at <code>position</code> or a dummy zero-length
+	 *         partition if accessing the document fails
+	 */
+	private ITypedRegion getPartition(int position) {
+		Assert.isTrue(position >= 0);
+		Assert.isTrue(position <= fDocument.getLength());
+
+		try {
+			return TextUtilities.getPartition(fDocument, fPartitioning, position, false);
+		}
+		catch (BadLocationException e) {
+			return new TypedRegion(position, 0, "__no_partition_at_all"); //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * Checks if the line seems to be an open condition not followed by a
+	 * block (i.e. an if, while, or for statement with just one following
+	 * statement, see example below).
+	 * 
+	 * <pre>
+	 * if (condition)
+	 * 	doStuff();
+	 * </pre>
+	 * 
+	 * <p>
+	 * Algorithm: if the last non-WS, non-Comment code on the line is an if
+	 * (condition), while (condition), for( expression), do, else, and there
+	 * is no statement after that
+	 * </p>
+	 * 
+	 * @param position
+	 *            the insert position of the new character
+	 * @param bound
+	 *            the lowest position to consider
+	 * @return <code>true</code> if the code is a conditional statement or
+	 *         loop without a block, <code>false</code> otherwise
+	 */
+	public boolean isBracelessBlockStart(int position, int bound) {
+		if (position < 1)
+			return false;
+
+		switch (previousToken(position, bound)) {
+			case TokenDO :
+			case TokenELSE :
+				return true;
+			case TokenRPAREN :
+				position = findOpeningPeer(fPos, LPAREN, RPAREN);
+				if (position > 0) {
+					switch (previousToken(position - 1, bound)) {
+						case TokenIF :
+						case TokenFOR :
+						case TokenWHILE :
+							return true;
+					}
+				}
+		}
+
+		return false;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaPairMatcher.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaPairMatcher.java
new file mode 100644
index 0000000..020769f
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaPairMatcher.java
@@ -0,0 +1,277 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.text;
+
+// taken from package org.eclipse.jdt.ui.text;
+
+import java.io.IOException;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.source.ICharacterPairMatcher;
+
+class JavaPairMatcher implements ICharacterPairMatcher {
+
+	protected char[] fPairs;
+	protected IDocument fDocument;
+	protected int fOffset;
+
+	protected int fStartPos;
+	protected int fEndPos;
+	protected int fAnchor;
+
+	protected JavaCodeReader fReader = new JavaCodeReader();
+	/**
+	 * Stores the source version state.
+	 * 
+	 * @see Eclipse  3.1
+	 */
+	private boolean fHighlightAngularBrackets = false;
+
+
+	public JavaPairMatcher(char[] pairs) {
+		fPairs = pairs;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#match(org.eclipse.jface.text.IDocument,
+	 *      int)
+	 */
+	public IRegion match(IDocument document, int offset) {
+		fOffset = offset;
+
+		if(offset < 0 || offset >= document.getLength())
+			return null;
+
+		fDocument = document;
+
+		if (fDocument != null && matchPairsAt() && fStartPos != fEndPos)
+			return new Region(fStartPos, fEndPos - fStartPos + 1);
+
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#getAnchor()
+	 */
+	public int getAnchor() {
+		return fAnchor;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#dispose()
+	 */
+	public void dispose() {
+		clear();
+		fDocument = null;
+		fReader = null;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#clear()
+	 */
+	public void clear() {
+		if (fReader != null) {
+			try {
+				fReader.close();
+			}
+			catch (IOException x) {
+				// ignore
+			}
+		}
+	}
+
+	protected boolean matchPairsAt() {
+
+		int i;
+		int pairIndex1 = fPairs.length;
+		int pairIndex2 = fPairs.length;
+
+		fStartPos = -1;
+		fEndPos = -1;
+
+		// get the chars preceding and following the start position
+		try {
+
+			char prevChar = fDocument.getChar(Math.max(fOffset - 1, 0));
+			// modified behavior for
+			// http://dev.eclipse.org/bugs/show_bug.cgi?id=16879
+			// char nextChar= fDocument.getChar(fOffset);
+
+			// search for opening peer character next to the activation point
+			for (i = 0; i < fPairs.length; i = i + 2) {
+				// if (nextChar == fPairs[i]) {
+				// fStartPos= fOffset;
+				// pairIndex1= i;
+				// } else
+				if (prevChar == fPairs[i]) {
+					fStartPos = fOffset - 1;
+					pairIndex1 = i;
+				}
+			}
+
+			// search for closing peer character next to the activation point
+			for (i = 1; i < fPairs.length; i = i + 2) {
+				if (prevChar == fPairs[i]) {
+					fEndPos = fOffset - 1;
+					pairIndex2 = i;
+				}
+				// else if (nextChar == fPairs[i]) {
+				// fEndPos= fOffset;
+				// pairIndex2= i;
+				// }
+			}
+
+			if (fEndPos > -1) {
+				fAnchor = RIGHT;
+				fStartPos = searchForOpeningPeer(fEndPos, fPairs[pairIndex2 - 1], fPairs[pairIndex2], fDocument);
+				if (fStartPos > -1)
+					return true;
+				else
+					fEndPos = -1;
+			}
+			else if (fStartPos > -1) {
+				fAnchor = LEFT;
+				fEndPos = searchForClosingPeer(fStartPos, fPairs[pairIndex1], fPairs[pairIndex1 + 1], fDocument);
+				if (fEndPos > -1)
+					return true;
+				else
+					fStartPos = -1;
+			}
+
+		}
+		catch (BadLocationException x) {
+		}
+		catch (IOException x) {
+		}
+
+		return false;
+	}
+
+	protected int searchForClosingPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
+		if (openingPeer == '<' && !(fHighlightAngularBrackets && isTypeParameterBracket(offset, document)))
+			return -1;
+
+		fReader.configureForwardReader(document, offset + 1, document.getLength(), true, true);
+
+		int stack = 1;
+		int c = fReader.read();
+		while (c != JavaCodeReader.EOF) {
+			if (c == openingPeer && c != closingPeer)
+				stack++;
+			else if (c == closingPeer)
+				stack--;
+
+			if (stack == 0)
+				return fReader.getOffset();
+
+			c = fReader.read();
+		}
+
+		return -1;
+	}
+
+
+	protected int searchForOpeningPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
+		if (openingPeer == '<' && !fHighlightAngularBrackets)
+			return -1;
+
+		fReader.configureBackwardReader(document, offset, true, true);
+
+		int stack = 1;
+		int c = fReader.read();
+		while (c != JavaCodeReader.EOF) {
+			if (c == closingPeer && c != openingPeer)
+				stack++;
+			else if (c == openingPeer)
+				stack--;
+
+			if (stack == 0) {
+				if (closingPeer == '>' && !isTypeParameterBracket(fReader.getOffset(), document))
+					return -1;
+				return fReader.getOffset();
+			}
+
+			c = fReader.read();
+		}
+
+		return -1;
+	}
+
+	/**
+	 * Checks if the angular bracket at <code>offset</code> is a type
+	 * parameter bracket.
+	 * 
+	 * @param offset
+	 *            the offset of the opening bracket
+	 * @param document
+	 *            the document
+	 * @return <code>true</code> if the bracket is part of a type parameter,
+	 *         <code>false</code> otherwise
+	 * @see Eclipse  3.1
+	 */
+	private boolean isTypeParameterBracket(int offset, IDocument document) {
+		/*
+		 * type parameter come after braces (closing or opening), semicolons,
+		 * or after a Type name (heuristic: starts with capital character, or
+		 * after a modifier keyword in a method declaration (visibility,
+		 * static, synchronized, final)
+		 */
+
+		try {
+			IRegion line = document.getLineInformationOfOffset(offset);
+
+			JavaHeuristicScanner scanner = new JavaHeuristicScanner(document);
+			int prevToken = scanner.previousToken(offset - 1, line.getOffset());
+			int prevTokenOffset = scanner.getPosition() + 1;
+			String previous = prevToken == Symbols.TokenEOF ? null : document.get(prevTokenOffset, offset - prevTokenOffset).trim();
+
+			if (prevToken == Symbols.TokenLBRACE || prevToken == Symbols.TokenRBRACE || prevToken == Symbols.TokenSEMICOLON || prevToken == Symbols.TokenSYNCHRONIZED || prevToken == Symbols.TokenSTATIC || (prevToken == Symbols.TokenIDENT && isTypeParameterIntroducer(previous)) || prevToken == Symbols.TokenEOF)
+				return true;
+		}
+		catch (BadLocationException e) {
+			return false;
+		}
+
+		return false;
+	}
+
+	/**
+	 * Returns <code>true</code> if <code>identifier</code> is an
+	 * identifier that could come right before a type parameter list. It uses
+	 * a heuristic: if the identifier starts with an upper case, it is assumed
+	 * a type name. Also, if <code>identifier</code> is a method modifier,
+	 * it is assumed that the angular bracket is part of the generic type
+	 * parameter of a method.
+	 * 
+	 * @param identifier
+	 *            the identifier to check
+	 * @return <code>true</code> if the identifier could introduce a type
+	 *         parameter list
+	 * @see Eclipse  3.1
+	 */
+	private boolean isTypeParameterIntroducer(String identifier) {
+		return identifier.length() > 0 && (Character.isUpperCase(identifier.charAt(0)) || identifier.startsWith("final") //$NON-NLS-1$
+					|| identifier.startsWith("public") //$NON-NLS-1$
+					|| identifier.startsWith("public") //$NON-NLS-1$
+					|| identifier.startsWith("protected") //$NON-NLS-1$
+		|| identifier.startsWith("private")); //$NON-NLS-1$
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/Symbols.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/Symbols.java
new file mode 100644
index 0000000..1b203e3
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/Symbols.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.text;
+
+// taken from package org.eclipse.jdt.ui.text;
+
+/**
+ * Symbols for the heuristic java scanner.
+ * 
+ * @see Eclipse 3.0
+ */
+interface Symbols {
+	int TokenEOF = -1;
+	int TokenLBRACE = 1;
+	int TokenRBRACE = 2;
+	int TokenLBRACKET = 3;
+	int TokenRBRACKET = 4;
+	int TokenLPAREN = 5;
+	int TokenRPAREN = 6;
+	int TokenSEMICOLON = 7;
+	int TokenOTHER = 8;
+	int TokenCOLON = 9;
+	int TokenQUESTIONMARK = 10;
+	int TokenCOMMA = 11;
+	int TokenEQUAL = 12;
+	int TokenLESSTHAN = 13;
+	int TokenGREATERTHAN = 14;
+	int TokenIF = 109;
+	int TokenDO = 1010;
+	int TokenFOR = 1011;
+	int TokenTRY = 1012;
+	int TokenCASE = 1013;
+	int TokenELSE = 1014;
+	int TokenBREAK = 1015;
+	int TokenCATCH = 1016;
+	int TokenWHILE = 1017;
+	int TokenRETURN = 1018;
+	int TokenSTATIC = 1019;
+	int TokenSWITCH = 1020;
+	int TokenFINALLY = 1021;
+	int TokenSYNCHRONIZED = 1022;
+	int TokenGOTO = 1023;
+	int TokenDEFAULT = 1024;
+	int TokenNEW = 1025;
+	int TokenCLASS = 1026;
+	int TokenINTERFACE = 1027;
+	int TokenENUM = 1028;
+	int TokenIDENT = 2000;
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupport.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupport.java
new file mode 100644
index 0000000..fa1ab95
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupport.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.wizard;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * This class encapsulates any used Module Core and Facets APIs along with
+ * fallbacks for use on non-compliant projects and when those services are not
+ * available at runtime.
+ * 
+ * Because ModuleCore API calls can result in locks needing to be acquired,
+ * none of these methods should be called while other thread locks have
+ * already been acquired.
+ */
+final class FacetModuleCoreSupport {
+	static final boolean _dump_NCDFE = false;
+
+	/**
+	 * @param project
+	 * @return the IPath to the "root" of the web contents
+	 */
+	public static IPath getWebContentRootPath(IProject project) {
+		if (project == null)
+			return null;
+		IPath path = null;
+		try {
+			path = FacetModuleCoreSupportDelegate.getWebContentRootPath(project);
+		}
+		catch (NoClassDefFoundError e) {
+			if (_dump_NCDFE)
+				e.printStackTrace();
+		}
+		return path;
+	}
+
+	/**
+	 * @param project
+	 * @return
+	 * @throws org.eclipse.core.runtime.CoreException
+	 */
+	public static boolean isWebProject(IProject project) {
+		if (project == null)
+			return false;
+		try {
+			return FacetModuleCoreSupportDelegate.isWebProject(project);
+		}
+		catch (NoClassDefFoundError e) {
+			if (_dump_NCDFE)
+				e.printStackTrace();
+		}
+		return true;
+	}
+
+
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupportDelegate.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupportDelegate.java
new file mode 100644
index 0000000..ab5484e
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupportDelegate.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.wizard;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.html.ui.internal.Logger;
+
+/**
+ * Wrapper class for all Facet-related calls. If the Facet or ModuleCore
+ * bundles are not available, this class will not load, or if it does, its
+ * methods will cause NoClassDefFoundErrors. This allows us to
+ * compartmentalize the dependencies.
+ * 
+ */
+final class FacetModuleCoreSupportDelegate {
+	/**
+	 * Copied to avoid unneeded extra dependency (plus it's unclear why the
+	 * value is in that plug-in).
+	 * 
+	 * @see org.eclipse.wst.common.componentcore.internal.util.IModuleConstants.JST_WEB_MODULE
+	 */
+	private final static String JST_WEB_MODULE = "jst.web"; //$NON-NLS-1$
+
+	private final static String WST_WEB_MODULE = "wst.web"; //$NON-NLS-1$
+
+	/**
+	 * @param project
+	 * @return the IPath to the "root" of the web contents
+	 */
+	static IPath getWebContentRootPath(IProject project) {
+		if (!ModuleCoreNature.isFlexibleProject(project))
+			return project.getFullPath();
+
+		IPath path = null;
+		IVirtualComponent component = ComponentCore.createComponent(project);
+		if (component != null && component.exists()) {
+			path = component.getRootFolder().getWorkspaceRelativePath();
+		}
+		else {
+			path = project.getFullPath();
+		}
+		return path;
+	}
+
+	/**
+	 * @param project
+	 * @return
+	 * @throws CoreException
+	 */
+	static boolean isWebProject(IProject project) {
+		boolean is = false;
+		try {
+			IFacetedProject faceted = ProjectFacetsManager.create(project);
+			if (ProjectFacetsManager.isProjectFacetDefined(JST_WEB_MODULE)) {
+				IProjectFacet facet = ProjectFacetsManager.getProjectFacet(JST_WEB_MODULE);
+				is = is || (faceted != null && faceted.hasProjectFacet(facet));
+			}
+			if (ProjectFacetsManager.isProjectFacetDefined(WST_WEB_MODULE)) {
+				IProjectFacet facet = ProjectFacetsManager.getProjectFacet(WST_WEB_MODULE);
+				is = is || (faceted != null && faceted.hasProjectFacet(facet));
+			}
+		}
+		catch (CoreException e) {
+			Logger.logException(e);
+		}
+		return is;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLFileWizardPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLFileWizardPage.java
new file mode 100644
index 0000000..110d800
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLFileWizardPage.java
@@ -0,0 +1,224 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.wizard;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
+import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
+import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+
+class NewHTMLFileWizardPage extends WizardNewFileCreationPage {
+
+	private IContentType fContentType;
+	private List fValidExtensions = null;
+	
+	public NewHTMLFileWizardPage(String pageName, IStructuredSelection selection) {
+        super(pageName, selection);
+    }
+	
+	/**
+	 * This method is overriden to set the selected folder to web contents 
+	 * folder if the current selection is outside the web contents folder. 
+	 */
+	protected void initialPopulateContainerNameField() {
+		super.initialPopulateContainerNameField();
+		
+		IPath fullPath = getContainerFullPath();
+		IProject project = getProjectFromPath(fullPath);
+		IPath webContentPath = getWebContentPath(project);
+		
+		if (webContentPath != null && !webContentPath.isPrefixOf(fullPath)) {
+			setContainerFullPath(webContentPath);
+		}
+	}
+	
+	/**
+	 * This method is overriden to set additional validation specific to 
+	 * html files. 
+	 */
+	protected boolean validatePage() {
+		setMessage(null);
+		setErrorMessage(null);
+		
+		if (!super.validatePage()) {
+			return false;
+		}
+		
+		String fileName = getFileName();
+		IPath fullPath = getContainerFullPath();
+		if ((fullPath != null) && (fullPath.isEmpty() == false) && (fileName != null)) {
+			// check that filename does not contain invalid extension
+			if (!extensionValidForContentType(fileName)) {
+				setErrorMessage(NLS.bind(HTMLUIMessages._ERROR_FILENAME_MUST_END_HTML, getValidExtensions().toString()));
+				return false;
+			}
+			// no file extension specified so check adding default
+			// extension doesn't equal a file that already exists
+			if (fileName.lastIndexOf('.') == -1) {
+				String newFileName = addDefaultExtension(fileName);
+				IPath resourcePath = fullPath.append(newFileName);
+
+				IWorkspace workspace = ResourcesPlugin.getWorkspace();
+				IStatus result = workspace.validatePath(resourcePath.toString(), IResource.FOLDER);
+				if (!result.isOK()) {
+					// path invalid
+					setErrorMessage(result.getMessage());
+					return false;
+				}
+
+				if ((workspace.getRoot().getFolder(resourcePath).exists() || workspace.getRoot().getFile(resourcePath).exists())) {
+					setErrorMessage(HTMLUIMessages.ResourceGroup_nameExists);
+					return false;
+				}
+			}
+			
+			// get the IProject for the selection path
+			IProject project = getProjectFromPath(fullPath);
+			// if inside web project, check if inside webContent folder
+			if (project != null && isWebProject(project)) {
+				// check that the path is inside the webContent folder
+				IPath webContentPath = getWebContentPath(project);
+				if (!webContentPath.isPrefixOf(fullPath)) {
+					setMessage(HTMLUIMessages._WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT, WARNING);
+				}
+			}
+		}
+
+		return true;
+	}
+	
+	/**
+	 * Get content type associated with this new file wizard
+	 * 
+	 * @return IContentType
+	 */
+	private IContentType getContentType() {
+		if (fContentType == null)
+			fContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForHTML.ContentTypeID_HTML);
+		return fContentType;
+	}
+
+	/**
+	 * Get list of valid extensions for HTML Content type
+	 * 
+	 * @return
+	 */
+	private List getValidExtensions() {
+		if (fValidExtensions == null) {
+			IContentType type = getContentType();
+			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
+		}
+		return fValidExtensions;
+	}
+	
+	/**
+	 * Verifies if fileName is valid name for content type. Takes base content
+	 * type into consideration.
+	 * 
+	 * @param fileName
+	 * @return true if extension is valid for this content type
+	 */
+	private boolean extensionValidForContentType(String fileName) {
+		boolean valid = false;
+
+		IContentType type = getContentType();
+		// there is currently an extension
+		if (fileName.lastIndexOf('.') != -1) {
+			// check what content types are associated with current extension
+			IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
+			int i = 0;
+			while (i < types.length && !valid) {
+				valid = types[i].isKindOf(type);
+				++i;
+			}
+		}
+		else
+			valid = true; // no extension so valid
+		return valid;
+	}
+
+	/**
+	 * Adds default extension to the filename
+	 * 
+	 * @param filename
+	 * @return
+	 */
+	String addDefaultExtension(String filename) {
+		StringBuffer newFileName = new StringBuffer(filename);
+
+		Preferences preference = HTMLCorePlugin.getDefault().getPluginPreferences();
+		String ext = preference.getString(HTMLCorePreferenceNames.DEFAULT_EXTENSION);
+
+		newFileName.append("."); //$NON-NLS-1$
+		newFileName.append(ext);
+
+		return newFileName.toString();
+	}
+	
+	/**
+	 * Returns the project that contains the specified path
+	 * 
+	 * @param path the path which project is needed
+	 * @return IProject object. If path is <code>null</code> the return value 
+	 * 		   is also <code>null</code>. 
+	 */
+	private IProject getProjectFromPath(IPath path) {
+		IWorkspace workspace = ResourcesPlugin.getWorkspace();
+		IProject project = null;
+		
+		if (path != null) {
+			if (workspace.validatePath(path.toString(), IResource.PROJECT).isOK()) {
+				project = workspace.getRoot().getProject(path.toString());
+			} else {
+				project = workspace.getRoot().getFile(path).getProject();
+			}
+		}
+		
+		return project;
+	}
+	
+	/**
+	 * Checks if the specified project is a web project. 
+	 * 
+	 * @param project project to be checked
+	 * @return true if the project is web project, otherwise false
+	 */
+	private boolean isWebProject(IProject project) {
+		return FacetModuleCoreSupport.isWebProject(project);
+	}
+	
+	/**
+	 * Returns the web contents folder of the specified project
+	 * 
+	 * @param project the project which web contents path is needed
+	 * @return IPath of the web contents folder
+	 */
+	private IPath getWebContentPath(IProject project) {
+		return FacetModuleCoreSupport.getWebContentRootPath(project);
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java
new file mode 100644
index 0000000..115042e
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java
@@ -0,0 +1,521 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.wizard;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.jface.text.templates.DocumentTemplateContext;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateBuffer;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
+import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.Logger;
+import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
+import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+
+/**
+ * Templates page in new file wizard. Allows users to select a new file
+ * template to be applied in new file.
+ * 
+ */
+public class NewHTMLTemplatesWizardPage extends WizardPage {
+
+	/**
+	 * Content provider for templates
+	 */
+	private class TemplateContentProvider implements IStructuredContentProvider {
+		/** The template store. */
+		private TemplateStore fStore;
+
+		/*
+		 * @see IContentProvider#dispose()
+		 */
+		public void dispose() {
+			fStore = null;
+		}
+
+		/*
+		 * @see IStructuredContentProvider#getElements(Object)
+		 */
+		public Object[] getElements(Object input) {
+			return fStore.getTemplates(TemplateContextTypeIdsHTML.NEW);
+		}
+
+		/*
+		 * @see IContentProvider#inputChanged(Viewer, Object, Object)
+		 */
+		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+			fStore = (TemplateStore) newInput;
+		}
+	}
+
+	/**
+	 * Label provider for templates.
+	 */
+	private class TemplateLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+		/*
+		 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object,
+		 *      int)
+		 */
+		public Image getColumnImage(Object element, int columnIndex) {
+			return null;
+		}
+
+		/*
+		 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
+		 *      int)
+		 */
+		public String getColumnText(Object element, int columnIndex) {
+			Template template = (Template) element;
+
+			switch (columnIndex) {
+				case 0 :
+					return template.getName();
+				case 1 :
+					return template.getDescription();
+				default :
+					return ""; //$NON-NLS-1$
+			}
+		}
+	}
+
+	/** Last selected template name */
+	private String fLastSelectedTemplateName;
+	/** The viewer displays the pattern of selected template. */
+	private SourceViewer fPatternViewer;
+	/** The table presenting the templates. */
+	private TableViewer fTableViewer;
+	/** Template store used by this wizard page */
+	private TemplateStore fTemplateStore;
+	/** Checkbox for using templates. */
+	private Button fUseTemplateButton;
+
+	public NewHTMLTemplatesWizardPage() {
+		super("NewHTMLTemplatesWizardPage", HTMLUIMessages.NewHTMLTemplatesWizardPage_0, null); //$NON-NLS-1$
+		setDescription(HTMLUIMessages.NewHTMLTemplatesWizardPage_1);
+	}
+
+	/**
+	 * Correctly resizes the table so no phantom columns appear
+	 * 
+	 * @param parent
+	 *            the parent control
+	 * @param buttons
+	 *            the buttons
+	 * @param table
+	 *            the table
+	 * @param column1
+	 *            the first column
+	 * @param column2
+	 *            the second column
+	 * @param column3
+	 *            the third column
+	 */
+	private void configureTableResizing(final Composite parent, final Table table, final TableColumn column1, final TableColumn column2) {
+		parent.addControlListener(new ControlAdapter() {
+			public void controlResized(ControlEvent e) {
+				Rectangle area = parent.getClientArea();
+				Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+				int width = area.width - 2 * table.getBorderWidth();
+				if (preferredSize.y > area.height) {
+					// Subtract the scrollbar width from the total column
+					// width
+					// if a vertical scrollbar will be required
+					Point vBarSize = table.getVerticalBar().getSize();
+					width -= vBarSize.x;
+				}
+
+				Point oldSize = table.getSize();
+				if (oldSize.x > width) {
+					// table is getting smaller so make the columns
+					// smaller first and then resize the table to
+					// match the client area width
+					column1.setWidth(width / 2);
+					column2.setWidth(width / 2);
+					table.setSize(width, area.height);
+				}
+				else {
+					// table is getting bigger so make the table
+					// bigger first and then make the columns wider
+					// to match the client area width
+					table.setSize(width, area.height);
+					column1.setWidth(width / 2);
+					column2.setWidth(width / 2);
+				}
+			}
+		});
+	}
+
+	public void createControl(Composite ancestor) {
+		Composite parent = new Composite(ancestor, SWT.NONE);
+		GridLayout layout = new GridLayout();
+		layout.numColumns = 2;
+		parent.setLayout(layout);
+
+		// create checkbox for user to use HTML Template
+		fUseTemplateButton = new Button(parent, SWT.CHECK);
+		fUseTemplateButton.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_4);
+		GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
+		fUseTemplateButton.setLayoutData(data);
+		fUseTemplateButton.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				enableTemplates();
+			}
+		});
+
+		// create composite for Templates table
+		Composite innerParent = new Composite(parent, SWT.NONE);
+		GridLayout innerLayout = new GridLayout();
+		innerLayout.numColumns = 2;
+		innerLayout.marginHeight = 0;
+		innerLayout.marginWidth = 0;
+		innerParent.setLayout(innerLayout);
+		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
+		innerParent.setLayoutData(gd);
+
+		Label label = new Label(innerParent, SWT.NONE);
+		label.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_7);
+		data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
+		label.setLayoutData(data);
+
+		// create table that displays templates
+		Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
+
+		data = new GridData(GridData.FILL_BOTH);
+		data.widthHint = convertWidthInCharsToPixels(2);
+		data.heightHint = convertHeightInCharsToPixels(10);
+		data.horizontalSpan = 2;
+		table.setLayoutData(data);
+		table.setHeaderVisible(true);
+		table.setLinesVisible(true);
+		TableLayout tableLayout = new TableLayout();
+		table.setLayout(tableLayout);
+
+		TableColumn column1 = new TableColumn(table, SWT.NONE);
+		column1.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_2);
+
+		TableColumn column2 = new TableColumn(table, SWT.NONE);
+		column2.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_3);
+
+		fTableViewer = new TableViewer(table);
+		fTableViewer.setLabelProvider(new TemplateLabelProvider());
+		fTableViewer.setContentProvider(new TemplateContentProvider());
+
+		fTableViewer.setSorter(new ViewerSorter() {
+			public int compare(Viewer viewer, Object object1, Object object2) {
+				if ((object1 instanceof Template) && (object2 instanceof Template)) {
+					Template left = (Template) object1;
+					Template right = (Template) object2;
+					int result = left.getName().compareToIgnoreCase(right.getName());
+					if (result != 0)
+						return result;
+					return left.getDescription().compareToIgnoreCase(right.getDescription());
+				}
+				return super.compare(viewer, object1, object2);
+			}
+
+			public boolean isSorterProperty(Object element, String property) {
+				return true;
+			}
+		});
+
+		fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+			public void selectionChanged(SelectionChangedEvent e) {
+				updateViewerInput();
+			}
+		});
+
+		// create viewer that displays currently selected template's contents
+		fPatternViewer = doCreateViewer(parent);
+
+		fTemplateStore = HTMLUIPlugin.getDefault().getTemplateStore();
+		fTableViewer.setInput(fTemplateStore);
+
+		// Create linked text to just to templates preference page
+		Link link = new Link(parent, SWT.NONE);
+		link.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_6);
+		data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
+		link.setLayoutData(data);
+		link.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				linkClicked();
+			}
+		});
+
+		configureTableResizing(innerParent, table, column1, column2);
+		loadLastSavedPreferences();
+
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.HTML_NEWWIZARD_TEMPLATE_HELPID);
+		Dialog.applyDialogFont(parent);
+		setControl(parent);
+	}
+
+	/**
+	 * Creates, configures and returns a source viewer to present the template
+	 * pattern on the preference page. Clients may override to provide a
+	 * custom source viewer featuring e.g. syntax coloring.
+	 * 
+	 * @param parent
+	 *            the parent control
+	 * @return a configured source viewer
+	 */
+	private SourceViewer createViewer(Composite parent) {
+		SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
+			StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationHTML();
+
+			public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+				return baseConfiguration.getConfiguredContentTypes(sourceViewer);
+			}
+
+			public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
+				return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
+			}
+		};
+		SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForHTML.ContentTypeID_HTML);
+		IDocument document = scratchModel.getStructuredDocument();
+		viewer.configure(sourceViewerConfiguration);
+		viewer.setDocument(document);
+		return viewer;
+	}
+
+	private SourceViewer doCreateViewer(Composite parent) {
+		Label label = new Label(parent, SWT.NONE);
+		label.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_5);
+		GridData data = new GridData();
+		data.horizontalSpan = 2;
+		label.setLayoutData(data);
+
+		SourceViewer viewer = createViewer(parent);
+		viewer.setEditable(false);
+
+		Control control = viewer.getControl();
+		data = new GridData(GridData.FILL_BOTH);
+		data.horizontalSpan = 2;
+		data.heightHint = convertHeightInCharsToPixels(5);
+		// [261274] - source viewer was growing to fit the max line width of the template
+		data.widthHint = convertWidthInCharsToPixels(2);
+		control.setLayoutData(data);
+
+		return viewer;
+	}
+
+	/**
+	 * Enable/disable controls in page based on fUseTemplateButton's current
+	 * state.
+	 */
+	void enableTemplates() {
+		boolean enabled = fUseTemplateButton.getSelection();
+
+		if (!enabled) {
+			// save last selected template
+			Template template = getSelectedTemplate();
+			if (template != null)
+				fLastSelectedTemplateName = template.getName();
+			else
+				fLastSelectedTemplateName = ""; //$NON-NLS-1$
+
+			fTableViewer.setSelection(null);
+		}
+		else {
+			setSelectedTemplate(fLastSelectedTemplateName);
+		}
+
+		fTableViewer.getControl().setEnabled(enabled);
+		fPatternViewer.getControl().setEnabled(enabled);
+	}
+
+	/**
+	 * Return the template preference page id
+	 * 
+	 * @return
+	 */
+	private String getPreferencePageId() {
+		return "org.eclipse.wst.html.ui.preferences.templates"; //$NON-NLS-1$
+	}
+
+	/**
+	 * Get the currently selected template.
+	 * 
+	 * @return
+	 */
+	private Template getSelectedTemplate() {
+		Template template = null;
+		IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
+
+		if (selection.size() == 1) {
+			template = (Template) selection.getFirstElement();
+		}
+		return template;
+	}
+
+	/**
+	 * Returns template string to insert.
+	 * 
+	 * @return String to insert or null if none is to be inserted
+	 */
+	String getTemplateString() {
+		String templateString = null;
+
+		Template template = getSelectedTemplate();
+		if (template != null) {
+			TemplateContextType contextType = HTMLUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsHTML.NEW);
+			IDocument document = new Document();
+			TemplateContext context = new DocumentTemplateContext(contextType, document, 0, 0);
+			try {
+				TemplateBuffer buffer = context.evaluate(template);
+				templateString = buffer.getString();
+			}
+			catch (Exception e) {
+				Logger.log(Logger.WARNING_DEBUG, "Could not create template for new html", e); //$NON-NLS-1$
+			}
+		}
+
+		return templateString;
+	}
+
+	void linkClicked() {
+		String pageId = getPreferencePageId();
+		PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[]{pageId}, null);
+		dialog.open();
+		fTableViewer.refresh();
+	}
+
+	/**
+	 * Load the last template name used in New HTML File wizard.
+	 */
+	private void loadLastSavedPreferences() {
+		fLastSelectedTemplateName = ""; //$NON-NLS-1$
+		boolean setSelection = false;
+		String templateName = HTMLUIPlugin.getDefault().getPreferenceStore().getString(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
+		if (templateName == null || templateName.length() == 0) {
+			templateName = HTMLUIPlugin.getDefault().getPreferenceStore().getString(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_ID);
+			if (templateName != null && templateName.length() > 0) {
+				Template template = fTemplateStore.findTemplateById(templateName);
+				if (template != null) {
+					fLastSelectedTemplateName = template.getName();
+					setSelection = true;
+				}
+			}
+		}
+		else {
+			fLastSelectedTemplateName = templateName;
+			setSelection = true;
+		}
+		fUseTemplateButton.setSelection(setSelection);
+		enableTemplates();
+	}
+
+	/**
+	 * Save template name used for next call to New HTML File wizard.
+	 */
+	void saveLastSavedPreferences() {
+		String templateName = ""; //$NON-NLS-1$
+
+		Template template = getSelectedTemplate();
+		if (template != null) {
+			templateName = template.getName();
+		}
+
+		HTMLUIPlugin.getDefault().getPreferenceStore().setValue(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
+		HTMLUIPlugin.getDefault().savePluginPreferences();
+	}
+
+	/**
+	 * Select a template in the table viewer given the template name. If
+	 * template name cannot be found or templateName is null, just select
+	 * first item in table. If no items in table select nothing.
+	 * 
+	 * @param templateName
+	 */
+	private void setSelectedTemplate(String templateName) {
+		Object template = null;
+
+		if (templateName != null && templateName.length() > 0) {
+			// pick the last used template
+			template = fTemplateStore.findTemplate(templateName, TemplateContextTypeIdsHTML.NEW);
+		}
+
+		// no record of last used template so just pick first element
+		if (template == null) {
+			// just pick first element
+			template = fTableViewer.getElementAt(0);
+		}
+
+		if (template != null) {
+			IStructuredSelection selection = new StructuredSelection(template);
+			fTableViewer.setSelection(selection, true);
+		}
+	}
+
+	/**
+	 * Updates the pattern viewer.
+	 */
+	void updateViewerInput() {
+		Template template = getSelectedTemplate();
+		if (template != null) {
+			fPatternViewer.getDocument().set(template.getPattern());
+		}
+		else {
+			fPatternViewer.getDocument().set(""); //$NON-NLS-1$
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java
new file mode 100644
index 0000000..77c52f1
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.wizard;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStreamWriter;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.Logger;
+import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
+import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
+import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+
+public class NewHTMLWizard extends Wizard implements INewWizard {
+	
+	private NewHTMLFileWizardPage fNewFilePage;
+	private NewHTMLTemplatesWizardPage fNewFileTemplatesPage;
+	private IStructuredSelection fSelection;
+
+	public void addPages() {
+		fNewFilePage = new NewHTMLFileWizardPage("HTMLWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))); //$NON-NLS-1$
+		fNewFilePage.setTitle(HTMLUIMessages._UI_WIZARD_NEW_HEADING);
+		fNewFilePage.setDescription(HTMLUIMessages._UI_WIZARD_NEW_DESCRIPTION);
+		addPage(fNewFilePage);
+
+		fNewFileTemplatesPage = new NewHTMLTemplatesWizardPage();
+		addPage(fNewFileTemplatesPage);
+	}
+	
+	private String applyLineDelimiter(IFile file, String text) {
+		String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, System.getProperty("line.separator"), new IScopeContext[] {new ProjectScope(file.getProject()), new InstanceScope() });//$NON-NLS-1$
+		String convertedText = StringUtils.replace(text, "\r\n", "\n");
+		convertedText = StringUtils.replace(convertedText, "\r", "\n");
+		convertedText = StringUtils.replace(convertedText, "\n", lineDelimiter);
+		return convertedText;
+	}
+
+	public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
+		fSelection = aSelection;
+		setWindowTitle(HTMLUIMessages._UI_WIZARD_NEW_TITLE);
+
+		ImageDescriptor descriptor = HTMLEditorPluginImageHelper.getInstance().getImageDescriptor(HTMLEditorPluginImages.IMG_WIZBAN_NEWHTMLFILE);
+		setDefaultPageImageDescriptor(descriptor);
+	}
+
+	private void openEditor(final IFile file) {
+		if (file != null) {
+			getShell().getDisplay().asyncExec(new Runnable() {
+				public void run() {
+					try {
+						IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+						IDE.openEditor(page, file, true);
+					}
+					catch (PartInitException e) {
+						Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+					}
+				}
+			});
+		}
+	}
+
+	public boolean performFinish() {
+		boolean performedOK = false;
+		// save user options for next use
+		fNewFileTemplatesPage.saveLastSavedPreferences();
+
+		// no file extension specified so add default extension
+		String fileName = fNewFilePage.getFileName();
+		if (fileName.lastIndexOf('.') == -1) {
+			String newFileName = fNewFilePage.addDefaultExtension(fileName);
+			fNewFilePage.setFileName(newFileName);
+		}
+
+		// create a new empty file
+		IFile file = fNewFilePage.createNewFile();
+
+		// if there was problem with creating file, it will be null, so make
+		// sure to check
+		if (file != null) {
+			// put template contents into file
+			String templateString = fNewFileTemplatesPage.getTemplateString();
+			if (templateString != null) {
+				templateString = applyLineDelimiter(file, templateString);
+				// determine the encoding for the new file
+				Preferences preference = HTMLCorePlugin.getDefault().getPluginPreferences();
+				String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
+
+				try {
+					ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+					OutputStreamWriter outputStreamWriter = null;
+					if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
+						// just use default encoding
+						outputStreamWriter = new OutputStreamWriter(outputStream);
+					}
+					else {
+						outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
+					}
+					outputStreamWriter.write(templateString);
+					outputStreamWriter.flush();
+					outputStreamWriter.close();
+					ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
+					file.setContents(inputStream, true, false, null);
+					inputStream.close();
+				}
+				catch (Exception e) {
+					Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new HTML file", e); //$NON-NLS-1$
+				}
+			}
+
+			// open the file in editor
+			openEditor(file);
+
+			// everything's fine
+			performedOK = true;
+		}
+		return performedOK;
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLContentOutlineConfiguration.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLContentOutlineConfiguration.java
new file mode 100644
index 0000000..4214204
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLContentOutlineConfiguration.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.views.contentoutline;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.contentoutline.HTMLNodeActionManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
+import org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration;
+
+/**
+ * Configuration for outline view page which shows HTML content.
+ * 
+ * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
+ * @since 1.0
+ */
+public class HTMLContentOutlineConfiguration extends XMLContentOutlineConfiguration {
+
+	/**
+	 * Create new instance of HTMLContentOutlineConfiguration
+	 */
+	public HTMLContentOutlineConfiguration() {
+		// Must have empty constructor to createExecutableExtension
+		super();
+	}
+
+	protected XMLNodeActionManager createNodeActionManager(TreeViewer treeViewer) {
+		return new HTMLNodeActionManager((IStructuredModel) treeViewer.getInput(), treeViewer);
+	}
+
+	protected IPreferenceStore getPreferenceStore() {
+		return HTMLUIPlugin.getDefault().getPreferenceStore();
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties
new file mode 100644
index 0000000..cfa1c62
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties
@@ -0,0 +1,54 @@
+###############################################################################
+# Copyright (c) 2004, 2010 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+#     Benjamin Muskalla, b.muskalla@gmx.net - [156040] no new html template for xhtml 1.0 strict
+###############################################################################
+Templates.comment.name=comment
+Templates.comment.desc=comment
+Templates.ul.name=ul
+Templates.ul.desc=unordered list
+Templates.ul.content=<ul>\n  <li> Item one </li>\n  <li> Item two </li>\n</ul>\n
+Templates.dl.name=dl
+Templates.dl.desc=definition list
+Templates.dl.content=<dl>\n  <dt> First definition</dt>  <dd>  First explanation</dd>\n  <dt> Second definition</dt> <dd> Second explanation</dd>\n</dl>\n
+Templates.table.name=table
+Templates.table.desc=table
+Templates.table.content=<table>\n  <tr>\n    <th>Column 1 Heading</th>\n    <th>Column 2 Heading</th>\n  </tr>\n  <tr>\n    <td>Row 1: Col 1</td>\n    <td>Row 1: Col 2</td>\n  </tr>\n</table>\n
+Templates.ol.name=ol
+Templates.ol.desc=ordered list
+Templates.ol.content=<ol>\n  <li> Item one </li>\n  <li> Item two </li>\n</ol>\n
+Templates.html.name=New HTML File (4.01 transitional)
+Templates.html.desc=html 4.01 transitional
+Templates.html.content=<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}">\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
+Templates.htmlframeset.name=New HTML File (4.01 frameset)
+Templates.htmlframeset.desc=html 4.01 frameset
+Templates.htmlframeset.content=<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">\n<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}">\n<title>Insert title here</title>\n</head>\n<frameset>\n    <frame>\n    <frame>\n    <noframes>\n    <body>\n    <p>This page uses frames. The current browser you are using does not support frames.</p>\n    </body>\n    </noframes>\n</frameset>\n</html>
+Templates.htmlstrict.name=New HTML File (4.01 strict)
+Templates.htmlstrict.desc=html 4.01 strict
+Templates.htmlstrict.content=<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">\n<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}">\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
+Templates.xhtml.name=New XHTML File (1.0 transitional)
+Templates.xhtml.desc=xhtml 1.0 transitional
+Templates.xhtml.content=<?xml version="1.0" encoding="${encoding}" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}" />\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
+Templates.xhtmlframeset.name=New XHTML File (1.0 frameset)
+Templates.xhtmlframeset.desc=xhtml 1.0 frameset
+Templates.xhtmlframeset.content=<?xml version="1.0" encoding="${encoding}" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}" />\n<title>Insert title here</title>\n</head>\n<frameset>\n    <frame />\n    <frame />\n    <noframes>\n    <body>\n    <p>This page uses frames. The current browser you are using does not support frames.</p>\n    </body>\n    </noframes>\n</frameset>\n</html>
+Templates.xhtmlstrict.name=New XHTML File (1.0 strict)
+Templates.xhtmlstrict.desc=xhtml 1.0 strict
+Templates.xhtmlstrict.content=<?xml version="1.0" encoding="${encoding}" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}" />\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
+Templates.script.name=script
+Templates.script.desc=script     (commented)
+Templates.script.content=<script type=\"${cursor}text/javascript\">\n<!--\n\n//-->\n</script>
+Templates.style.name=style
+Templates.style.desc=style     (commented)
+Templates.style.content=<style>\n<!--\n${cursor}\n-->\n</style>
+Templates.imgmap.name=img
+Templates.imgmap.desc=img     (map)
+Templates.html5.name=New HTML File (5)
+Templates.html5.desc=html 5
+Templates.html5.content=<!DOCTYPE html>\n<html>\n<head>\n<meta charset="${encoding}">\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml
new file mode 100644
index 0000000..c600c08
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Benjamin Muskalla, b.muskalla@gmx.net - [156040] no new html template for xhtml 1.0 strict
+ *     
+ *******************************************************************************/
+ -->
+<templates>
+
+<template name="%Templates.comment.name" description="%Templates.comment.desc" id="org.eclipse.wst.html.ui.templates.comment" context="html_tag" enabled="true">&lt;!-- ${cursor} --&gt;</template>
+
+<template name="%Templates.imgmap.name" description="%Templates.imgmap.desc" id="org.eclipse.wst.html.ui.templates.imgmap" context="html_tag" enabled="true">&lt;img ismap&gt;</template>
+
+<template name="%Templates.ul.name" description="%Templates.ul.desc" id="org.eclipse.wst.html.ui.templates.ul" context="html_tag" enabled="true">%Templates.ul.content</template>
+
+<template name="%Templates.dl.name" description="%Templates.dl.desc" id="org.eclipse.wst.html.ui.templates.dl" context="html_tag" enabled="true">%Templates.dl.content</template>
+
+<template name="%Templates.table.name" description="%Templates.table.desc" id="org.eclipse.wst.html.ui.templates.table" context="html_tag" enabled="true">%Templates.table.content</template>
+
+<template name="%Templates.ol.name" description="%Templates.ol.desc" id="org.eclipse.wst.html.ui.templates.ol" context="html_tag" enabled="true">%Templates.ol.content</template>
+
+<template name="%Templates.html.name" description="%Templates.html.desc" id="org.eclipse.wst.html.ui.templates.html" context="html_new" enabled="true">%Templates.html.content</template>
+
+<template name="%Templates.htmlframeset.name" description="%Templates.htmlframeset.desc" id="org.eclipse.wst.html.ui.templates.htmlframeset" context="html_new" enabled="true">%Templates.htmlframeset.content</template>
+
+<template name="%Templates.htmlstrict.name" description="%Templates.htmlstrict.desc" id="org.eclipse.wst.html.ui.templates.htmlstrict" context="html_new" enabled="true">%Templates.htmlstrict.content</template>
+
+<template name="%Templates.xhtml.name" description="%Templates.xhtml.desc" id="org.eclipse.wst.html.ui.templates.xhtml" context="html_new" enabled="true">%Templates.xhtml.content</template>
+
+<template name="%Templates.xhtmlframeset.name" description="%Templates.xhtmlframeset.desc" id="org.eclipse.wst.html.ui.templates.xhtmlframeset" context="html_new" enabled="true">%Templates.xhtmlframeset.content</template>
+
+<template name="%Templates.xhtmlstrict.name" description="%Templates.xhtmlstrict.desc" id="org.eclipse.wst.html.ui.templates.xhtmlstrict" context="html_new" enabled="true">%Templates.xhtmlstrict.content</template>
+
+<template name="%Templates.script.name" description="%Templates.script.desc" id="org.eclipse.wst.html.ui.templates.script" context="html_tag" enabled="true">%Templates.script.content</template>
+
+<template name="%Templates.style.name" description="%Templates.style.desc" id="org.eclipse.wst.html.ui.templates.style" context="html_tag" enabled="true">%Templates.style.content</template>
+
+<template name="%Templates.html5.name" description="%Templates.html5.desc" id="org.eclipse.wst.html.ui.templates.html5" context="html_new" enabled="true">%Templates.html5.content</template>
+
+</templates>
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/.classpath b/bundles/org.eclipse.wst.jsdt.web.core/.classpath
new file mode 100644
index 0000000..52165ec
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/.options b/bundles/org.eclipse.wst.jsdt.web.core/.options
new file mode 100644
index 0000000..4ac5072
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/.options
@@ -0,0 +1,12 @@
+org.eclipse.wst.jsdt.web.core/debug=true
+org.eclipse.wst.jsdt.web.core/debug/tracefilter=
+org.eclipse.wst.jsdt.web.core/debug/jsindexmanager=false
+org.eclipse.wst.jsdt.web.core/debug/jstranslation=false
+org.eclipse.wst.jsdt.web.core/debug/jstranslationstodisk=false
+org.eclipse.wst.jsdt.web.core/debug/jssearch=false
+
+org.eclipse.wst.jsdt.web.core/taglib/resolve=false
+
+org.eclipse.wst.jsdt.web.core/debug/jsjavamapping=false
+
+org.eclipse.wst.jsdt.web.core/debug/jsvalidator=false
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/.project b/bundles/org.eclipse.wst.jsdt.web.core/.project
new file mode 100644
index 0000000..22cb875
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.wst.jsdt.web.core</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+	</natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.core.resources.prefs
similarity index 100%
copy from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs
copy to bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.core.resources.prefs
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.core.runtime.prefs
similarity index 100%
copy from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.runtime.prefs
copy to bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.core.runtime.prefs
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..6e07215
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,96 @@
+#Wed Oct 24 19:49:45 EDT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=ignore
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=ignore
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..c91d09d
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,51 @@
+#Wed Oct 24 19:41:31 EDT 2007
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=false
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=true
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=true
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.format_source_code=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=false
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=true
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=true
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_SSE Team Styles
+cleanup_settings_version=2
+eclipse.preferences.version=1
+internal.default.compliance=default
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.overrideannotation=false
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.ltk.core.refactoring.prefs
similarity index 100%
copy from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.ltk.core.refactoring.prefs
copy to bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.ltk.core.refactoring.prefs
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000..fc522bb
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,16 @@
+#Mon Apr 17 02:01:33 EDT 2006
+compilers.incompatible-environment=0
+compilers.p.build=0
+compilers.p.deprecated=1
+compilers.p.illegal-att-value=0
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=0
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.p.unused-element-or-attribute=0
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.web.core/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..48bb144
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/META-INF/MANIFEST.MF
@@ -0,0 +1,35 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.wst.jsdt.web.core;singleton:=true
+Bundle-Version: 1.0.302.qualifier
+Bundle-Activator: org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin
+Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Localization: plugin
+Export-Package: org.eclipse.wst.jsdt.web.core.internal,
+ org.eclipse.wst.jsdt.web.core.internal.modelhandler,
+ org.eclipse.wst.jsdt.web.core.internal.project;
+  uses:="org.eclipse.wst.common.project.facet.core,
+   org.eclipse.wst.jsdt.internal.core,
+   org.eclipse.wst.jsdt.core,
+   org.eclipse.core.resources,
+   org.eclipse.core.runtime",
+ org.eclipse.wst.jsdt.web.core.internal.provisional.contenttype,
+ org.eclipse.wst.jsdt.web.core.internal.validation,
+ org.eclipse.wst.jsdt.web.core.javascript,
+ org.eclipse.wst.jsdt.web.core.javascript.search,
+ org.eclipse.wst.jsdt.web.core.text
+Import-Package: com.ibm.icu.util; version="3.8"
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.filebuffers;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.validation;bundle-version="[1.2.100,2.0.0)",
+ org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.jsdt.core;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.0,2.0.0)";resolution:=optional,
+ org.eclipse.wst.common.modulecore;bundle-version="[1.1.0,2.0.0)";resolution:=optional
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.jsdt.web.core.internal.project"
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/about.html b/bundles/org.eclipse.wst.jsdt.web.core/about.html
new file mode 100644
index 0000000..4602330
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>June 2, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/build.properties b/bundles/org.eclipse.wst.jsdt.web.core/build.properties
new file mode 100644
index 0000000..0a4269e
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/build.properties
@@ -0,0 +1,20 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/
+bin.includes = .options,\
+               META-INF/,\
+               .,\
+               plugin.properties,\
+               plugin.xml,\
+               component.xml,\
+               about.html
+src.includes = component.xml
+              
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/component.xml b/bundles/org.eclipse.wst.jsdt.web.core/component.xml
new file mode 100644
index 0000000..0d66ac2
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/component.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.wst.jsdt.web">
+	<component-depends unrestricted="true" />
+	<plugin id="org.eclipse.wst.jsdt.web.core" fragment="false" />
+	<package name="org.eclipse.wst.jsdt.web.core.taglib" api="false">
+		<type name="IJarRecord" implement="false" />
+		<!-- <type name="ITagDirRecord" implement="false" /> -->
+		<!-- <type name="ITaglibIndexListener" implement="true" /> -->
+		<type name="ITaglibDescriptor" implement="false" />
+		<type name="ITaglibRecord" implement="false" />
+		<!-- <type name="ITaglibRecordEvent" implement="false" /> -->
+		<type name="ITLDRecord" implement="false" />
+		<type name="IURLRecord" implement="false" />
+		<type name="TaglibIndex" subclass="false" instantiate="false" />
+	</package>
+	<plugin id="org.eclipse.wst.jsdt.web.ui" fragment="false" />
+	<package name="org.eclipse.wst.jsdt.web.ui" api="false">
+		<type name="StructuredTextViewerConfigurationJSP" subclass="true" instantiate="true" />
+	</package>
+	<package name="org.eclipse.wst.jsdt.web.ui.views.contentoutline" api="false">
+		<type name="JSPContentOutlineConfiguration" subclass="true" instantiate="true" />
+	</package>
+	<plugin id="org.eclipse.wst.jsdt.web.ui.infopop" fragment="false" />
+	<description url="http://eclipse.org/webtools/jst/components/jsp/overview.html" />
+</component>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/plugin.properties b/bundles/org.eclipse.wst.jsdt.web.core/plugin.properties
new file mode 100644
index 0000000..f927b2c
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/plugin.properties
@@ -0,0 +1,22 @@
+###############################################################################
+# Copyright (c) 2000, 2010 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+
+pluginName= JavaScript Support
+providerName= Eclipse Web Tools Platform
+Bundle-Name.0 = JSDT Web Support Core 
+Bundle-Vendor.0 = Eclipse.org
+extension.name.0 = JavaScript Embedded
+extension.name.1 = Embedded JavaScript Builder
+extension-point.name.0 = JavaScript Pre Processing
+javascript.validator= Client-side JavaScript
+facet.label=JavaScript
+facet.description=Enables JavaScript development using multiple source files in a configurable Include Path.
+
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/plugin.xml b/bundles/org.eclipse.wst.jsdt.web.core/plugin.xml
new file mode 100644
index 0000000..97393f8
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/plugin.xml
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+   <extension-point id="javascriptPreProcessor" name="%extension-point.name.0" schema="schema/javascriptPreProcessor.exsd"/>
+   
+   <!-- Full blown JSDT FACET -->
+   <extension point="org.eclipse.wst.common.project.facet.core.facets">
+   		<project-facet id="wst.jsdt.web">
+			<label>%facet.label</label>
+	  	 	<description>%facet.description</description>
+	  	  	<default-version version="1.0"/>
+		</project-facet>
+	
+		<project-facet-version facet="wst.jsdt.web" version="1.0" />
+	
+		<action facet="wst.jsdt.web" type="install" id="wst.jsdt.web.install" version="1.0">
+	   		<delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureInstaller"/>
+		</action>
+	
+		<action facet="wst.jsdt.web" type="uninstall" id="wst.jsdt.web.uninstall" version="1.0">
+			<delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureUninstaller"/>
+		</action>
+	
+	</extension>
+	
+	<extension point="org.eclipse.wst.common.project.facet.core.runtimes">
+	  <supported>
+	    <facet id="wst.jsdt.web"/>
+	    <runtime-component any="true"/>
+	  </supported>
+
+	</extension>
+   
+   <extension point="org.eclipse.wst.jsdt.web.core.javascriptPreProcessor">
+   		<javascriptPreProcessor
+   			class="org.eclipse.wst.jsdt.web.core.javascript.JsTranslation"
+   			priority="1" />
+   </extension>
+   
+   <!-- Install Handler for web JSDT.. Piggybacks on wst.web/jst.web facet-->
+   <extension point="org.eclipse.wst.common.project.facet.core.listeners">
+      <listener class="org.eclipse.wst.jsdt.web.core.internal.project.FacetedProjectListener" eventTypes="POST_INSTALL"/>
+   </extension>
+   
+  <!--
+   <extension point="org.eclipse.wst.common.project.facet.core.facets">
+   
+		<event-handler facet="wst.web" type="POST_INSTALL" version="[1.0">
+	   		<delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureInstaller"/>
+		</event-handler>
+	
+		<event-handler facet="wst.web" type="POST_UNINSTALL" version="[1.0">
+			<delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureUninstaller"/>
+		</event-handler>
+
+	</extension>
+	-->
+	<!-- removed due to JUnit failures during initial WTP build
+	   <extension id="embeded.jsNature" name="%extension.name.0" point="org.eclipse.core.resources.natures"> 
+		   <runtime>          
+		   	<run class="org.eclipse.wst.jsdt.web.core.internal.project.JsWebNature"/>       
+		   </runtime>       
+	 	   <builder id="org.eclipse.wst.jsdt.web.core.embeded.javascript"/>    
+	   </extension> 
+	-->   
+
+	   	<!-- 
+	   	Not using this at the moment, but everythings in place if we need in the future. 
+	    -->  
+	   
+	   <extension id="embeded.javascript" name="%extension.name.1" point="org.eclipse.core.resources.builders">       
+		   	<builder hasNature="true" callOnEmptyDelta="true">		   	      
+		   	<run class="org.eclipse.wst.jsdt.web.core.internal.IncrementalBuilder"/>      
+		   </builder>    
+	   </extension>
+
+	
+	<!--======================================================================================-->
+	<!-- JS batch validation in Web files                                                     -->
+	<!--======================================================================================-->
+	<extension
+		id="JsBatchValidator"
+		name="%javascript.validator"
+		point="org.eclipse.wst.validation.validatorV2">
+      <validator
+            build="false"
+			class="org.eclipse.wst.jsdt.web.core.internal.validation.JsValidator"
+            manual="false"
+            sourceid="org.eclipse.wst.jsdt.web.jssourcevalidator"
+            version="1"
+            markerId="org.eclipse.wst.jsdt.core.problem">
+         <include>
+            <rules>
+				<projectNature id="org.eclipse.wst.jsdt.core.jsNature" />
+			</rules>
+         </include>
+         <include>
+            <rules>
+				<fileext caseSensitive="false" ext="html"/>
+				<fileext caseSensitive="false" ext="xhtml"/>
+				<fileext caseSensitive="false" ext="htm"/>
+				<fileext caseSensitive="false" ext="htpl"/>
+				<fileext caseSensitive="false" ext="jsp"/>
+				<fileext caseSensitive="false" ext="jsf"/>
+				<fileext caseSensitive="false" ext="jsv"/>
+				<fileext caseSensitive="false" ext="jtpl"/>
+				<contentType id="org.eclipse.wst.html.core.htmlsource"/>
+				<contentType id="org.eclipse.jst.jsp.core.jspsource"/>
+			</rules>
+         </include>
+         <group id="org.eclipse.wst.sse.core.structuredModelGroup"/>
+      </validator>
+	</extension>
+	
+	<extension  point="org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer">
+	      <JsGlobalScopeContainerInitializer
+	            class="org.eclipse.wst.jsdt.web.core.internal.project.WebProjectJsGlobalScopeContainerInitializer"
+	            id="org.eclipse.wst.jsdt.launching.WebProject">
+	      </JsGlobalScopeContainerInitializer>
+  	 </extension>
+	
+	<extension
+		id="webSourcePathProvider"
+		point="org.eclipse.wst.jsdt.core.sourcePathProvider">
+		<provider class="org.eclipse.wst.jsdt.web.core.internal.project.ModuleSourcePathProvider"/>
+	</extension>
+</plugin>
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/schema/javascriptPreProcessor.exsd b/bundles/org.eclipse.wst.jsdt.web.core/schema/javascriptPreProcessor.exsd
new file mode 100644
index 0000000..82f6f30
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/schema/javascriptPreProcessor.exsd
@@ -0,0 +1,104 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.jsdt.web.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.eclipse.wst.jsdt.web.core" id="javascriptPreProcessor" name="JavaScript Pre Processing"/>
+      </appinfo>
+      <documentation>
+         [Enter description of this extension point.]
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <complexType>
+         <sequence>
+            <element ref="javascriptPreProcessor"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute translatable="true"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="javascriptPreProcessor">
+      <complexType>
+         <attribute name="class" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn=":org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+         <attribute name="priority" type="string">
+            <annotation>
+               <documentation>
+                  loading priority. the highest number wins.
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="since"/>
+      </appinfo>
+      <documentation>
+         [Enter the first release in which this extension point appears.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="examples"/>
+      </appinfo>
+      <documentation>
+         [Enter extension point usage example here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="apiinfo"/>
+      </appinfo>
+      <documentation>
+         [Enter API information here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="implementation"/>
+      </appinfo>
+      <documentation>
+         [Enter information about supplied implementation of this extension point.]
+      </documentation>
+   </annotation>
+
+
+</schema>
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/IncrementalBuilder.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/IncrementalBuilder.java
new file mode 100644
index 0000000..443bdb7
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/IncrementalBuilder.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.core.internal;
+
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class IncrementalBuilder extends IncrementalProjectBuilder {
+	public IncrementalBuilder() {
+		System.out.println("Unimplemented method:IncrementalProjectBuilder()"); //$NON-NLS-1$
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.resources.IncrementalProjectBuilder#build(int,
+	 *      java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	
+	protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
+		// TODO Auto-generated method stub
+		System.out.println("Unimplemented method:IncrementalBuilder.build"); //$NON-NLS-1$
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSPCorePluginResources.properties b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSPCorePluginResources.properties
new file mode 100644
index 0000000..f3918c6
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSPCorePluginResources.properties
@@ -0,0 +1,24 @@
+###############################################################################
+# Copyright (c) 2004, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+JSPIndexManager_0=Updating JavaScript Index
+JSPIndexManager_2=JavaScript Indexer indexing {0} files
+JSP_Search=JavaScript Search - 
+JSPDocumentLoader_1=Program Error: structured model had no structuredDocument
+JSPEL_Syntax=EL Syntax Error 
+JSPEL_Token=Unable to analyse EL expression due to lexical analysis error
+MESSAGE_JSP_VALIDATING_MESSAGE_UI_=JavaScript Validator validating {0}
+JSPFContentPropertiesManager_Updating=Updating JavaScript Fragment Content Settings
+JSPFContentPropertiesManager_Problems_Updating=Problem saving JavaScript Fragment Content Settings for {0}
+JSPDirectiveValidator_0={0} is a reserved prefix.  Try another
+JSPDirectiveValidator_1=Cannot find the tag library descriptor for {0}
+JSPDirectiveValidator_2=The prefix {0} is used more than once
+JSPDirectiveValidator_3=A {0} value is required in this directive
+JSPBatchValidator_0=Gathering files in {0}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCoreMessages.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCoreMessages.java
new file mode 100644
index 0000000..287fc1f
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCoreMessages.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.internal;
+
+import org.eclipse.osgi.util.NLS;
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsCoreMessages extends NLS {
+	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.core.internal.JSPCorePluginResources"; //$NON-NLS-1$
+	public static String JSP_Search;
+	public static String JSPBatchValidator_0;
+	public static String JSPDirectiveValidator_0;
+	public static String JSPDirectiveValidator_1;
+	public static String JSPDirectiveValidator_2;
+	public static String JSPDirectiveValidator_3;
+	public static String JSPDocumentLoader_1;
+	public static String JSPEL_Syntax;
+	public static String JSPEL_Token;
+	public static String JSPFContentPropertiesManager_Problems_Updating;
+	public static String JSPFContentPropertiesManager_Updating;
+	public static String JSPIndexManager_0;
+	public static String JSPIndexManager_2;
+	/**
+	 * @deprecated
+	 */
+
+	public static String MESSAGE_JSP_VALIDATING_MESSAGE_UI_;
+	static {
+		// initialize resource bundle
+		NLS.initializeMessages(JsCoreMessages.BUNDLE_NAME, JsCoreMessages.class);
+	}
+	
+	private JsCoreMessages() {}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCorePlugin.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCorePlugin.java
new file mode 100644
index 0000000..ef6801a
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCorePlugin.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.internal;
+
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsIndexManager;
+import org.osgi.framework.BundleContext;
+
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsCorePlugin extends Plugin {
+	// The shared instance.
+	private static JsCorePlugin plugin;
+	public static final String PLUGIN_ID = "org.eclipse.wst.jsdt.web.core"; //$NON-NLS-1$
+	
+	/**
+	 * Returns the shared instance.
+	 * 
+	 * @deprecated - will be removed. Currently used to get "model preferences",
+	 *             but there are other, better ways.
+	 */
+
+	public static JsCorePlugin getDefault() {
+		return JsCorePlugin.plugin;
+	}
+	
+	/**
+	 * The constructor.
+	 */
+	public JsCorePlugin() {
+		super();
+		JsCorePlugin.plugin = this;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
+	 */
+	
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		// JSPIndexManager depends on TaglibController, so TaglibController
+		// should be started first
+		// listen for classpath changes
+		JsIndexManager.getInstance().initialize();
+		// listen for resource changes to update content properties keys
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+	 */
+	
+	public void stop(BundleContext context) throws Exception {
+		// stop listenning for resource changes to update content properties
+		// keys
+		// stop any indexing
+		JsIndexManager.getInstance().shutdown();
+		super.stop(context);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/Logger.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/Logger.java
new file mode 100644
index 0000000..50ac416
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/Logger.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.internal;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.osgi.framework.Bundle;
+
+import com.ibm.icu.util.StringTokenizer;
+
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class Logger {
+	public static final int ERROR = IStatus.ERROR; // 4
+	public static final int ERROR_DEBUG = 200 + Logger.ERROR;
+	public static final int INFO = IStatus.INFO; // 1
+	public static final int INFO_DEBUG = 200 + Logger.INFO;
+	public static final int OK = IStatus.OK; // 0
+	public static final int OK_DEBUG = 200 + Logger.OK;
+	private static final String PLUGIN_ID = "org.eclipse.wst.jsdt.web.core"; //$NON-NLS-1$
+	private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
+	public static final int WARNING = IStatus.WARNING; // 2
+	public static final int WARNING_DEBUG = 200 + Logger.WARNING;
+	
+	/**
+	 * Adds message to log.
+	 * 
+	 * @param level
+	 *            severity level of the message (OK, INFO, WARNING, ERROR,
+	 *            OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
+	 * @param message
+	 *            text to add to the log
+	 * @param exception
+	 *            exception thrown
+	 */
+	protected static void _log(int level, String message, Throwable exception) {
+		if (level == Logger.OK_DEBUG || level == Logger.INFO_DEBUG || level == Logger.WARNING_DEBUG || level == Logger.ERROR_DEBUG) {
+			if (!Logger.isDebugging()) {
+				return;
+			}
+		}
+		int severity = IStatus.OK;
+		switch (level) {
+			case INFO_DEBUG:
+			case INFO:
+				severity = IStatus.INFO;
+			break;
+			case WARNING_DEBUG:
+			case WARNING:
+				severity = IStatus.WARNING;
+			break;
+			case ERROR_DEBUG:
+			case ERROR:
+				severity = IStatus.ERROR;
+		}
+		message = (message != null) ? message : "null"; //$NON-NLS-1$
+		Status statusObj = new Status(severity, Logger.PLUGIN_ID, severity, message, exception);
+		Bundle bundle = Platform.getBundle(Logger.PLUGIN_ID);
+		if (bundle != null) {
+			Platform.getLog(bundle).log(statusObj);
+		}
+	}
+	
+	/**
+	 * Prints message to log if category matches /debug/tracefilter option.
+	 * 
+	 * @param message
+	 *            text to print
+	 * @param category
+	 *            category of the message, to be compared with
+	 *            /debug/tracefilter
+	 */
+	protected static void _trace(String category, String message, Throwable exception) {
+		if (Logger.isTracing(category)) {
+			message = (message != null) ? message : "null"; //$NON-NLS-1$
+			Status statusObj = new Status(IStatus.OK, Logger.PLUGIN_ID, IStatus.OK, message, exception);
+			Bundle bundle = Platform.getBundle(Logger.PLUGIN_ID);
+			if (bundle != null) {
+				Platform.getLog(bundle).log(statusObj);
+			}
+		}
+	}
+	
+	/**
+	 * @return true if the platform is debugging
+	 */
+	public static boolean isDebugging() {
+		return Platform.inDebugMode();
+	}
+	
+	/**
+	 * Determines if currently tracing a category
+	 * 
+	 * @param category
+	 * @return true if tracing category, false otherwise
+	 */
+	public static boolean isTracing(String category) {
+		if (!Logger.isDebugging()) {
+			return false;
+		}
+		String traceFilter = Platform.getDebugOption(Logger.PLUGIN_ID + Logger.TRACEFILTER_LOCATION);
+		if (traceFilter != null) {
+			StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
+			while (tokenizer.hasMoreTokens()) {
+				String cat = tokenizer.nextToken().trim();
+				if (category.equals(cat)) {
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+	
+	public static void log(int level, String message) {
+		Logger._log(level, message, null);
+	}
+	
+	public static void log(int level, String message, Throwable exception) {
+		Logger._log(level, message, exception);
+	}
+	
+	public static void logException(String message, Throwable exception) {
+		Logger._log(Logger.ERROR, message, exception);
+	}
+	
+	public static void logException(Throwable exception) {
+		Logger._log(Logger.ERROR, exception.getMessage(), exception);
+	}
+	
+	public static void trace(String category, String message) {
+		Logger._trace(category, message, null);
+	}
+	
+	public static void traceException(String category, String message, Throwable exception) {
+		Logger._trace(category, message, exception);
+	}
+	
+	public static void traceException(String category, Throwable exception) {
+		Logger._trace(category, exception.getMessage(), exception);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebDocumentChangeListener.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebDocumentChangeListener.java
new file mode 100644
index 0000000..9d4edd7
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebDocumentChangeListener.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.core.internal.modelhandler;
+
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public interface IWebDocumentChangeListener extends IWebResourceChangedListener {
+	public static final int BORING = 0;
+	public static final int DIRTY_DOC = 1;
+	public static final int DIRTY_MODEL = 2;
+	
+	public int getIntrestLevelAtOffset(int documentOffset);
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebResourceChangedListener.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebResourceChangedListener.java
new file mode 100644
index 0000000..4084e8b
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebResourceChangedListener.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.core.internal.modelhandler;
+
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public interface IWebResourceChangedListener {
+	public void resourceChanged();
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/Messages.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/Messages.java
new file mode 100644
index 0000000..889438f
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/Messages.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.core.internal.modelhandler;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class Messages {
+	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.core.internal.modelhandler.messages"; //$NON-NLS-1$
+
+	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+	private Messages() {
+	}
+
+	public static String getString(String key) {
+		try {
+			return RESOURCE_BUNDLE.getString(key);
+		}
+		catch (MissingResourceException e) {
+			return '!' + key + '!';
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/WebResourceChangeHandler.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/WebResourceChangeHandler.java
new file mode 100644
index 0000000..106843f
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/WebResourceChangeHandler.java
@@ -0,0 +1,211 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.internal.modelhandler;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
+import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class WebResourceChangeHandler implements IResourceChangeListener, IDocumentListener, IModelLifecycleListener {
+	/*
+	 * Check the level of dirty regions when signaling for document events.
+	 * 
+	 * sometimes the SSE editor doesn't re-validate regions when text is
+	 * inserted, so setting this to false causes every document change event to
+	 * trigger a revalidation.
+	 * 
+	 * setting to true may speed things up.
+	 * 
+	 */
+//	private static final boolean CHECK_INTREST_LEVEL = false;
+	private static Hashtable instances = new Hashtable();
+	private static final boolean SIGNAL_MODEL = false;
+	
+	public static WebResourceChangeHandler getInstance(IStructuredModel xmlModel, IWebResourceChangedListener changeListener) {
+		WebResourceChangeHandler handler = null;
+		synchronized (WebResourceChangeHandler.instances) {
+			Enumeration values = WebResourceChangeHandler.instances.elements();
+			while (values.hasMoreElements()) {
+				Object model = values.nextElement();
+				if (model == xmlModel) {
+					handler = (WebResourceChangeHandler) WebResourceChangeHandler.instances.get(model);
+				}
+			}
+			if (handler == null) {
+				handler = new WebResourceChangeHandler();
+				WebResourceChangeHandler.instances.put(handler, xmlModel);
+			}
+		}
+		handler.initialize();
+		handler.fchangeListener.add(changeListener);
+		return handler;
+	}
+	private class ModelIrritantThread implements Runnable {
+		public void run() {
+			signalAllDirtyModel();
+		}
+		
+		public void signalAllDirtyModel() {
+			for (int i = 0; i < fchangeListener.size(); i++) {
+				((IWebResourceChangedListener) fchangeListener.get(i)).resourceChanged();
+			}
+			if (!WebResourceChangeHandler.SIGNAL_MODEL) {
+				return;
+			}
+			IStructuredModel xmlModel = null;
+			Object modelRef = getModel();
+			if (modelRef == null) {
+				return;
+			}
+			try {
+// for(int i =0;i<fchangeListener.size();i++) {
+// ((IWebResourceChangedListener)fchangeListener.get(i)).resourceChanged();
+// }
+				xmlModel = (IStructuredModel) modelRef;//(IDOMModel) StructuredModelManager.getModelManager().getExistingModelForEdit(((IStructuredModel) modelRef).getBaseLocation());
+				if (xmlModel != null) {
+					IStructuredDocument doc = xmlModel.getStructuredDocument();
+					try {
+						xmlModel.aboutToChangeModel();
+					// xmlModel.setReinitializeNeeded(true);
+					// (doc).replace(0, doc.getLength(),doc.get());
+					}
+					finally {
+						xmlModel.changedModel();
+					}
+				}
+			} catch (Exception e) {
+				System.out.println(Messages.getString("WebResourceChangeHandler.0")); //$NON-NLS-1$
+			} finally {
+				if (xmlModel != null) {
+//					xmlModel.releaseFromEdit();
+				}
+			}
+		}
+	}
+	private ArrayList fchangeListener = new ArrayList();
+	private ModelIrritantThread irritator;
+	
+	private WebResourceChangeHandler() {}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
+	 */
+	public void documentAboutToBeChanged(DocumentEvent event) {}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
+	 */
+	public void documentChanged(DocumentEvent event) {
+//		if (WebResourceChangeHandler.CHECK_INTREST_LEVEL) {
+//			for (int i = 0; i < fchangeListener.size(); i++) {
+//				Object o = fchangeListener.get(i);
+//				if (o instanceof IWebDocumentChangeListener) {
+//					int intrest = ((IWebDocumentChangeListener) o).getIntrestLevelAtOffset(event.fOffset);
+//					switch (intrest) {
+//						case IWebDocumentChangeListener.DIRTY_MODEL:
+//							irritator.signalAllDirtyModel();
+//							return;
+//						case IWebDocumentChangeListener.DIRTY_DOC:
+//							((IWebDocumentChangeListener) o).resourceChanged();
+//						break;
+//					}
+//					return;
+//				}
+//			}
+//		} else {
+			irritator.signalAllDirtyModel();
+		//}
+	}
+	
+	
+	public boolean equals(Object o) {
+		return (o instanceof WebResourceChangeHandler && ((WebResourceChangeHandler) o).fchangeListener == this.fchangeListener);
+	}
+	
+	
+	public void finalize() {
+		ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
+		if (WebResourceChangeHandler.instances == null) {
+			return;
+		}
+		Object o = null;
+		synchronized (WebResourceChangeHandler.instances) {
+			o = WebResourceChangeHandler.instances.get(this);
+			WebResourceChangeHandler.instances.remove(this);
+		}
+		if (o != null) {
+			IStructuredModel fXMLModel = (IStructuredModel) o;
+			IStructuredDocument fJspDocument = fXMLModel.getStructuredDocument();
+			if (fJspDocument != null) {
+				fJspDocument.removeDocumentListener(this);
+			}
+		}
+	}
+	
+	private IStructuredModel getModel() {
+		if (WebResourceChangeHandler.instances == null) {
+			return null;
+		}
+		return (IStructuredModel) WebResourceChangeHandler.instances.get(this);
+	}
+	
+	private void initialize() {
+		IStructuredModel xmlModel = getModel();
+		ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
+		xmlModel.addModelLifecycleListener(this);
+		IStructuredDocument fJspDocument = xmlModel.getStructuredDocument();
+		if (fJspDocument != null) {
+			fJspDocument.addDocumentListener(this);
+		}
+		irritator = new ModelIrritantThread();
+	}
+	
+	public void processPostModelEvent(ModelLifecycleEvent event) {
+		if (irritator != null) {
+			irritator.signalAllDirtyModel();
+		}
+		if (WebResourceChangeHandler.instances == null) {
+			return;
+		}
+		if (event.getType() == ModelLifecycleEvent.MODEL_RELEASED) {
+			synchronized (WebResourceChangeHandler.instances) {
+				WebResourceChangeHandler.instances.remove(this);
+			}
+		}
+	}
+	
+	public void processPreModelEvent(ModelLifecycleEvent event) {}
+	
+	public void resourceChanged(IResourceChangeEvent event) {
+		FileBuffers.getTextFileBufferManager().execute(irritator);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/messages.properties b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/messages.properties
new file mode 100644
index 0000000..c06bf5d
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/messages.properties
@@ -0,0 +1,11 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+WebResourceChangeHandler.0=Error when updating the model.
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ConvertJob.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ConvertJob.java
new file mode 100644
index 0000000..5824025
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ConvertJob.java
@@ -0,0 +1,86 @@
+/*******************************************************************************

+ * Copyright (c) 2010 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+

+package org.eclipse.wst.jsdt.web.core.internal.project;

+

+import java.util.HashSet;

+import java.util.Set;

+

+import org.eclipse.core.resources.IProject;

+import org.eclipse.core.resources.WorkspaceJob;

+import org.eclipse.core.runtime.CoreException;

+import org.eclipse.core.runtime.IProgressMonitor;

+import org.eclipse.core.runtime.IStatus;

+import org.eclipse.core.runtime.NullProgressMonitor;

+import org.eclipse.core.runtime.Status;

+import org.eclipse.wst.common.project.facet.core.IFacetedProject;

+import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;

+import org.eclipse.wst.common.project.facet.core.IProjectFacet;

+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;

+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;

+import org.eclipse.wst.jsdt.internal.core.util.Messages;

+import org.eclipse.wst.jsdt.web.core.internal.Logger;

+

+/**

+ * Installs the JSDT facet, if asked, and setting it as a "fixed" facet.

+ * 

+ */

+class ConvertJob extends WorkspaceJob {

+	final static String JSDT_FACET = "wst.jsdt.web";

+	private IProject fProject;

+	private boolean fInstall = true;

+	private boolean fUseExplicitWorkingCopy = false;

+

+	ConvertJob(IProject project, boolean install, boolean useExplicitWorkingCopy) {

+		super(Messages.converter_ConfiguringForJavaScript);

+		fProject = project;

+		fInstall = install;

+		fUseExplicitWorkingCopy = useExplicitWorkingCopy;

+	}

+

+	public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {

+		try {

+			IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(JSDT_FACET);

+			IFacetedProject facetedProject = ProjectFacetsManager.create(fProject);

+

+			if (facetedProject != null && fProject.isAccessible()) {

+				if (fInstall) {

+					IProjectFacetVersion latestVersion = projectFacet.getLatestVersion();

+					facetedProject.installProjectFacet(latestVersion, null, monitor);

+				}

+

+

+				if (fUseExplicitWorkingCopy) {

+					IFacetedProjectWorkingCopy copy = facetedProject.createWorkingCopy();

+					Set fixed = new HashSet(facetedProject.getFixedProjectFacets());

+					fixed.add(projectFacet);

+					copy.setFixedProjectFacets(fixed);

+					copy.commitChanges(new NullProgressMonitor());

+				}

+				else {

+					Set fixed = new HashSet(facetedProject.getFixedProjectFacets());

+					if (!fixed.contains(projectFacet)) {

+						fixed.add(projectFacet);

+						facetedProject.setFixedProjectFacets(fixed);

+					}

+				}

+			}

+		}

+		catch (IllegalArgumentException e) {

+			// unknown facet ID, bad installation configuration?

+		}

+		catch (Exception e) {

+			Logger.logException(e);

+		}

+		return Status.OK_STATUS;

+	}

+

+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/FacetedProjectListener.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/FacetedProjectListener.java
new file mode 100644
index 0000000..d1a9abc
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/FacetedProjectListener.java
@@ -0,0 +1,47 @@
+/*******************************************************************************

+ * Copyright (c) 2010 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+

+package org.eclipse.wst.jsdt.web.core.internal.project;

+

+import java.util.Arrays;

+import java.util.Collection;

+

+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;

+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;

+import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;

+

+public class FacetedProjectListener implements IFacetedProjectListener {

+	final static Collection INTERESTING_FACETS = Arrays.asList(new Object[]{"wst.web", "jst.web"});

+

+	/**

+	 * 

+	 */

+	public FacetedProjectListener() {

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see

+	 * org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener

+	 * #handleEvent(org.eclipse.wst.common.project.facet.core.events.

+	 * IFacetedProjectEvent)

+	 */

+	public void handleEvent(IFacetedProjectEvent event) {

+		if (event.getType() == IFacetedProjectEvent.Type.POST_INSTALL) {

+			IProjectFacetActionEvent actionEvent = (IProjectFacetActionEvent) event;

+			if (INTERESTING_FACETS.contains(actionEvent.getProjectFacet().getId())) {

+				new ConvertJob(event.getProject().getProject(), true, true).schedule(1000);

+			}

+		}

+	}

+

+}

diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureInstaller.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureInstaller.java
new file mode 100644
index 0000000..8877270
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureInstaller.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.internal.project;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin;
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsNatureInstaller implements IDelegate {
+	public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor) throws CoreException {
+		if (monitor == null) {
+			monitor = new NullProgressMonitor();
+		}
+		monitor.beginTask("Installing Facet for JavaScript Development Tools" + ".", 100); //$NON-NLS-1$ //$NON-NLS-2$
+		try {
+			installNature(project, monitor);
+		} finally {
+			monitor.done();
+		}
+	}
+	
+	public void installNature(IProject project, IProgressMonitor monitor) throws CoreException {
+		monitor.beginTask(Messages.getString("JsNatureInstaller.1"), 100); //$NON-NLS-1$
+		monitor.subTask(Messages.getString("JsNatureInstaller.2")); //$NON-NLS-1$
+		try {
+			monitor.worked(20);
+			JsWebNature jsNature = new JsWebNature(project, monitor);
+			monitor.worked(20);
+			jsNature.configure();
+			monitor.worked(40);
+			
+			new ConvertJob(project, false, true).schedule(1000);
+		} catch (Exception e) {
+			throw new CoreException(new Status(IStatus.ERROR, JsCorePlugin.PLUGIN_ID, IStatus.OK, Messages.getString("JsNatureInstaller.3"), e)); //$NON-NLS-1$
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureUninstaller.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureUninstaller.java
new file mode 100644
index 0000000..c59fc6d
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureUninstaller.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.internal.project;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin;
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsNatureUninstaller implements IDelegate {
+	public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor) throws CoreException {
+		if (monitor == null) {
+			monitor = new NullProgressMonitor();
+		}
+		monitor.beginTask("Uninstalling Facet for JavaScript Development Tools" + ".", 100); //$NON-NLS-1$ //$NON-NLS-2$
+		try {
+			uninstallNature(project, monitor);
+		} finally {
+			monitor.done();
+		}
+	}
+	
+	public void uninstallNature(IProject project, IProgressMonitor monitor) throws CoreException {
+		monitor.beginTask(Messages.getString("JsNatureUninstaller.1"), 100); //$NON-NLS-1$
+		// by using natures we can leverage the precondition support
+		monitor.subTask(Messages.getString("JsNatureUninstaller.2")); //$NON-NLS-1$
+		if (!JsWebNature.hasNature(project)) {
+			return;
+		}
+		try {
+			IProjectNature jsNature = new JsWebNature(project, monitor);
+			monitor.worked(20);
+			monitor.worked(50);
+			jsNature.deconfigure();
+			monitor.worked(20);
+		} catch (CoreException e) {
+			throw new CoreException(new Status(IStatus.ERROR, JsCorePlugin.PLUGIN_ID, IStatus.OK, Messages.getString("JsNatureUninstaller.3"), e)); //$NON-NLS-1$
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java
new file mode 100644
index 0000000..d8c3448
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java
@@ -0,0 +1,288 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.internal.project;
+
+import java.util.Arrays;
+import java.util.Vector;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.jsdt.core.IAccessRule;
+import org.eclipse.wst.jsdt.core.IIncludePathAttribute;
+import org.eclipse.wst.jsdt.core.IIncludePathEntry;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.core.LibrarySuperType;
+import org.eclipse.wst.jsdt.internal.core.JavaProject;
+import org.eclipse.wst.jsdt.internal.core.util.ConvertUtility;
+//import org.eclipse.wst.jsdt.ui.PreferenceConstants;
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsWebNature implements IProjectNature {
+	//private static final String FILENAME_CLASSPATH = ".classpath"; //$NON-NLS-1$
+	// private static final String NATURE_IDS[] =
+	// {"org.eclipse.wst.jsdt.web.core.embeded.jsNature",JavaScriptCore.NATURE_ID};
+	// //$NON-NLS-1$
+	private static final String NATURE_IDS[] = { JavaScriptCore.NATURE_ID };
+
+	public static final IPath VIRTUAL_BROWSER_CLASSPATH = new Path("org.eclipse.wst.jsdt.launching.baseBrowserLibrary"); //$NON-NLS-1$
+	public static final String VIRTUAL_CONTAINER = "org.eclipse.wst.jsdt.launching.WebProject"; //$NON-NLS-1$
+	public static final IIncludePathEntry VIRTUAL_SCOPE_ENTRY = JavaScriptCore.newContainerEntry(new Path(VIRTUAL_CONTAINER),  new IAccessRule[0], new IIncludePathAttribute[] {IIncludePathAttribute.HIDE}, false);
+	private static final String SUPER_TYPE_NAME = "Window"; //$NON-NLS-1$
+	private static final String SUPER_TYPE_LIBRARY = "org.eclipse.wst.jsdt.launching.baseBrowserLibrary"; //$NON-NLS-1$
+	
+	/* Default JRE entry */
+	private static final String DEFAULT_JRE_PATH = "org.eclipse.wst.jsdt.launching.JRE_CONTAINER"; //$NON-NLS-1$
+	
+	public static void addJsNature(IProject project, IProgressMonitor monitor) throws CoreException {
+		if (monitor != null && monitor.isCanceled()) {
+			throw new OperationCanceledException();
+		}
+		if (!JsWebNature.hasNature(project)) {
+			IProjectDescription description = project.getDescription();
+			String[] prevNatures = description.getNatureIds();
+			String[] newNatures = new String[prevNatures.length + JsWebNature.NATURE_IDS.length];
+			System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
+			// newNatures[prevNatures.length] = JavaScriptCore.NATURE_ID;
+			for (int i = 0; i < JsWebNature.NATURE_IDS.length; i++) {
+				newNatures[prevNatures.length + i] = JsWebNature.NATURE_IDS[i];
+			}
+			description.setNatureIds(newNatures);
+			project.setDescription(description, monitor);
+		} else {
+			if (monitor != null) {
+				monitor.worked(1);
+			}
+		}
+	}
+	
+	public static boolean hasNature(IProject project) {
+		try {
+			for (int i = 0; i < JsWebNature.NATURE_IDS.length; i++) {
+				if (!project.hasNature(JsWebNature.NATURE_IDS[i])) {
+					return false;
+				}
+			}
+		} catch (CoreException ex) {
+			return false;
+		}
+		return true;
+	}
+	
+	public static void removeJsNature(IProject project, IProgressMonitor monitor) throws CoreException {
+		if (monitor != null && monitor.isCanceled()) {
+			throw new OperationCanceledException();
+		}
+		if (JsWebNature.hasNature(project)) {
+			IProjectDescription description = project.getDescription();
+			String[] prevNatures = description.getNatureIds();
+			String[] newNatures = new String[prevNatures.length - JsWebNature.NATURE_IDS.length];
+			int k = 0;
+			head: for (int i = 0; i < prevNatures.length; i++) {
+				for (int j = 0; j < JsWebNature.NATURE_IDS.length; j++) {
+					if (prevNatures[i].equals(JsWebNature.NATURE_IDS[j])) {
+						continue head;
+					}
+				}
+				newNatures[k++] = prevNatures[i];
+			}
+			description.setNatureIds(newNatures);
+			project.setDescription(description, monitor);
+		} else {
+			if (monitor != null) {
+				monitor.worked(1);
+			}
+		}
+	}
+	private Vector classPathEntries = new Vector();
+	private boolean DEBUG = false;
+	private IProject fCurrProject;
+	private JavaProject fJavaProject;
+	private IPath fOutputLocation;
+	private IProgressMonitor monitor;
+	
+	public JsWebNature() {
+		monitor = new NullProgressMonitor();
+	}
+	
+	public JsWebNature(IProject project, IProgressMonitor monitor) {
+		fCurrProject = project;
+		if (monitor != null) {
+			this.monitor = monitor;
+		} else {
+			monitor = new NullProgressMonitor();
+		}
+	}
+	
+	public void configure() throws CoreException {
+
+		initOutputPath();
+		createSourceClassPath();
+		initJREEntry();
+		initLocalClassPath();
+		
+		if (hasProjectClassPathFile()) {
+			IIncludePathEntry[] entries = getRawClassPath();
+			if (entries != null && entries.length > 0) {
+				classPathEntries.removeAll(Arrays.asList(entries));
+				classPathEntries.addAll(Arrays.asList(entries));
+			}
+		}
+		
+		JsWebNature.addJsNature(fCurrProject, monitor);
+		fJavaProject = (JavaProject) JavaScriptCore.create(fCurrProject);
+		fJavaProject.setProject(fCurrProject);
+		try {
+			// , fOutputLocation
+			if (!hasProjectClassPathFile()) {
+				fJavaProject.setRawIncludepath((IIncludePathEntry[]) classPathEntries.toArray(new IIncludePathEntry[] {}), fOutputLocation, monitor);
+			}else{
+				fJavaProject.setRawIncludepath((IIncludePathEntry[]) classPathEntries.toArray(new IIncludePathEntry[] {}), monitor);
+			}
+		} catch (Exception e) {
+			System.out.println(e);
+		}
+		LibrarySuperType superType = new LibrarySuperType(new Path( SUPER_TYPE_LIBRARY),  getJavaProject(), SUPER_TYPE_NAME);
+		getJavaProject().setCommonSuperType(superType);
+		// getJavaProject().addToBuildSpec(BUILDER_ID);
+		fCurrProject.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+	}
+	
+	private void createSourceClassPath() {
+		if (hasAValidSourcePath()) {
+			return;
+		}
+		IIncludePathEntry[] entries = new ConvertUtility(fCurrProject).getDefaultSourcePaths(fCurrProject);
+		for (int i = 0; i < entries.length; i++) {
+			classPathEntries.add(entries[i]);
+		}
+		// IPath projectPath = fCurrProject.getFullPath();
+		// classPathEntries.add(JavaScriptCore.newSourceEntry(projectPath));
+	}
+	
+	public void deconfigure() throws CoreException {
+		Vector badEntries = new Vector();
+		IIncludePathEntry defaultJRELibrary =  getJreEntry();
+		IIncludePathEntry[] localEntries = initLocalClassPath();
+		badEntries.add(defaultJRELibrary);
+		badEntries.addAll(Arrays.asList(localEntries));
+		IIncludePathEntry[] entries = getRawClassPath();
+		Vector goodEntries = new Vector();
+		for (int i = 0; i < entries.length; i++) {
+			if (!badEntries.contains(entries[i])) {
+				goodEntries.add(entries[i]);
+			}
+		}
+		// getJavaProject().removeFromBuildSpec(BUILDER_ID);
+		IPath outputLocation = getJavaProject().getOutputLocation();
+		getJavaProject().setRawIncludepath((IIncludePathEntry[]) goodEntries.toArray(new IIncludePathEntry[] {}), outputLocation, monitor);
+		getJavaProject().deconfigure();
+		JsWebNature.removeJsNature(fCurrProject, monitor);
+		fCurrProject.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+	}
+	
+	public JavaProject getJavaProject() {
+		if (fJavaProject == null) {
+			fJavaProject = (JavaProject) JavaScriptCore.create(fCurrProject);
+			fJavaProject.setProject(fCurrProject);
+		}
+		return fJavaProject;
+	}
+	
+	public IProject getProject() {
+		return this.fCurrProject;
+	}
+	
+	private IIncludePathEntry[] getRawClassPath() {
+		JavaProject proj = new JavaProject();
+		proj.setProject(fCurrProject);
+		return proj.readRawIncludepath();
+	}
+	
+	private boolean hasAValidSourcePath() {
+		if (hasProjectClassPathFile()) {
+			try {
+				IIncludePathEntry[] entries = getRawClassPath();
+				for (int i = 0; i < entries.length; i++) {
+					if (entries[i].getEntryKind() == IIncludePathEntry.CPE_SOURCE) {
+						return true;
+					}
+				}
+			} catch (Exception e) {
+				if (DEBUG) {
+					System.out.println(Messages.getString("JsWebNature.5") + e); //$NON-NLS-1$
+				}
+			}
+		}
+		return false;
+	}
+	
+	private boolean hasProjectClassPathFile() {
+		if (fCurrProject == null) {
+			return false;
+		}
+		return fCurrProject.getFolder(JavaProject.DEFAULT_PREFERENCES_DIRNAME).getFile(JavaProject.CLASSPATH_FILENAME).exists();
+	}
+	
+	private IIncludePathEntry getJreEntry() {
+		return JavaScriptCore.newContainerEntry(new Path(DEFAULT_JRE_PATH));
+	}
+	
+	private void initJREEntry() {
+		IIncludePathEntry defaultJRELibrary =  getJreEntry();
+		try {
+			IIncludePathEntry[] entries = getRawClassPath();
+			for (int i = 0; i < entries.length; i++) {
+				if (entries[i] == defaultJRELibrary) {
+					return;
+				}
+			}
+			classPathEntries.add(defaultJRELibrary);
+		} catch (Exception e) {
+			if (DEBUG) {
+				System.out.println(Messages.getString("JsWebNature.6") + e); //$NON-NLS-1$
+			}
+		}
+	}
+	
+	private IIncludePathEntry[] initLocalClassPath() {
+		
+		classPathEntries.add(JsWebNature.VIRTUAL_SCOPE_ENTRY);
+		IIncludePathEntry browserLibrary = JavaScriptCore.newContainerEntry( VIRTUAL_BROWSER_CLASSPATH);
+		classPathEntries.add(browserLibrary);
+		//IPath webRoot = WebRootFinder.getWebContentFolder(fCurrProject);
+	//	IIncludePathEntry source = JavaScriptCore.newSourceEntry(fCurrProject.getFullPath().append(webRoot).append("/"));
+	//	classPathEntries.add(source);
+		return new IIncludePathEntry[] { JsWebNature.VIRTUAL_SCOPE_ENTRY , browserLibrary/*,source*/};
+	}
+	
+	private void initOutputPath() {
+		if (fOutputLocation == null) {
+			fOutputLocation = fCurrProject.getFullPath();
+		}
+	}
+	
+	public void setProject(IProject project) {
+		this.fCurrProject = project;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/Messages.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/Messages.java
new file mode 100644
index 0000000..3c2697f
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/Messages.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.core.internal.project;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class Messages {
+	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.core.internal.project.messages"; //$NON-NLS-1$
+
+	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+	private Messages() {
+	}
+
+	public static String getString(String key) {
+		try {
+			return RESOURCE_BUNDLE.getString(key);
+		}
+		catch (MissingResourceException e) {
+			return '!' + key + '!';
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupport.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupport.java
new file mode 100644
index 0000000..a17da6a
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupport.java
@@ -0,0 +1,198 @@
+/*******************************************************************************

+ * Copyright (c) 2007, 2008 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+package org.eclipse.wst.jsdt.web.core.internal.project;

+

+import org.eclipse.core.filebuffers.FileBuffers;

+import org.eclipse.core.resources.IContainer;

+import org.eclipse.core.resources.IFile;

+import org.eclipse.core.resources.IFolder;

+import org.eclipse.core.resources.IProject;

+import org.eclipse.core.resources.IResource;

+import org.eclipse.core.resources.IWorkspaceRoot;

+import org.eclipse.core.resources.ResourcesPlugin;

+import org.eclipse.core.runtime.IPath;

+import org.eclipse.core.runtime.Path;

+

+/**

+ * This class encapsulates any used Module Core APIs along with fallbacks for

+ * use on non-compliant projects and when those services are not available at

+ * runtime.

+ * 

+ * Because ModuleCore API calls can result in locks needing to be acquired,

+ * none of these methods should be called while other thread locks have

+ * already been acquired.

+ */

+public final class ModuleCoreSupport {

+	static final boolean _dump_NCDFE = false;

+	private static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$

+	private static final IPath WEB_INF_PATH = new Path(WEB_INF);

+

+	/**

+	 * @param project

+	 * @return the computed IPath to the "root" of the web contents, either

+	 *         from facet knowledge or hueristics, or null if one can not be

+	 *         determined

+	 */

+	public static IPath computeWebContentRootPath(IPath path) {

+		IPath root = null;

+		try {

+			root = ModuleCoreSupportDelegate.getWebContentRootPath(ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0)));

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+		if (root == null) {

+			/*

+			 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=213245

+			 * 

+			 * NPE in JSPTaglibDirectiveContentAssistProcessor with

+			 * non-faceted project

+			 */

+			root = getLocalRoot(path);

+		}

+		return root;

+	}

+

+	/**

+	 * @param project

+	 * @return the IPath to the "root" of the web contents

+	 */

+	public static IPath getWebContentRootPath(IProject project) {

+		if (project == null)

+			return null;

+

+		IPath path = null;

+		try {

+			path = ModuleCoreSupportDelegate.getWebContentRootPath(project);

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+		return path;

+	}

+

+	/**

+	 * @param path

+	 *            - the full path to a resource within the workspace

+	 * @return - the runtime path of the resource if one exists, null

+	 *         otherwise

+	 */

+	public static IPath getRuntimePath(IPath path) {

+		IPath result = null;

+		try {

+			result = ModuleCoreSupportDelegate.getRuntimePath(path);

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+		if (result == null) {

+			IPath root = getLocalRoot(path);

+			result = path.removeFirstSegments(root.segmentCount()).makeAbsolute();

+		}

+		return result;

+	}

+

+	/**

+	 * @param basePath

+	 *            - the full path to a resource within the workspace

+	 * @param reference

+	 *            - the reference string to resolve

+	 * @return - the full path within the workspace that corresponds to the

+	 *         given reference according to the virtual pathing support

+	 */

+	public static IPath resolve(IPath basePath, String reference) {

+		IPath resolvedPath = null;

+		try {

+			resolvedPath = ModuleCoreSupportDelegate.resolve(basePath, reference);

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+

+		if (resolvedPath == null) {

+			IPath rootPath = getLocalRoot(basePath);

+			if (reference.startsWith(Path.ROOT.toString())) {

+				resolvedPath = rootPath.append(reference);

+			}

+			else {

+				resolvedPath = basePath.removeLastSegments(1).append(reference);

+			}

+		}

+

+		return resolvedPath;

+	}

+

+	/**

+	 * @param basePath

+	 * @return the applicable Web context root path, if one exists

+	 */

+	private static IPath getLocalRoot(IPath basePath) {

+		IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();

+

+		// existing workspace resources - this is the 93% case

+		IResource file = FileBuffers.getWorkspaceFileAtLocation(basePath);

+

+		// Try the base path as a folder first

+		if (file == null && basePath.segmentCount() > 1) {

+			file = workspaceRoot.getFolder(basePath);

+		}

+		// If not a folder, then try base path as a file

+		if (file != null && !file.exists() && basePath.segmentCount() > 1) {

+			file = workspaceRoot.getFile(basePath);

+		}

+

+		if (file == null && basePath.segmentCount() == 1) {

+			file = workspaceRoot.getProject(basePath.segment(0));

+		}

+

+		if (file == null) {

+			/*

+			 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=116529

+			 * 

+			 * This method produces a less accurate result, but doesn't

+			 * require that the file exist yet.

+			 */

+			IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(basePath);

+			if (files.length > 0)

+				file = files[0];

+		}

+

+		while (file != null) {

+			/**

+			 * Treat any parent folder with a WEB-INF subfolder as a web-app

+			 * root

+			 */

+			IContainer folder = null;

+			if ((file.getType() & IResource.FOLDER) != 0) {

+				folder = (IContainer) file;

+			}

+			else {

+				folder = file.getParent();

+			}

+			// getFolder on a workspace root must use a full path, skip

+			if (folder != null && (folder.getType() & IResource.ROOT) == 0) {

+				IFolder webinf = folder.getFolder(WEB_INF_PATH);

+				if (webinf != null && webinf.exists()) {

+					return folder.getFullPath();

+				}

+			}

+			file = file.getParent();

+		}

+

+		return basePath.uptoSegment(1);

+	}

+

+

+}

diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java
new file mode 100644
index 0000000..e8b6112
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.internal.project;
+
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
+import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
+
+/**
+ * Wrapper class for all Facet and ModuleCore-related calls. If the Facet or
+ * ModuleCore bundles are not available, this class will not load, or if it
+ * does, its methods will cause NoClassDefFoundErrors. This allows us to
+ * compartmentalize the dependencies.
+ * 
+ */
+final class ModuleCoreSupportDelegate {
+	private static final String SLASH = "/";
+	private static Map fResolvedMap = new HashMap();
+
+	/**
+	 * @param path
+	 *            - the full path to a resource within the workspace
+	 * @return - the runtime path of the resource if one exists, null
+	 *         otherwise
+	 */
+	static IPath getRuntimePath(IPath path) {
+		if (path == null)
+			return null;
+
+		IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));
+
+		if (!ModuleCoreNature.isFlexibleProject(project))
+			return null;
+
+		IVirtualResource[] virtualResources = ComponentCore.createResources(ResourcesPlugin.getWorkspace().getRoot().getFile(path));
+		if (virtualResources != null && virtualResources.length > 0) {
+			return virtualResources[0].getRuntimePath();
+		}
+		return null;
+	}
+
+	/**
+	 * @param project
+	 * @return the IPath to the "root" of the web contents
+	 */
+	static IPath getWebContentRootPath(IProject project) {
+		if (project == null)
+			return null;
+
+		if (!ModuleCoreNature.isFlexibleProject(project))
+			return null;
+
+		IPath path = null;
+		IVirtualComponent component = ComponentCore.createComponent(project);
+		if (component != null && component.exists()) {
+			path = component.getRootFolder().getWorkspaceRelativePath();
+		}
+		return path;
+	}
+
+	/**
+	 * @param basePath
+	 *            - the full path to a resource within the workspace
+	 * @param reference
+	 *            - the reference string to resolve
+	 * @return - the full path within the workspace that corresponds to the
+	 *         given reference according to the virtual pathing support
+	 */
+	static IPath resolve(IPath basePath, String reference) {
+		if (reference == null || basePath == null || basePath.segmentCount() == 0)
+			return null;
+
+		IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
+
+		if (!ModuleCoreNature.isFlexibleProject(project))
+			return null;
+
+		if (basePath.segmentCount() > 1) {
+			/*
+			 * It can take the better part of a full second to do this, so
+			 * cache the result.
+			 */
+			IPath resolved = null;
+			Map mapForBaseResource = null;
+			mapForBaseResource = (Map) fResolvedMap.get(basePath);
+			if (mapForBaseResource != null) {
+				Reference resolvedReference = (Reference) mapForBaseResource.get(reference);
+				if (resolvedReference != null)
+					resolved = (IPath) resolvedReference.get();
+			}
+			else {
+				mapForBaseResource = new HashMap();
+				fResolvedMap.put(basePath, mapForBaseResource);
+			}
+
+			if (resolved == null) {
+				IFile baseFile = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
+				IVirtualResource[] virtualResources = ComponentCore.createResources(baseFile);
+				for (int i = 0; i < virtualResources.length; i++) {
+					IPath baseRuntimePath = virtualResources[i].getRuntimePath();
+					IPath referenceRuntimePath = null;
+					if (reference.startsWith(SLASH)) {
+						referenceRuntimePath = new Path(reference);
+					}
+					else {
+						referenceRuntimePath = baseRuntimePath.removeLastSegments(1).append(reference);
+					}
+					IVirtualFile virtualFile = ComponentCore.createFile(project, referenceRuntimePath);
+					if (virtualFile != null && virtualFile.exists()) {
+						IFile[] underlyingFiles = virtualFile.getUnderlyingFiles();
+						for (int j = 0; j < underlyingFiles.length; j++) {
+							if (underlyingFiles[j].getProject().equals(project) && underlyingFiles[j].exists()) {
+								mapForBaseResource.put(reference, new SoftReference(underlyingFiles[j].getFullPath()));
+								resolved = underlyingFiles[j].getFullPath();
+							}
+
+						}
+					}
+				}
+			}
+			return resolved;
+		}
+		else {
+			IVirtualFile virtualFile = ComponentCore.createFile(project, new Path(reference));
+			if (virtualFile != null && virtualFile.exists()) {
+				return virtualFile.getUnderlyingFile().getFullPath();
+			}
+		}
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleSourcePathProvider.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleSourcePathProvider.java
new file mode 100644
index 0000000..3a98b89
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleSourcePathProvider.java
@@ -0,0 +1,52 @@
+/*******************************************************************************

+ * Copyright (c) 2010 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+package org.eclipse.wst.jsdt.web.core.internal.project;

+

+import org.eclipse.core.resources.IProject;

+import org.eclipse.core.resources.IResource;

+import org.eclipse.core.runtime.IPath;

+import org.eclipse.core.runtime.Path;

+import org.eclipse.wst.common.componentcore.ComponentCore;

+import org.eclipse.wst.common.componentcore.ModuleCoreNature;

+import org.eclipse.wst.common.componentcore.resources.IVirtualFile;

+import org.eclipse.wst.jsdt.core.IIncludePathEntry;

+import org.eclipse.wst.jsdt.core.JavaScriptCore;

+import org.eclipse.wst.jsdt.internal.core.util.DefaultSourcePathProvider;

+

+public class ModuleSourcePathProvider extends DefaultSourcePathProvider {

+

+	public ModuleSourcePathProvider() {

+	}

+

+	public IIncludePathEntry[] getDefaultSourcePaths(IProject p) {

+		if (ModuleCoreNature.isFlexibleProject(p)) {

+			IVirtualFile root = ComponentCore.createFile(p, Path.ROOT);

+			IResource[] underlyingResources = root.getUnderlyingResources();

+			if (underlyingResources == null || underlyingResources.length == 0) {

+				underlyingResources = new IResource[]{root.getUnderlyingResource()};

+			}

+			if (underlyingResources.length > 0 && underlyingResources[0] != null) {

+				IPath[] paths = new IPath[underlyingResources.length];

+				for (int i = 0; i < underlyingResources.length; i++) {

+					paths[i] = underlyingResources[i].getFullPath();

+				}

+				if (paths.length > 0) {

+					IIncludePathEntry[] entries = new IIncludePathEntry[paths.length];

+					for (int i = 0; i < paths.length; i++) {

+						entries[i] = JavaScriptCore.newSourceEntry(paths[i]);

+					}

+					return entries;

+				}

+			}

+		}

+		return super.getDefaultSourcePaths(p);

+	}

+}

diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectJsGlobalScopeContainerInitializer.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectJsGlobalScopeContainerInitializer.java
new file mode 100644
index 0000000..f5c4960
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectJsGlobalScopeContainerInitializer.java
@@ -0,0 +1,237 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.core.internal.project;
+
+import java.net.URI;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.jsdt.core.IIncludePathEntry;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer;
+import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer;
+import org.eclipse.wst.jsdt.core.compiler.libraries.LibraryLocation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsNameManglerUtil;
+import org.eclipse.wst.jsdt.web.core.javascript.WebRootFinder;
+
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class WebProjectJsGlobalScopeContainerInitializer extends JsGlobalScopeContainerInitializer  {
+	private static final String CONTAINER_DESCRIPTION = Messages.getString("WebProjectJsGlobalScopeContainerInitializer.0"); //$NON-NLS-1$
+	
+	public static final char[] LIB_NAME = {'b','r','o','w','s','e','r','W','i','n','d','o','w','.','j','s'};
+	/* Some tokens for us to identify mangled paths */
+	private static final String MANGLED_BUTT1 = "htm"; //$NON-NLS-1$
+	private static final String MANGLED_BUTT2 = ".js"; //$NON-NLS-1$
+	
+	//private IJavaScriptProject javaProject;
+	
+	
+	private static String getUnmangedHtmlPath(String containerPathString) {
+		if (containerPathString == null) {
+			return null;
+		}
+		if (containerPathString.toLowerCase().indexOf(WebProjectJsGlobalScopeContainerInitializer.MANGLED_BUTT1) != -1 && containerPathString.toLowerCase().indexOf(WebProjectJsGlobalScopeContainerInitializer.MANGLED_BUTT2) != -1) {
+			return JsNameManglerUtil.unmangle(containerPathString);
+		}
+		return null;
+	}
+	public LibraryLocation getLibraryLocation() {
+		return null;
+	}
+	
+	
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer#canUpdateJsGlobalScopeContainer(org.eclipse.core.runtime.IPath,
+	 *      org.eclipse.wst.jsdt.core.IJavaScriptProject)
+	 */
+	
+	public boolean canUpdateJsGlobalScopeContainer(IPath containerPath, IJavaScriptProject project) {
+		/* dont remove from this project */
+		return false;
+	}
+	
+	
+	protected IJsGlobalScopeContainer getContainer(IPath containerPath, IJavaScriptProject project) {
+		return this;
+	}
+	
+	
+	public String getDescription() {
+		return WebProjectJsGlobalScopeContainerInitializer.CONTAINER_DESCRIPTION;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer#getDescription(org.eclipse.core.runtime.IPath,
+	 *      org.eclipse.wst.jsdt.core.IJavaScriptProject)
+	 */
+	
+	public String getDescription(IPath containerPath, IJavaScriptProject javaProject) {
+		if (containerPath.equals(new Path(JsWebNature.VIRTUAL_CONTAINER))) {
+			return WebProjectJsGlobalScopeContainerInitializer.CONTAINER_DESCRIPTION;
+		}
+		
+		String containerPathString = containerPath.toString();
+		IPath webContext = getWebContextRoot(javaProject);
+		String fileExtension = containerPath.getFileExtension();
+		if(containerPath.equals(getWebContextRoot(javaProject)) || (fileExtension!=null && fileExtension.equals("js"))) { //$NON-NLS-1$
+			return webContext.toString();
+		}
+		String unmangled = WebProjectJsGlobalScopeContainerInitializer.getUnmangedHtmlPath(containerPathString);
+		if (unmangled != null) {
+			IPath projectPath = javaProject.getPath();
+			/* Replace the project path with the project name */
+			if (unmangled.indexOf(projectPath.toString()) >= 0) {
+				unmangled = javaProject.getDisplayName() + ":" + unmangled.substring(projectPath.toString().length()); //$NON-NLS-1$
+			}
+			return unmangled;
+		}
+		return containerPathString;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer#getHostPath(org.eclipse.core.runtime.IPath)
+	 */
+	
+	public URI getHostPath(IPath path, IJavaScriptProject project) {
+		// TODO Auto-generated method stub
+		String htmlPath = WebProjectJsGlobalScopeContainerInitializer.getUnmangedHtmlPath(path.toString());
+		if (htmlPath != null) {
+			URI fileUri =  new Path(htmlPath).toFile().toURI();
+			return fileUri;
+			//			try {
+//				return new URI(htmlPath);
+//			} catch (URISyntaxException ex) {
+//				ex.printStackTrace();
+//			}
+		}
+//		else {
+//			try {
+//				return new URI(path.toString());
+//			} catch (URISyntaxException ex) {
+//				// TODO Auto-generated catch block
+//				ex.printStackTrace();
+//			}
+//		}
+		return null;
+	}
+	
+	
+	public int getKind() {
+		return IJsGlobalScopeContainer.K_SYSTEM;
+	}
+	
+	
+	public IPath getPath() {
+		return new Path(JsWebNature.VIRTUAL_CONTAINER);
+	}
+
+	/**
+	 * @deprecated Use {@link #getIncludepathEntries()} instead
+	 */
+	public IIncludePathEntry[] getClasspathEntries() {
+		return getIncludepathEntries();
+	}
+	public IIncludePathEntry[] getIncludepathEntries() {
+		
+		//IIncludePathEntry entry=null;
+		
+	return new IIncludePathEntry[0];
+//		try {
+//		
+//			
+//			
+//			IPath contextPath = getWebContextRoot(javaProject);
+//			//entry =JavaScriptCore.newLibraryEntry(contextPath.makeAbsolute(), null,null, new IAccessRule[0], new IIncludePathAttribute[0], true);
+//			//entry =JavaScriptCore.newLibraryEntry(contextPath.makeAbsolute(), null, null, new IAccessRule[0], new IIncludePathAttribute[0], true);
+//			//entry =JavaScriptCore.newSourceEntry(contextPath.makeAbsolute());
+//			entry = new ClasspathEntry(
+//					IPackageFragmentRoot.K_SOURCE,
+//					IIncludePathEntry.CPE_SOURCE,
+//					contextPath.makeAbsolute(),
+//					ClasspathEntry.INCLUDE_ALL, ClasspathEntry.EXCLUDE_NONE,
+//					null, // source attachment
+//					null, // source attachment root
+//					null, // custom output location
+//					false,
+//					null,
+//					false, // no access rules to combine
+//					new IIncludePathAttribute[] {ClasspathEntry.EXCLUDE_VALIDATE}); 
+//			
+//		} catch (RuntimeException ex) {
+//			// TODO Auto-generated catch block
+//			ex.printStackTrace();
+//		}
+//		
+//		if(entry!=null) return new IIncludePathEntry[] {entry};
+//		return new IIncludePathEntry[0];
+	}
+	public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException {
+		//this.javaProject = project;
+		super.initialize(containerPath, project);
+		
+	}
+	
+	public static IPath getWebContextRoot(IJavaScriptProject javaProject) {
+		String webRoot = WebRootFinder.getWebContentFolder(javaProject.getProject()).toString();	
+		IPath webRootPath = javaProject.getPath().append(webRoot);
+		return webRootPath;
+	}
+	
+//	public IPath[] getAllHtmlInProject() {
+//		final ArrayList found = new ArrayList();
+//		String webRoot = getWebContextRoot(javaProject).toString();	
+//			IResourceProxyVisitor visitor = new IResourceProxyVisitor()
+//			{
+//				public boolean visit( IResourceProxy proxy ) throws CoreException
+//				{
+//					if ( proxy.getName().endsWith( ".htm" ) )
+//					{
+//						IPath path = proxy.requestResource().getLocation();
+//						found.add(path);
+//						//IIncludePathEntry newLibraryEntry = JavaScriptCore.newLibraryEntry( path,null, null, new IAccessRule[ 0 ], new IIncludePathAttribute[ 0 ], true );
+//						//entries.add( newLibraryEntry );
+//						return false;
+//					}
+//					
+//					return true;
+//				}
+//			};
+//			try
+//			{
+//				javaProject.getProject().findMember( new Path(webRoot) ).accept( visitor, 0 );
+//			}
+//			catch ( CoreException e )
+//			{
+//			}
+//		
+//		
+//		return (IPath[])found.toArray(new IPath[found.size()]);
+//	
+//	}
+	
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/messages.properties b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/messages.properties
new file mode 100644
index 0000000..52bc405
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/messages.properties
@@ -0,0 +1,19 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+JsNatureUninstaller.1=Uninstalling JavaScript Development Tools...
+JsNatureUninstaller.2=Removing JavaScript Development Toolking Nature...
+JsNatureUninstaller.3=Error installing runtime\! JavaScript Development Tools could not be removed, or is not present in target project..
+JsNatureInstaller.1=Installing JavaScript Development Tools...
+JsNatureInstaller.2=Adding JavaScript Development Toolkit Nature...
+JsNatureInstaller.3=Error installing runtime\! JavaScript Development Tools could not be added..
+JsWebNature.5=Error checking sourcepath:
+JsWebNature.6=Error checking sourcepath:
+WebProjectJsGlobalScopeContainerInitializer.0=Web Project support for JSDT
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/ContentTypeIdForEmbededJs.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/ContentTypeIdForEmbededJs.java
new file mode 100644
index 0000000..f4f8734
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/ContentTypeIdForEmbededJs.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.internal.provisional.contenttype;
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class ContentTypeIdForEmbededJs {
+	/**
+	 * The value of the contenttype id field must match what is specified in
+	 * plugin.xml file. Note: this value is intentially set with default
+	 * protected method so it will not be inlined.
+	 */
+	public final static String[] ContentTypeIds = ContentTypeIdForEmbededJs. getJsConstantString();
+
+	static String[] getJsConstantString() {
+		return new String[] {"org.eclipse.wst.html.core.htmlsource","org.eclipse.jst.jsp.core.jspsource"}; //$NON-NLS-1$ //$NON-NLS-2$
+	}
+	
+	private ContentTypeIdForEmbededJs() {
+		super();
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/IContentDescriptionForJSP.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/IContentDescriptionForJSP.java
new file mode 100644
index 0000000..2b48f85
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/IContentDescriptionForJSP.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.internal.provisional.contenttype;
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.wst.sse.core.internal.encoding.ICodedResourcePlugin;
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public interface IContentDescriptionForJSP {
+	public final static QualifiedName CONTENT_FAMILY_ATTRIBUTE = new QualifiedName(ICodedResourcePlugin.ID, "contentFamilyAttribute"); //$NON-NLS-1$;
+	/**
+	 * Extra properties as part of ContentDescription, if the content is JSP.
+	 */
+	public final static QualifiedName CONTENT_TYPE_ATTRIBUTE = new QualifiedName(ICodedResourcePlugin.ID, "contentTypeAttribute"); //$NON-NLS-1$
+	public final static QualifiedName LANGUAGE_ATTRIBUTE = new QualifiedName(ICodedResourcePlugin.ID, "languageAttribute"); //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsValidator.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsValidator.java
new file mode 100644
index 0000000..30dc484
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsValidator.java
@@ -0,0 +1,356 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.internal.validation;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceProxy;
+import org.eclipse.core.resources.IResourceProxyVisitor;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.wst.jsdt.core.compiler.IProblem;
+import org.eclipse.wst.jsdt.web.core.internal.Logger;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapterFactory;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
+import org.eclipse.wst.validation.AbstractValidator;
+import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
+import org.eclipse.wst.validation.internal.core.Message;
+import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+public class JsValidator extends AbstractValidator implements IValidator, IExecutableExtension {
+	private static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsvalidator")).booleanValue(); //$NON-NLS-1$
+	private IValidator fMessageOriginator;
+	private Set fValidFileExts = new HashSet();
+	
+//	private static String [] jsdtValidator = {"org.eclipse.wst.jsdt.web.core.internal.validation.JsBatchValidator"}; //$NON-NLS-1$
+
+	
+	protected class LocalizedMessage extends Message {
+		private String _message = null;
+		
+		public LocalizedMessage(int severity, String messageText) {
+			this(severity, messageText, null);
+		}
+		
+		public LocalizedMessage(int severity, String messageText, IResource targetObject) {
+			this(severity, messageText, (Object) targetObject);
+		}
+		
+		public LocalizedMessage(int severity, String messageText, Object targetObject) {
+			super(null, severity, null);
+			setLocalizedMessage(messageText);
+			setTargetObject(targetObject);
+		}
+		
+		public String getLocalizedMessage() {
+			return _message;
+		}
+		
+		
+		public String getText() {
+			return getLocalizedMessage();
+		}
+		
+		
+		public String getText(ClassLoader cl) {
+			return getLocalizedMessage();
+		}
+		
+		
+		public String getText(Locale l) {
+			return getLocalizedMessage();
+		}
+		
+		
+		public String getText(Locale l, ClassLoader cl) {
+			return getLocalizedMessage();
+		}
+		
+		public void setLocalizedMessage(String message) {
+			_message = message;
+		}
+	}
+	public JsValidator() {
+		this.fMessageOriginator = this;
+	}
+	
+	/**
+	 * Creates an IMessage from an IProblem
+	 * 
+	 * @param problem
+	 * @param f
+	 * @param translation
+	 * @param textDoc
+	 * @return message representation of the problem, or null if it could not
+	 *         create one
+	 */
+	private IMessage createMessageFromProblem(IProblem problem, IFile f, IJsTranslation translation, IDocument textDoc) {
+		int sourceStart = problem.getSourceStart();
+		int sourceEnd = problem.getSourceEnd();
+		if (sourceStart == -1) {
+			return null;
+		}
+		
+		/*
+		 * Bug 241794 - Validation shows errors when using JSP Expressions
+		 * inside JavaScript code
+		 */
+		IStructuredDocument doc = (IStructuredDocument) textDoc;
+		IStructuredDocumentRegion documentRegion = doc.getRegionAtCharacterOffset(sourceStart);
+		if (documentRegion != null) {
+			ITextRegion textRegion = documentRegion.getRegionAtCharacterOffset(sourceStart);
+			/*
+			 * Filter out problems from areas that aren't simple JavaScript,
+			 * e.g. JSP.
+			 */
+			if (textRegion != null && textRegion instanceof ITextRegionCollection)
+				return null;
+		}
+
+		int sev = problem.isError() ? IMessage.HIGH_SEVERITY : (problem.isWarning() ? IMessage.NORMAL_SEVERITY : IMessage.LOW_SEVERITY);
+		IMessage m = new LocalizedMessage(sev, problem.getMessage(), f);
+		// line numbers for marker starts @ 1
+		// line numbers from document starts @ 0
+		try {
+			int lineNo = textDoc.getLineOfOffset(sourceStart) + 1;
+			m.setLineNo(lineNo);
+			m.setOffset(sourceStart);
+			m.setLength(sourceEnd - sourceStart + 1);
+		}
+		catch (BadLocationException e) {
+			Logger.logException(e);
+		}
+		return m;
+	}
+	
+	void performValidation(IFile f, IReporter reporter, IStructuredModel model, boolean inBatch) {
+		if (model instanceof IDOMModel) {
+			IDOMModel domModel = (IDOMModel) model;
+			setupAdapterFactory(domModel);
+			IDOMDocument xmlDoc = domModel.getDocument();
+			JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+			//translationAdapter.resourceChanged();
+			IJsTranslation translation = translationAdapter.getJsTranslation(false);
+			if (!reporter.isCancelled()) {
+				translation.setProblemCollectingActive(true);
+				translation.reconcileCompilationUnit();
+				List problems = translation.getProblems();
+//				if(!inBatch) reporter.removeAllMessages(this, f);
+				// add new messages
+				for (int i = 0; i < problems.size() && !reporter.isCancelled(); i++) {
+					IMessage m = createMessageFromProblem((IProblem) problems.get(i), f, translation, domModel.getStructuredDocument());
+					if (m != null) {
+						reporter.addMessage(fMessageOriginator, m);
+					}
+				}
+			}
+		}
+	}
+	
+	/* Read the definition for this validator and the declared valid file extensions
+	 * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+	 */
+	public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+		IConfigurationElement[] includes = config.getChildren("include"); //$NON-NLS-1$
+		for (int i = 0; i < includes.length; i++) {
+			IConfigurationElement[] fileexts = includes[i].getChildren("fileext"); //$NON-NLS-1$
+			for (int j = 0; j < fileexts.length; j++) {
+				String fileext = fileexts[j].getAttribute("ext"); //$NON-NLS-1$
+				if (fileext != null) {
+					fValidFileExts.add(fileext);
+				}
+			}
+		}
+	}
+	
+	/**
+	 * Ensures that our translation adapter is present before we try to use it
+	 * 
+	 * @param sm
+	 */
+	private void setupAdapterFactory(IStructuredModel sm) {
+		if (sm.getFactoryRegistry().getFactoryFor(IJsTranslation.class) == null) {
+			JsTranslationAdapterFactory factory = new JsTranslationAdapterFactory();
+			sm.getFactoryRegistry().addFactory(factory);
+		}
+	}
+	
+	boolean shouldValidate(IFile file) {
+		IResource resource = file;
+		do {
+			if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || resource.getName().charAt(0) == '.') {
+				return false;
+			}
+			resource = resource.getParent();
+		} while ((resource.getType() & IResource.PROJECT) == 0);
+		return fValidFileExts.isEmpty() || fValidFileExts.contains(file.getFileExtension());
+	}
+	
+	public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
+		/* Added by BC ---- */
+		// if(true) return;
+		/* end Added by BC ---- */
+		
+		String[] uris = helper.getURIs();
+		if (uris.length > 0) {
+			IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
+			IFile currentFile = null;
+			for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
+				currentFile = wsRoot.getFile(new Path(uris[i]));
+				reporter.removeAllMessages(this, currentFile);
+				if (currentFile != null && currentFile.exists()) {
+					if (shouldValidate(currentFile) ){ //&& fragmentCheck(currentFile)) {
+						int percent = (i * 100) / uris.length + 1;
+						IMessage message = new LocalizedMessage(IMessage.LOW_SEVERITY, percent + "% " + uris[i]); //$NON-NLS-1$
+						reporter.displaySubtask(this, message);
+						validateFile(currentFile, reporter);
+					}
+					if (DEBUG) {
+						System.out.println("validating: [" + uris[i] + "]"); //$NON-NLS-1$ //$NON-NLS-2$
+					}
+				}
+			}
+		} else {
+			// if uris[] length 0 -> validate() gets called for each project
+			if (helper instanceof IWorkbenchContext) {
+				IProject project = ((IWorkbenchContext) helper).getProject();
+				JSFileVisitor visitor = new JSFileVisitor(reporter);
+				try {
+					// collect all jsp files for the project
+					project.accept(visitor, IResource.DEPTH_INFINITE);
+				} catch (CoreException e) {
+					if (DEBUG) {
+						e.printStackTrace();
+					}
+				}
+				IFile[] files = visitor.getFiles();
+				for (int i = 0; i < files.length && !reporter.isCancelled(); i++) {
+					int percent = (i * 100) / files.length + 1;
+					IMessage message = new LocalizedMessage(IMessage.LOW_SEVERITY, percent + "% " + files[i].getFullPath().toString()); //$NON-NLS-1$
+					reporter.displaySubtask(this, message);
+					validateFile(files[i], reporter);
+					if (DEBUG) {
+						System.out.println("validating: [" + files[i] + "]"); //$NON-NLS-1$ //$NON-NLS-2$
+					}
+				}
+			}
+		}
+	}
+
+	protected class JSFileVisitor implements IResourceProxyVisitor {
+		private List fFiles = new ArrayList();
+		private IReporter fReporter = null;
+		
+		public JSFileVisitor(IReporter reporter) {
+			fReporter = reporter;
+		}
+		
+		public final IFile[] getFiles() {
+			return (IFile[]) fFiles.toArray(new IFile[fFiles.size()]);
+		}
+		
+		
+		public boolean visit(IResourceProxy proxy) throws CoreException {
+			// check validation
+			if (fReporter.isCancelled()) {
+				return false;
+			}
+			if (proxy.getType() == IResource.FILE) {
+				if (Util.isJsType(proxy.getName())) {
+					IFile file = (IFile) proxy.requestResource();
+					if (file.exists() && shouldValidate(file)) {
+						if (DEBUG) {
+							System.out.println("(+) JSPValidator adding file: " + file.getName()); //$NON-NLS-1$
+						}
+						fFiles.add(file);
+						// don't search deeper for files
+						return false;
+					}
+				}
+			}
+			return true;
+		}
+	}
+	public void cleanup(IReporter reporter) {
+		// nothing to do
+	}
+	/**
+	 * Validate one file. It's assumed that the file has JSP content type.
+	 * 
+	 * @param f
+	 * @param reporter
+	 */
+	
+	protected void validateFile(IFile f, IReporter reporter) {
+		if (JsValidator.DEBUG) {
+			Logger.log(Logger.INFO, getClass().getName() + " validating: " + f); //$NON-NLS-1$
+		}
+		IStructuredModel model = null;
+		try {
+			// get jsp model, get tranlsation
+			model = StructuredModelManager.getModelManager().getModelForRead(f);
+			if (!reporter.isCancelled() && model != null) {
+				// get DOM model then translation
+				//WorkbenchReporter.removeAllMessages(f.getProject(), jsdtValidator, f.toString());
+				//reporter.removeAllMessages(fMessageOriginator, f);
+				performValidation(f, reporter, model, false);
+			}
+		} catch (IOException e) {
+			Logger.logException(e);
+		} catch (CoreException e) {
+			Logger.logException(e);
+		} finally {
+			if (model != null) {
+				model.releaseFromRead();
+			}
+		}
+	}
+	public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
+		if (resource.getType() != IResource.FILE)
+			return null;
+		ValidationResult result = new ValidationResult();
+		IReporter reporter = result.getReporter(monitor);
+		validateFile((IFile) resource, reporter);
+		return result;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/Util.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/Util.java
new file mode 100644
index 0000000..5e84a72
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/Util.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.core.internal.validation;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.wst.jsdt.web.core.internal.provisional.contenttype.ContentTypeIdForEmbededJs;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class Util {
+	
+	public static boolean isJsType(String fileName) {
+		if(fileName==null) return false;
+		boolean valid = false;
+		IContentType[] types =getJavascriptContentTypes();
+		int i = 0;
+		while (types!=null && i < types.length && !valid) {
+			valid = types[i]!=null && types[i].isAssociatedWith(fileName);
+			++i;
+		}
+		return valid;
+		
+	}
+	
+	public static IContentType[] getJavascriptContentTypes() {
+
+		String[] contentTypeIds = ContentTypeIdForEmbededJs.ContentTypeIds;
+		ArrayList fContentTypes = new ArrayList();
+		
+		
+		for(int i = 0;i<contentTypeIds.length;i++) {
+			IContentType ct =  Platform.getContentTypeManager().getContentType(contentTypeIds[i]);
+			if(ct!=null) fContentTypes.add(ct);
+		}
+		
+		return (IContentType[])fContentTypes.toArray(new IContentType[fContentTypes.size()]);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/CompilationUnitHelper.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/CompilationUnitHelper.java
new file mode 100644
index 0000000..8dbeb85
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/CompilationUnitHelper.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IProblemRequestor;
+import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
+
+/**
+
+
+
+
+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to
+ * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+ * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+ * (repeatedly) as the API evolves.
+ * 
+ * <br><br> this code was taken from the JSP plugin.  This class is to ensure only one copy of the compilation unit exits.
+ * 
+ * @author pavery
+ */
+public class CompilationUnitHelper {
+	private static CompilationUnitHelper instance;
+	
+	public synchronized static final CompilationUnitHelper getInstance() {
+		if (CompilationUnitHelper.instance == null) {
+			CompilationUnitHelper.instance = new CompilationUnitHelper();
+		}
+		return CompilationUnitHelper.instance;
+	}
+	private JsProblemRequestor fProblemRequestor = null;
+	private WorkingCopyOwner fWorkingCopyOwner = null;
+	
+	private CompilationUnitHelper() {
+	// force use of instance
+	}
+	
+	public JsProblemRequestor getProblemRequestor() {
+		if (fProblemRequestor == null) {
+			fProblemRequestor = new JsProblemRequestor();
+		}
+		return fProblemRequestor;
+	}
+	
+	public WorkingCopyOwner getWorkingCopyOwner() {
+		if (fWorkingCopyOwner == null) {
+			fWorkingCopyOwner = new WorkingCopyOwner() {
+				/* (non-Javadoc)
+				 * @see org.eclipse.wst.jsdt.core.WorkingCopyOwner#getProblemRequestor(org.eclipse.wst.jsdt.core.IJavaScriptUnit)
+				 */
+				public IProblemRequestor getProblemRequestor(IJavaScriptUnit workingCopy) {
+					return CompilationUnitHelper.this.getProblemRequestor();
+				}
+				
+				public String toString() {
+					return "Client JavaScript WorkingCopyOwner"; //$NON-NLS-1$
+				}
+			};
+		}
+		return fWorkingCopyOwner;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/DocumentChangeListenerToTextEdit.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/DocumentChangeListenerToTextEdit.java
new file mode 100644
index 0000000..7320ba9
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/DocumentChangeListenerToTextEdit.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.text.edits.DeleteEdit;
+import org.eclipse.text.edits.InsertEdit;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.ReplaceEdit;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+* <br><br>
+* 
+* this class attaches to a "cloned" document, listens for changes to that document then translates
+* the changes to text edits.  these changes can then be applied back to the original document.
+* 
+*
+*/
+public class DocumentChangeListenerToTextEdit implements IDocumentListener {
+	private MultiTextEdit textEdit;
+	
+	public DocumentChangeListenerToTextEdit() {
+		textEdit = new MultiTextEdit();
+	}
+	
+	public void documentAboutToBeChanged(DocumentEvent event) {
+	// System.out.println("Unimplemented
+	// method:DocumentChangeListenerToTextEdit.documentAboutToBeChanged");
+	}
+	
+	public void documentChanged(DocumentEvent event) {
+		int length = event.getLength();
+		int offset = event.getOffset();
+		String text = event.getText();
+		if (length < 0) {
+			return;
+		}
+		if (length == 0) {
+			/* inserting text operation */
+			InsertEdit edit = new InsertEdit(offset, text);
+			textEdit.addChild(edit);
+			
+		} else if (text == null || text.equals("")) { //$NON-NLS-1$
+			/* delete operation */
+			DeleteEdit edit = new DeleteEdit(offset, length);
+			textEdit.addChild(edit);
+			
+		} else if (length > 0) {
+			/* replace text operation */
+			ReplaceEdit edit = new ReplaceEdit(offset, length, text);
+			textEdit.addChild(edit);
+		
+		}
+	}
+	
+	public MultiTextEdit getTextEdits() {
+		return textEdit;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/HTML40Namespace.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/HTML40Namespace.java
new file mode 100644
index 0000000..e34d226
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/HTML40Namespace.java
Binary files differ
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslation.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslation.java
new file mode 100644
index 0000000..5a6dd23
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslation.java
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to 
+ * change significantly before reaching stability. It is being made available at this early stage to solicit feedback 
+ * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken 
+ * (repeatedly) as the API evolves.
+ *     
+ *     
+ *******************************************************************************/
+
+
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+import java.util.List;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+
+
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.<br>
+* 
+*/
+public interface IJsTranslation {
+
+	/**
+	 * @return IJavaScriptProject that this translation belongs to
+	 */
+	public IJavaScriptProject getJavaProject();
+
+	/**
+	 * @return Original HTML document from the translation.
+	 */
+	public IDocument getHtmlDocument();
+
+	/**
+	 * @return integer position of a missing </script> tag (the document isn't well formed and resulted in translation error.).
+	 * 
+	 */
+	public int getMissingTagStart();
+
+	/**
+	 * @param javaPositionStart
+	 * @param javaPositionEnd
+	 * @return all javascript elements within the given range
+	 */
+	public IJavaScriptElement[] getAllElementsInJsRange(int javaPositionStart, int javaPositionEnd);
+
+	/**
+	 * @return the javascript unit from the jsdt.core
+	 */
+	public IJavaScriptUnit getCompilationUnit();
+
+	/**
+	 * @param javaPositionStart
+	 * @param javaPositionEnd
+	 * @return
+	 */
+	public IJavaScriptElement[] getElementsFromJsRange(int javaPositionStart, int javaPositionEnd);
+
+	/**
+	 * @return string of the document.
+	 */
+	public String getHtmlText();
+
+	/**
+	 * @param jsOffset
+	 * @return a single javascript element at the given offset.
+	 */
+	public IJavaScriptElement getJsElementAtOffset(int jsOffset);
+
+	/**
+	 * @return only the translated javascript text
+	 */
+	public String getJsText();
+
+	/**
+	 * @return a list of the script regions within the translation.
+	 */
+	public Position[] getScriptPositions();
+
+	/**
+	 * @param text
+	 */
+	public void insertInFirstScriptRegion(String text);
+
+	/**
+	 * insert javascript at the given offset.  method should ensure the documents well-formedness and proper script region.
+	 * 
+	 * @param offset
+	 * @param text
+	 */
+	public void insertScript(int offset, String text);
+
+	/**
+	 * @return a list of javascript errors
+	 */
+	public List getProblems();
+
+	/**
+	 * @param offset
+	 * @return if the offset is within a script import node.
+	 */
+	public boolean ifOffsetInImportNode(int offset);
+
+	/**
+	 * checks the CU for errors/consistancy.
+	 */
+	public void reconcileCompilationUnit();
+
+	/**
+	 * release the translation.  always a good idea to do when you're done.  you may notice document and model locks if not.
+	 */
+	public void release();
+	
+	/**
+	 * fixes a mangled html--> pure js name.
+	 * @param displayString
+	 * @return
+	 */
+	public String fixupMangledName(String displayString); 
+	
+	/**
+	 * start/stop collecting problems within the javascript unit.
+	 * @param collect
+	 */
+	public void setProblemCollectingActive(boolean collect);
+	
+	/**
+	 * @return
+	 */
+	public String getJavaPath();
+	
+	/**
+	 * 
+	 * 
+	 * @param htmlDocument
+	 * @param javaProj
+	 * @param listenForChanges
+	 * @return
+	 */
+	public IJsTranslation getInstance(IStructuredDocument htmlDocument, IJavaScriptProject javaProj, boolean listenForChanges) ;
+
+	/**
+	 * notify the translation to update any external dependancies that are created during translation
+	 * 
+	 */
+	public void classpathChange() ;
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslator.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslator.java
new file mode 100644
index 0000000..8726cab
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslator.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to 
+ * change significantly before reaching stability. It is being made available at this early stage to solicit feedback 
+ * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken 
+ * (repeatedly) as the API evolves.
+ *     
+ *     
+ *******************************************************************************/
+
+
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.Position;
+import org.eclipse.wst.jsdt.core.IBuffer;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+
+
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public interface IJsTranslator extends IDocumentListener{
+
+	/**
+	 * @return string of javascript from the document
+	 */
+	public String getJsText();
+
+	/**
+	 * sets the javascript unit buffer
+	 * @param buffer
+	 */
+	public void setBuffer(IBuffer buffer);
+
+	/**
+	 * 
+	 * @return a list of html locations within the docuemnt.
+	 */
+	public Position[] getHtmlLocations();
+
+	/**
+	 * @return the region of a missing </script> tag
+	 */
+	public int getMissingEndTagRegionStart();
+
+	/**
+	 * @return position array of <script src=".."> within the doc.
+	 */
+	public Position[] getImportHtmlRanges();
+
+	/**
+	 * @return raw/unresolved <script imports>
+	 */
+	public String[] getRawImports();
+
+	/**
+	 *  begin translating the document.
+	 */
+	public void translate();
+
+	/**
+	 * translates an inline (event="..") js container region and adds it to the document text.  must be called in order
+	 * @param container
+	 */
+	public void translateInlineJSNode(IStructuredDocumentRegion container);
+
+	/**
+	 * translates a script block.  must be called in the order it appears within the document.
+	 * @param container
+	 */
+	public void translateJSNode(IStructuredDocumentRegion container);
+
+	/**
+	 * translates a <script src=".."> element, parsing out an import.
+	 * @param region
+	 */
+	public void translateScriptImportNode(IStructuredDocumentRegion region);
+
+	/**
+	 * release any resources the translation is holding onto.
+	 * 
+	 */
+	public void release();
+
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsDataTypes.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsDataTypes.java
new file mode 100644
index 0000000..8bd2ae1
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsDataTypes.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public interface JsDataTypes extends HTML40Namespace {
+	/*
+	 * remove when when we refactor (need to add this content type to many
+	 * project types in wst)
+	 */
+	public static final String BASE_FILE_EXTENSION = ".js"; //$NON-NLS-1$
+	public static String[] CONSTANTS = { "false", "null", "true" }; //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
+	public static final String[] EVENTS = { HTML40Namespace.ATTR_NAME_ONCLICK, HTML40Namespace.ATTR_NAME_ONDBLCLICK, HTML40Namespace.ATTR_NAME_ONMOUSEDOWN,
+			HTML40Namespace.ATTR_NAME_ONMOUSEUP, HTML40Namespace.ATTR_NAME_ONMOUSEOVER, HTML40Namespace.ATTR_NAME_ONMOUSEMOVE,
+			HTML40Namespace.ATTR_NAME_ONMOUSEOUT, HTML40Namespace.ATTR_NAME_ONKEYPRESS, HTML40Namespace.ATTR_NAME_ONKEYDOWN, HTML40Namespace.ATTR_NAME_ONKEYUP,
+			HTML40Namespace.ATTR_NAME_ONHELP };
+	public static final String[] HTMLATREVENTS = { "onload ", "onunload", "onclick", "onmousedown", "onmouseup", "onmouseover", "onmousemove", "onmouseout", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
+			"onfocus", "onblur", "onkeypress", "onkeydown", "onkeyup", "onsubmit", "onreset", "onselect", "onchange", }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
+	public static final String[] JSVALIDDATATYPES = { "JAVASCRIPT", "TEXT/JAVASCRIPT" }; //$NON-NLS-1$ //$NON-NLS-2$
+	public static String[] KEYWORDS = { "abstract", "break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$
+			"enum", "export", "extends", "final", "finally", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "interface", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$ //$NON-NLS-13$ //$NON-NLS-14$
+			"native", "new", "package", "private", "protected", "public", "return", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+			"static", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", "typeof", "volatile", "while", "with" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$ //$NON-NLS-13$
+	// public static final String
+	// NEW_PARTITION_TYPE="org.eclipse.wst.jsdt.StructuredJs";
+	// public static final String NEW_PARTITION_TYPE=IHTMLPartitions.SCRIPT;
+	public static final String NEW_PARTITION_TYPE = IHTMLPartitions.SCRIPT;
+	public static final String[] TAKEOVER_PARTITION_TYPES = { "none" }; //$NON-NLS-1$
+	public static String[] TYPES = { "boolean", "byte", "char", "double", "int", "long", "short", "float", "var", "void" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsNameManglerUtil.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsNameManglerUtil.java
new file mode 100644
index 0000000..40cee8f
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsNameManglerUtil.java
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+import java.io.File;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsNameManglerUtil {
+	/**
+	 * Determine if given string is a valid Hex representation of an ASCII
+	 * character (eg. 2F -> /)
+	 * 
+	 * @param possible
+	 * @return
+	 */
+	private static boolean isValid(String possible) {
+		boolean result = false;
+		if (possible.length() == 2) {
+			char c1 = possible.charAt(0);
+			char c2 = possible.charAt(1);
+			// 1st character must be a digit
+			if (Character.isDigit(c1)) {
+				// 2nd character must be digit or upper case letter A-F
+				if (Character.isDigit(c2)) {
+					result = true;
+				} else if (Character.isUpperCase(c2) && (c2 == 'A' || c2 == 'B' || c2 == 'C' || c2 == 'D' || c2 == 'E' || c2 == 'F')) {
+					result = true;
+				}
+			}
+		}
+		return result;
+	}
+	
+	/**
+	 * Mangle string to WAS-like specifications
+	 * 
+	 */
+	public final static String mangle(String name) {
+		StringBuffer modifiedName = new StringBuffer();
+		// extension (.jsp, .jspf, .jspx, etc...) should already be encoded in
+		// name
+		int length = name.length();
+		// in case name is forbidden (a number, class, for, etc...)
+		modifiedName.append('_');
+		// ensure rest of characters are valid
+		for (int i = 0; i < length; i++) {
+			char currentChar = name.charAt(i);
+			if (Character.isJavaIdentifierPart(currentChar) == true) {
+				modifiedName.append(currentChar);
+			} else {
+				modifiedName.append(JsNameManglerUtil.mangleChar(currentChar));
+			}
+		}
+		return modifiedName.toString();
+	}
+	
+	/**
+	 * take a character and return its hex equivalent
+	 */
+	private final static String mangleChar(char ch) {
+		if (ch == File.separatorChar) {
+			ch = '/';
+		}
+		if (Character.isLetterOrDigit(ch) == true) {
+			return "" + ch; //$NON-NLS-1$
+		}
+		return "_" + Integer.toHexString(ch).toUpperCase() + "_"; //$NON-NLS-1$ //$NON-NLS-2$
+	}
+	
+	/**
+	 * WAS mangles Tom&Jerry as: _Tom_26_Jerry; this takes in the mangled name
+	 * and returns the original name.
+	 * 
+	 * Unmangles the qualified type name. If an underscore is found it is
+	 * assumed to be a mangled representation of a non-alpha, non-digit
+	 * character of the form _NN_, where NN are hex digits representing the
+	 * encoded character. This routine converts it back to the original
+	 * character.
+	 */
+	public final static String unmangle(String qualifiedTypeName) {
+		if (qualifiedTypeName.charAt(0) != '_') {
+			return qualifiedTypeName;
+		}
+		StringBuffer buf = new StringBuffer();
+		String possible = ""; //$NON-NLS-1$
+		// remove the .java extension if there is one
+		if (qualifiedTypeName.endsWith(".js")) { //$NON-NLS-1$
+			qualifiedTypeName = qualifiedTypeName.substring(0, qualifiedTypeName.length() - 3);
+		}
+		for (int i = 1; i < qualifiedTypeName.length(); i++) { // start at
+			// index 1 b/c
+			// 1st char is
+			// always '_'
+			char c = qualifiedTypeName.charAt(i);
+			if (c == '_') {
+				int endIndex = qualifiedTypeName.indexOf('_', i + 1);
+				if (endIndex == -1) {
+					buf.append(c);
+				} else {
+					char unmangled;
+					try {
+						possible = qualifiedTypeName.substring(i + 1, endIndex);
+						if (JsNameManglerUtil.isValid(possible)) {
+							unmangled = (char) Integer.decode("0x" + possible).intValue();//$NON-NLS-1$
+							i = endIndex;
+						} else {
+							unmangled = c;
+						}
+					} catch (NumberFormatException e) {
+						unmangled = c;
+					}
+					buf.append(unmangled);
+				}
+			} else {
+				buf.append(c);
+			}
+		}
+		return buf.toString();
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsProblemRequestor.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsProblemRequestor.java
new file mode 100644
index 0000000..ac94dd0
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsProblemRequestor.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.wst.jsdt.core.IProblemRequestor;
+import org.eclipse.wst.jsdt.core.compiler.IProblem;
+
+class JsProblemRequestor implements IProblemRequestor {
+	private List fCollectedProblems;
+	private boolean fIsActive = false;
+	private boolean fIsRunning = false;
+	
+	public void acceptProblem(IProblem problem) {
+		if (isActive()) {
+			getCollectedProblems().add(problem);
+		}
+	}
+	
+	public void beginReporting() {
+		fIsRunning = true;
+	}
+	
+	public void endReporting() {
+		fIsRunning = false;
+	}
+	
+	/**
+	 * @return the list of collected problems
+	 */
+	public List getCollectedProblems() {
+		if (fCollectedProblems == null)
+			fCollectedProblems = new ArrayList();
+		return fCollectedProblems;
+	}
+	
+	public boolean isActive() {
+		return fIsActive;
+	}
+	
+	public boolean isRunning() {
+		return fIsRunning;
+	}
+	
+	/**
+	 * Sets the active state of this problem requestor.
+	 * 
+	 * @param isActive
+	 *            the state of this problem requestor
+	 */
+	public void setIsActive(boolean isActive) {
+		fIsActive = isActive;
+	}
+	
+	/**
+	 * Tells this annotation model to collect temporary problems from now on.
+	 */
+	private void startCollectingProblems() {
+		getCollectedProblems().clear();
+	}
+	
+	/**
+	 * Tells this annotation model to no longer collect temporary problems.
+	 */
+	private void stopCollectingProblems() {
+	// do nothing
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslation.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslation.java
new file mode 100644
index 0000000..74fd5d3
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslation.java
@@ -0,0 +1,589 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     bug:244839 - eugene@genuitec.com
+ *     
+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to 
+ * change significantly before reaching stability. It is being made available at this early stage to solicit feedback 
+ * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken 
+ * (repeatedly) as the API evolves.
+ *     
+ *     
+ *******************************************************************************/
+
+
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.List;
+import java.util.Vector;
+
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.Region;
+import org.eclipse.wst.jsdt.core.IBuffer;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
+import org.eclipse.wst.jsdt.core.ISourceRange;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
+import org.eclipse.wst.jsdt.core.compiler.IProblem;
+import org.eclipse.wst.jsdt.internal.core.DocumentContextFragmentRoot;
+import org.eclipse.wst.jsdt.internal.core.Member;
+import org.eclipse.wst.jsdt.internal.core.SourceRefElement;
+import org.eclipse.wst.jsdt.web.core.internal.Logger;
+import org.eclipse.wst.jsdt.web.core.internal.project.JsWebNature;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsTranslation implements IJsTranslation {
+
+	private static final boolean DEBUG;
+	static {
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jstranslation"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+
+	private IJavaScriptUnit fCompilationUnit = null;
+	private DocumentContextFragmentRoot fDocumentScope;
+	private IJavaScriptProject fJavaProject = null;
+	private byte[] fLock = null;
+	private IProgressMonitor fProgressMonitor = null;
+	protected IStructuredDocument fHtmlDocument;
+	protected String fModelBaseLocation;
+
+
+//	private static final String SUPER_TYPE_NAME = "Window"; //$NON-NLS-1$
+//	private static final String SUPER_TYPE_LIBRARY = "org.eclipse.wst.jsdt.launching.baseBrowserLibrary"; //$NON-NLS-1$
+
+	protected IJsTranslator fTranslator;
+
+	private String mangledName;
+	protected boolean listenForChanges;
+
+	public JsTranslation() {
+		/* do nothing */
+	}
+	
+	public IJsTranslator getTranslator() {
+		if(fTranslator!=null) {
+			return fTranslator;
+		}
+		
+		fTranslator = new JsTranslator(fHtmlDocument, fModelBaseLocation, listenForChanges);
+		return this.fTranslator;
+	}
+	
+
+	
+	protected JsTranslation(IStructuredDocument htmlDocument, IJavaScriptProject javaProj, boolean listenForChanges) {
+		fLock = new byte[0];
+		fJavaProject = javaProj;
+		fHtmlDocument = htmlDocument;
+		setBaseLocation();
+		mangledName = createMangledName();
+		this.listenForChanges=listenForChanges;
+	}
+
+	public IJsTranslation getInstance(IStructuredDocument htmlDocument, IJavaScriptProject javaProj, boolean listenForChanges) {
+		return new JsTranslation(htmlDocument,javaProj, listenForChanges);
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getJavaProject()
+	 */
+	public IJavaScriptProject getJavaProject() {
+		return fJavaProject;
+	}
+
+	private IPackageFragmentRoot getDocScope(boolean reset) {
+		if (fDocumentScope == null) {
+			// IProject project = getJavaProject().getProject();
+			// IResource absoluteRoot =
+			// ((IContainer)getJavaProject().getResource()).findMember(
+			// WebRootFinder.getWebContentFolder(fJavaProject.getProject()));
+			fDocumentScope = new DocumentContextFragmentRoot(fJavaProject, getFile(), WebRootFinder.getWebContentFolder(fJavaProject.getProject()), WebRootFinder.getServerContextRoot(fJavaProject.getProject()), JsWebNature.VIRTUAL_SCOPE_ENTRY);
+			fDocumentScope.setIncludedFiles(getTranslator().getRawImports());
+			return fDocumentScope;
+		}
+
+		if (reset)
+			fDocumentScope.setIncludedFiles(getTranslator().getRawImports());
+		return fDocumentScope;
+	}
+
+	private void setBaseLocation() {
+		IDOMModel xmlModel = null;
+		try {
+			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(fHtmlDocument);
+			if (xmlModel == null) {
+				xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getModelForRead(fHtmlDocument);
+			}
+			fModelBaseLocation = xmlModel.getBaseLocation();
+		}
+		finally {
+			if (xmlModel != null)
+				xmlModel.releaseFromRead();
+		}
+		// return xmlModel;
+	}
+
+	public IFile getFile() {
+		return FileBuffers.getWorkspaceFileAtLocation(new Path(fModelBaseLocation));
+	}
+
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getHtmlDocument()
+	 */
+	public IDocument getHtmlDocument() {
+		return fHtmlDocument;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getMissingTagStart()
+	 */
+	public int getMissingTagStart() {
+		return getTranslator().getMissingEndTagRegionStart();
+	}
+
+	private String getWebRoot() {
+		return WebRootFinder.getWebContentFolder(fJavaProject.getProject()).toString();
+	}
+
+
+	public String getDirectoryUnderRoot() {
+		String webRoot = getWebRoot();
+		IPath projectWebRootPath = getJavaProject().getPath().append(webRoot);
+		IPath filePath = new Path(fModelBaseLocation).removeLastSegments(1);
+		return filePath.removeFirstSegments(projectWebRootPath.matchingFirstSegments(filePath)).toString();
+	}
+
+	/**
+	 * Originally from ReconcileStepForJava. Creates an IJavaScriptUnit from
+	 * the contents of the JSP document.
+	 * 
+	 * @return an IJavaScriptUnit from the contents of the JSP document
+	 */
+	private IJavaScriptUnit createCompilationUnit() throws JavaScriptModelException {
+		IPackageFragmentRoot root = getDocScope(true);
+		IJavaScriptUnit cu = root.getPackageFragment("").getJavaScriptUnit(getMangledName() + JsDataTypes.BASE_FILE_EXTENSION).getWorkingCopy(getWorkingCopyOwner(), getProgressMonitor()); //$NON-NLS-1$
+		IBuffer buffer;
+		try {
+			buffer = cu.getBuffer();
+		}
+		catch (JavaScriptModelException e) {
+			e.printStackTrace();
+			buffer = null;
+		}
+		if (buffer != null) {
+			getTranslator().setBuffer(buffer);
+		}
+		return cu;
+	}
+
+	public String fixupMangledName(String displayString) {
+		if (displayString == null) {
+			return null;
+		}
+		return displayString.replaceAll(getMangledName() + ".js", getHtmlPageName()); //$NON-NLS-1$
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getAllElementsInJsRange(int, int)
+	 */
+	public IJavaScriptElement[] getAllElementsInJsRange(int javaPositionStart, int javaPositionEnd) {
+		IJavaScriptElement[] EMTPY_RESULT_SET = new IJavaScriptElement[0];
+		IJavaScriptElement[] result = EMTPY_RESULT_SET;
+		IJavaScriptElement[] allChildren = null;
+		try {
+			allChildren = getCompilationUnit().getChildren();
+		}
+		catch (JavaScriptModelException e) {
+		}
+		Vector validChildren = new Vector();
+		for (int i = 0; i < allChildren.length; i++) {
+			ISourceRange range = getJSSourceRangeOf(allChildren[i]);
+			if (javaPositionStart <= range.getOffset() && range.getLength() + range.getOffset() <= (javaPositionEnd)) {
+				validChildren.add(allChildren[i]);
+			}
+			else if (allChildren[i].getElementType() == IJavaScriptElement.TYPE) {
+				validChildren.add(allChildren[i]);
+			}
+		}
+		if (validChildren.size() > 0) {
+			result = (IJavaScriptElement[]) validChildren.toArray(new IJavaScriptElement[]{});
+		}
+		if (result == null || result.length == 0) {
+			return EMTPY_RESULT_SET;
+		}
+		return result;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getCompilationUnit()
+	 */
+	public IJavaScriptUnit getCompilationUnit() {
+        // Genuitec Begin Fix 6149: Exception opening external HTML file
+	    if (!getJavaProject().exists()) {
+	        return null;
+	    }
+	    // Genuitec End Fix 6149: Exception opening external HTML file
+		synchronized (fLock) {
+			try {
+				if (fCompilationUnit == null) {
+					fCompilationUnit = createCompilationUnit();
+					return fCompilationUnit;
+				}
+
+			}
+			catch (JavaScriptModelException jme) {
+				if (JsTranslation.DEBUG) {
+					Logger.logException("error creating JSP working copy... ", jme); //$NON-NLS-1$
+				}
+			}
+
+		}
+		getDocScope(true);
+		try {
+			fCompilationUnit = fCompilationUnit.getWorkingCopy(getWorkingCopyOwner(), getProgressMonitor());
+			// fCompilationUnit.makeConsistent(getProgressMonitor());
+		}
+		catch (JavaScriptModelException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		}
+		return fCompilationUnit;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getElementsFromJsRange(int, int)
+	 */
+	public IJavaScriptElement[] getElementsFromJsRange(int javaPositionStart, int javaPositionEnd) {
+		IJavaScriptElement[] EMTPY_RESULT_SET = new IJavaScriptElement[0];
+		IJavaScriptElement[] result = EMTPY_RESULT_SET;
+		try {
+			IJavaScriptUnit cu = getCompilationUnit();
+			if (cu != null) {
+				synchronized (fLock) {
+					int cuDocLength = cu.getBuffer().getLength();
+					int javaLength = javaPositionEnd - javaPositionStart;
+					if (cuDocLength > 0 && javaPositionStart >= 0 && javaLength >= 0 && javaPositionEnd <= cuDocLength) {
+						result = cu.codeSelect(javaPositionStart, javaLength, getWorkingCopyOwner());
+					}
+				}
+			}
+			if (result == null || result.length == 0) {
+				return EMTPY_RESULT_SET;
+			}
+		}
+		catch (JavaScriptModelException x) {
+			Logger.logException(x);
+		}
+		return result;
+	}
+
+	private String getHtmlPageName() {
+		IPath path = new Path(fModelBaseLocation);
+		return path.lastSegment();
+
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getHtmlText()
+	 */
+	public String getHtmlText() {
+		return fHtmlDocument.get();
+	}
+
+	public String getJavaPath() {
+		IPath rootPath = new Path(fModelBaseLocation).removeLastSegments(1);
+		String cuPath = rootPath.append("/" + getMangledName() + JsDataTypes.BASE_FILE_EXTENSION).toString(); //$NON-NLS-1$
+		return cuPath;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getJsElementAtOffset(int)
+	 */
+	public IJavaScriptElement getJsElementAtOffset(int jsOffset) {
+		IJavaScriptElement elements = null;
+		try {
+			elements = getCompilationUnit().getElementAt(jsOffset);
+		}
+		catch (JavaScriptModelException e) {
+			// TODO Auto-generated catch block
+			if (JsTranslation.DEBUG) {
+				Logger.logException("error retrieving java elemtnt from compilation unit... ", e); //$NON-NLS-1$
+			}
+			// }
+		}
+		return elements;
+	}
+
+	private ISourceRange getJSSourceRangeOf(IJavaScriptElement element) {
+		// returns the offset in html of given element
+		ISourceRange range = null;
+		if (element instanceof Member) {
+			try {
+				range = ((Member) element).getNameRange();
+			} catch (JavaScriptModelException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}else if (element instanceof SourceRefElement) {
+			try {
+				range = ((SourceRefElement) element).getSourceRange();
+			}
+			catch (JavaScriptModelException e) {
+				e.printStackTrace();
+			}
+		}
+		return range;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getJsText()
+	 */
+	public String getJsText() {
+		return getTranslator().getJsText();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getScriptPositions()
+	 */
+	public Position[] getScriptPositions() {
+		return getTranslator().getHtmlLocations();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#insertInFirstScriptRegion(java.lang.String)
+	 */
+	public void insertInFirstScriptRegion(String text) {
+		Position pos[] = getScriptPositions();
+		int scriptStartOffset = 0;
+		if(pos!=null && pos.length>0) {
+			scriptStartOffset = pos[0].getOffset();
+			
+		}
+		String insertText = (scriptStartOffset==0?"":"\n") + text;
+		insertScript(scriptStartOffset,insertText);
+		
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#insertScript(int, java.lang.String)
+	 */
+	public void insertScript(int offset, String text) {
+
+		IDOMModel xmlModel = null;
+		Position[] inHtml = getScriptPositions();
+		boolean isInsideExistingScriptRegion = false;
+		for (int i = 0; i < inHtml.length; i++) {
+			if (inHtml[i].overlapsWith(offset, 1)) {
+				// * inserting into a script region
+				isInsideExistingScriptRegion = true;
+			}
+		}
+
+		String insertText = null;
+
+		if (isInsideExistingScriptRegion) {
+			insertText = text;
+		}
+		else {
+			insertText = offset != 0 ? "\n" : "" + "<script type=\"text/javascript\">\n" + text + "\n</script>\n";
+		}
+	//	translator.documentAboutToBeChanged(null);
+
+		synchronized (fLock) {
+			try {
+				xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForEdit(fHtmlDocument);
+				if (xmlModel == null) {
+					xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getModelForEdit(fHtmlDocument);
+				}
+				if (xmlModel != null) {
+
+
+					xmlModel.aboutToChangeModel();
+					xmlModel.getDocument().getStructuredDocument().replaceText(this, offset, 0, insertText);
+					xmlModel.changedModel();
+					try {
+						xmlModel.save();
+					}
+
+					catch (UnsupportedEncodingException e) {}
+					catch (IOException e) {}
+					catch (CoreException e) {}
+				}
+			}
+			finally {
+				if (xmlModel != null)
+					xmlModel.releaseFromEdit();
+			}
+		}
+
+	//	translator.documentChanged(null);
+
+	}
+
+	public String getMangledName() {
+		return this.mangledName;
+	}
+
+	private String createMangledName() {
+		return JsNameManglerUtil.mangle(fModelBaseLocation);
+	}
+
+	/**
+	 * 
+	 * @return the problem requestor for the JavaScriptUnit in this
+	 *         JsTranslation
+	 */
+	private JsProblemRequestor getProblemRequestor() {
+		return CompilationUnitHelper.getInstance().getProblemRequestor();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getProblems()
+	 */
+	public List getProblems() {
+		List problemList = getProblemRequestor().getCollectedProblems();
+		getProblemRequestor().endReporting();
+		IProblem[] problems = null;
+		if (problemList == null)
+			problems = new IProblem[0];
+		else 
+			problems = (IProblem[]) problemList.toArray(new IProblem[problemList.size()]);
+		
+		IJsTranslator translator = getTranslator();
+		if (translator instanceof JsTranslator && problems.length > 0) {
+			Region[] generatedRanges = ((JsTranslator) translator).getGeneratedRanges();
+			for (int i = 0; i < problems.length; i++) {
+				for (int j = 0; j < generatedRanges.length; j++) {
+					// remove any problems that are fully reported within a region generated by the translator
+					if (problems[i].getSourceStart() >= generatedRanges[j].getOffset() && problems[i].getSourceEnd() <= (generatedRanges[j].getOffset() + generatedRanges[j].getLength())) {
+						problemList.remove(problems[i]);
+					}
+				}
+			}
+		}
+		return problemList;
+	}
+
+	private IProgressMonitor getProgressMonitor() {
+		if (fProgressMonitor == null) {
+			fProgressMonitor = new NullProgressMonitor();
+		}
+		return fProgressMonitor;
+	}
+
+	public WorkingCopyOwner getWorkingCopyOwner() {
+		return CompilationUnitHelper.getInstance().getWorkingCopyOwner();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#ifOffsetInImportNode(int)
+	 */
+	public boolean ifOffsetInImportNode(int offset) {
+		Position[] importRanges = getTranslator().getImportHtmlRanges();
+		for (int i = 0; i < importRanges.length; i++) {
+			if (importRanges[i].includes(offset)) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#reconcileCompilationUnit()
+	 */
+	public void reconcileCompilationUnit() {
+		// if(true) return;
+		IJavaScriptUnit cu = getCompilationUnit();
+		if (fCompilationUnit == null) {
+			return;
+		}
+		if (cu != null) {
+			try {
+				synchronized (fLock) {
+					// clear out old validation messages
+					WorkingCopyOwner workingCopyOwner = getWorkingCopyOwner();
+					JsProblemRequestor problemRequestor = (JsProblemRequestor) workingCopyOwner.getProblemRequestor(cu.getWorkingCopy(getProgressMonitor()));
+					if(problemRequestor != null && problemRequestor.getCollectedProblems() != null)
+						problemRequestor.getCollectedProblems().clear();
+					cu.reconcile(IJavaScriptUnit.NO_AST, true, true, getWorkingCopyOwner(), getProgressMonitor());
+				}
+			}
+			catch (JavaScriptModelException e) {
+				Logger.logException(e);
+			}
+		}
+	}
+
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#release()
+	 */
+	public void release() {
+		if (getTranslator() != null)
+			getTranslator().release();
+		synchronized (fLock) {
+			if (fCompilationUnit != null) {
+				try {
+					if (JsTranslation.DEBUG) {
+						System.out.println("------------------------------------------------------------------"); //$NON-NLS-1$
+						System.out.println("(-) JsTranslation [" + this + "] discarding JavaScriptUnit: " + fCompilationUnit); //$NON-NLS-1$ //$NON-NLS-2$
+						System.out.println("------------------------------------------------------------------"); //$NON-NLS-1$
+					}
+					fCompilationUnit.discardWorkingCopy();
+				}
+				catch (JavaScriptModelException e) {
+					// we're done w/ it anyway
+				}
+			}
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#setProblemCollectingActive(boolean)
+	 */
+	public void setProblemCollectingActive(boolean collect) {
+		IJavaScriptUnit cu = getCompilationUnit();
+		if (cu != null) {
+			getProblemRequestor().setIsActive(collect);
+		}
+	}
+
+	public void classpathChange() {
+
+		if (fDocumentScope != null) {
+			fDocumentScope.classpathChange();
+		}
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapter.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapter.java
new file mode 100644
index 0000000..61aa63d
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapter.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to 
+ * change significantly before reaching stability. It is being made available at this early stage to solicit feedback 
+ * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken 
+ * (repeatedly) as the API evolves.
+ *     
+ *     
+ *******************************************************************************/
+
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.web.core.internal.Logger;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+
+ * <br><br> this adapter loads translation information from extension points.  this is to allow more complicated html/js translations through extensions.
+ * @author pavery
+ */
+public class JsTranslationAdapter implements INodeAdapter, IResourceChangeListener {
+
+	private static final boolean DEBUG = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jstranslation")); //$NON-NLS-1$  //$NON-NLS-2$
+	private IStructuredDocument fHtmlDocument = null;
+	private IJsTranslation fJSTranslation = null;
+	private NullProgressMonitor fTranslationMonitor = null;
+	private String baseLocation;
+	private boolean listenForChanges=false;
+	private static final String PRIORITY_ATTRIB = "priority";
+	private IJsTranslation fTranslationAsFactory;
+	
+	public JsTranslationAdapter(IDOMModel xmlModel) {
+		fHtmlDocument = xmlModel.getStructuredDocument();
+		baseLocation = xmlModel.getBaseLocation();
+		initializeJavaPlugins();
+		
+		
+	}
+	public void shouldListenForChanges(boolean listenForProjectChanges) {
+		if(listenForProjectChanges) {
+			ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
+		}
+	}
+
+	public IJavaScriptProject getJavaProject() {
+		IJavaScriptProject javaProject = null;
+		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+		IPath filePath = new Path(baseLocation);
+		IProject project = null;
+		if (filePath.segmentCount() > 0) {
+			project = root.getProject(filePath.segment(0));
+		}
+		if (project != null) {
+			javaProject = JavaScriptCore.create(project);
+		}
+		
+		return javaProject;
+	}
+	
+	/**
+	 * Returns the IJsTranslation for this adapter.
+	 * 
+	 * @return a IJsTranslation
+	 */
+	public IJsTranslation getJsTranslation(boolean listenForChanges) {
+		/*
+		 * If no translation exists or switching from not listening to
+		 * listening
+		 */
+		if (fJSTranslation == null || (!this.listenForChanges && listenForChanges)) {
+			if (fJSTranslation != null)
+				fJSTranslation.release();
+			if (fTranslationAsFactory == null) {
+				/* load the translation factory from the extension point */
+				try {
+					IExtensionRegistry registry = Platform.getExtensionRegistry();
+					IExtensionPoint extensionPoint = registry.getExtensionPoint("org.eclipse.wst.jsdt.web.core.javascriptPreProcessor");
+					IConfigurationElement points[] = extensionPoint.getConfigurationElements();
+
+					int highestPriorityValue = -1;
+					int highestPriorityIndex = -1;
+
+					for (int i = 0; i < points.length; i++) {
+						String priority = points[i].getAttribute(PRIORITY_ATTRIB);
+						int value = Integer.parseInt(priority);
+						if (value > highestPriorityValue) {
+							highestPriorityIndex = i;
+							highestPriorityValue = value;
+						}
+					}
+					fTranslationAsFactory = (IJsTranslation) points[highestPriorityIndex].createExecutableExtension("class");
+				}
+				catch (Exception e) {
+					Logger.logException(e);
+				}
+			}
+			if (fTranslationAsFactory != null) {
+				fJSTranslation = fTranslationAsFactory.getInstance(fHtmlDocument, getJavaProject(), listenForChanges);
+			}
+			else {
+				fJSTranslation = new JsTranslation(fHtmlDocument, getJavaProject(), listenForChanges);
+			}
+			this.listenForChanges = listenForChanges;
+		}
+		shouldListenForChanges(listenForChanges);
+		return fJSTranslation;
+	}
+	
+	
+	private void initializeJavaPlugins() {
+		JavaScriptCore.getPlugin();
+	}
+	
+	public boolean isAdapterForType(Object type) {
+		return type.equals(IJsTranslation.class);
+	}
+	
+	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {}
+	
+	public void release() {
+		if (fTranslationMonitor != null) {
+			fTranslationMonitor.setCanceled(true);
+		}
+		ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
+		if (fJSTranslation != null) {
+			if (JsTranslationAdapter.DEBUG) {
+				System.out.println("JSTranslationAdapter releasing:" + fJSTranslation); //$NON-NLS-1$
+			}
+			fJSTranslation.release();
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
+	 */
+	public void resourceChanged(IResourceChangeEvent event) {
+		IProject changedProject = (event==null || event.getResource()==null)?null:event.getResource().getProject();
+		if(changedProject!=null && getJavaProject().getProject().equals(changedProject) && fJSTranslation!=null){
+			fJSTranslation.classpathChange();
+		}	
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapterFactory.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapterFactory.java
new file mode 100644
index 0000000..b621153
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapterFactory.java
@@ -0,0 +1,89 @@
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to 
+ * change significantly before reaching stability. It is being made available at this early stage to solicit feedback 
+ * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken 
+ * (repeatedly) as the API evolves.
+ *     
+ *     
+ *******************************************************************************/
+
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+
+ * @author pavery
+ * 
+ */
+public class JsTranslationAdapterFactory extends AbstractAdapterFactory {
+	// for debugging
+	private static final boolean DEBUG;
+	
+	static {
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jstranslation"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+	private JsTranslationAdapter fAdapter = null;
+	
+	public JsTranslationAdapterFactory() {
+		super(IJsTranslation.class, true);
+	}
+	
+	
+	public INodeAdapterFactory copy() {
+		return new JsTranslationAdapterFactory();
+	}
+	
+	
+	protected INodeAdapter createAdapter(INodeNotifier target) {
+		if (target instanceof IDOMNode && fAdapter == null) {
+			fAdapter = new JsTranslationAdapter(((IDOMNode) target).getModel());
+			if (JsTranslationAdapterFactory.DEBUG) {
+				System.out.println("(+) JSPTranslationAdapterFactory [" + this + "] created adapter: " + fAdapter); //$NON-NLS-1$ //$NON-NLS-2$
+			}
+		}
+		return fAdapter;
+	}
+	
+	
+	public void release() {
+		if (fAdapter != null) {
+			if (JsTranslationAdapterFactory.DEBUG) {
+				System.out.println("(-) JSPTranslationAdapterFactory [" + this + "] releasing adapter: " + fAdapter); //$NON-NLS-1$ //$NON-NLS-2$
+			}
+			fAdapter.release();
+		}
+		super.release();
+	}
+	
+	public static void setupAdapterFactory(IStructuredModel sm) {
+		if (sm.getFactoryRegistry().getFactoryFor(IJsTranslation.class) == null) {
+			JsTranslationAdapterFactory factory = new JsTranslationAdapterFactory();
+			sm.getFactoryRegistry().addFactory(factory);
+		}
+	}
+	
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslator.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslator.java
new file mode 100644
index 0000000..50abda8
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslator.java
@@ -0,0 +1,767 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to 
+ * change significantly before reaching stability. It is being made available at this early stage to solicit feedback 
+ * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken 
+ * (repeatedly) as the API evolves.
+ *     
+ *******************************************************************************/
+
+
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.DocumentRewriteSessionEvent;
+import org.eclipse.jface.text.IDocumentExtension4;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.IDocumentRewriteSessionListener;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.Region;
+import org.eclipse.wst.jsdt.core.IBuffer;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+
+ * Translates a web page into its JavaScript pieces. 
+ * 
+ */
+public class JsTranslator extends Job implements IJsTranslator, IDocumentListener {
+	
+	protected static final boolean DEBUG;
+	private static final boolean DEBUG_SAVE_OUTPUT = false;  //"true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jstranslationstodisk")); //$NON-NLS-1$  //$NON-NLS-2$
+//	private static final String ENDL = "\n"; //$NON-NLS-1$
+	
+	private static final String XML_COMMENT_START = "<!--"; //$NON-NLS-1$
+//	private static final String XML_COMMENT_END = "-->"; //$NON-NLS-1$
+	
+	private static final String CDATA_START = "<![CDATA["; //$NON-NLS-1$
+	private static final String CDATA_START_PAD = new String(Util.getPad(CDATA_START.length()));
+	private static final String CDATA_END = "]]>"; //$NON-NLS-1$
+	private static final String CDATA_END_PAD = new String(Util.getPad(CDATA_END.length()));
+	
+	
+	//TODO: should be an inclusive rule rather than exclusive
+	private static final Pattern fClientSideTagPattern = Pattern.compile("<[^<%?)!>]+/?>"); //$NON-NLS-1$
+
+	// FIXME: Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=307401
+	private String[][] fServerSideDelimiters = new String[][]{{"<%","%>"},{"<?","?>"}};
+	private int fShortestServerSideDelimiterPairLength = 4;
+	
+	static {
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsjavamapping"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+	
+	private class DocumentRewriteSessionListener implements IDocumentRewriteSessionListener {
+		public void documentRewriteSessionChanged(DocumentRewriteSessionEvent event) {
+			if (DocumentRewriteSessionEvent.SESSION_START.equals(event.getChangeType())) {
+				fIsInRewriteSession = true;
+			}
+			else if (DocumentRewriteSessionEvent.SESSION_STOP.equals(event.getChangeType())) {
+				fIsInRewriteSession = false;
+				schedule();
+			}
+		}		
+	}
+
+	private IStructuredDocumentRegion fCurrentNode;
+	boolean fIsInRewriteSession = false;
+	protected StringBuffer fScriptText = new StringBuffer();
+	protected IStructuredDocument fStructuredDocument = null;
+	protected ArrayList importLocationsInHtml = new ArrayList();
+	/* use java script by default */
+	protected boolean fIsGlobalJs = true;
+	protected ArrayList rawImports = new ArrayList(); // translated
+	protected ArrayList scriptLocationInHtml = new ArrayList();
+	protected int scriptOffset = 0;
+	
+	protected byte[] fLock = new byte[0];
+	protected byte[] finished = new byte[0];
+	
+	protected IBuffer fCompUnitBuff;
+	protected boolean cancelParse = false;
+	protected int missingEndTagRegionStart = -1;
+	protected static final boolean ADD_SEMICOLON_AT_INLINE=true;
+	private IDocumentRewriteSessionListener fDocumentRewriteSessionListener = new DocumentRewriteSessionListener();
+
+	/*
+	 * org.eclipse.jface.text.Regions that contain purely generated code, for
+	 * which no validation messages should be reported to the user
+	 */
+	private List fGeneratedRanges = new ArrayList();
+	
+	protected boolean isGlobalJs() {
+		return fIsGlobalJs;
+	}
+	
+	protected IBuffer getCompUnitBuffer() {
+		return fCompUnitBuff;
+	}
+	
+	protected StringBuffer getScriptTextBuffer() {
+		return fScriptText;
+	}
+	
+	
+	protected void setIsGlobalJs(boolean value) {
+		this.fIsGlobalJs = value;
+	}
+	
+	protected void advanceNextNode() {
+		setCurrentNode(getCurrentNode().getNext());
+	}	
+	
+	public JsTranslator(IStructuredDocument document, 	String fileName) {
+		this(document, fileName, false);
+	}
+	
+	/**
+	 * @deprecated
+	 */
+	public JsTranslator() {
+		super("JavaScript Translation");
+	}
+	
+	public JsTranslator(IStructuredDocument document, 	String fileName, boolean listenForChanges) {
+		super("JavaScript translation for : " + fileName); //$NON-NLS-1$
+		fStructuredDocument = document;
+		if (listenForChanges) {
+			fStructuredDocument.addDocumentListener(this);
+			if (fStructuredDocument instanceof IDocumentExtension4) {
+				((IDocumentExtension4) fStructuredDocument).addDocumentRewriteSessionListener(fDocumentRewriteSessionListener);
+			}
+			setPriority(Job.LONG);
+			setSystem(true);
+			schedule();
+		}
+		reset();
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#getJsText()
+	 */
+	public String getJsText() {
+		synchronized(finished) {
+			/* if mid re-write session doc changes have been ignored,
+			 * but if jsText is specifically request we should re-translate
+			 * to pick up any changes thus far
+			 */
+			if(this.fIsInRewriteSession) {
+				this.reset();
+			}
+			
+			return fScriptText.toString();
+		}
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#getCurrentNode()
+	 */
+	protected final IStructuredDocumentRegion getCurrentNode() {
+		
+		return fCurrentNode;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#setBuffer(org.eclipse.wst.jsdt.core.IBuffer)
+	 */
+	public void setBuffer(IBuffer buffer) {
+		fCompUnitBuff = buffer;
+		synchronized(finished) {
+			fCompUnitBuff.setContents(fScriptText.toString());
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#getHtmlLocations()
+	 */
+	public Position[] getHtmlLocations() {
+		synchronized(finished) {
+			return (Position[]) scriptLocationInHtml.toArray(new Position[scriptLocationInHtml.size()]);
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#getMissingEndTagRegionStart()
+	 */
+	public int getMissingEndTagRegionStart() {
+		return missingEndTagRegionStart;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#getImportHtmlRanges()
+	 */
+	public Position[] getImportHtmlRanges() {
+		synchronized(finished) {
+			return (Position[]) importLocationsInHtml.toArray(new Position[importLocationsInHtml.size()]);
+		}
+	}
+	
+
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#getRawImports()
+	 */
+	public String[] getRawImports() {
+		synchronized(finished) {
+			return (String[]) this.rawImports.toArray(new String[rawImports.size()]);
+		}
+	}
+
+		
+	
+	/**
+	 * 
+	 * @return the status of the translator's progrss monitor, false if the
+	 *         monitor is null
+	 */
+	protected boolean isCanceled() {
+		return cancelParse;
+	}
+	
+	/**
+	 * Reinitialize some fields
+	 */
+	protected void reset() {
+		synchronized(fLock) {
+			scriptOffset = 0;
+			// reset progress monitor
+			fScriptText = new StringBuffer();
+			fCurrentNode = fStructuredDocument.getFirstStructuredDocumentRegion();
+			rawImports.clear();
+			importLocationsInHtml.clear();
+			scriptLocationInHtml.clear();
+			missingEndTagRegionStart = -1;
+			cancelParse = false;
+			fGeneratedRanges.clear();
+		}
+		translate();
+	}
+
+
+	
+	protected IStructuredDocumentRegion setCurrentNode(IStructuredDocumentRegion currentNode) {
+		synchronized(fLock) {
+			return this.fCurrentNode = currentNode;
+		}
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#translate()
+	 */
+	public void translate() {
+		//setCurrentNode(fStructuredDocument.getFirstStructuredDocumentRegion());
+		
+		synchronized(finished) {
+			if(getCurrentNode() != null) {
+			NodeHelper nh = new NodeHelper(getCurrentNode());
+			while (getCurrentNode() != null && !isCanceled()) {
+				nh.setDocumentRegion(getCurrentNode());
+				
+				// System.out.println("Translator Looking at Node
+				// type:"+getCurrentNode().getType()+"---------------------------------:");
+				// System.out.println(new NodeHelper(getCurrentNode()));
+				// i.println("/---------------------------------------------------");
+				if (getCurrentNode().getType() == DOMRegionContext.XML_TAG_NAME) {
+					if ((!nh.isEndTag() || nh.isSelfClosingTag()) && nh.nameEquals("script")) { //$NON-NLS-1$
+						/*
+						 * Handles the following cases: <script
+						 * type="javascriptype"> <script language="javascriptype>
+						 * <script src='' type=javascriptype> <script src=''
+						 * language=javascripttype <script src=''> global js type.
+						 * <script> (global js type)
+						 */
+						if (NodeHelper.isInArray(JsDataTypes.JSVALIDDATATYPES, nh.getAttributeValue("type")) || NodeHelper.isInArray(JsDataTypes.JSVALIDDATATYPES, nh.getAttributeValue("language")) || (nh.getAttributeValue("type")==null && nh.getAttributeValue("language")==null && isGlobalJs())) { //$NON-NLS-1$ //$NON-NLS-2$
+							if (nh.containsAttribute(new String[] { "src" })) { //$NON-NLS-1$
+								// Handle import
+								translateScriptImportNode(getCurrentNode());
+							}
+							// } else {
+							// handle script section
+							
+							if (getCurrentNode().getNext() != null /*&& getCurrentNode().getNext().getType() == DOMRegionContext.BLOCK_TEXT*/) {
+								translateJSNode(getCurrentNode().getNext());
+							}
+						} // End search for <script> sections
+					} else if (nh.containsAttribute(JsDataTypes.HTMLATREVENTS)) {
+						/* Check for embedded JS events in any tags */
+						translateInlineJSNode(getCurrentNode());
+					} else if (nh.nameEquals("META") && nh.attrEquals("http-equiv", "Content-Script-Type") && nh.containsAttribute(new String[] { "content" })) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+						// <META http-equiv="Content-Script-Type" content="type">
+						setIsGlobalJs( NodeHelper.isInArray(JsDataTypes.JSVALIDDATATYPES, nh.getAttributeValue("content"))); //$NON-NLS-1$
+					} // End big if of JS types
+				}
+				if (getCurrentNode() != null) {
+					advanceNextNode();
+				}
+			} // end while loop
+			if(getCompUnitBuffer()!=null) getCompUnitBuffer().setContents(fScriptText.toString());
+		}
+		finishedTranslation();
+		}
+	}
+	
+	protected void finishedTranslation() {
+		if(DEBUG_SAVE_OUTPUT){
+			IDOMModel xmlModel = null;
+			String baseLocation = null;
+			FileOutputStream fout = null;
+			PrintStream out = null;
+			try {
+				xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(fStructuredDocument);
+				if (xmlModel == null) {
+					xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getModelForRead(fStructuredDocument);
+				}
+				baseLocation = xmlModel.getBaseLocation();
+			}
+			finally {
+				if (xmlModel != null)
+					xmlModel.releaseFromRead();
+			}
+			
+			if(baseLocation!=null){
+				IWorkspace workspace = ResourcesPlugin.getWorkspace();
+				IWorkspaceRoot root = workspace.getRoot();
+				IFile tFile = workspace.getRoot().getFile(new Path(baseLocation + ".js"));
+				File tempFile = tFile.getLocation().toFile();
+				
+				  if(tempFile.exists()){
+					  tempFile.delete();
+				  }
+				 
+				  try {
+					  tempFile.createNewFile();
+					  fout = new FileOutputStream(tempFile);
+					  out = new PrintStream(fout);
+					  out.println(fScriptText);
+					  out.close();
+				} catch (FileNotFoundException e) {
+				
+				} catch (IOException e) {
+					
+				}finally{
+					if(out!=null) out.close();
+				
+					
+				}
+				 try {
+					root.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+				} catch (CoreException e) {
+					
+				}
+			}
+			
+		}
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#translateInlineJSNode(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)
+	 */
+	public void translateInlineJSNode(IStructuredDocumentRegion container) {
+		// System.out
+		// .println("JSPTranslator.translateInlineJSNode Entered
+		// w/ScriptOffset:"
+		// + scriptOffset);
+		
+			//NodeHelper nh = new NodeHelper(container);
+			// System.out.println("inline js node looking at:\n" + nh);
+			/* start a function header.. will amend later */
+			ITextRegionList t = container.getRegions();
+			ITextRegion r;
+			Iterator regionIterator = t.iterator();
+			while (regionIterator.hasNext() && !isCanceled() ) {
+				r = (ITextRegion) regionIterator.next();
+				if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+					int start = r.getStart();
+					int offset = r.getTextEnd();
+					String tagAttrname = container.getText().substring(start, offset).trim();
+					/*
+					 * Attribute values aren't case sensative, also make sure next
+					 * region is attrib value
+					 */
+					if (NodeHelper.isInArray(JsDataTypes.HTMLATREVENTS, tagAttrname)) {
+						if (regionIterator.hasNext()) {
+							regionIterator.next();
+						}
+						if (regionIterator.hasNext()) {
+							r = ((ITextRegion) regionIterator.next());
+						}
+						if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+							int valStartOffset = container.getStartOffset(r);
+							// int valEndOffset = r.getTextEnd();
+							String rawText = container.getText().substring(r.getStart(), r.getTextEnd());
+							if (rawText == null || rawText.length() == 0) {
+								return;
+							}
+							/* Strip quotes */
+							switch (rawText.charAt(0)) {
+								case '\'':
+								case '"':
+									rawText = rawText.substring(1);
+									valStartOffset++;
+							}
+							if (rawText == null || rawText.length() == 0) {
+								return;
+							}
+							switch (rawText.charAt(rawText.length() - 1)) {
+								case '\'':
+								case '"':
+									rawText = rawText.substring(0, rawText.length() - 1);
+							}
+							// Position inScript = new Position(scriptOffset,
+							// rawText.length());
+							/* Quoted text starts +1 and ends -1 char */
+							if(ADD_SEMICOLON_AT_INLINE) rawText = rawText + ";"; //$NON-NLS-1$
+							Position inHtml = new Position(valStartOffset, rawText.length());
+							scriptLocationInHtml.add(inHtml);
+							/* need to pad the script text with spaces */
+							char[] spaces = Util.getPad(valStartOffset - scriptOffset);
+							fScriptText.append(spaces);
+							fScriptText.append(rawText);
+							scriptOffset = fScriptText.length();
+						}
+					}
+				}
+			}
+		}
+	
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#translateJSNode(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)
+	 */
+	public void translateJSNode(IStructuredDocumentRegion container) {
+		ITextRegionCollection containerRegion = container;
+		Iterator regions = containerRegion.getRegions().iterator();
+		ITextRegion region = null;
+		
+		if(container==null) return;
+		
+		char[] spaces = Util.getPad(container.getStartOffset() - scriptOffset);
+		fScriptText.append(spaces);
+		scriptOffset = container.getStartOffset();
+	
+		if(container.getType()!=DOMRegionContext.BLOCK_TEXT && container.getType()!= DOMRegionContext.XML_CDATA_TEXT) {
+			return;
+		}
+		
+		while (regions.hasNext() && !isCanceled()) {
+			region = (ITextRegion) regions.next();
+			String type = region.getType();
+			// content assist was not showing up in JSP inside a javascript
+			// region
+			
+			//System.out.println("Region text: " + container.getText().substring(region.getStart(), region.getEnd()));
+			boolean isContainerRegion = region instanceof ITextRegionContainer;
+			/* make sure its not a sub container region, probably JSP */
+			if (type == DOMRegionContext.BLOCK_TEXT ) {
+				int scriptStart = container.getStartOffset();
+				int scriptTextLength = container.getLength();
+				String regionText = container.getFullText(region);
+				regionText = StringUtils.replace(regionText, CDATA_START, CDATA_START_PAD);
+				regionText = StringUtils.replace(regionText, CDATA_END, CDATA_END_PAD);
+				int regionLength = region.getLength();
+				
+				spaces = Util.getPad(scriptStart - scriptOffset);
+				fScriptText.append(spaces); 	
+				// skip over XML/HTML comment starts
+				if (regionText.indexOf(XML_COMMENT_START) >= 0) {
+					int index = regionText.indexOf(XML_COMMENT_START);
+					int leadingTrimPlusCommentStart = index + XML_COMMENT_START.length();
+					boolean replaceCommentStart = true;
+					for (int i = 0; i < index; i++) {
+						/*
+						 * replace the comment start in the translation when
+						 * it's preceded only by white space
+						 */
+						replaceCommentStart = replaceCommentStart && Character.isWhitespace(regionText.charAt(i));
+					}
+					if (replaceCommentStart) {
+						StringBuffer newRegionText = new StringBuffer(regionText.substring(0, index));
+						spaces = Util.getPad(XML_COMMENT_START.length());
+						newRegionText.append(spaces);
+						newRegionText.append(regionText.substring(leadingTrimPlusCommentStart));
+						regionText = newRegionText.toString();
+					}
+				}
+				// server-side code
+//				else {
+					/*
+					 * Fix for
+					 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=284774
+					 * end of last valid JS source, start of next content to
+					 * skip
+					 */
+					// last offset of valid JS source, after which there's server-side stuff
+					int validJSend = 0;
+					// start of next valid JS source, last offset of content that was skipped
+					int validJSstart = 0;
+
+					Matcher matcher = fClientSideTagPattern.matcher(regionText);
+					// note the start of a HTML tag if one's present
+					int clientMatchStart = matcher.find() ? matcher.start() : -1;
+
+					StringBuffer contents = new StringBuffer();
+					
+					int serverSideStart = -1;
+					int serverSideDelimiter = 0;
+
+					// find any instance of server code blocks in the region text
+					for (int i = 0; i < fServerSideDelimiters.length; i++) {
+						int index = regionText.indexOf(fServerSideDelimiters[i][0]);
+						if (serverSideStart < 0) {
+							serverSideStart = index;
+							serverSideDelimiter = i;
+						}
+						else if (index >= 0) {
+							serverSideStart = Math.min(serverSideStart, index);
+							if (serverSideStart == index) {
+								serverSideDelimiter = i;
+							}
+						}
+					}
+					// contains something other than pure JavaScript
+					while (serverSideStart > -1 || clientMatchStart > -1) { //$NON-NLS-1$
+						validJSend = validJSstart;
+						boolean biasClient = false;
+						boolean biasServer = false;
+						// update the start of content to skip
+						if (clientMatchStart > -1 && serverSideStart > -1) {
+							validJSend = Math.min(clientMatchStart, serverSideStart);
+							biasClient = validJSend == clientMatchStart;
+							biasServer = validJSend == serverSideStart;
+						}
+						else if (clientMatchStart > -1 && serverSideStart < 0) {
+							validJSend = clientMatchStart;
+							biasClient = true;
+						}
+						else if (clientMatchStart < 0 && serverSideStart > -1) {
+							validJSend = serverSideStart;
+							biasServer = true;
+						}
+						
+						// append if there's something we want to include
+						if (-1 < validJSstart && -1 < validJSend) {
+							// append what we want to include
+							contents.append(regionText.substring(validJSstart, validJSend));
+							
+							// change the skipped content to a valid variable name and append it as a placeholder
+							int startOffset = container.getStartOffset(region) + validJSend;
+
+							String serverEnd = fServerSideDelimiters[serverSideDelimiter][1];
+							int serverSideEnd = (regionLength > validJSend + serverEnd.length()) ? regionText.indexOf(serverEnd, validJSend + fServerSideDelimiters[serverSideDelimiter][1].length()) : -1;
+							if (serverSideEnd > -1)
+								serverSideEnd += serverEnd.length();
+							int clientMatchEnd = matcher.find(validJSend) ? matcher.end() : -1;
+							// update end of what we skipped
+							validJSstart = -1;
+							if (clientMatchEnd > validJSend && serverSideEnd > validJSend) {
+								if (biasClient)
+									validJSstart = clientMatchEnd;
+								else if (biasServer)
+									validJSstart = serverSideEnd;
+								else
+									validJSstart = Math.min(clientMatchEnd, serverSideEnd);
+							}
+							if (clientMatchEnd >= validJSend && serverSideEnd < 0)
+								validJSstart = matcher.end();
+							if (clientMatchEnd < 0 && serverSideEnd >= validJSend)
+								validJSstart = serverSideEnd;
+							int line = container.getParentDocument().getLineOfOffset(startOffset);
+							int column;
+							try {
+								column = startOffset - container.getParentDocument().getLineOffset(line);
+							}
+							catch (BadLocationException e) {
+								column = -1;
+							}
+							// substituted text length much match original length exactly, find text of the right length
+							int start = validJSend + container.getStartOffset(region);
+							contents.append('_');
+							for (int i = validJSend + 1; i < validJSstart; i++) {
+								switch (i - validJSend) {
+									case 1 :
+										contents.append('$');
+										break;
+									case 2 :
+										contents.append('t');
+										break;
+									case 3 :
+										contents.append('a');
+										break;
+									case 4 :
+										contents.append('g');
+										break;
+									default :
+										contents.append('_');
+								}
+							}
+							int end = validJSstart + container.getStartOffset(region);
+							// remember that this source range w
+							fGeneratedRanges.add(new Region(start, end - start));
+						}
+						// set up to end while if no end for valid
+						if (validJSstart > 0) {
+							int serverSideStartGuess = -1;
+							for (int i = 0; i < fServerSideDelimiters.length; i++) {
+								int index = regionText.indexOf(fServerSideDelimiters[i][0], validJSstart);
+								if (serverSideStartGuess < 0) {
+									serverSideStartGuess = index;
+									serverSideDelimiter = i;
+								}
+								else if (index >= 0) {
+									serverSideStartGuess = Math.min(serverSideStartGuess, index);
+									if (serverSideStartGuess == index) {
+										serverSideDelimiter = i;
+									}
+								}
+							}
+							serverSideStart = validJSstart < regionLength - fShortestServerSideDelimiterPairLength ? serverSideStartGuess : -1;
+							clientMatchStart = validJSstart < regionLength ? (matcher.find(validJSstart) ? matcher.start() : -1) : -1;
+						}
+						else {
+							serverSideStart = clientMatchStart = -1;
+						}
+					}
+					if (validJSstart >= 0) {
+						contents.append(regionText.substring(validJSstart));
+					}
+					if (contents.length() != 0) {
+						fScriptText.append(contents.toString());
+					}
+					else {
+						fScriptText.append(regionText);
+					}
+					Position inHtml = new Position(scriptStart, scriptTextLength);
+					scriptLocationInHtml.add(inHtml);
+//				}
+								
+				scriptOffset = fScriptText.length();
+			}
+		}
+		
+		IStructuredDocumentRegion endTag = container.getNext();
+		
+		if(endTag==null) {
+			missingEndTagRegionStart = container.getStartOffset();
+		}else if(endTag!=null) {
+			NodeHelper nh = new NodeHelper(endTag);
+			String name = nh.getTagName();
+			
+			if(name==null || !name.trim().equalsIgnoreCase("script") || !nh.isEndTag()) { //$NON-NLS-1$
+				missingEndTagRegionStart = container.getStartOffset();
+			}
+		}
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#translateScriptImportNode(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)
+	 */
+	public void translateScriptImportNode(IStructuredDocumentRegion region) {
+		NodeHelper nh = new NodeHelper(region);
+		String importName = nh.getAttributeValue("src"); //$NON-NLS-1$
+		if (importName != null && !importName.equals("")) { //$NON-NLS-1$
+			rawImports.add(importName);
+			Position inHtml = new Position(region.getStartOffset(), region.getEndOffset());
+			importLocationsInHtml.add(inHtml);
+		}
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
+	 */
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
+	 */
+	public void documentAboutToBeChanged(DocumentEvent event) {
+		cancelParse = true;
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
+	 */
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#documentChanged(org.eclipse.jface.text.DocumentEvent)
+	 */
+	public void documentChanged(DocumentEvent event) {
+		if (fIsInRewriteSession) {
+			return;
+		}
+
+		reset();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	protected IStatus run(IProgressMonitor monitor) {
+		reset();
+		return Status.OK_STATUS;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#release()
+	 */
+	public void release() {
+		fStructuredDocument.removeDocumentListener(this);
+		if (fStructuredDocument instanceof IDocumentExtension4) {
+			((IDocumentExtension4) fStructuredDocument).removeDocumentRewriteSessionListener(fDocumentRewriteSessionListener);
+		}
+	}
+
+	/**
+	 * @return the fGeneratedRanges
+	 */
+	public Region[] getGeneratedRanges() {
+		return (Region[]) fGeneratedRanges.toArray(new Region[fGeneratedRanges.size()]);
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Messages.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Messages.java
new file mode 100644
index 0000000..4b0baff
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Messages.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * 
+ * 
+ * Provisional API: This class/interface is part of an interim API that is
+ * still under development and expected to change significantly before
+ * reaching stability. It is being made available at this early stage to
+ * solicit feedback from pioneering adopters on the understanding that any
+ * code that uses this API will almost certainly be broken (repeatedly) as the
+ * API evolves.
+ * 
+ */
+public class Messages extends NLS {
+	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.core.internal.java.messages"; //$NON-NLS-1$
+
+	private Messages() {
+	}
+
+	static {
+		// initialize resource bundle
+		NLS.initializeMessages(Messages.BUNDLE_NAME, Messages.class);
+	}
+
+	public static String NodeHelper00;
+	public static String NodeHelper01;
+	public static String NodeHelper03;
+	public static String NodeHelper11;
+	public static String NodeHelper12;
+
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/NodeHelper.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/NodeHelper.java
new file mode 100644
index 0000000..8afd83e
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/NodeHelper.java
@@ -0,0 +1,245 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to 
+ * change significantly before reaching stability. It is being made available at this early stage to solicit feedback 
+ * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken 
+ * (repeatedly) as the API evolves.
+ *     
+ *     
+ *******************************************************************************/
+
+
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+import java.util.Iterator;
+
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class NodeHelper {
+	protected static final char DOUBLE_QUOTE_CHAR = '\"';
+	protected static final String DOUBLE_QUOTE_ENTITY = "&quot;"; //$NON-NLS-1$
+	protected static final char SINGLE_QUOTE_CHAR = '\'';
+	protected static final String SINGLE_QUOTE_ENTITY = "&#039;"; //$NON-NLS-1$
+	
+	public static boolean isInArray(String StringArray[], String text) {
+		if (StringArray == null || text == null) {
+			return false;
+		}
+		for (int i = 0; i < StringArray.length; i++) {
+			if (StringArray[i].equalsIgnoreCase(text.trim())) {
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	public static boolean isQuoted(String string) {
+		if ((string == null) || (string.length() < 2)) {
+			return false;
+		}
+		int lastIndex = string.length() - 1;
+		char firstChar = string.charAt(0);
+		char lastChar = string.charAt(lastIndex);
+		return (((firstChar == NodeHelper.SINGLE_QUOTE_CHAR) && (lastChar == NodeHelper.SINGLE_QUOTE_CHAR)) || ((firstChar == NodeHelper.DOUBLE_QUOTE_CHAR) && (lastChar == NodeHelper.DOUBLE_QUOTE_CHAR)));
+	}
+	protected IStructuredDocumentRegion region;
+	
+	public NodeHelper(IStructuredDocumentRegion region) {
+		this.region = region;
+	}
+	
+	public boolean attrEquals(String attribute, String value) {
+		String attValue = getAttributeValue(attribute);
+		if(attValue==null) return false;
+		return attValue.equalsIgnoreCase(value);
+	}
+	
+	public String AttrToString() {
+		if (region == null) {
+			return null;
+		}
+		// For debugging
+		ITextRegionList t = region.getRegions();
+		ITextRegion r;
+		Iterator regionIterator = t.iterator();
+		String StructuredValue = Messages.NodeHelper00 + getTagName() + Messages.NodeHelper01; //$NON-NLS-1$ //$NON-NLS-2$
+		while (regionIterator.hasNext()) {
+			r = (ITextRegion) regionIterator.next();
+			if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+				StructuredValue += "\t\t" + region.getText(r); //$NON-NLS-1$
+				/*
+				 * Theres a XML_TAG_ATTRIBUTE_EQUALS after the
+				 * XML_TAG_ATTRIBUTE_NAME we have to get rid of
+				 */
+				if (regionIterator.hasNext()) {
+					regionIterator.next();
+				}
+				if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
+					if (regionIterator.hasNext()) {
+						r = ((ITextRegion) regionIterator.next());
+					}
+					if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+						StructuredValue += "\t\t" + stripEndQuotes(region.getText(r)) + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
+					}
+				}
+			}
+		}
+		return StructuredValue;
+	}
+	
+	public boolean containsAttribute(String name[]) {
+		if (name == null) {
+			return false;
+		}
+		if (region == null) {
+			return false;
+		}
+		ITextRegionList t = region.getRegions();
+		ITextRegion r;
+		Iterator regionIterator = t.iterator();
+		while (regionIterator.hasNext()) {
+			r = (ITextRegion) regionIterator.next();
+			if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+				String tagname = region.getText(r).trim();
+				/* Attribute values aren't case sensative */
+				if (NodeHelper.isInArray(name, tagname)) {
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+	
+	public String getAttributeValue(String name) {
+		if (region == null) {
+			return null;
+		}
+		if (name == null) {
+			return null;
+		}
+		ITextRegionList t = region.getRegions();
+		ITextRegion r;
+		Iterator regionIterator = t.iterator();
+		while (regionIterator.hasNext()) {
+			r = (ITextRegion) regionIterator.next();
+			if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+				String tagname = region.getText(r).trim();
+				/*
+				 * Attribute values aren't case sensative, also make sure next
+				 * region is attrib value
+				 */
+				if (tagname.equalsIgnoreCase(name)) {
+					if (regionIterator.hasNext()) {
+						regionIterator.next();
+					}
+					if (regionIterator.hasNext()) {
+						r = ((ITextRegion) regionIterator.next());
+					}
+					if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+						return stripEndQuotes(region.getText(r));
+					}
+				}
+			}
+		}
+		return null;
+	}
+	
+	public String getElementAsFlatString() {
+		/*
+		 * Returns a full string of this element minus and 'illegal' characters
+		 * (usefull for identifying the HTML element in a generic JS function)
+		 */
+		if (region == null) {
+			return null;
+		}
+		String fullRegionText = region.getFullText();
+		if (fullRegionText == null) {
+			return null;
+		}
+		return fullRegionText.replaceAll("[^a-zA-Z0-9]", ""); //$NON-NLS-1$ //$NON-NLS-2$
+	}
+	
+	public String getTagName() {
+		if (region == null) {
+			return null;
+		}
+		ITextRegionList t = region.getRegions();
+		ITextRegion r;
+		Iterator regionIterator = t.iterator();
+		while (regionIterator.hasNext()) {
+			r = (ITextRegion) regionIterator.next();
+			if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
+				return region.getText(r);
+			}
+		}
+		return null;
+	}
+	
+	public boolean isEndTag() {
+		if (region == null) {
+			return false;
+		}
+		return DOMRegionContext.XML_END_TAG_OPEN.equals(region.getFirstRegion().getType());
+	}
+	
+	public boolean isSelfClosingTag() {
+		if (region == null) {
+			return false;
+		}
+		return DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(region.getLastRegion().getType());
+	}
+	
+	public boolean nameEquals(String name) {
+		if (region == null || name == null) {
+			return false;
+		}
+		return name.equalsIgnoreCase(getTagName());
+	}
+	
+	public void setDocumentRegion(IStructuredDocumentRegion newRegion) {
+		if (newRegion == null)
+			throw new IllegalArgumentException();
+		region = newRegion;
+	}
+	
+	public String stripEndQuotes(String text) {
+		if (text == null) {
+			return null;
+		}
+		if (NodeHelper.isQuoted(text)) {
+			return text.substring(1, text.length() - 1);
+		}
+		return text;
+	}
+	
+	
+	public String toString() {
+		ITextRegionList t = region.getRegions();
+		Iterator regionIterator = t.iterator();
+		String nodeText = new String();
+		while (regionIterator.hasNext()) {
+			ITextRegion r = (ITextRegion) regionIterator.next();
+			String nodeType = r.getType();
+			nodeText += (Messages.NodeHelper11 + nodeType + Messages.NodeHelper12 + region.getText(r) + "\n"); //$NON-NLS-1$
+		}
+		return nodeText;
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Util.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Util.java
new file mode 100644
index 0000000..a42aead
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Util.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to 
+ * change significantly before reaching stability. It is being made available at this early stage to solicit feedback 
+ * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken 
+ * (repeatedly) as the API evolves.
+ *     
+ *     
+ *******************************************************************************/
+
+
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+import java.util.Arrays;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ *
+ */
+public class Util {
+	public static char[] getPad(int numberOfChars) {
+		if(numberOfChars < 0) return new char[0];
+		final char[] spaceArray = new char[numberOfChars];
+		Arrays.fill(spaceArray, ' ');
+		return spaceArray;
+	}
+	
+	public static String removeAll(String source, char remove) {
+		
+		String newString = "";
+		
+		char[] oldStringArray = source.toCharArray();
+		
+		for(int i = 0;i<oldStringArray.length;i++) {
+			if(oldStringArray[i]!=remove) newString+=oldStringArray[i];
+		}
+		return newString;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/WebRootFinder.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/WebRootFinder.java
new file mode 100644
index 0000000..24cc871
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/WebRootFinder.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to 
+ * change significantly before reaching stability. It is being made available at this early stage to solicit feedback 
+ * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken 
+ * (repeatedly) as the API evolves.
+ *     
+ *     
+ *******************************************************************************/
+
+
+
+package org.eclipse.wst.jsdt.web.core.javascript;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.jsdt.web.core.internal.project.ModuleCoreSupport;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class WebRootFinder {
+	public static IPath getServerContextRoot(IProject project) {
+		IPath root = ModuleCoreSupport.getWebContentRootPath(project);
+		if (root != null)
+			return root;
+		return Path.ROOT;
+	}
+	
+	public static IPath getWebContentFolder(IProject project) {
+		IPath root = ModuleCoreSupport.getWebContentRootPath(project);
+		if (root != null)
+			return root.removeFirstSegments(1);
+		return Path.ROOT;
+	}
+	
+	public static String getWebContext(IProject project) {
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/messages.properties b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/messages.properties
new file mode 100644
index 0000000..ebccdda
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/messages.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+NodeHelper.0=Tag name:
+NodeHelper.1=\tAttribute\tValue\n
+NodeHelper.3=attrib type
+NodeHelper.11=\tNode Type:
+NodeHelper.12=\ \t\tValue:
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/IndexWorkspaceJob.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/IndexWorkspaceJob.java
new file mode 100644
index 0000000..a259283
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/IndexWorkspaceJob.java
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.javascript.search;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceProxy;
+import org.eclipse.core.resources.IResourceProxyVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.wst.jsdt.web.core.internal.JsCoreMessages;
+import org.eclipse.wst.jsdt.web.core.internal.validation.Util;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+* (copied from JSP)
+ * Re-indexes the entire workspace.
+ * Ensures the JSP Index is in a stable state before performing a search.
+ * (like after a crash or if previous indexing was canceled)
+ * 
+ * @author pavery
+ */
+public class IndexWorkspaceJob extends Job {
+
+	// for debugging
+	static final boolean DEBUG;
+	static {
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsindexmanager"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+	
+	/**
+	 * Visitor that retrieves jsp project paths for all jsp files in the workspace,
+	 * and adds the files to be indexed as they are encountered
+	 */
+	private class JSPFileVisitor implements IResourceProxyVisitor {
+	    private List files = new ArrayList(); 
+		
+		// monitor from the Job
+		IProgressMonitor fInnerMonitor = null;
+		public JSPFileVisitor(IProgressMonitor monitor) {
+			this.fInnerMonitor = monitor;
+		}
+		
+		public boolean visit(IResourceProxy proxy) throws CoreException {
+			
+			// check job canceled
+			if ((this.fInnerMonitor != null) && this.fInnerMonitor.isCanceled()) {
+				setCanceledState();
+				return false;
+			}
+			
+			// check search support canceled
+			if(JsSearchSupport.getInstance().isCanceled()) {
+				setCanceledState();
+				return false;
+			}
+			
+			if (proxy.getType() == IResource.FILE) {
+				
+				// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
+				// check this before description
+				// check name before actually getting the file (less work)
+				if(Util.isJsType(proxy.getName())) {
+					IFile file = (IFile) proxy.requestResource();
+					if(file.exists()) {
+						
+						if(DEBUG) {
+							System.out.println("(+) IndexWorkspaceJob adding file: " + file.getName()); //$NON-NLS-1$
+						}
+						// this call will check the ContentTypeDescription, so don't need to do it here.
+						//JSPSearchSupport.getInstance().addJspFile(file);
+						this.files.add(file);
+						this.fInnerMonitor.subTask(proxy.getName());
+						
+						// don't search deeper for files
+						return false;
+					}
+				}
+			}
+			return true;
+		}
+		
+		public final IFile[] getFiles() {
+		    return (IFile[])this.files.toArray(new IFile[this.files.size()]);
+		}
+	}
+	
+	//private IContentType fContentTypeJSP = null;
+	
+	public IndexWorkspaceJob() {
+		// pa_TODO may want to say something like "Rebuilding JSP Index" to be more
+		// descriptive instead of "Updating JSP Index" since they are 2 different things
+		super(JsCoreMessages.JSPIndexManager_0);
+		setPriority(Job.LONG);
+		setSystem(true);
+	}
+
+//	IContentType getJspContentType() {
+//		if(this.fContentTypeJSP == null)
+//			this.fContentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
+//		return this.fContentTypeJSP;
+//	}
+	
+	/**
+	 * @see org eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor) 
+	 * for similar method
+	 */
+	protected IStatus run(IProgressMonitor monitor) {
+		
+		IStatus status = Status.OK_STATUS;
+		
+		if(monitor.isCanceled()) {
+			setCanceledState();
+			return Status.CANCEL_STATUS;
+		}
+		
+		if(DEBUG) {
+			System.out.println(" ^ IndexWorkspaceJob started: "); //$NON-NLS-1$
+		}
+		
+		long start = System.currentTimeMillis();
+		
+		try {
+		    JSPFileVisitor visitor = new JSPFileVisitor(monitor);
+		    // collect all jsp files
+			ResourcesPlugin.getWorkspace().getRoot().accept(visitor, IResource.DEPTH_INFINITE);
+			// request indexing
+			// this is pretty much like faking an entire workspace resource delta
+			JsIndexManager.getInstance().indexFiles(visitor.getFiles());
+		}
+		catch (CoreException e) {
+			if(DEBUG) {
+				e.printStackTrace();
+			}
+		}
+		finally {
+			monitor.done();
+		}
+		long finish = System.currentTimeMillis();
+		if(DEBUG) {
+			System.out.println(" ^ IndexWorkspaceJob finished\n   total time running: " + (finish - start)); //$NON-NLS-1$
+		}
+		
+		return status;
+	}
+	
+	void setCanceledState() {
+		JsIndexManager.getInstance().setIndexState(JsIndexManager.S_CANCELED);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JSDTSearchDocumentDelegate.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JSDTSearchDocumentDelegate.java
new file mode 100644
index 0000000..0862b4b
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JSDTSearchDocumentDelegate.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.javascript.search;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.internal.core.search.JavaSearchDocument;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
+ * Wrapper method to set getPath() path to be the path of the compilation unit 
+ * for the jsp file. (since it's a final method, it needs to be set via constructor)
+ * 
+ * @author pavery
+ */
+public class JSDTSearchDocumentDelegate extends JavaSearchDocument {
+	
+	private JsSearchDocument fJSPSearchDoc = null;
+	
+	public JSDTSearchDocumentDelegate(JsSearchDocument jspSearchDoc) {
+		
+		super(jspSearchDoc.getPath(), jspSearchDoc.getParticipant());
+		this.fJSPSearchDoc = jspSearchDoc;
+	}
+
+	public byte[] getByteContents() {
+		
+		return this.fJSPSearchDoc.getByteContents();
+	}
+
+	public char[] getCharContents() {
+		
+		return this.fJSPSearchDoc.getCharContents();
+	}
+	
+	public String getJavaText() {
+		return this.fJSPSearchDoc.getJavaText();
+	}
+
+	public String getEncoding() {
+		
+		return this.fJSPSearchDoc.getEncoding();
+	}
+	
+	public IFile getFile() {
+		
+		return this.fJSPSearchDoc.getFile();
+	}
+	
+	public IJsTranslation getJspTranslation() {
+		
+		return this.fJSPSearchDoc.getJSTranslation();
+	}
+	
+//	public int getJspOffset(int javaOffset) {
+//		
+//		return this.fJSPSearchDoc.getJspOffset(javaOffset);
+//	}
+	
+	public void release() {
+		this.fJSPSearchDoc.release();
+	}
+	public IJavaScriptElement getJavaElement() {
+		return getJspTranslation().getCompilationUnit();
+	}
+	public boolean isVirtual() {
+		return true;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsIndexManager.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsIndexManager.java
new file mode 100644
index 0000000..11b1149
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsIndexManager.java
@@ -0,0 +1,775 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.javascript.search;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
+import org.eclipse.wst.jsdt.internal.core.index.Index;
+import org.eclipse.wst.jsdt.internal.core.search.indexing.IndexManager;
+import org.eclipse.wst.jsdt.web.core.internal.JsCoreMessages;
+import org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin;
+import org.eclipse.wst.jsdt.web.core.internal.Logger;
+import org.eclipse.wst.jsdt.web.core.internal.project.JsWebNature;
+import org.eclipse.wst.jsdt.web.core.internal.validation.Util;
+import org.osgi.framework.Bundle;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
+ * Responsible for keeping the JSP index up to date.
+ * 
+ * @author pavery
+ */
+public class JsIndexManager {
+
+	// for debugging
+	// TODO move this to Logger, as we have in SSE
+	static final boolean DEBUG;
+	static {
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsindexmanager"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+
+	private static final String PKEY_INDEX_STATE = "jspIndexState"; //$NON-NLS-1$
+
+	private IndexWorkspaceJob indexingJob = new IndexWorkspaceJob();
+
+
+
+	// TODO: consider enumeration for these int constants
+	// set to S_UPDATING once a resource change comes in
+	// set to S_STABLE if:
+	// - we know we aren't interested in the resource change
+	// - or the ProcessFilesJob completes
+	// set to S_CANCELED if an indexing job is canceled
+	// set to S_REBUILDING if re-indexing the entire workspace
+
+	// the int '0' is reserved for the default value if a preference is not
+	// there
+	/** index is reliable to use */
+	public static final int S_STABLE = 1;
+	/** index is being updated (from a resource delta) */
+	public static final int S_UPDATING = 2;
+	/** entire index is being rebuilt */
+	public static final int S_REBUILDING = 3;
+	/**
+	 * indexing job was canceled in the middle of it, index needs to be
+	 * rebuilt
+	 */
+	public static final int S_CANCELED = 4;
+
+	/** symbolic name for OSGI framework */
+	private final String OSGI_FRAMEWORK_ID = "org.eclipse.osgi"; //$NON-NLS-1$
+
+	/**
+	 * Collects JSP files from a resource delta.
+	 */
+	private class JSPResourceVisitor implements IResourceDeltaVisitor {
+		// using hash map ensures only one of each file
+		// must be reset before every use
+		private HashMap jspFiles = null;
+
+		public JSPResourceVisitor() {
+			this.jspFiles = new HashMap();
+		}
+
+		public boolean visit(IResourceDelta delta) throws CoreException {
+
+			// in case JSP search was canceled (eg. when closing the editor)
+			if (JsSearchSupport.getInstance().isCanceled() || frameworkIsShuttingDown()) {
+				setCanceledState();
+				return false;
+			}
+
+			try {
+				if (!isHiddenResource(delta.getFullPath())) {
+
+					int kind = delta.getKind();
+					boolean added = (kind & IResourceDelta.ADDED) == IResourceDelta.ADDED;
+					boolean isInterestingChange = false;
+					if ((kind & IResourceDelta.CHANGED) == IResourceDelta.CHANGED) {
+						int flags = delta.getFlags();
+						// ignore things like marker changes
+						isInterestingChange = ((flags & IResourceDelta.CONTENT) == IResourceDelta.CONTENT) || ((flags & IResourceDelta.REPLACED) == IResourceDelta.REPLACED);
+					}
+					boolean removed = (kind & IResourceDelta.REMOVED) == IResourceDelta.REMOVED;
+					if (added || isInterestingChange) {
+
+						visitAdded(delta);
+					}
+					else if (removed) {
+						visitRemoved(delta);
+					}
+				}
+			}
+			catch (Exception e) {
+				// need to set state here somehow, and reindex
+				// otherwise index will be unreliable
+				if (DEBUG) {
+					Logger.logException("Delta analysis may not be complete", e); //$NON-NLS-1$
+				}
+			}
+			// if the delta has children, continue to add/remove files
+			return true;
+		}
+
+		private void visitRemoved(IResourceDelta delta) {
+			// handle cleanup
+			if (delta.getResource() != null) {
+				IResource r = delta.getResource();
+				if ((r.getType() == IResource.FOLDER) && r.exists()) {
+					deleteIndex((IFile) r);
+				}
+			}
+		}
+
+		private void visitAdded(IResourceDelta delta) {
+			// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
+			// quick check if it's even JSP related to improve
+			// performance
+			// checking name from the delta before getting
+			// resource because it's lighter
+			String filename = delta.getFullPath().lastSegment();
+			if ((filename != null) && Util.isJsType(filename)) {
+				IResource r = delta.getResource();
+				if ((r != null) && r.exists() && (r.getType() == IResource.FILE)) {
+					this.jspFiles.put(r.getFullPath(), r);
+				}
+			}
+		}
+
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=93463
+		private boolean isHiddenResource(IPath p) {
+			String[] segments = p.segments();
+			for (int i = 0; i < segments.length; i++) {
+				if (segments[i].startsWith(".")) {
+					return true;
+				}
+			}
+			return false;
+		}
+
+		private void deleteIndex(IFile folder) {
+			// cleanup index
+			IndexManager im = JavaModelManager.getJavaModelManager().getIndexManager();
+			IPath folderPath = folder.getFullPath();
+			IPath indexLocation = JsSearchSupport.getInstance().computeIndexLocation(folderPath);
+			im.removeIndex(indexLocation);
+			// im.indexLocations.removeKey(folderPath);
+			// im.indexLocations.removeValue(indexLocation);
+			File f = indexLocation.toFile();
+			f.delete();
+		}
+
+		public IFile[] getFiles() {
+			return (IFile[]) this.jspFiles.values().toArray(new IFile[this.jspFiles.size()]);
+		}
+
+		public void reset() {
+			this.jspFiles.clear();
+		}
+	}
+
+	// end class JSPResourceVisitor
+
+	/**
+	 * schedules JSP files for indexing by Java core
+	 */
+	private class ProcessFilesJob extends Job {
+		List fileList = null;
+		// keep track of how many files we've indexed
+		int lastFileCursor = 0;
+
+		ProcessFilesJob(String taskName) {
+			super(taskName);
+			fileList = new ArrayList();
+		}
+
+		synchronized void process(IFile[] files) {
+			for (int i = 0; i < files.length; i++) {
+				fileList.add(files[i]);
+			}
+			if (DEBUG) {
+				System.out.println("JSPIndexManager queuing " + files.length + " files"); //$NON-NLS-2$ //$NON-NLS-1$
+			}
+		}
+
+		synchronized IFile[] getFiles() {
+			return (IFile[]) fileList.toArray(new IFile[fileList.size()]);
+		}
+
+		synchronized void clearFiles() {
+			fileList.clear();
+			lastFileCursor = 0;
+			//System.out.println("cleared files");
+		}
+
+		protected IStatus run(IProgressMonitor monitor) {
+			// System.out.println("indexer monitor" + monitor);
+			if (isCanceled(monitor) || frameworkIsShuttingDown()) {
+				setCanceledState();
+				return Status.CANCEL_STATUS;
+			}
+
+			long start = System.currentTimeMillis();
+
+			try {
+				IFile[] filesToBeProcessed = getFiles();
+
+				if (DEBUG) {
+					System.out.println("JSPIndexManager indexing " + filesToBeProcessed.length + " files"); //$NON-NLS-2$ //$NON-NLS-1$
+				}
+				// API indicates that monitor is never null
+				monitor.beginTask("", filesToBeProcessed.length); //$NON-NLS-1$
+				JsSearchSupport ss = JsSearchSupport.getInstance();
+				String processingNFiles = ""; //$NON-NLS-1$
+
+
+				for (;lastFileCursor < filesToBeProcessed.length; lastFileCursor++) {
+
+					if (isCanceled(monitor) || frameworkIsShuttingDown()) {
+						setCanceledState();
+						return Status.CANCEL_STATUS;
+					}
+					IFile file = filesToBeProcessed[lastFileCursor];
+					try {
+						IJavaScriptProject project = JavaScriptCore.create(file.getProject());
+						if (project.exists()) {
+							ss.addJspFile(file);
+							// JSP Indexer processing n files
+							processingNFiles = NLS.bind(JsCoreMessages.JSPIndexManager_2, new String[]{Integer.toString((filesToBeProcessed.length - lastFileCursor))});
+							monitor.subTask(processingNFiles + " - " + file.getName()); //$NON-NLS-1$
+							monitor.worked(1);
+
+							if (DEBUG) {
+								System.out.println("JSPIndexManager Job added file: " + file.getName()); //$NON-NLS-1$
+							}
+						}
+					}
+					catch (Exception e) {
+						// RATLC00284776
+						// ISSUE: we probably shouldn't be catching EVERY
+						// exception, but
+						// the framework only allows to return IStatus in
+						// order to communicate
+						// that something went wrong, which means the loop
+						// won't complete, and we would hit the same problem
+						// the next time.
+						// 
+						// a possible solution is to keep track of the
+						// exceptions logged
+						// and only log a certain amt of the same one,
+						// otherwise skip it.
+						if (!frameworkIsShuttingDown()) {
+							String filename = file != null ? file.getFullPath().toString() : ""; //$NON-NLS-1$
+							Logger.logException("JSPIndexer problem indexing:" + filename, e); //$NON-NLS-1$
+						}
+					}
+				} // end for
+			}
+			finally {
+				// just in case something didn't follow API (monitor is null)
+				if (monitor != null) {
+					monitor.done();
+				}
+			}
+
+			// successfully finished, clear files list
+			clearFiles();
+			
+			long finish = System.currentTimeMillis();
+			long diff = finish - start;
+			if (DEBUG) {
+				fTotalTime += diff;
+				System.out.println("============================================================================"); //$NON-NLS-1$
+				System.out.println("this time: " + diff + " cumulative time for resource changed: " + fTotalTime); //$NON-NLS-1$ //$NON-NLS-2$
+				System.out.println("============================================================================"); //$NON-NLS-1$
+			}
+			return Status.OK_STATUS;
+		}
+
+		private boolean isCanceled(IProgressMonitor runMonitor) {
+
+			boolean canceled = false;
+			// check specific monitor passed into run method (the progress
+			// group in this case)
+			// check main search support canceled
+			if ((runMonitor != null) && runMonitor.isCanceled()) {
+				canceled = true;
+			} else if (JsSearchSupport.getInstance().isCanceled()) {
+				canceled = true;
+				if (runMonitor != null) {
+					runMonitor.setCanceled(true);
+				}
+			}
+			return canceled;
+		}
+		
+	}
+
+	// end class ProcessFilesJob
+
+	private static JsIndexManager fSingleton = null;
+	private boolean initialized;
+	private boolean initializing = true;
+
+	private IndexJobCoordinator indexJobCoordinator;
+	private IResourceChangeListener jspResourceChangeListener;
+
+	private JSPResourceVisitor fVisitor = null;
+	static long fTotalTime = 0;
+
+	// Job for processing resource delta
+	private ProcessFilesJob processFilesJob = null;
+
+	private JsIndexManager() {
+		processFilesJob = new ProcessFilesJob(JsCoreMessages.JSPIndexManager_0);
+		// only show in verbose mode
+		processFilesJob.setSystem(true);
+		processFilesJob.setPriority(Job.LONG);
+		processFilesJob.addJobChangeListener(new JobChangeAdapter() {
+			public void done(IJobChangeEvent event) {
+				super.done(event);
+				setStableState();
+			}
+		});
+	}
+
+	public synchronized static JsIndexManager getInstance() {
+
+		if (fSingleton == null) {
+			fSingleton = new JsIndexManager();
+		}
+		return fSingleton;
+	}
+
+	public void initialize() {
+
+		JsIndexManager singleInstance = getInstance();
+
+
+		if (!singleInstance.initialized) {
+			singleInstance.initialized = true;
+
+			singleInstance.indexJobCoordinator = new IndexJobCoordinator();
+			singleInstance.jspResourceChangeListener = new JSPResourceChangeListener();
+
+			// added as JobChange listener so JSPIndexManager can be smarter
+			// about when it runs
+			Platform.getJobManager().addJobChangeListener(singleInstance.indexJobCoordinator);
+
+			// add JSPIndexManager to keep JSP Index up to date
+			// listening for IResourceChangeEvent.PRE_DELETE and
+			// IResourceChangeEvent.POST_CHANGE
+			ResourcesPlugin.getWorkspace().addResourceChangeListener(jspResourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+
+			// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5091
+			// makes sure IndexManager is aware of our indexes
+			saveIndexes();
+			//rebuildIndexIfNeeded();
+			singleInstance.initializing = false;
+
+		}
+
+	}
+	
+	synchronized void setIndexState(int state) {
+		if (DEBUG) {
+			System.out.println("JSPIndexManager setting index state to: " + state2String(state)); //$NON-NLS-1$
+		}
+		Plugin jspModelPlugin = JsCorePlugin.getDefault();
+		jspModelPlugin.getPluginPreferences().setValue(PKEY_INDEX_STATE, state);
+		jspModelPlugin.savePluginPreferences();
+
+	}
+
+	private String state2String(int state) {
+		String s = "UNKNOWN"; //$NON-NLS-1$
+		switch (state) {
+			case (S_STABLE) :
+				s = "S_STABLE"; //$NON-NLS-1$
+				break;
+			case (S_UPDATING) :
+				s = "S_UPDATING"; //$NON-NLS-1$
+				break;
+			case (S_CANCELED) :
+				s = "S_CANCELED"; //$NON-NLS-1$
+				break;
+			case (S_REBUILDING) :
+				s = "S_REBUILDING"; //$NON-NLS-1$
+				break;
+		}
+		return s;
+	}
+
+	int getIndexState() {
+		return JsCorePlugin.getDefault().getPluginPreferences().getInt(PKEY_INDEX_STATE);
+	}
+
+	void setUpdatingState() {
+		//if (getIndexState() != S_CANCELED)
+		setIndexState(S_UPDATING);
+	}
+
+	void setCanceledState() {
+		setIndexState(JsIndexManager.S_CANCELED);
+	}
+
+	void setStableState() {
+		//if (getIndexState() != S_CANCELED)
+		setIndexState(S_STABLE);
+	}
+
+	void setRebuildingState() {
+		setIndexState(S_REBUILDING);
+	}
+
+	synchronized void rebuildIndexIfNeeded() {
+		if (getIndexState() != S_STABLE) {
+			rebuildIndex();
+		}
+	}
+
+	void rebuildIndex() {
+
+		if (DEBUG) {
+			System.out.println("*** JSP Index unstable, requesting re-indexing"); //$NON-NLS-1$
+		}
+
+		getIndexingJob().addJobChangeListener(new JobChangeAdapter() {
+			public void aboutToRun(IJobChangeEvent event) {
+				super.aboutToRun(event);
+				setRebuildingState();
+			}
+
+			public void done(IJobChangeEvent event) {
+				super.done(event);
+				setStableState();
+				getIndexingJob().removeJobChangeListener(this);
+			}
+		});
+		// we're about to reindex everything anyway
+		getProcessFilesJob().clearFiles();
+		getIndexingJob().schedule();
+
+	}
+
+	/**
+	 * Creates and schedules a Job to process collected files. All JSP
+	 * indexing should be done through this method or processFiles(IFile file)
+	 * 
+	 * @param files
+	 */
+	final void indexFiles(IFile[] files) {
+		// don't use this rule
+		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4931
+		// processFiles.setRule(new IndexFileRule());
+		processFilesJob.process(files);
+	}
+
+
+	/**
+	 * Package protected for access by inner Job class in resourceChanged(...)
+	 * 
+	 * @return
+	 */
+	JSPResourceVisitor getVisitor() {
+
+		if (this.fVisitor == null) {
+			this.fVisitor = new JSPResourceVisitor();
+		}
+		return this.fVisitor;
+	}
+	void saveIndexes() {
+		IndexManager indexManager = JavaModelManager.getJavaModelManager().getIndexManager();
+		IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+		for (int j = 0; j < allProjects.length; j++) {
+			if (!JsWebNature.hasNature(allProjects[j]) || !allProjects[j].isOpen()) {
+				continue;
+			}
+			IPath jspModelWorkingLocation = JsSearchSupport.getInstance().getModelJspPluginWorkingLocation(allProjects[j]);
+			File folder = new File(jspModelWorkingLocation.toOSString());
+			String[] files = folder.list();
+			String locay = ""; //$NON-NLS-1$
+			try {
+				for (int i = 0; i < files.length; i++) {
+					if (files[i].toLowerCase().endsWith(".index")) { //$NON-NLS-1$
+						locay = jspModelWorkingLocation.toString() + "/" + files[i]; //$NON-NLS-1$
+						// reuse index file
+// index = new Index(locay, allProjects[j].getFullPath().toOSString(), true);
+// //$NON-NLS-1$
+// index.save();
+						indexManager.getIndex(allProjects[j].getFullPath(), new Path(locay), true, false);
+						// indexManager.saveIndex(index);
+					}
+				}
+			} catch (Exception e) {
+				// we should be shutting down, want to shut down quietly
+				if (JsIndexManager.DEBUG) {
+					e.printStackTrace();
+				}
+			}
+		}
+	}
+	// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5091
+	// makes sure IndexManager is aware of our indexes
+	void saveIndexesORIGINAL() {
+		IndexManager indexManager = JavaModelManager.getJavaModelManager().getIndexManager();
+		IPath jspModelWorkingLocation = JsSearchSupport.getInstance().getModelJspPluginWorkingLocation();
+
+		File folder = new File(jspModelWorkingLocation.toOSString());
+		String[] files = folder.list();
+		String locay = ""; //$NON-NLS-1$
+		Index index = null;
+		try {
+			for (int i = 0; i < files.length; i++) {
+				if (files[i].toLowerCase().endsWith(".index")) { //$NON-NLS-1$
+					locay = jspModelWorkingLocation.toString() + "/" + files[i]; //$NON-NLS-1$
+					// reuse index file
+					index = new Index(locay, "Index for " + locay, true); //$NON-NLS-1$
+					indexManager.saveIndex(index);
+				}
+			}
+		}
+		catch (Exception e) {
+			// we should be shutting down, want to shut down quietly
+			if (DEBUG) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+//	IContentType getJspContentType() {
+//		if (this.fContentTypeJSP == null)
+//			this.fContentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
+//		return this.fContentTypeJSP;
+//	}
+
+	/**
+	 * A check to see if the OSGI framework is shutting down.
+	 * 
+	 * @return true if the System Bundle is stopped (ie. the framework is
+	 *         shutting down)
+	 */
+	boolean frameworkIsShuttingDown() {
+		// in the Framework class there's a note:
+		// set the state of the System Bundle to STOPPING.
+		// this must be done first according to section 4.19.2 from the OSGi
+		// R3 spec.
+		boolean shuttingDown = Platform.getBundle(OSGI_FRAMEWORK_ID).getState() == Bundle.STOPPING;
+		if (DEBUG && shuttingDown) {
+			System.out.println("JSPIndexManager: system is shutting down!"); //$NON-NLS-1$
+		}
+		return shuttingDown;
+	}
+
+
+	public void shutdown() {
+
+		// stop listening
+		ResourcesPlugin.getWorkspace().removeResourceChangeListener(jspResourceChangeListener);
+
+
+		// stop any searching
+		JsSearchSupport.getInstance().setCanceled(true);
+
+		// stop listening to jobs
+		Platform.getJobManager().removeJobChangeListener(indexJobCoordinator);
+
+
+		int maxwait = 5000;
+		if (processFilesJob != null) {
+			processFilesJob.cancel();
+		}
+		// attempt to make sure this indexing job is litterally
+		// done before continuing, since we are shutting down
+		waitTillNotRunning(maxwait, processFilesJob);
+
+		if (indexingJob != null) {
+			indexingJob.cancel();
+		}
+		waitTillNotRunning(maxwait, processFilesJob);
+	}
+
+	private void waitTillNotRunning(int maxSeconds, Job job) {
+		int pauseTime = 10;
+		int maxtries = maxSeconds / pauseTime;
+		int count = 0;
+		while ((count++ < maxtries) && (job.getState() == Job.RUNNING)) {
+			try {
+				Thread.sleep(pauseTime);
+				// System.out.println("count: " + count + " max: " +
+				// maxtries);
+			}
+			catch (InterruptedException e) {
+				Logger.logException(e);
+			}
+		}
+	}
+
+	private class IndexJobCoordinator extends JobChangeAdapter {
+		
+		public void aboutToRun(IJobChangeEvent event) {
+			Job jobToCoordinate = event.getJob();
+			if (isJobToAvoid(jobToCoordinate)) {
+				// job will be rescheduled when the job we
+				// are avoiding (eg. build) is done
+				getProcessFilesJob().cancel();
+				//System.out.println("cancel:" + jobToCoordinate.getName());
+			}
+		}
+
+		public void done(IJobChangeEvent event) {
+
+			Job jobToCoordinate = event.getJob();
+			if (isJobToAvoid(jobToCoordinate)) {
+				if (getProcessFilesJob().getFiles().length > 0) {
+					getProcessFilesJob().schedule(500);
+					//System.out.println("schedule:" + jobToCoordinate.getName());
+				}
+					
+
+			}
+		}
+
+		private boolean isJobToAvoid(Job jobToCoordinate) {
+			boolean result = false;
+			if (jobToCoordinate.belongsTo(ResourcesPlugin.FAMILY_AUTO_BUILD) || jobToCoordinate.belongsTo(ResourcesPlugin.FAMILY_MANUAL_BUILD) || jobToCoordinate.belongsTo(ResourcesPlugin.FAMILY_AUTO_REFRESH)) {
+				result = true;
+			}
+			return result;
+
+		}
+
+	}
+
+	private class JSPResourceChangeListener implements IResourceChangeListener {
+
+
+		/**
+		 * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
+		 */
+		public void resourceChanged(IResourceChangeEvent event) {
+
+			if (isInitializing()) {
+				return;
+			}
+
+			// ignore resource changes if already rebuilding
+			if (getIndexState() == S_REBUILDING) {
+				return;
+			}
+			// previously canceled, needs entire index rebuild
+			if (getIndexState() == S_CANCELED) {
+				// rebuildIndex();
+				// just resume indexing
+				getProcessFilesJob().schedule(500);
+				//System.out.println("schedule: resource changed, previously canceled");
+				return;
+			}
+
+			IResourceDelta delta = event.getDelta();
+			if (delta != null) {
+				// only care about adds or changes right now...
+				int kind = delta.getKind();
+				boolean added = (kind & IResourceDelta.ADDED) == IResourceDelta.ADDED;
+				boolean changed = (kind & IResourceDelta.CHANGED) == IResourceDelta.CHANGED;
+				if (added || changed) {
+
+					// only analyze the full (starting at root) delta
+					// hierarchy
+					if (delta.getFullPath().toString().equals("/")) { //$NON-NLS-1$
+						try {
+							JSPResourceVisitor v = getVisitor();
+							// clear from last run
+							v.reset();
+							// count files, possibly do this in a job too...
+							// don't include PHANTOM resources
+							delta.accept(v, false);
+
+							// process files from this delta
+							IFile[] files = v.getFiles();
+							if (files.length > 0) {
+								/*
+								 * Job change listener should set back to
+								 * stable when finished
+								 */
+								setUpdatingState();
+								// processFiles(files);
+								indexFiles(files);
+							}
+						}
+						catch (CoreException e) {
+							// need to set state here somehow, and reindex
+							// otherwise index will be unreliable
+							if (DEBUG) {
+								Logger.logException(e);
+							}
+						}
+						catch (Exception e) {
+							// need to set state here somehow, and reindex
+							// otherwise index will be unreliable
+							if (DEBUG) {
+								Logger.logException(e);
+							}
+						}
+					}
+				}
+
+			}
+		}
+
+	}
+
+	IndexWorkspaceJob getIndexingJob() {
+		return indexingJob;
+	}
+
+	ProcessFilesJob getProcessFilesJob() {
+		return processFilesJob;
+	}
+
+	boolean isInitializing() {
+		return initializing;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsPathIndexer.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsPathIndexer.java
new file mode 100644
index 0000000..b1ebaad
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsPathIndexer.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.javascript.search;
+
+import java.util.HashMap;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceProxy;
+import org.eclipse.core.resources.IResourceProxyVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
+import org.eclipse.wst.jsdt.core.search.SearchPattern;
+import org.eclipse.wst.jsdt.web.core.internal.validation.Util;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
+ * pa_TODO Still need to take into consideration:
+ * 	- focus in workspace
+ *  - search pattern
+ * 
+ * @author pavery
+ */
+public class JsPathIndexer {
+
+	// for debugging
+	static final boolean DEBUG;
+	static {
+		
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jssearch"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+
+	}
+	
+	// visitor that retrieves jsp project paths for all jsp files in the workspace
+	class JSPFileVisitor implements IResourceProxyVisitor {
+		// hash map forces only one of each file
+		private HashMap fPaths = new HashMap();
+		IJavaScriptSearchScope fScope = null;
+		SearchPattern fPattern = null;
+
+		public JSPFileVisitor(SearchPattern pattern, IJavaScriptSearchScope scope) {
+			this.fPattern = pattern;
+			this.fScope = scope;
+		}
+
+		public boolean visit(IResourceProxy proxy) throws CoreException {
+			
+			if(JsSearchSupport.getInstance().isCanceled()) {
+				return false;
+			}
+			
+			if (proxy.getType() == IResource.FILE) {
+
+				//IContentType contentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
+				// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
+				// check this before description
+				// check name before actually getting the file (less work)
+				//if(contentTypeJSP.isAssociatedWith(proxy.getName())) {
+				if(Util.isJsType(proxy.getName())){	
+					IFile file = (IFile)proxy.requestResource();
+					//IContentDescription contentDescription = file.getContentDescription();
+					//String ctId = null;
+//					if (contentDescription != null) {
+//						ctId = contentDescription.getContentType().getId();
+//					}
+					//if (ContentTypeIdForJSP.ContentTypeID_JSP.equals(ctId)) {
+					//if(Util.isJsType(file.getName())){
+						if (this.fScope.encloses(proxy.requestFullPath().toString())) {
+	
+							if (DEBUG) {
+								System.out.println("adding selected index path:" + file.getParent().getFullPath()); //$NON-NLS-1$
+							}
+
+							fPaths.put(file.getParent().getFullPath(), JsSearchSupport.getInstance().computeIndexLocation(file.getParent().getFullPath()));
+						}
+					//}
+				}
+				// don't search deeper for files
+				return false;
+			}
+			return true;
+		}
+
+		public IPath[] getPaths() {
+			return (IPath[]) fPaths.values().toArray(new IPath[fPaths.size()]);
+		}
+	}
+
+	public IPath[] getVisibleJspPaths(SearchPattern pattern, IJavaScriptSearchScope scope) {
+
+		JSPFileVisitor jspFileVisitor = new JSPFileVisitor(pattern, scope);
+		try {
+			ResourcesPlugin.getWorkspace().getRoot().accept(jspFileVisitor, 0);
+		}
+		catch (CoreException e) {
+			e.printStackTrace();
+		}
+		return jspFileVisitor.getPaths();
+	}
+}
+
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchDocument.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchDocument.java
new file mode 100644
index 0000000..ce87bb1
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchDocument.java
@@ -0,0 +1,261 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.javascript.search;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.jsdt.core.search.SearchParticipant;
+import org.eclipse.wst.jsdt.web.core.internal.Logger;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapterFactory;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.exceptions.UnsupportedCharsetExceptionWithDetail;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
+ * Created with a .jsp file, but should appear to be a .java file for indexing
+ * and searching purposes. There are purposely few fields in this class, and
+ * those fields are lightweight since it's possible for many JSP search
+ * documents to exist in memory at one time (eg. after importing a project
+ * with a large number of JSP files)
+ * 
+ * @author pavery
+ */
+public class JsSearchDocument {
+
+	private String UNKNOWN_PATH = "**path unknown**"; //$NON-NLS-1$
+	private String fJSPPathString = UNKNOWN_PATH;
+	private String fCUPath = UNKNOWN_PATH;
+	private SearchParticipant fParticipant = null;
+	private long fLastModifiedStamp;
+	private char[] fCachedCharContents;
+	
+	/**
+	 * @param file
+	 * @param participant
+	 * @throws CoreException
+	 */
+	public JsSearchDocument(String filePath, SearchParticipant participant) {
+
+		this.fJSPPathString = filePath;
+		this.fParticipant = participant;
+	}
+
+	public SearchParticipant getParticipant() {
+		return this.fParticipant;
+	}
+
+	/**
+	 * @see org.eclipse.jdt.core.search.SearchDocument#getCharContents()
+	 */
+	public char[] getCharContents() {
+		
+		if((fCachedCharContents == null) || isDirty()) {
+		    IJsTranslation trans = getJSTranslation();    
+		    fCachedCharContents = trans != null ? trans.getJsText().toCharArray() : new char[0];
+		    fCUPath = trans.getJavaPath();
+		}
+		return fCachedCharContents;
+	}
+
+	public String getJavaText() {
+		return new String(getCharContents());
+	}
+
+	private IModelManager getModelManager() {
+		return StructuredModelManager.getModelManager();
+	}
+
+	/**
+	 * It's not recommended for clients to hold on to this JSPTranslation
+	 * since it's kind of large. If possible, hold on to the
+	 * JSPSearchDocument, which is more of a lightweight proxy.
+	 * 
+	 * @return the JSPTranslation for the jsp file, or null if it's an
+	 *         unsupported file.
+	 */
+	public final IJsTranslation getJSTranslation() {
+		IJsTranslation translation = null;
+		IFile jspFile = getFile();
+		if (!JsSearchSupport.isJsp(jspFile)) {
+			return translation;
+		}
+
+		IStructuredModel model = null;
+		try {
+			// get existing model for read, then get document from it
+			IModelManager modelManager = getModelManager();
+			if (modelManager != null) {
+				jspFile.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
+				model = modelManager.getModelForRead(jspFile);
+			}
+			// handle unsupported
+			if (model instanceof IDOMModel) {
+				IDOMModel xmlModel = (IDOMModel)model;
+				setupAdapterFactory(xmlModel);
+				IDOMDocument doc = xmlModel.getDocument();
+				JsTranslationAdapter adapter = (JsTranslationAdapter) doc.getAdapterFor(IJsTranslation.class);
+				translation = adapter.getJsTranslation(false);
+			}
+		}
+		catch (IOException e) {
+			Logger.logException(e);
+		}
+		catch (CoreException e) {
+			Logger.logException(e);
+		}
+		catch (UnsupportedCharsetExceptionWithDetail e) {
+			// no need to log this. Just consider it an invalid file for our
+			// purposes.
+			// Logger.logException(e);
+		}
+		finally {
+			if (model != null) {
+				model.releaseFromRead();
+			}
+		}
+		return translation;
+	}
+
+	/**
+	 * add the factory for JSPTranslationAdapter here
+	 * 
+	 * @param sm
+	 */
+	private void setupAdapterFactory(IStructuredModel sm) {
+		JsTranslationAdapterFactory.setupAdapterFactory(sm);
+	}
+
+	/**
+	 * the path to the Java compilation unit
+	 * 
+	 * @see org.eclipse.jdt.core.search.SearchDocument#getPath()
+	 */
+	public String getPath() {
+	    // caching the path since it's expensive to get translation
+		// important that isDirty() check is second to cache modification stamp
+	    if((this.fCUPath == null) || isDirty() || (this.fCUPath == UNKNOWN_PATH)) {
+	        IJsTranslation trans = getJSTranslation();
+	        if(trans != null) {
+	            this.fCUPath = trans.getJavaPath();
+	            // save since it's expensive to calculate again later
+	            fCachedCharContents = trans.getJsText().toCharArray();
+	        }
+	    }
+		return fCUPath != null ? fCUPath : UNKNOWN_PATH;
+	}
+
+//	public int getJspOffset(int javaOffset) {
+//		// copied from JSPTranslation
+//		int result = -1;
+//		int offsetInRange = 0;
+//		Position jspPos, javaPos = null;
+//		IJsTranslation trans = getJSPTranslation();
+//		if (trans != null) {
+//			HashMap java2jspMap = trans.getJava2JspMap();
+//
+//			// iterate all mapped java ranges
+//			Iterator it = java2jspMap.keySet().iterator();
+//			while (it.hasNext()) {
+//				javaPos = (Position) it.next();
+//				// need to count the last position as included
+//				if (!javaPos.includes(javaOffset) && !(javaPos.offset + javaPos.length == javaOffset))
+//					continue;
+//
+//				offsetInRange = javaOffset - javaPos.offset;
+//				jspPos = (Position) java2jspMap.get(javaPos);
+//
+//				if (jspPos != null)
+//					result = jspPos.offset + offsetInRange;
+//				else {
+//					Logger.log(Logger.ERROR, "jspPosition was null!" + javaOffset); //$NON-NLS-1$
+//				}
+//				break;
+//			}
+//		}
+//		return result;
+//	}
+
+	public IFile getFile() {
+		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+		IPath jspPath = new Path(this.fJSPPathString);
+		IFile jspFile = root.getFile(jspPath);
+		if (!jspFile.exists()) {
+			// possibly outside workspace
+			jspFile = root.getFileForLocation(jspPath);
+		}
+		return jspFile;
+	}
+
+	
+	private boolean isDirty() {
+		boolean modified = false;
+		IFile f = getFile();
+		if(f != null) {
+			long currentStamp = f.getModificationStamp();
+			if(currentStamp != fLastModifiedStamp) {
+				modified = true;
+			}
+			fLastModifiedStamp = currentStamp;
+		}
+		return modified;
+	}
+	
+	public void release() {
+		// nothing to do now since JSPTranslation is created on the fly
+	}
+
+	/**
+	 * for debugging
+	 */
+	public String toString() {
+		return "[JSPSearchDocument:" + this.fJSPPathString + "]"; //$NON-NLS-1$ //$NON-NLS-2$ 
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jdt.core.search.SearchDocument#getEncoding()
+	 */
+	public String getEncoding() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jdt.core.search.SearchDocument#getByteContents()
+	 */
+	public byte[] getByteContents() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchParticipant.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchParticipant.java
new file mode 100644
index 0000000..88ac3a1
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchParticipant.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.javascript.search;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
+import org.eclipse.wst.jsdt.core.search.SearchDocument;
+import org.eclipse.wst.jsdt.core.search.SearchEngine;
+import org.eclipse.wst.jsdt.core.search.SearchParticipant;
+import org.eclipse.wst.jsdt.core.search.SearchPattern;
+import org.eclipse.wst.jsdt.core.search.SearchRequestor;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
+ * Integration of JSP w/ java search.
+ * 
+ * @author pavery
+ */
+public class JsSearchParticipant extends SearchParticipant {
+
+	// for debugging
+	private static final boolean DEBUG = calculateValue();
+
+	private static boolean calculateValue() {
+		String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspsearch"); //$NON-NLS-1$
+		boolean debug = (value != null) && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+		return debug;
+	}
+
+	/**
+	 * Important to never return null here or else Java search participation
+	 * will break.
+	 */
+	public SearchDocument getDocument(String documentPath) {
+		SearchDocument sDoc = JsSearchSupport.getInstance().getSearchDocument(documentPath);
+
+		if (sDoc == null) {
+			// return a dummy doc here so search participation doesn't break
+			return new NullSearchDocument(documentPath);
+		}
+		return sDoc;
+	}
+
+	public String getDescription() {
+		return "Embeded JavaScript"; //$NON-NLS-1$
+	}
+
+	public IPath[] selectIndexes(SearchPattern pattern, IJavaScriptSearchScope scope) {
+		JsPathIndexer indexer = new JsPathIndexer();
+		return indexer.getVisibleJspPaths(pattern, scope);
+	}
+
+	public void indexDocument(SearchDocument document, IPath indexPath) {
+		if (!(document instanceof JSDTSearchDocumentDelegate)) {
+			return;
+		}
+
+		// use Java search indexing
+		SearchEngine.getDefaultSearchParticipant().indexDocument(document, indexPath);
+	}
+
+	public void locateMatches(SearchDocument[] indexMatches, SearchPattern pattern, IJavaScriptSearchScope scope, SearchRequestor requestor, IProgressMonitor monitor) throws CoreException {
+
+		if ((monitor != null) && monitor.isCanceled()) {
+			return;
+		}
+
+		// filter out null matches
+		List filtered = new ArrayList();
+		SearchDocument match = null;
+		for (int i = 0; i < indexMatches.length; i++) {
+			if (DEBUG) {
+				System.out.println("found possible matching JavaSearchDocumentDelegate: " + indexMatches[i]); //$NON-NLS-1$
+			}
+			match = indexMatches[i];
+			if (match != null) {
+				// some matches may be null, or if the index is out of date,
+				// the file may not even exist
+				if ((match instanceof JSDTSearchDocumentDelegate) && ((JSDTSearchDocumentDelegate) match).getFile().exists()) {
+					filtered.add(match);
+				}
+			}
+		}
+
+		indexMatches = (SearchDocument[]) filtered.toArray(new SearchDocument[filtered.size()]);
+		SearchEngine.getDefaultSearchParticipant().locateMatches(indexMatches, pattern, scope, requestor, monitor);
+	}
+
+	/**
+	 * @see org.eclipse.jdt.core.search.SearchParticipant#getDocument(org.eclipse.core.resources.IFile)
+	 */
+	public SearchDocument getDocument(IFile file) {
+		// never gets called?
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchScope.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchScope.java
new file mode 100644
index 0000000..815e7f7
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchScope.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.javascript.search;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.resources.IResourceProxy;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
+ * Used to constrain JSP/java search to certain paths and elements.
+ * @author pavery
+ */
+public class JsSearchScope implements IJavaScriptSearchScope {
+
+	private boolean fEnclosesAll = false;
+	private List fResourcePaths = null;
+	private List fJavaElements = null;
+
+	public JsSearchScope() {
+		// empty constructor just returns true for everything
+		// everything is in scope
+		this.fEnclosesAll = true;
+		init();
+	}
+
+	public JsSearchScope(String[] resourceStringPath) {
+		init();
+		fResourcePaths.addAll(Arrays.asList(resourceStringPath));
+	}
+
+	public JsSearchScope(IJavaScriptElement[] javaElement) {
+		init();
+		fJavaElements.addAll(Arrays.asList(javaElement));
+	}
+
+	private void init() {
+		this.fResourcePaths = new ArrayList();
+		this.fJavaElements = new ArrayList();
+	}
+
+	public boolean encloses(String resourcePathString) {
+
+		if (this.fEnclosesAll) {
+			return true;
+		} else if (enclosesPath(resourcePathString)) {
+			return true;
+		}
+
+		return false;
+	}
+
+	public boolean encloses(IJavaScriptElement element) {
+
+		// pa_TOD implement
+		if (this.fEnclosesAll) {
+			return true;
+		}
+
+		return true;
+	}
+
+	public boolean encloses(IResourceProxy element) {
+
+		if (this.fEnclosesAll) {
+			return true;
+		} else if (enclosesPath(element.requestFullPath().toOSString())) {
+			return true;
+		}
+
+		return true;
+	}
+
+	public void addPath(String path) {
+		this.fResourcePaths.add(path);
+	}
+
+	public void addElement(IJavaScriptElement element) {
+		this.fJavaElements.add(element);
+	}
+
+	private boolean enclosesPath(String possible) {
+
+		String[] paths = (String[]) fResourcePaths.toArray(new String[fResourcePaths.size()]);
+		for (int i = 0; i < paths.length; i++) {
+			if (possible.equals(paths[i])) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public String getDescription() {
+
+		return "JavaScript Search Scope"; //$NON-NLS-1$
+	}
+
+	public IPath[] enclosingProjectsAndJars() {
+		return (IPath[]) fResourcePaths.toArray(new IPath[fResourcePaths.size()]);
+	}
+
+	public boolean shouldExclude(String container, String resourceName) {
+		/* auto gen */
+		return false;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchSupport.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchSupport.java
new file mode 100644
index 0000000..80f03f0
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchSupport.java
@@ -0,0 +1,594 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.javascript.search;
+
+import java.io.File;
+import java.util.zip.CRC32;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants;
+import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
+import org.eclipse.wst.jsdt.core.search.SearchDocument;
+import org.eclipse.wst.jsdt.core.search.SearchEngine;
+import org.eclipse.wst.jsdt.core.search.SearchPattern;
+import org.eclipse.wst.jsdt.core.search.SearchRequestor;
+import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
+import org.eclipse.wst.jsdt.web.core.internal.JsCoreMessages;
+import org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin;
+import org.eclipse.wst.jsdt.web.core.internal.Logger;
+import org.eclipse.wst.jsdt.web.core.internal.validation.Util;
+import org.eclipse.wst.jsdt.web.core.javascript.JsNameManglerUtil;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
+ * Central access to java indexing and search. All contact between JDT indexing
+ * and Searching should be done through here.
+ * 
+ * Clients should access the methods of this class via the single instance via
+ * <code>getInstance()</code>.
+ * 
+ * @author pavery
+ */
+public class JsSearchSupport {
+
+    // for debugging
+    static final boolean DEBUG;
+    static {
+    	String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jssearch"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+    }
+
+    private static JsSearchSupport singleton = null;
+
+    private JsSearchParticipant fParticipant = null;
+
+    private IPath fJsPluginLocation = null;
+
+    // pa_TODO may be slow (esp for indexing entire workspace)
+    private final CRC32 fChecksumCalculator = new CRC32();
+
+    /** main cancel montior for all search support */
+    private final IProgressMonitor fMonitor = new NullProgressMonitor();
+
+    private JsSearchSupport() {
+        // force use of single instance
+    }
+
+    /**
+     * This operation ensures that the live resource's search markers show up in
+     * the open editor. It also allows the ability to pass in a ProgressMonitor
+     */
+    private class SearchJob extends Job implements IJavaScriptSearchConstants {
+
+        String fSearchText = ""; //$NON-NLS-1$
+
+        IJavaScriptSearchScope fScope = null;
+
+        int fSearchFor = FIELD;
+
+        int fLimitTo = ALL_OCCURRENCES;
+
+        int fMatchMode = SearchPattern.R_PATTERN_MATCH;
+
+       // boolean fIsCaseSensitive = false;
+
+        SearchRequestor fRequestor = null;
+
+        IJavaScriptElement fElement = null;
+
+        // constructor w/ java element
+        public SearchJob(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor) {
+
+            super(JsCoreMessages.JSP_Search + element.getElementName());
+            this.fElement = element;
+            this.fScope = scope;
+            this.fRequestor = requestor;
+        }
+
+        // constructor w/ search text
+        public SearchJob(String searchText, IJavaScriptSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
+
+            super(JsCoreMessages.JSP_Search + searchText);
+            this.fSearchText = searchText;
+            this.fScope = scope;
+            this.fSearchFor = searchFor;
+            this.fLimitTo = limitTo;
+            this.fMatchMode = matchMode;
+           // this.fIsCaseSensitive = isCaseSensitive;
+            this.fRequestor = requestor;
+        }
+
+        public IStatus run(IProgressMonitor jobMonitor) {
+
+            if ((jobMonitor != null) && jobMonitor.isCanceled()) {
+				return Status.CANCEL_STATUS;
+			}
+            if (JsSearchSupport.getInstance().isCanceled()) {
+				return Status.CANCEL_STATUS;
+			}
+
+            SearchPattern javaSearchPattern = null;
+            // if an element is available, use that to create search pattern
+            // (eg. LocalVariable)
+            // otherwise use the text and other paramters
+            if (this.fElement != null) {
+				javaSearchPattern = SearchPattern.createPattern(this.fElement, this.fLimitTo);
+			} else {
+				javaSearchPattern = SearchPattern.createPattern(this.fSearchText, this.fSearchFor, this.fLimitTo, this.fMatchMode);
+			}
+
+            if (javaSearchPattern != null) {
+                JsSearchParticipant[] participants = { getSearchParticipant() };
+                SearchEngine engine = new SearchEngine();
+                try {
+                    if (jobMonitor != null) {
+						jobMonitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
+					}
+                    engine.search(javaSearchPattern, participants, this.fScope, this.fRequestor, jobMonitor);
+                } catch (CoreException e) {
+                    if (DEBUG) {
+						Logger.logException(e);
+					}
+                }
+                // non-CoreExceptions will permanently stall the Worker thread
+                catch (Exception e) {
+                    if (DEBUG) {
+						Logger.logException(e);
+					}
+                } finally {
+                    if (jobMonitor != null) {
+						jobMonitor.done();
+					}
+                }
+            }
+            return Status.OK_STATUS;
+        }
+    }
+
+    // end SearchJob
+    /**
+     * Runnable forces caller to wait until finished (as opposed to using a Job)
+     */
+    private class SearchRunnable implements IWorkspaceRunnable, IJavaScriptSearchConstants {
+
+        String fSearchText = ""; //$NON-NLS-1$
+
+        IJavaScriptSearchScope fScope = null;
+
+        int fSearchFor = FIELD;
+
+        int fLimitTo = ALL_OCCURRENCES;
+
+        int fMatchMode = SearchPattern.R_PATTERN_MATCH;
+
+        //boolean fIsCaseSensitive = false;
+
+        SearchRequestor fRequestor = null;
+
+        IJavaScriptElement fElement = null;
+
+        // constructor w/ java element
+        public SearchRunnable(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor) {
+
+            this.fElement = element;
+            this.fScope = scope;
+            this.fRequestor = requestor;
+        }
+
+        // constructor w/ search text
+//        public SearchRunnable(String searchText, IJavaScriptSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
+//
+//            this.fSearchText = searchText;
+//            this.fScope = scope;
+//            this.fSearchFor = searchFor;
+//            this.fLimitTo = limitTo;
+//            this.fMatchMode = matchMode;
+//            this.fIsCaseSensitive = isCaseSensitive;
+//            this.fRequestor = requestor;
+//        }
+
+        public void run(IProgressMonitor monitor) throws CoreException {
+
+            if ((monitor != null) && monitor.isCanceled()) {
+				return;
+			}
+            if (JsSearchSupport.getInstance().isCanceled()) {
+				return;
+			}
+
+            SearchPattern javaSearchPattern = null;
+            // if an element is available, use that to create search pattern
+            // (eg. LocalVariable)
+            // otherwise use the text and other paramters
+            if (this.fElement != null) {
+				javaSearchPattern = SearchPattern.createPattern(this.fElement, fLimitTo);
+			} else {
+				javaSearchPattern = SearchPattern.createPattern(fSearchText, fSearchFor, fLimitTo, fMatchMode);
+			}
+
+            if (javaSearchPattern != null) {
+                JsSearchParticipant[] participants = { getSearchParticipant() };
+                SearchEngine engine = new SearchEngine();
+                try {
+                    if (monitor != null) {
+						monitor.beginTask("", 0); //$NON-NLS-1$
+					}
+                    engine.search(javaSearchPattern, participants, fScope, fRequestor, monitor);
+                } catch (CoreException e) {
+                    Logger.logException(e);
+                    //throw e;
+                }
+                // non-CoreExceptions will permanently stall the Worker thread
+                catch (Exception e) {
+                    Logger.logException(e);
+                } finally {
+                    if (monitor != null) {
+						monitor.done();
+					}
+                }
+            }
+        }
+    }
+
+    // end SearchRunnable
+
+    /**
+     * Clients should access the methods of this class via the single instance
+     * via getInstance()
+     * 
+     * @return
+     */
+    public synchronized static JsSearchSupport getInstance() {
+
+        if (singleton == null) {
+			singleton = new JsSearchSupport();
+		}
+        return singleton;
+    }
+
+    /**
+     * Utility method to check if a file is a jsp file (since this is done
+     * frequently)
+     */
+    public static boolean isJsp(IFile file) {
+    	return Util.isJsType(file.getName());
+    	// (pa) 20051025 removing deep content type check
+    	// because this method is called frequently
+    	// and IO is expensive
+//        boolean isJsp = false;
+//
+//        if (file != null && file.exists()) {
+//        	
+//            IContentType contentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
+//            // check this before description, it's less expensive
+//            if (contentTypeJSP.isAssociatedWith(file.getName())) {
+//            	isJsp = true;
+//            }
+//        }
+//
+//        return isJsp;
+    }
+
+    /**
+     * schedules a search document representing this JSP file for indexing (by
+     * the java indexer)
+     * 
+     * @param file
+     *            the JSP file
+     * @return true if indexing was successful, false otherwise
+     * @throws CoreException
+     */
+    public SearchDocument addJspFile(IFile file) {
+        if (JsSearchSupport.getInstance().isCanceled() || !file.isAccessible()) {
+            return null;
+        }
+
+        if (DEBUG) {
+			System.out.println("adding JSP file:" + file.getFullPath()); //$NON-NLS-1$
+		}
+
+        // create
+        SearchDocument delegate = createSearchDocument(file);
+        // null if not a jsp file
+        if (delegate != null) {
+            try {
+                getSearchParticipant().scheduleDocumentIndexing(delegate, computeIndexLocation(file.getParent().getFullPath()));
+            } catch (Exception e) {
+                // ensure that failure here doesn't keep other documents from
+                // being indexed
+                // if peformed in a batch call (like JSPIndexManager)
+                if (DEBUG) {
+					e.printStackTrace();
+				}
+            }
+        }
+
+        if (DEBUG) {
+			System.out.println("scheduled" + delegate + "for indexing"); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+
+        return delegate;
+    }
+    
+    /**
+     * Perform a java search w/ the given parameters. Runs in a background Job
+     * (results may still come in after this method call)
+     * 
+     * @param searchText
+     *            the string of text to search on
+     * @param searchFor
+     *            IJavaScriptSearchConstants.TYPE, METHOD, FIELD, PACKAGE, etc...
+     * @param limitTo
+     *            IJavaScriptSearchConstants.DECLARATIONS,
+     *            IJavaScriptSearchConstants.REFERENCES,
+     *            IJavaScriptSearchConstants.IMPLEMENTORS, or
+     *            IJavaScriptSearchConstants.ALL_OCCURRENCES
+     * @param matchMode
+     *            allow * wildcards or not
+     * @param isCaseSensitive
+     * @param requestor
+     *            passed in to accept search matches (and do "something" with
+     *            them)
+     */
+    public void search(String searchText, IJavaScriptSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
+
+        JsIndexManager.getInstance().rebuildIndexIfNeeded();
+
+        SearchJob job = new SearchJob(searchText, scope, searchFor, limitTo, matchMode, isCaseSensitive, requestor);
+        setCanceled(false);
+        job.setUser(true);
+        // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5032
+        // pops up user operation blocked dialog if you perform a long search,
+        // then open a file because it locks the workspace
+        //job.setRule(ResourcesPlugin.getWorkspace().getRoot());
+        job.schedule();
+    }
+
+    /**
+     * Search for an IJavaScriptElement, constrained by the given parameters. Runs in
+     * a background Job (results may still come in after this method call)
+     * 
+     * @param element
+     * @param scope
+     * @param requestor
+     */
+    public void search(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor) {
+
+        JsIndexManager.getInstance().rebuildIndexIfNeeded();
+
+        SearchJob job = new SearchJob(element, scope, requestor);
+        setCanceled(false);
+        job.setUser(true);
+        // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5032
+        //job.setRule(ResourcesPlugin.getWorkspace().getRoot());
+        job.schedule();
+    }
+
+    /**
+     * Search for an IJavaScriptElement, constrained by the given parameters. Runs in
+     * an IWorkspace runnable (results will be reported by the end of this
+     * method)
+     * 
+     * @param element
+     * @param scope
+     * @param requestor
+     */
+    public void searchRunnable(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor) {
+
+        JsIndexManager.getInstance().rebuildIndexIfNeeded();
+
+        SearchRunnable searchRunnable = new SearchRunnable(element, scope, requestor);
+        try {
+            setCanceled(false);
+            ResourcesPlugin.getWorkspace().run(searchRunnable, JsSearchSupport.getInstance().getProgressMonitor());
+        } catch (CoreException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * @param jspFile
+     * @return SearchDocument if the file is not null, exists, and is a JSP
+     *         file, otherwise null.
+     */
+    private SearchDocument createSearchDocument(IFile jspFile) {
+
+        JSDTSearchDocumentDelegate delegate = null;
+        if ((jspFile != null) && jspFile.exists() && isJsp(jspFile)) {
+
+            delegate = new JSDTSearchDocumentDelegate(new JsSearchDocument(jspFile.getFullPath().toString(), getSearchParticipant()));
+        }
+        return delegate;
+
+    }
+
+    /**
+     * Centralized place to access JSPSearchDocuments (used by
+     * JSPSearchParticipant and JSPSearchRequestor)
+     * 
+     * @param searchDocPath
+     * @param doc
+     * @return the JSPSearchDocument or null if one is not found
+     */
+    public SearchDocument getSearchDocument(String searchDocPath) {
+         
+        SearchDocument delegate = null;
+        IFile f = fileForCUPath(searchDocPath);
+        if (f != null) {
+            delegate = createSearchDocument(f);
+        } else {
+            // handle failure case... (file deleted maybe?)
+        }
+        return delegate;
+    }
+
+    /**
+     * Unmangles the searchDocPath and returns the corresponding JSP file.
+     * 
+     * @param searchDocPath
+     */
+    private IFile fileForCUPath(String searchDocPath) {
+    
+        String[] split = searchDocPath.split("/"); //$NON-NLS-1$
+        String classname = split[split.length - 1];
+
+        // ignore anything but .java matches (like .class binary matches)
+        if(!searchDocPath.endsWith(".js")) { //$NON-NLS-1$
+            return null;
+        }
+
+        String filePath = JsNameManglerUtil.unmangle(classname);
+       
+        // try absolute path
+        IFile f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(filePath));
+        // workspace relative then
+        if(f == null) {
+            // https://bugs.eclipse.org/bugs/show_bug.cgi?id=86009
+            // must have a project name as well
+            // which would mean >= 2 path segments
+            IPath path = new Path(filePath);
+            if(path.segmentCount() >= 2) {
+                f = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+            }
+        }
+        return f;
+    }
+
+    JsSearchParticipant getSearchParticipant() {
+
+        if (this.fParticipant == null) {
+			this.fParticipant = new JsSearchParticipant();
+		}
+        return this.fParticipant;
+    }
+
+    // This is called from JSPPathIndexer
+    // pa_TODO
+    //how can we make sure participant indexLocations are updated at startup?
+    public final IPath computeIndexLocation(IPath containerPath) {
+
+        IPath indexLocation = null;
+        // we don't want to inadvertently use a JDT Index
+        // we want to be sure to use the Index from the JSP location
+        //Object obj = indexLocations.get(containerPath);
+        //if (obj != null) {
+        //    indexLocation = (String) obj;
+        //} else {
+            // create index entry
+            String pathString = containerPath.toOSString();
+            this.fChecksumCalculator.reset();
+            this.fChecksumCalculator.update(pathString.getBytes());
+            String fileName = Long.toString(this.fChecksumCalculator.getValue()) + ".index"; //$NON-NLS-1$
+            // this is the only difference from
+            // IndexManager#computeIndexLocation(...)
+            indexLocation = getModelJspPluginWorkingLocation().append(fileName);
+
+            // pa_TODO need to add to java path too, so JDT search support knows
+            // there should be a non internal way to do this.
+            // https://bugs.eclipse.org/bugs/show_bug.cgi?id=77564
+            JavaModelManager.getJavaModelManager().getIndexManager().indexLocations.put(containerPath, indexLocation);
+        //}
+        return indexLocation;
+    }
+	public IPath getModelJspPluginWorkingLocation(IProject project) {
+		if (project == null) {
+			System.out.println("Null project"); //$NON-NLS-1$
+		}
+		IPath workingLocationFile = project.getWorkingLocation(JsCorePlugin.PLUGIN_ID).append("jssearch"); //$NON-NLS-1$
+		// ensure that it exists on disk
+		File folder = new File(workingLocationFile.toOSString());
+		if (!folder.isDirectory()) {
+			try {
+				folder.mkdir();
+			} catch (SecurityException e) {
+			}
+		}
+		return workingLocationFile;
+	}
+    // copied from JDT IndexManager
+    public IPath getModelJspPluginWorkingLocation() {
+
+        if (this.fJsPluginLocation != null) {
+			return this.fJsPluginLocation;
+		}
+
+        // Append the folder name "jssearch" to keep the state location area cleaner
+        IPath stateLocation = JsCorePlugin.getDefault().getStateLocation().addTrailingSeparator().append("jssearch"); //$NON-NLS-1$
+
+        // pa_TODO workaround for
+        // https://bugs.eclipse.org/bugs/show_bug.cgi?id=62267
+        // copied from IndexManager
+        String device = stateLocation.getDevice();
+        if ((device != null) && (device.charAt(0) == '/')) {
+			stateLocation = stateLocation.setDevice(device.substring(1));
+		}
+
+        // ensure that it exists on disk
+        File folder = new File(stateLocation.toOSString());
+		if (!folder.isDirectory()) {
+			try {
+				folder.mkdir();
+			}
+			catch (SecurityException e) {
+			}
+		}
+
+        return this.fJsPluginLocation = stateLocation;
+    }
+
+    /**
+     * JSP Indexing and Search jobs check this
+     * 
+     * @return
+     */
+    public synchronized final void setCanceled(boolean cancel) {
+    	//System.out.println("search support monitor" + fMonitor);
+        fMonitor.setCanceled(cancel);
+    }
+
+    /**
+     * JSP Indexing and Search jobs check this
+     * 
+     * @return
+     */
+    public synchronized final boolean isCanceled() {
+
+        return fMonitor.isCanceled();
+    }
+
+    /**
+     * JSP Indexing and Search jobs check this
+     * 
+     * @return
+     */
+    public final IProgressMonitor getProgressMonitor() {
+
+        return this.fMonitor;
+    }
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/NullSearchDocument.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/NullSearchDocument.java
new file mode 100644
index 0000000..7f1ce79
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/NullSearchDocument.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.javascript.search;
+
+import org.eclipse.wst.jsdt.core.search.SearchDocument;
+
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * An empty servlet, safe for Java search participation
+ * 
+ * @author pavery
+ */
+public class NullSearchDocument extends SearchDocument {
+	
+	StringBuffer fEmptyServletBuffer = null;
+	
+	public NullSearchDocument(String documentPath) {
+		super(documentPath, new JsSearchParticipant()); 
+		this.fEmptyServletBuffer = new StringBuffer();
+	}
+	
+	public byte[] getByteContents() {
+		return this.fEmptyServletBuffer.toString().getBytes();
+	}
+	
+	public char[] getCharContents() {
+		return this.fEmptyServletBuffer.toString().toCharArray();
+	}
+	
+	public String getEncoding() {
+		return null;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/text/IJsPartitions.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/text/IJsPartitions.java
new file mode 100644
index 0000000..44ab14b
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/text/IJsPartitions.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.text;
+
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public interface IJsPartitions {
+	String HtmlJsPartition = IHTMLPartitions.SCRIPT;
+	//$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.classpath b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.classpath
new file mode 100644
index 0000000..ce73933
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.cvsignore b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.cvsignore
new file mode 100644
index 0000000..c7e8ba8
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.cvsignore
@@ -0,0 +1,4 @@
+@dot
+build.xml
+javaCompiler...args
+org.eclipse.wst.jsdt.web.support.jsp_1.0.0.200806031304.jar
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.project b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.project
new file mode 100644
index 0000000..f9e0796
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.wst.jsdt.web.support.jsp</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.core.resources.prefs
similarity index 100%
copy from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs
copy to bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.core.resources.prefs
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.core.runtime.prefs
similarity index 100%
copy from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.runtime.prefs
copy to bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.core.runtime.prefs
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..9153739
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,80 @@
+#Sat Mar 24 11:23:54 EDT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=ignore
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..301c7ad
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,4 @@
+#Mon Apr 17 01:48:39 EDT 2006
+eclipse.preferences.version=1
+internal.default.compliance=default
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<templates/>
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.ltk.core.refactoring.prefs
similarity index 100%
copy from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.ltk.core.refactoring.prefs
copy to bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.ltk.core.refactoring.prefs
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000..fc522bb
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,16 @@
+#Mon Apr 17 02:01:33 EDT 2006
+compilers.incompatible-environment=0
+compilers.p.build=0
+compilers.p.deprecated=1
+compilers.p.illegal-att-value=0
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=0
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.p.unused-element-or-attribute=0
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.web.support.jsp/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..4f552a3
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.wst.jsdt.web.support.jsp;singleton:=true
+Bundle-Version: 1.0.301.qualifier
+Bundle-Activator: org.eclipse.wst.jsdt.web.support.jsp.Activator
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.jsdt.web.ui;bundle-version="[1.0.200,2.0.0)",
+ org.eclipse.jst.jsp.ui;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.sse.ui;bundle-version="[1.1.200,1.3.0)",
+ org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jface;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.html.ui;bundle-version="[1.0.500,1.1.0)",
+ org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.jst.jsp.core;bundle-version="[1.2.300,1.3.0)",
+ org.eclipse.wst.css.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.jsdt.web.core;bundle-version="[1.0.300,2.0.0)"
+Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.wst.jsdt.web.support.jsp
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/about.html b/bundles/org.eclipse.wst.jsdt.web.support.jsp/about.html
new file mode 100644
index 0000000..4602330
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>June 2, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/build.properties b/bundles/org.eclipse.wst.jsdt.web.support.jsp/build.properties
new file mode 100644
index 0000000..bc3b0f2
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               plugin.properties,\
+               about.html
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.properties b/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.properties
new file mode 100644
index 0000000..8189ecb
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.properties
@@ -0,0 +1,14 @@
+###############################################################################

+# Copyright (c) 2000, 2010 IBM Corporation and others.

+# All rights reserved. This program and the accompanying materials

+# are made available under the terms of the Eclipse Public License v1.0

+# which accompanies this distribution, and is available at

+# http://www.eclipse.org/legal/epl-v10.html

+#

+# Contributors:

+#     IBM Corporation - initial API and implementation

+###############################################################################

+

+#Properties file for org.eclipse.wst.jsdt.web.support.jsp

+Bundle-Vendor.0 = Eclipse Web Tools Platform

+Bundle-Name.0 = JSDT support for JSP Plug-in
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.xml b/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.xml
new file mode 100644
index 0000000..ea1b7a6
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
+		<sourceViewerConfiguration
+			class="org.eclipse.wst.jsdt.web.support.jsp.JSDTStructuredTextViewerConfigurationJSP"
+			target="org.eclipse.jst.jsp.core.jspsource.source" />
+		<provisionalConfiguration
+			type="contentassistprocessor"
+			class="org.eclipse.wst.jsdt.web.ui.internal.contentassist.JSDTContentAssistant"
+			target="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT" />
+		<documentationTextHover
+			class="org.eclipse.wst.jsdt.web.ui.internal.taginfo.JSDTHoverProcessor"
+			target="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT" />
+		<provisionalConfiguration
+			type="org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor"
+			class="org.eclipse.wst.jsdt.web.ui.internal.java.search.JsFindOccurrencesProcessor"
+			target="org.eclipse.jst.jsp.SCRIPT,org.eclipse.jst.jsp.SCRIPT.EVENTHANDLER" />
+		<provisionalConfiguration
+			type="slaveformattingstrategy"
+			class="org.eclipse.wst.jsdt.web.ui.internal.format.FormattingStrategyJSDT"
+			target="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT" />
+	</extension>
+
+	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
+		<validator
+			scope="total"
+			class="org.eclipse.wst.jsdt.web.core.internal.validation.JsValidator"
+			id="org.eclipse.wst.jsdt.web.support.jsp.jssourcevalidator">
+			<contentTypeIdentifier id="org.eclipse.jst.jsp.core.jspsource">
+				<partitionType id="org.eclipse.wst.html.SCRIPT"></partitionType>
+				<partitionType id="org.eclipse.wst.html.SCRIPT.EVENT"></partitionType>
+			</contentTypeIdentifier>
+		</validator>
+	</extension>
+
+   <!--
+   <extension point="org.eclipse.wst.common.project.facet.core.facets">
+		<event-handler facet="jst.web" type="POST_INSTALL"  version="[2.0">
+	   		<delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureInstaller"/>
+		</event-handler>
+	
+		<event-handler facet="jst.web" type="POST_UNINSTALL" version="[2.0">
+			<delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureUninstaller"/>
+		</event-handler>
+	</extension>-->
+</plugin>
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/Activator.java b/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/Activator.java
new file mode 100644
index 0000000..dd179c0
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/Activator.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ ******************************************************************************
+ *
+ **/
+package org.eclipse.wst.jsdt.web.support.jsp;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class Activator extends Plugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.eclipse.wst.jsdt.web.support.jsp";
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTStructuredTextViewerConfigurationJSP.java b/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTStructuredTextViewerConfigurationJSP.java
new file mode 100644
index 0000000..661e60d
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTStructuredTextViewerConfigurationJSP.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.support.jsp;
+
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP;
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.jsdt.web.ui.StructuredTextViewerConfigurationJSDT;
+import org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs;
+import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JSDTStructuredTextViewerConfigurationJSP extends StructuredTextViewerConfigurationJSP{
+
+	private StructuredTextViewerConfiguration fHTMLSourceViewerConfiguration;
+
+	private StructuredTextViewerConfiguration getJSDTHTMLSourceViewerConfiguration() {
+		if (fHTMLSourceViewerConfiguration == null) {
+			fHTMLSourceViewerConfiguration = new StructuredTextViewerConfigurationJSDT();
+		}
+		return fHTMLSourceViewerConfiguration;
+	}
+	
+	public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
+		String[] indentations = null;
+		if (IHTMLPartitions.SCRIPT.equals(contentType) || IJSPPartitions.JSP_CONTENT_JAVASCRIPT.equals(contentType) || IHTMLPartitions.SCRIPT_EVENTHANDLER.equals(contentType))
+			indentations = getJSDTHTMLSourceViewerConfiguration().getIndentPrefixes(sourceViewer, contentType);
+		else
+			indentations = super.getIndentPrefixes(sourceViewer, contentType);
+		return indentations;
+	}
+	
+	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
+		LineStyleProvider[] providers = null;
+		if (IHTMLPartitions.SCRIPT.equals(partitionType) || IJSPPartitions.JSP_CONTENT_JAVASCRIPT.equals(partitionType) || IHTMLPartitions.SCRIPT_EVENTHANDLER.equals(partitionType)) {
+			providers = getJSDTHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitions.SCRIPT);
+		}
+		else{
+			providers = super.getLineStyleProviders(sourceViewer, partitionType);
+		}
+
+		return providers;
+	}
+	
+	/**
+	 * @see org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
+	 */
+	public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
+		if(contentType.equals(IHTMLPartitions.SCRIPT) || contentType.equals(IHTMLPartitions.SCRIPT_EVENTHANDLER)) {
+			IAutoEditStrategy[] strategies = new IAutoEditStrategy[1];
+			strategies[0] = new AutoEditStrategyForJs();
+			return strategies;
+		} else {
+			return super.getAutoEditStrategies(sourceViewer, contentType);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/.classpath b/bundles/org.eclipse.wst.jsdt.web.ui/.classpath
new file mode 100644
index 0000000..52165ec
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/.project b/bundles/org.eclipse.wst.jsdt.web.ui/.project
new file mode 100644
index 0000000..4917858
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.wst.jsdt.web.ui</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+	</natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.core.resources.prefs
similarity index 100%
copy from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs
copy to bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.core.resources.prefs
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.core.runtime.prefs
similarity index 100%
copy from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.runtime.prefs
copy to bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.core.runtime.prefs
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..6e07215
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,96 @@
+#Wed Oct 24 19:49:45 EDT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=ignore
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=ignore
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..c91d09d
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,51 @@
+#Wed Oct 24 19:41:31 EDT 2007
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=false
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=true
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=true
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.format_source_code=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=false
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=true
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=true
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_SSE Team Styles
+cleanup_settings_version=2
+eclipse.preferences.version=1
+internal.default.compliance=default
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.overrideannotation=false
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
similarity index 100%
copy from bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.ltk.core.refactoring.prefs
copy to bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000..262b0ab
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,28 @@
+#Fri Feb 27 12:45:35 EST 2009
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=0
+compilers.p.build=0
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.illegal-att-value=0
+compilers.p.internal=1
+compilers.p.missing-packages=2
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=0
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.p.unused-element-or-attribute=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.web.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..6fee1c7
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,53 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.wst.jsdt.web.ui; singleton:=true
+Bundle-Version: 1.0.302.qualifier
+Bundle-Activator: org.eclipse.wst.jsdt.web.ui.internal.JsUIPlugin
+Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Localization: plugin
+Export-Package: org.eclipse.wst.jsdt.web.ui;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.autoedit;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.contentassist;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.derived;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.editor;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.format;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.hyperlink;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.java.search;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.java.search.ui;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.registry;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.style;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.style.java;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.taginfo;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.internal.text;x-internal:=true,
+ org.eclipse.wst.jsdt.web.ui.views.contentoutline
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8",
+ org.eclipse.core.filesystem,
+ org.eclipse.ui.views.contentoutline
+Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.workbench;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.3.0)",
+ org.eclipse.wst.xml.ui;bundle-version="[1.1.100,1.2.0)",
+ org.eclipse.wst.jsdt.web.core;bundle-version="[1.0.300,2.0.0)",
+ org.eclipse.wst.css.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.debug.core;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.search;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ltk.core.refactoring;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.common.uriresolver;bundle-version="[1.1.300,1.2.0)",
+ org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.jsdt.core;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.wst.jsdt.ui;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.wst.html.ui;bundle-version="[1.0.500,1.1.0)",
+ org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.jsdt.manipulation;bundle-version="[1.0.200,2.0.0)"
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/about.html b/bundles/org.eclipse.wst.jsdt.web.ui/about.html
new file mode 100644
index 0000000..4602330
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>June 2, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/build.properties b/bundles/org.eclipse.wst.jsdt.web.ui/build.properties
new file mode 100644
index 0000000..01667d8
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/build.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2007, 2009 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/
+bin.includes = META-INF/,\
+               .,\
+               icons/,\
+               plugin.properties,\
+               plugin.xml,\
+               about.html
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/icons/eye_icon.gif b/bundles/org.eclipse.wst.jsdt.web.ui/icons/eye_icon.gif
new file mode 100644
index 0000000..078398e
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/icons/eye_icon.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/icons/full/elcl16/javaassist_co.gif b/bundles/org.eclipse.wst.jsdt.web.ui/icons/full/elcl16/javaassist_co.gif
new file mode 100644
index 0000000..e9a6bd9
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/icons/full/elcl16/javaassist_co.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/plugin.properties b/bundles/org.eclipse.wst.jsdt.web.ui/plugin.properties
new file mode 100644
index 0000000..09d199d
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/plugin.properties
@@ -0,0 +1,67 @@
+###############################################################################
+# Copyright (c) 2000, 2010 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+
+Bundle-Vendor.0 = Eclipse Web Tools Platform
+Bundle-Name.0 = JSDT Web Support UI
+hyperlinkDetector.name.0 = JavaScript Element
+menu.label.0 = Declarations
+action.tooltip.0 = Working Set
+action.label.0 = Working Set
+action.label.1 = Hierarchy
+action.tooltip.1 = Hierarchy
+action.label.2 = Project
+action.tooltip.2 = Project
+action.label.3 = Workspace
+action.tooltip.3 = Declarations
+menu.label.1 = References
+action.label.4 = Working Set
+action.tooltip.4 = Working Set
+action.label.5 = Hierarchy
+action.tooltip.5 = Hierarchy
+action.label.6 = Project
+action.tooltip.6 = Project
+action.label.7 = Workspace
+action.tooltip.7 = 
+menu.label.2 = Refactor
+menu.label.3 = Source
+action.label.8 = Generate Element Comment
+action.tooltip.8 = Generate Element Comment
+action.label.9 = Change Function Signature
+action.tooltip.9 = Change Function Signature
+action.label.10 = Move
+action.tooltip.10 = Move
+action.label.11 = Rename
+action.tooltip.11 = Rename
+action.label.12 = Delete
+action.tooltip.12 = Delete
+action.label.13 = Paste After
+action.tooltip.13 = Paste
+action.label.14 = Paste Before
+action.tooltip.14 = Paste
+action.label.15 = Copy
+action.tooltip.15 = Copy
+action.label.16 = Cut
+action.tooltip.16 = Cut
+menu.label.4 = Show In
+action.label.17 = Navigator
+action.tooltip.17 = Show In Navigator
+action.label.18 = Script Explorer
+action.tooltip.18 = Show In Script Explorer
+action.label.19 = Open Call Hierarchy
+action.tooltip.19 = Open Call Hierarchy
+action.label.20 = Open Type Hierarchy
+action.tooltip.20 = Open Type Hierarchy
+renameParticipant.name.0 = JSDT Web Rename Participant
+renameParticipant.name.1 = JSDT Web Rename Participant
+renameParticipant.name.2 = JSDT Web Rename Participant
+renameParticipant.name.3 = JSDT Web Rename Participant
+queryParticipant.name.0 = JavaScript Query Participant
+javaScriptProposals = JavaScript Proposals
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml b/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml
new file mode 100644
index 0000000..604fd98
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml
@@ -0,0 +1,735 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ 	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
+ 		<contentOutlineConfiguration
+			class="org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline.JsContentOutlineConfig"
+			target="org.eclipse.wst.html.core.htmlsource.source" />	
+		<sourceViewerConfiguration
+			class="org.eclipse.wst.jsdt.web.ui.StructuredTextViewerConfigurationJSDT"
+			target="org.eclipse.wst.html.core.htmlsource.source" />	
+		<provisionalConfiguration
+			type="linestyleprovider"
+			class="org.eclipse.wst.jsdt.web.ui.internal.style.java.LineStyleProviderForJSDT"
+			target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
+		<documentationTextHover
+			class="org.eclipse.wst.jsdt.web.ui.internal.taginfo.JSDTHoverProcessor"
+			target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
+		<provisionalConfiguration
+			type="characterpairmatcher"
+			class="org.eclipse.wst.jsdt.web.ui.internal.text.JsDocumentRegionEdgeMatcher"
+			target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
+		<provisionalConfiguration
+			type="autoeditstrategy"
+			class="org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs"
+			target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
+		<provisionalConfiguration
+			type="org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor"
+			class="org.eclipse.wst.jsdt.web.ui.internal.java.search.JsFindOccurrencesProcessor"
+			target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
+		<provisionalConfiguration
+			type="slaveformattingstrategy"
+			class="org.eclipse.wst.jsdt.web.ui.internal.format.FormattingStrategyJSDT"
+			target="org.eclipse.wst.html.SCRIPT" />
+	</extension>		
+	
+	 <extension
+         point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
+      <hyperlinkDetector 
+            class="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.JSDTHyperlinkDetector"
+            id="org.eclipse.wst.jsdt.web.ui.JSDTHyperlinkDetector.SCRIPT"
+            name="%hyperlinkDetector.name.0"
+            targetId="org.eclipse.wst.html.SCRIPT"/>
+      <hyperlinkDetector
+            class="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.JSDTHyperlinkDetector"
+            id="org.eclipse.wst.jsdt.web.ui.JSDTHyperlinkDetector.SCRIPT.events"
+            name="%hyperlinkDetector.name.0"
+            targetId="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"/>  
+      <hyperlinkDetector
+			class="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.JSDTHyperlinkDetector"
+			id="org.eclipse.wst.jsdt.web.ui.JSDTHyperlinkDetector.HTML"
+			name="%hyperlinkDetector.name.0"
+			targetId="org.eclipse.wst.html.core.htmlsource"/>
+   </extension>
+  
+  
+    <extension
+         point="org.eclipse.ui.popupMenus">
+	<!-- content outline contributions for Open Type and Open Hierarchy menu.  Menus show up in reverse order of decliration (google it). -->
+      <objectContribution
+            objectClass="org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode"
+            id="org.eclipse.wst.jsdt.web.ui.JavaActions">
+            <!-- Declarations Search Menu -->
+            <menu
+                id="org.eclipse.wst.jsdt.web.declerations"
+         		label="%menu.label.0"
+         		path="group.search">
+     		 	<separator name="declerations"/>
+         </menu>
+         <action
+               label="%action.label.0"          
+               tooltip="%action.tooltip.0"
+               menubarPath="org.eclipse.wst.jsdt.web.declerations/declerations"
+               class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesInWorkingSetAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.ui.actions.FindDeclarationsInWorkingSetAction">
+         </action>  
+         <action
+               label="%action.label.1"          
+               tooltip="%action.tooltip.1"
+               menubarPath="org.eclipse.wst.jsdt.web.declerations/declerations"
+               class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.ui.actions.FindDeclarationsInHierarchyAction">
+         </action> 
+          <action
+               label="%action.label.2"          
+               tooltip="%action.tooltip.2"
+               menubarPath="org.eclipse.wst.jsdt.web.declerations/declerations"
+               class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.ui.actions.FindDeclarationsInProjectAction">
+         </action>
+         
+         <action
+               label="%action.label.3"
+               tooltip="%action.tooltip.3"
+               menubarPath="org.eclipse.wst.jsdt.web.declerations/declerations"
+               class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.ui.actions.FindDeclarationsAction">
+         </action>   
+            
+            <!-- Refrences Search menu -->
+          <menu
+                id="org.eclipse.wst.jsdt.web.references"
+         		label="%menu.label.1"
+         		path="group.search">
+     		 	<separator name="references"/>
+         </menu>
+         <action
+               label="%action.label.4"          
+               tooltip="%action.tooltip.4"
+               menubarPath="org.eclipse.wst.jsdt.web.references/references"
+               class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesInWorkingSetAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.ui.actions.FindReferencesInWorkingSetAction">
+         </action>  
+         <action
+               label="%action.label.5"          
+               tooltip="%action.tooltip.5"
+               menubarPath="org.eclipse.wst.jsdt.web.references/references"
+               class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.ui.actions.FindReferencesInHierarchyAction">
+         </action> 
+          <action
+               label="%action.label.6"          
+               tooltip="%action.tooltip.6"
+               menubarPath="org.eclipse.wst.jsdt.web.references/references"
+               class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.ui.actions.FindReferencesInProjectAction">
+         </action>
+         
+         <action
+               label="%action.label.7"
+               tooltip="%action.tooltip.7"
+               menubarPath="org.eclipse.wst.jsdt.web.references/references"
+               class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.ui.actions.FindReferencesAction">
+         </action>   
+         <!-- Source and Refactoring Menu's -->
+          <menu
+                id="org.eclipse.wst.jsdt.web.refactor"
+         		label="%menu.label.2"
+         		path="group.generate">
+     		 	<separator name="refactor"/>
+         </menu>
+
+         <menu
+                id="org.eclipse.wst.jsdt.web.source"
+         		label="%menu.label.3"
+         		path="group.generate">
+     		 	<separator name="source"/>
+         </menu>
+         <!-- Source Actions -->
+		 <action
+               label="%action.label.8"          
+               tooltip="%action.tooltip.8"
+               menubarPath="org.eclipse.wst.jsdt.web.source/source"
+               style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.AddJavaDocStubAction"
+               enablesFor="*"
+               id="org.eclipse.wst.jsdt.web.ui.generate.element.comment">
+         </action>
+         <!-- Refactor Actions -->
+         <action
+               label="%action.label.9"          
+               tooltip="%action.tooltip.9"
+               menubarPath="org.eclipse.wst.jsdt.web.refactor/refactor"
+               style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.SourceActionsAction"
+               enablesFor="*"
+               id="org.eclipse.wst.jsdt.web.ui.change.function.signature">
+         </action>
+         <action
+               label="%action.label.10"          
+               tooltip="%action.tooltip.10"
+               menubarPath="org.eclipse.wst.jsdt.web.refactor/refactor"
+               style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.SourceActionsAction"
+               enablesFor="*"
+               id="org.eclipse.wst.jsdt.web.ui.Move">
+         </action>
+         <action
+               label="%action.label.11"          
+               tooltip="%action.tooltip.11"
+               menubarPath="org.eclipse.wst.jsdt.web.refactor/refactor"
+               style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.SourceActionsAction"
+               enablesFor="*"
+               id="org.eclipse.wst.jsdt.web.ui.rename">
+         </action>
+         
+         
+         <!-- Edit  (cut copy paste etc.. -->
+          <action
+               label="%action.label.12"          
+               tooltip="%action.tooltip.12"
+               menubarPath="group.edit"
+               style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.StandardEditorActionsAction"
+               enablesFor="*"
+               id="org.eclipse.wst.jsdt.web.ui.delete">
+         </action>
+        
+         <action
+               label="%action.label.13"          
+               tooltip="%action.tooltip.13"
+                     menubarPath="group.edit"
+               style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.StandardEditorActionsAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.web.ui.paste.after">
+         </action>
+          <action
+               label="%action.label.14"          
+               tooltip="%action.tooltip.14"
+                     menubarPath="group.edit"
+               style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.StandardEditorActionsAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.web.ui.paste.before">
+         </action>
+         <action
+               label="%action.label.15"          
+               tooltip="%action.tooltip.15"
+                     menubarPath="group.edit"
+               style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.StandardEditorActionsAction"
+               enablesFor="*"
+               id="org.eclipse.wst.jsdt.web.ui.copy">
+         </action>
+
+         <action
+               label="%action.label.16"          
+               tooltip="%action.tooltip.16"
+               menubarPath="group.edit"
+               style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.StandardEditorActionsAction"
+               enablesFor="*"
+               id="org.eclipse.wst.jsdt.web.ui.cut">
+         </action>         
+         
+         <!-- Show in Script Explorer, History and Navigator -->       
+         <menu
+                id="org.eclipse.wst.jsdt.web.showin"
+         		label="%menu.label.4"
+         		path="group.show">
+     		 	<separator name="showin"/>
+         </menu>  
+         <action
+               label="%action.label.17"          
+               tooltip="%action.tooltip.17"
+               menubarPath="org.eclipse.wst.jsdt.web.showin/showin"
+               style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.ShowInNavigatorAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.ui.actions.ShowInNavigatorViewAction">
+         </action>
+         <!-- History not working well -->
+         <!--
+         <action
+               label="History"          
+               tooltip="Show In History"
+               menubarPath="org.eclipse.wst.jsdt.web.showin/showin"
+               style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.ShowHistoryAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.internal.ui.callhierarchy.OpenCallHierarchyAction">
+         </action> 
+         -->
+          <action
+               label="%action.label.18"          
+               tooltip="%action.tooltip.18"
+               menubarPath="org.eclipse.wst.jsdt.web.showin/showin"
+               style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.ShowInScriptExplorerAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.ui.actions.ShowInScriptExplorer">
+         </action>
+         
+         <!-- Open Call and Type Hierarchies -->
+          <action
+               label="%action.label.19"          
+               tooltip="%action.tooltip.19"
+             menubarPath="group.show"
+             style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.OpenCallHierarchyAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.internal.ui.callhierarchy.OpenCallHierarchyAction">
+         </action>
+         <action
+               label="%action.label.20"
+               tooltip="%action.tooltip.20"
+   			menubarPath="group.show"
+   			style="push"
+               class="org.eclipse.wst.jsdt.web.ui.actions.OpenTypeHierarchy"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.ui.actions.OpenTypeHierarchyAction">
+         </action>
+       </objectContribution> 
+		
+	</extension>
+	
+  
+	<!-- ====================================================================================== -->
+	<!-- source validation for JSP															  -->
+	<!--======================================================================================-->
+	
+	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
+		<validator
+			scope="total"
+			class="org.eclipse.wst.jsdt.web.core.internal.validation.JsValidator"
+			id="org.eclipse.wst.jsdt.web.jssourcevalidator">
+			<contentTypeIdentifier id="org.eclipse.wst.html.core.htmlsource">
+				<partitionType id="org.eclipse.wst.html.SCRIPT"/>
+				<partitionType id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"/>
+			</contentTypeIdentifier>
+			<contentTypeIdentifier id="org.eclipse.jst.jsp.core.jspsource">
+				<partitionType id="org.eclipse.wst.html.SCRIPT"/>
+				<partitionType id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"/>
+			</contentTypeIdentifier>
+		</validator>
+	</extension>
+	
+	<!--======================================================================================-->
+	<!-- JSP UI Adapter factories					   						  				  -->
+	<!--======================================================================================-->
+	<extension
+		point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
+		<adapterFactoryDescription
+			class="org.eclipse.wst.jsdt.web.ui.internal.registry.AdapterFactoryProviderForJSDT">
+			<contentType id="org.eclipse.wst.html.core.htmlsource" />
+		</adapterFactoryDescription>
+	</extension>
+
+	
+
+
+	<!--======================================================================================-->
+	<!-- for breakpoint                                                                       -->
+	<!--======================================================================================-->
+	<!-- removed for now -->
+	<!--
+	<extension point="org.eclipse.wst.sse.ui.breakpoint">
+		<breakpointContribution id="org.eclipse.wst.jsdt.web.ui.providers">
+			<provider
+				contentTypes="org.eclipse.wst.html.core.htmlsource"
+				class="org.eclipse.wst.jsdt.web.ui.internal.breakpointproviders.JavaStratumBreakpointProvider:*html,js,htm*"
+				id="org.eclipse.wst.jsdt.web.ui.internal.breakpointproviders.JavaStratumBreakpointProvider" />
+		</breakpointContribution>
+	</extension>
+	-->
+	
+	
+	<!-- Editor actionsets -->
+	<!--
+	<extension point="org.eclipse.ui.actionSetPartAssociations">
+		<actionSetPartAssociation
+			targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
+			<part id="org.eclipse.wst.jsdt.web.core.jspsource.source" />
+		</actionSetPartAssociation>
+		<actionSetPartAssociation
+			targetID="org.eclipse.ui.NavigateActionSet">
+			<part id="org.eclipse.wst.jsdt.web.core.jspsource.source" />
+		</actionSetPartAssociation>
+	</extension>
+	-->
+
+	
+	
+	
+	<!-- Keybindings for jsp source editor -->
+	<!--
+	<extension point="org.eclipse.ui.bindings"> -->
+	    <!--  win32:  M1=CTRL, M2=SHIFT, M3=ALT -->
+		<!-- rename refactor -->
+		<!--
+		<key
+			sequence="M2+M3+R"
+			contextId="org.eclipse.wst.jsdt.web.ui.structured.text.editor.jsp.scope"
+			commandId="org.eclipse.wst.jsdt.ui.edit.text.java.rename.element"
+			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
+		</key>
+		-->
+		<!-- move refactor -->
+		<!--
+		<key
+			sequence="M2+M3+V"
+			contextId="org.eclipse.wst.jsdt.web.ui.structured.text.editor.jsp.scope"
+			commandId="org.eclipse.wst.jsdt.web.ui.refactor.move"
+			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
+		</key>
+	</extension>
+	-->
+	
+	
+	<!--======================================================================================-->
+	<!-- queryParticipant to participate in java seraches                                     -->
+	<!--======================================================================================-->
+	<extension point="org.eclipse.wst.jsdt.ui.queryParticipants">
+		<queryParticipant
+			name="%queryParticipant.name.0"
+			nature="org.eclipse.wst.jsdt.core.jsNature"
+			class="org.eclipse.wst.jsdt.web.ui.internal.java.search.ui.JsQueryParticipant"
+			id="org.eclipse.wst.jsdt.web.ui.java.search.ui.JsQueryParticipant" />
+
+	</extension>
+	
+	
+	<!--======================================================================================-->
+	<!-- Document provider for ExternalFileEditorInput                                        -->
+	<!--======================================================================================-->
+	<!--
+	<extension point="org.eclipse.ui.editors.documentProviders">
+		<provider
+			inputTypes="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.ExternalFileEditorInput"
+			class="org.eclipse.ui.editors.text.TextFileDocumentProvider"
+			id="org.eclipse.wst.jsdt.web.ui.internal.ExternalFileDocumentProvider" />
+
+	</extension>
+	-->
+	<!--
+	<extension point="org.eclipse.ui.popupMenus">
+		<viewerContribution
+			targetID="org.eclipse.wst.jsdt.web.core.jspsource.source.RulerContext"
+			id="org.eclipse.ui.texteditor.ruler.context.actions">
+			<action
+				label="%AddTask.label"
+				helpContextId="org.eclipse.ui.AddTask_action_context"
+				class="org.eclipse.ui.texteditor.TaskRulerAction"
+				tooltip="%AddTask.tooltip"
+				menubarPath="additions"
+				id="org.eclipse.ui.texteditor.TaskRulerAction" />
+
+			<action
+				label="%AddBookmark.label"
+				helpContextId="org.eclipse.ui.bookmark_action_context"
+				class="org.eclipse.ui.texteditor.BookmarkRulerAction"
+				tooltip="%AddBookmark.tooltip"
+				menubarPath="additions"
+				id="org.eclipse.ui.texteditor.BookmarkRulerAction" />
+
+		</viewerContribution>
+	</extension>
+-->
+
+
+<!--
+	<extension point="org.eclipse.ui.editorActions">
+		<editorContribution
+			id="org.eclipse.wst.jsdt.web.core.jspsource.source.editorActions"
+			contributorClass="org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditorActionContributor"
+			targetID="org.eclipse.wst.html.core.htmlsource">
+			<action
+				id="CleanupDocument"
+				label="%CleanupDocument_label"
+				definitionId="org.eclipse.wst.sse.ui.cleanup.document"
+				tooltip="%CleanupDocument_tooltip"
+				class="org.eclipse.wst.html.ui.internal.edit.ui.CleanupActionHTMLDelegate"
+				actionID="CleanupDocument">
+			</action>
+			<action
+				id="ToggleComment"
+				label="%ToggleComment_label"
+				definitionId="org.eclipse.wst.sse.ui.toggle.comment"
+				tooltip="%ToggleComment_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.actions.ToggleCommentActionXMLDelegate"
+				actionID="ToggleComment">
+			</action>
+			<action
+				id="AddBlockComment"
+				label="%AddBlockComment_label"
+				definitionId="org.eclipse.wst.sse.ui.add.block.comment"
+				tooltip="%AddBlockComment_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.actions.AddBlockCommentActionXMLDelegate"
+				actionID="AddBlockComment">
+			</action>
+			<action
+				id="RemoveBlockComment"
+				label="%RemoveBlockComment_label"
+				definitionId="org.eclipse.wst.sse.ui.remove.block.comment"
+				tooltip="%RemoveBlockComment_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.actions.RemoveBlockCommentActionXMLDelegate"
+				actionID="RemoveBlockComment">
+			</action>
+			<action
+				id="RenameElement"
+				label="%RenameElement_label"
+				definitionId="org.eclipse.wst.jsdt.web.ui.refactor.rename"
+				class="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPRenameElementActionDelegate"
+				actionID="RenameElement">
+			</action>
+			<action
+				id="MoveElement"
+				label="%MoveElement_label"
+				definitionId="org.eclipse.wst.jsdt.web.ui.refactor.move"
+				class="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPMoveElementActionDelegate"
+				actionID="MoveElement">
+			</action>
+			<action
+				id="FindOccurrences"
+				label="%FindOccurrences_label"
+				definitionId="org.eclipse.wst.sse.ui.search.find.occurrences"
+				class="org.eclipse.wst.jsdt.web.ui.internal.java.search.JsFindOccurrencesActionDelegate"
+				actionID="FindOccurrences">
+			</action>
+			<action
+				id="StructureSelectEnclosing"
+				label="%StructureSelectEnclosing_label"
+				definitionId="org.eclipse.wst.sse.ui.structure.select.enclosing"
+				tooltip="%StructureSelectEnclosing_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectEnclosingXMLActionDelegate"
+				actionID="StructureSelectEnclosing">
+			</action>
+			<action
+				id="StructureSelectNext"
+				label="%StructureSelectNext_label"
+				definitionId="org.eclipse.wst.sse.ui.structure.select.next"
+				tooltip="%StructureSelectNext_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectNextXMLActionDelegate"
+				actionID="StructureSelectNext">
+			</action>
+			<action
+				id="StructureSelectPrevious"
+				label="%StructureSelectPrevious_label"
+				definitionId="org.eclipse.wst.sse.ui.structure.select.previous"
+				tooltip="%StructureSelectPrevious_tooltip"
+				class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectPreviousXMLActionDelegate"
+				actionID="StructureSelectPrevious">
+			</action>
+			<action
+				id="StructureSelectHistory"
+				label="%StructureSelectHistory_label"
+				definitionId="org.eclipse.wst.sse.ui.structure.select.last"
+				tooltip="%StructureSelectHistory_tooltip"
+				class="org.eclipse.wst.sse.ui.internal.selection.StructuredSelectHistoryActionDelegate"
+				actionID="StructureSelectHistory">
+			</action>
+		</editorContribution>
+        <editorContribution
+            targetID="org.eclipse.wst.html.core.htmlsource"
+            id="org.eclipse.wst.jsdt.web.core.jspsource.ruler.actions">
+         <action
+               label="%AddBookmark.label"
+               helpContextId="org.eclipse.ui.bookmark_action_context"
+               class="org.eclipse.ui.texteditor.BookmarkRulerAction"
+               actionID="RulerDoubleClick"
+               id="org.eclipse.ui.texteditor.BookmarkRulerAction"/>
+         <action
+               label="%SelectRuler.label"
+               class="org.eclipse.ui.texteditor.SelectRulerAction"
+               actionID="RulerClick"
+               id="org.eclipse.ui.texteditor.SelectRulerAction"/>
+        </editorContribution>
+	</extension>
+	-->
+		<!--======================================================================================-->
+	<!-- FOR JSP/JAVA RENAME PARTICIPATION                                                    -->
+	<!--======================================================================================-->
+	<extension
+		point="org.eclipse.ltk.core.refactoring.renameParticipants">
+		<renameParticipant
+			name="%renameParticipant.name.0"
+			class="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPTypeRenameParticipant"
+			id="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPTypeRenameParticipant">
+			<enablement>
+				<with variable="affectedNatures">
+					<iterate operator="or">
+						<equals value="org.eclipse.wst.jsdt.core.jsNature" />
+					</iterate>
+				</with>
+				<with variable="element">
+					<instanceof value="org.eclipse.wst.jsdt.core.IType" />
+
+				</with>
+			</enablement>
+		</renameParticipant>
+		<renameParticipant
+			name="%renameParticipant.name.1"
+			class="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPTypeRenameParticipant"
+			id="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPTypeRenameParticipant">
+			<enablement>
+				<with variable="affectedNatures">
+					<iterate operator="or">
+						<equals value="org.eclipse.wst.jsdt.core.jsNature" />
+					</iterate>
+				</with>
+				<with variable="element">
+					<instanceof value="org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode" />
+
+				</with>
+			</enablement>
+		</renameParticipant>
+		<renameParticipant
+			name="%renameParticipant.name.2"
+			class="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPMethodRenameParticipant"
+			id="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPMethodRenameParticipant">
+			<enablement>
+				<with variable="affectedNatures">
+					<iterate operator="or">
+						<equals value="org.eclipse.wst.jsdt.core.jsNature" />
+
+					</iterate>
+				</with>
+				<with variable="element">
+					<instanceof value="org.eclipse.wst.jsdt.core.IFunction" />
+
+				</with>
+			</enablement>
+		</renameParticipant>
+		<renameParticipant
+			name="%renameParticipant.name.3"
+			class="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPMethodRenameParticipant"
+			id="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPMethodRenameParticipant">
+			<enablement>
+				<with variable="affectedNatures">
+					<iterate operator="or">
+						<equals value="org.eclipse.wst.jsdt.core.jsNature" />
+
+					</iterate>
+				</with>
+				<with variable="element">
+					<instanceof value="org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode" />
+
+				</with>
+			</enablement>
+		</renameParticipant>
+
+	  </extension>
+
+	  <!--
+  <extension point="org.eclipse.wst.jsdt.ui.JsGlobalScopeUIInitializer">
+     <JsGlobalScopeUIInitializer
+     	id="org.eclipse.wst.jsdt.launching.WebProject"
+     	class="org.eclipse.wst.jsdt.web.ui.WebProjectJsGlobalScopeUIInitializer">
+     </JsGlobalScopeUIInitializer>
+   </extension>
+-->
+
+  	 <!--
+  	 <extension
+         point="org.eclipse.ui.popupMenus">
+  		<objectContribution
+            objectClass="org.eclipse.core.resources.IProject"
+            adaptable="true"
+            id="org.eclipse.wst.jsdt.web.ui.jsdtSetup">
+       	 <visibility>
+        	<not>
+	        	<or>
+		            <objectState 
+			            name="projectNature" 
+			            value="org.eclipse.wst.jsdt.core.jsNature"/>
+			        <objectState
+			        	name="open"
+			        	value="false"/>
+	            </or>
+            </not>
+       	 </visibility>
+         <action
+            class="org.eclipse.wst.jsdt.web.ui.SetupProjectsWizzard"
+            label="%action.label.21"
+            menubarPath="org.eclipse.ui.projectConfigure/additions"
+            enablesFor="+"
+            id="org.eclipse.wst.jsdt.internal.web.ui.convertProjects">
+      	</action>
+   		</objectContribution>
+   </extension> 
+-->
+
+  	 <!-- Uncomment for Standalone + HTML as seperate options -->
+  	 <!--
+  	 <extension
+         point="org.eclipse.ui.popupMenus">
+ 		<objectContribution
+            objectClass="org.eclipse.core.resources.IProject"
+            adaptable="true"
+            id="org.eclipse.wst.jsdt.web.ui.jsdtSetup">
+         <action
+            label="Add Support for JavaScript in HTML"
+            class="org.eclipse.wst.jsdt.web.ui.SetupProjectsWizzard"
+            menubarPath="org.eclipse.wst.jsdt.ui.project.tools/group0"
+            enablesFor="+"
+            id="org.eclipse.wst.jsdt.web.internal.ui.convertProjects">
+      	</action>
+   		</objectContribution>
+   </extension>  
+   -->
+ <extension point="org.eclipse.wst.sse.ui.completionProposal">
+  <proposalCategory
+      id="org.eclipse.wst.jsdt.web.ui.ContentAssistProposals"
+      name="%javaScriptProposals"
+      icon="icons/full/elcl16/javaassist_co.gif">
+  </proposalCategory>
+  <proposalComputer
+      activate="true"
+      categoryId="org.eclipse.wst.jsdt.web.ui.ContentAssistProposals"
+      class="org.eclipse.wst.jsdt.web.ui.internal.contentassist.JSDTContentAssistant"
+      id="org.eclipse.wst.jsdt.web.ui.ContentAssistProposals">
+     <contentType
+        id="org.eclipse.jst.jsp.core.jspsource">
+      <partitionType
+          id="org.eclipse.wst.html.SCRIPT">
+      </partitionType>
+            <partitionType
+          id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
+      </partitionType>
+    </contentType>
+     <contentType
+        id="org.eclipse.wst.html.core.htmlsource">
+      <partitionType
+          id="org.eclipse.wst.html.SCRIPT">
+      </partitionType>
+            <partitionType
+          id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
+      </partitionType>
+    </contentType>
+  </proposalComputer>
+</extension>
+<extension point="org.eclipse.wst.sse.ui.characterPairing">
+	<inserter class="org.eclipse.wst.jsdt.web.ui.internal.text.JsCharacterPairInserter" id="org.eclipse.wst.jsdt.web.ui.inserter">
+  <contentTypeIdentifier
+        id="org.eclipse.wst.html.core.htmlsource"
+        partitions="org.eclipse.wst.html.SCRIPT, org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
+  </contentTypeIdentifier>
+  <contentTypeIdentifier
+        id="org.eclipse.jst.jsp.core.jspsource"
+        partitions="org.eclipse.wst.html.SCRIPT, org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
+  </contentTypeIdentifier>
+	</inserter>
+</extension>
+</plugin>
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/Messages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/Messages.java
new file mode 100644
index 0000000..3c7655f
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/Messages.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ *
+ */
+public class Messages {
+	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.ui.messages"; //$NON-NLS-1$
+
+	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+	private Messages() {
+	}
+
+	public static String getString(String key) {
+		try {
+			return RESOURCE_BUNDLE.getString(key);
+		}
+		catch (MissingResourceException e) {
+			return '!' + key + '!';
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/SetupProjectsWizzard.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/SetupProjectsWizzard.java
new file mode 100644
index 0000000..298210c
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/SetupProjectsWizzard.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.jsdt.web.ui;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.progress.IProgressService;
+import org.eclipse.wst.jsdt.core.IIncludePathEntry;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.web.core.internal.Logger;
+import org.eclipse.wst.jsdt.web.core.internal.project.JsWebNature;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIPlugin;
+
+/**
+ * Not API
+ */
+public class SetupProjectsWizzard implements IObjectActionDelegate, IActionDelegate {
+	IWorkbenchPart fPart;
+	Object[] fTarget;
+
+	private void doInstall(IProject project, final boolean openProperties, IProgressMonitor monitor) {
+		boolean configured = false;
+		JsWebNature nature = new JsWebNature(project, monitor);
+		try {
+			boolean hadBasicNature = JsWebNature.hasNature(project);
+
+			nature.configure();
+
+			if (!hadBasicNature) {
+				/*
+				 * No nature before, so no existing build path. Define the
+				 * project itself as an include folder.
+				 */
+				IJavaScriptProject jp = JavaScriptCore.create(project);
+				IIncludePathEntry[] oldEntries = null;
+				try {
+					oldEntries = jp.getRawIncludepath();
+				}
+				catch (JavaScriptModelException ex1) {
+					Logger.log(Logger.ERROR_DEBUG, null, ex1);
+				}
+				
+				IPath projectPath = project.getFullPath();
+				IIncludePathEntry projectPathEntry = JavaScriptCore.newSourceEntry(projectPath);
+				
+				if (! Arrays.asList(oldEntries).contains(projectPathEntry)) {
+					IIncludePathEntry[] newEntries = new IIncludePathEntry[oldEntries.length + 1];
+					System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
+					
+					newEntries[oldEntries.length] = projectPathEntry;
+					jp.setRawIncludepath(newEntries, monitor);
+				}
+			}
+			configured = true;
+		}
+		catch (CoreException ex) {
+			Logger.logException(ex);
+		}
+
+		if (configured && openProperties) {
+			showPropertiesOn(project, monitor);
+		}
+	}
+	
+	private void doUninstall(IProject project, IProgressMonitor monitor) {
+		JsWebNature nature = new JsWebNature(project, monitor);
+		try {
+			nature.deconfigure();
+		} catch (CoreException ex) {
+			Logger.logException(ex);
+		}
+	}
+
+	private void install(final IProject project, final boolean openProperties) {
+		IProgressService service = null;
+		if (fPart != null) {
+			service = (IProgressService) fPart.getSite().getService(IProgressService.class);
+		}
+		if (service == null) {
+			doInstall(project, openProperties, null);
+		}
+		else {
+			IRunnableWithProgress runnable = new IRunnableWithProgress() {
+				public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+					doInstall(project, openProperties, monitor);
+				}
+			};
+			try {
+				service.run(false, false, runnable);
+			}
+			catch (InvocationTargetException e) {
+				Logger.logException(e);
+			}
+			catch (InterruptedException e) {
+				Logger.logException(e);
+			}
+		}
+	}
+
+	public void run(IAction action) {
+		if (fTarget == null)
+			return;
+
+		for (int i = 0; i < fTarget.length; i++) {
+			if (fTarget[i] instanceof IResource) {
+				final IProject project = ((IResource) fTarget[i]).getProject();
+
+				if (!JsWebNature.hasNature(project)) {
+					/* Doesn't have nature, do a full install. */
+					install(project, i == fTarget.length - 1);
+				}
+				else {
+					/*
+					 * Has nature, check for browser library on include path
+					 * and setup if not found.
+					 */
+					IJavaScriptProject jp = JavaScriptCore.create(project);
+					IIncludePathEntry[] rawClasspath = null;
+					try {
+						rawClasspath = jp.getRawIncludepath();
+					}
+					catch (JavaScriptModelException ex1) {
+						Logger.log(Logger.ERROR_DEBUG, null, ex1);
+					}
+
+					boolean browserFound = false;
+					for (int k = 0; rawClasspath != null && !browserFound && k < rawClasspath.length; k++) {
+						if (rawClasspath[k].getPath().equals(JsWebNature.VIRTUAL_BROWSER_CLASSPATH)) {
+							browserFound = true;
+						}
+					}
+					if (!browserFound) {
+						install(project, false);
+					}
+				}
+			}
+		}
+
+	}
+
+	public void selectionChanged(IAction action, ISelection selection) {
+		if (selection instanceof IStructuredSelection) {
+			fTarget = ((IStructuredSelection) selection).toArray();
+		}
+		else {
+			fTarget = null;
+		}
+	}
+
+	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+		fPart = targetPart;
+	}
+
+	private void showPropertiesOn(final IProject project, final IProgressMonitor monitor) {
+		IExtension[] extensions = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.ui.propertyPages").getExtensions(); //$NON-NLS-1$
+		final List pageIds = new ArrayList(8);
+		for (int i = 0; i < extensions.length; i++) {
+			if (extensions[i].getNamespaceIdentifier().startsWith("org.eclipse.wst.jsdt.")) { //$NON-NLS-1$
+				IConfigurationElement[] configurationElements = extensions[i].getConfigurationElements();
+				for (int j = 0; j < configurationElements.length; j++) {
+					if ("page".equals(configurationElements[j].getName())) {
+						pageIds.add(configurationElements[j].getAttribute("id")); //$NON-NLS-1$
+					}
+				}
+			}
+		}
+		Shell shell = (Shell) fPart.getAdapter(Shell.class);
+		if (shell == null) {
+			IWorkbenchWindow activeWorkbenchWindow = JsUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
+			if (activeWorkbenchWindow != null)
+				shell = activeWorkbenchWindow.getShell();
+		}
+		final Shell finalShell = shell;
+		if (finalShell != null) {
+			finalShell.getDisplay().asyncExec(new Runnable() {
+				public void run() {
+					PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn(finalShell, project, "org.eclipse.wst.jsdt.ui.propertyPages.BuildPathsPropertyPage", (String[]) pageIds.toArray(new String[pageIds.size()]), null); //$NON-NLS-1$
+					if (dialog.open() == Window.CANCEL) {
+						doUninstall(project, monitor);
+					}
+				}
+			});
+		}
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/StructuredTextViewerConfigurationJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/StructuredTextViewerConfigurationJSDT.java
new file mode 100644
index 0000000..a1d8070
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/StructuredTextViewerConfigurationJSDT.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui;
+
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
+import org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+* 
+ * Configuration for a source viewer which shows Html and supports JSDT.
+ * <p>
+ * Clients can subclass and override just those methods which must be specific
+ * to their needs.
+ * </p>
+ * 
+ * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration
+ * @since 1.0
+ */
+public class StructuredTextViewerConfigurationJSDT extends StructuredTextViewerConfigurationHTML {
+	/**
+	 * Create new instance of StructuredTextViewerConfigurationHTML
+	 */
+	public StructuredTextViewerConfigurationJSDT() {
+		// Must have empty constructor to createExecutableExtension
+		super();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
+	 */
+	public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
+		if(contentType.equals(IHTMLPartitions.SCRIPT) || contentType.equals(IHTMLPartitions.SCRIPT_EVENTHANDLER)) {
+			IAutoEditStrategy[] strategies = new IAutoEditStrategy[1];
+			strategies[0] = new AutoEditStrategyForJs();
+			return strategies;
+		} else {
+			return super.getAutoEditStrategies(sourceViewer, contentType);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/WebProjectJsGlobalScopeUIInitializer.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/WebProjectJsGlobalScopeUIInitializer.java
new file mode 100644
index 0000000..03aecce
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/WebProjectJsGlobalScopeUIInitializer.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.internal.ui.IJsGlobalScopeContainerInitializerExtension;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ *
+ */
+public class WebProjectJsGlobalScopeUIInitializer implements IJsGlobalScopeContainerInitializerExtension{
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.internal.ui.IJsGlobalScopeContainerInitialzerExtension#getImage(org.eclipse.core.runtime.IPath, java.lang.String, org.eclipse.wst.jsdt.core.IJavaScriptProject)
+	 */
+	public ImageDescriptor getImage(IPath containerPath, String element, IJavaScriptProject project) {
+		return ImageDescriptor.createFromFile(this.getClass(),"web1.JPG"); //$NON-NLS-1$
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubAction.java
new file mode 100644
index 0000000..560444c
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubAction.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IMember;
+import org.eclipse.wst.jsdt.internal.ui.actions.WorkbenchRunnableAdapter;
+import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
+import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JsJfaceNode;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ * 
+ */
+public class AddJavaDocStubAction implements IObjectActionDelegate {
+	private ISelection selection;
+	private IWorkbenchPart targetPart;
+	
+	public String getDialogTitle() {
+		return Messages.getString("AddJavaDocStubAction.0"); //$NON-NLS-1$
+	}
+	
+	public Shell getShell() {
+		return getSite().getShell();
+	}
+	
+	public IWorkbenchPartSite getSite() {
+		return targetPart.getSite();
+	}
+	
+	public void run(IAction action) {
+		IJavaScriptElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
+		if (elements == null || elements.length < 1) {
+			return;
+		}
+		IJavaScriptElement parent = elements[0].getParent();
+		/* find the cu */
+		while (parent != null && !(parent instanceof IJavaScriptUnit)) {
+			
+		}
+		if (parent != null) {
+			ArrayList members = new ArrayList();
+			for (int i = 0; i < elements.length; i++) {
+				if (elements[i] instanceof IMember) {
+					members.add(elements[i]);
+				}
+			}
+			JsJfaceNode node[] = SimpleJSDTActionProxy.getJsJfaceNodesFromSelection(selection);
+			/* only should be one node */
+			run((IJavaScriptUnit) parent, (IMember[]) members.toArray(new IMember[members.size()]), node[0]);
+		}
+	}
+	
+	public void run(IJavaScriptUnit cu, IMember[] members, JsJfaceNode node) {
+		try {
+			AddJavaDocStubOperation op = new AddJavaDocStubOperation(members, node);
+			PlatformUI.getWorkbench().getProgressService().runInUI(PlatformUI.getWorkbench().getProgressService(), new WorkbenchRunnableAdapter(op, op.getScheduleRule()), op.getScheduleRule());
+		} catch (InvocationTargetException e) {
+			ExceptionHandler.handle(e, getShell(), getDialogTitle(), Messages.getString("AddJavaDocStubAction.1")); //$NON-NLS-1$
+		} catch (InterruptedException e) {
+			// operation canceled
+		}
+	}
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		this.selection = selection;
+	}
+	
+	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+		this.targetPart = targetPart;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubOperation.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubOperation.java
new file mode 100644
index 0000000..edde605
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubOperation.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.text.edits.MalformedTreeException;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IMember;
+import org.eclipse.wst.jsdt.web.core.javascript.DocumentChangeListenerToTextEdit;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+
+import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JsJfaceNode;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ * 
+ */
+public class AddJavaDocStubOperation extends org.eclipse.wst.jsdt.internal.corext.codemanipulation.AddJavaDocStubOperation {
+	private IDocument copy;
+	/**
+	 * @param members
+	 */
+	private JsJfaceNode node;
+	private DocumentChangeListenerToTextEdit textEditListener;
+	
+	public AddJavaDocStubOperation(IMember[] members, JsJfaceNode node) {
+		super(members);
+		this.node = node;
+	}
+	
+	protected void applyChanges() {
+		IModelManager modelManager = StructuredModelManager.getModelManager();
+		IStructuredModel model = null;
+		IStructuredDocument doc = node.getStructuredDocument();
+		try {
+			MultiTextEdit edits = textEditListener.getTextEdits();
+			model = modelManager.getExistingModelForEdit(doc);
+			model.aboutToChangeModel();
+			model.beginRecording(this, Messages.getString("AddJavaDocStubOperation.0"), Messages.getString("AddJavaDocStubOperation.1")); //$NON-NLS-1$ //$NON-NLS-2$
+			edits.apply(doc);
+		} catch (MalformedTreeException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (BadLocationException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} finally {
+			if (model != null) {
+				model.endRecording(this);
+				model.changedModel();
+				model.releaseFromEdit();
+			}
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.internal.corext.codemanipulation.AddJavaDocStubOperation#getDocument(org.eclipse.wst.jsdt.core.IJavaScriptUnit,
+	 *      org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	
+	protected IDocument getDocument(IJavaScriptUnit cu, IProgressMonitor monitor) throws CoreException {
+		return getJavaDocumentFromNode();
+	}
+	
+	protected IDocument getJavaDocumentFromNode() {
+		if (copy == null) {
+			IJsTranslation tran = node.getTranslation();
+			copy = new Document(tran.getJsText());
+			textEditListener = new DocumentChangeListenerToTextEdit();
+			copy.addDocumentListener(textEditListener);
+		}
+		return copy;
+	}
+	
+	
+	public void run(IProgressMonitor monitor) throws CoreException, OperationCanceledException {
+		super.run(monitor);
+		applyChanges();
+		/* need to apply the text edits back to the original doc */
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesAction.java
new file mode 100644
index 0000000..28a4c70
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesAction.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ * 
+ */
+public class FindReferencesAction extends JsElementActionProxy {
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.web.ui.actions.JsElementActionProxy#getRunArgs(org.eclipse.jface.action.IAction)
+	 */
+	
+	public Object[] getRunArgs(IAction action) {
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		if (elements != null && elements.length > 0) {
+			return new Object[] { elements[0] };
+		}
+		return new Object[0];
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.web.ui.actions.JsElementActionProxy#getRunArgTypes()
+	 */
+	
+	public Class[] getRunArgTypes() {
+		return new Class[] { IJavaScriptElement.class };
+	}
+	
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		setSelection(selection);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesInWorkingSetAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesInWorkingSetAction.java
new file mode 100644
index 0000000..0c8f424
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesInWorkingSetAction.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ * 
+ */
+public class FindReferencesInWorkingSetAction extends FindReferencesAction {
+	
+	public void run(IAction action) {
+		try {
+			Object handler = getActionHandler(action);
+			IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+			if (elements == null || elements.length == 0) {
+				return;
+			}
+			SimpleJSDTActionProxy.executeMethod(handler, "run", new Class[] { IJavaScriptElement.class }, new Object[] { elements[0] }); //$NON-NLS-1$
+		} catch (IllegalArgumentException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (SecurityException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (IllegalAccessException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (NoSuchMethodException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (InstantiationException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (InvocationTargetException ex) {
+			// If user doesn't select a working set an exception is thrown so we
+			// wont print stack trace here
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java
new file mode 100644
index 0000000..00771fa
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ * 
+ */
+public class JsElementActionProxy extends SimpleJSDTActionProxy {
+	/* Util method to get all the java elements in a selection */
+	public static IJavaScriptElement[] getJsElementsFromSelection(ISelection selection) {
+		if (selection == null) {
+			return new IJavaScriptElement[0];
+		}
+		ArrayList elements = new ArrayList();
+		if (selection instanceof IStructuredSelection) {
+			Iterator itt = ((IStructuredSelection) selection).iterator();
+			while (itt.hasNext()) {
+				Object element = itt.next();
+				if (element instanceof IJavaScriptElement) {
+					elements.add(element);
+				}
+				if (element instanceof IJavaWebNode) {
+					elements.add(((IJavaWebNode) element).getJavaElement());
+				}
+			}
+			return (IJavaScriptElement[]) elements.toArray(new IJavaScriptElement[elements.size()]);
+		}
+		return new IJavaScriptElement[0];
+	}
+	
+	
+	public Object[] getRunArgs(IAction action) {
+		/*
+		 * Needs to return an array of IJavaElements. Since its one arg of type
+		 * IJavaScriptElement[] need to put into an object array
+		 */
+		return new Object[] { JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection()) };
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.web.ui.actions.SimpleJSDTActionProxy#getRunArgTypes()
+	 */
+	
+	public Class[] getRunArgTypes() {
+		return new Class[] { (new IJavaScriptElement[0]).getClass() };
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/Messages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/Messages.java
new file mode 100644
index 0000000..0bfa17b
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/Messages.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ *
+ */
+public class Messages {
+	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.ui.actions.messages"; //$NON-NLS-1$
+
+	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+	private Messages() {
+	}
+
+	public static String getString(String key) {
+		try {
+			return RESOURCE_BUNDLE.getString(key);
+		}
+		catch (MissingResourceException e) {
+			return '!' + key + '!';
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java
new file mode 100644
index 0000000..06083a3
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ * 
+ */
+public class OpenCallHierarchyAction extends JsElementActionProxy {
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.web.ui.actions.SimpleJSDTActionProxy#selectionChanged(org.eclipse.jface.action.IAction,
+	 *      org.eclipse.jface.viewers.ISelection)
+	 */
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		IJavaScriptElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
+		/* Open call hierarchy needs to be disabled for TYPEs */
+		for (int i = 0; i < elements.length; i++) {
+			if (elements[i].getElementType() == IJavaScriptElement.TYPE) {
+				action.setEnabled(false);
+				return;
+			}
+		}
+		super.selectionChanged(action, selection);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java
new file mode 100644
index 0000000..405a4c6
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ * 
+ */
+public class OpenTypeHierarchy extends JsElementActionProxy {
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		IJavaScriptElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
+		/* Open call hierarchy needs to be disabled for TYPEs */
+		for (int i = 0; i < elements.length; i++) {
+			if (elements[i].getElementType() != IJavaScriptElement.TYPE) {
+				action.setEnabled(false);
+				return;
+			}
+		}
+		super.selectionChanged(action, selection);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowHistoryAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowHistoryAction.java
new file mode 100644
index 0000000..678c02f
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowHistoryAction.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ISetSelectionTarget;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ * 
+ */
+public class ShowHistoryAction extends JsElementActionProxy {
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+	 */
+	private IResource getHostResource(IJavaScriptElement virtualElement) {
+		IProject project = virtualElement.getJavaScriptProject().getProject();
+		IPath path = new Path(virtualElement.getHostPath().getPath());
+		IResource host = project.getWorkspace().getRoot().findMember(path);
+		return host;
+	}
+	
+	
+	public void run(IAction action) {
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		if (elements == null || elements.length == 0) {
+			return;
+		}
+		IResource resource = null;
+		if (elements[0].isVirtual()) {
+			resource = getHostResource(elements[0]);
+		} else {
+			resource = elements[0].getResource();
+		}
+		if (resource == null) {
+			return;
+		}
+		try {
+			IWorkbenchPage page = targetWorkbenchPart.getSite().getPage();
+			IViewPart view = page.showView(IPageLayout.ID_RES_NAV);
+			if (view instanceof ISetSelectionTarget) {
+				ISelection selection = new StructuredSelection(resource);
+				((ISetSelectionTarget) view).selectReveal(selection);
+			}
+		} catch (PartInitException e) {
+			ExceptionHandler.handle(e, targetWorkbenchPart.getSite().getShell(), Messages.getString("ShowHistoryAction.0"), Messages.getString("ShowHistoryAction.1") + e); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+	}
+	
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		setSelection(selection);
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		for (int i = 0; i < elements.length; i++) {
+			if (elements[i].isVirtual()) {
+				IResource resource = getHostResource(elements[i]);
+				if (resource == null || !resource.exists()) {
+					action.setEnabled(false);
+				}
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInNavigatorAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInNavigatorAction.java
new file mode 100644
index 0000000..628b942
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInNavigatorAction.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ISetSelectionTarget;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ * 
+ */
+public class ShowInNavigatorAction extends JsElementActionProxy {
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+	 */
+	private IResource getHostResource(IJavaScriptElement virtualElement) {
+		IProject project = virtualElement.getJavaScriptProject().getProject();
+		IPath path = new Path(virtualElement.getHostPath().getPath());
+		IResource host = project.getWorkspace().getRoot().findMember(path);
+		return host;
+	}
+	
+	
+	public void run(IAction action) {
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		if (elements == null || elements.length == 0) {
+			return;
+		}
+		IResource resource = null;
+		if (elements[0].isVirtual()) {
+			resource = getHostResource(elements[0]);
+		} else {
+			resource = elements[0].getResource();
+		}
+		if (resource == null) {
+			return;
+		}
+		try {
+			IWorkbenchPage page = targetWorkbenchPart.getSite().getPage();
+			IViewPart view = page.showView(IPageLayout.ID_RES_NAV);
+			if (view instanceof ISetSelectionTarget) {
+				ISelection selection = new StructuredSelection(resource);
+				((ISetSelectionTarget) view).selectReveal(selection);
+			}
+		} catch (PartInitException e) {
+			ExceptionHandler.handle(e, targetWorkbenchPart.getSite().getShell(), Messages.getString("ShowInNavigatorAction.0"), Messages.getString("ShowInNavigatorAction.1") + e); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+	}
+	
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		setSelection(selection);
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		for (int i = 0; i < elements.length; i++) {
+			if (elements[i].isVirtual()) {
+				IResource resource = getHostResource(elements[i]);
+				if (resource == null || !resource.exists()) {
+					action.setEnabled(false);
+				}
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInScriptExplorerAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInScriptExplorerAction.java
new file mode 100644
index 0000000..799ea1f
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInScriptExplorerAction.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.part.ISetSelectionTarget;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.internal.ui.packageview.PackageExplorerPart;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ * 
+ */
+public class ShowInScriptExplorerAction extends JsElementActionProxy {
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+	 */
+	private IResource getHostResource(IJavaScriptElement virtualElement) {
+		IProject project = virtualElement.getJavaScriptProject().getProject();
+		IPath path = new Path(virtualElement.getHostPath().getPath());
+		IResource host = project.getWorkspace().getRoot().findMember(path);
+		return host;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.web.ui.actions.JsElementActionProxy#getRunArgs(org.eclipse.jface.action.IAction)
+	 */
+	
+	public Object[] getRunArgs(IAction action) {
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		if (elements != null && elements.length > 0) {
+			return new Object[] { elements[0] };
+		}
+		return new Object[0];
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.web.ui.actions.JsElementActionProxy#getRunArgTypes()
+	 */
+	
+	public Class[] getRunArgTypes() {
+		return new Class[] { IJavaScriptElement.class };
+	}
+	
+	
+	public void run(IAction action) {
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		if (elements == null || elements.length == 0) {
+			return;
+		}
+		IResource resource = null;
+		if (elements[0].isVirtual()) {
+			resource = getHostResource(elements[0]);
+		} else {
+			resource = elements[0].getResource();
+		}
+		if (resource == null) {
+			return;
+		}
+		try {
+			PackageExplorerPart view = PackageExplorerPart.openInActivePerspective();
+			view.tryToReveal(resource);
+// IWorkbenchPage page= targetWorkbenchPart.getSite().getPage();
+// IViewPart view= page.showView(IPageLayout.ID_RES_NAV);
+			if (view instanceof ISetSelectionTarget) {
+				ISelection selection = new StructuredSelection(resource);
+				((ISetSelectionTarget) view).selectReveal(selection);
+			}
+		} catch (Exception e) {
+			// ExceptionHandler.handle(e,
+			// targetWorkbenchPart.getSite().getShell(), "Error Opening in
+			// Script View", "Error while displaying element in Script View:\n"
+			// + e);
+		}
+	}
+	
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		setSelection(selection);
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		for (int i = 0; i < elements.length; i++) {
+			if (elements[i].isVirtual()) {
+				IResource resource = getHostResource(elements[i]);
+				if (resource == null || !resource.exists()) {
+					action.setEnabled(false);
+				}
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java
new file mode 100644
index 0000000..3d24b70
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchSite;
+import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JsJfaceNode;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ * 
+ */
+public class SimpleJSDTActionProxy implements IObjectActionDelegate {
+	public static Object executeMethod(Object handler, String methodName, Class[] paramaterTypes, Object[] paramaterValues) throws SecurityException,
+			NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+		Class target = handler.getClass();
+		Method m = target.getMethod(methodName, paramaterTypes);
+		return m.invoke(handler, paramaterValues);
+	}
+	
+	public static JsJfaceNode[] getJsJfaceNodesFromSelection(ISelection selection) {
+		if (selection == null) {
+			return new JsJfaceNode[0];
+		}
+		ArrayList elements = new ArrayList();
+		if (selection instanceof IStructuredSelection) {
+			Iterator itt = ((IStructuredSelection) selection).iterator();
+			while (itt.hasNext()) {
+				Object element = itt.next();
+				if (element instanceof JsJfaceNode) {
+					elements.add(element);
+				}
+			}
+			return (JsJfaceNode[]) elements.toArray(new JsJfaceNode[elements.size()]);
+		}
+		return new JsJfaceNode[0];
+	}
+	protected Object actionHandlerTarget;
+	private ISelection currentSelection;
+	protected IAction handlerTargetAction;
+	protected IWorkbenchPart targetWorkbenchPart;
+	
+	public SimpleJSDTActionProxy() {}
+	
+	/*
+	 * Most handlers look for WorkBenchSite, so we convert the WorkBenchPart to
+	 * WorkBenchSite for init
+	 */
+	protected Object getActionHandler(IAction action) throws IllegalAccessException, NoSuchMethodException, IllegalArgumentException, InstantiationException,
+			InvocationTargetException {
+		/* Target class is cached */
+		if (handlerTargetAction == action && actionHandlerTarget != null) {
+			return actionHandlerTarget;
+		}
+		Class target = null;
+		String className = getActionHandlerClassName(action);
+		try {
+			target = Class.forName(className);
+		} catch (ClassNotFoundException ex) {
+			System.out.println("Error.. Class target of action handler not found: " + action);
+			System.out.println(Messages.getString("SimpleJSDTActionProxy.0") + ex); //$NON-NLS-1$
+		}
+		// use the loaded class
+		Class[] types = new Class[] { IWorkbenchSite.class };
+		Constructor cons = target.getConstructor(types);
+		Object[] args = new Object[] { targetWorkbenchPart.getSite() };
+		
+		actionHandlerTarget = cons.newInstance(args);
+		handlerTargetAction = action;
+		return actionHandlerTarget;
+	}
+	
+	/*
+	 * Default way of determining the action handlers class name.. may be
+	 * subclassed/overridden
+	 */
+	protected String getActionHandlerClassName(IAction action) {
+		return action.getId();
+	}
+	
+	public ISelection getCurrentSelection() {
+		return currentSelection;
+	}
+	
+	public Object[] getRunArgs(IAction action) {
+		return new Object[] { getCurrentSelection() };
+	}
+	
+	public Class[] getRunArgTypes() {
+		return new Class[] { IStructuredSelection.class };
+	}
+	
+	public Object[] getSelectionChangeArgs(IAction action, ISelection selection) {
+		return new Object[] { getCurrentSelection() };
+	}
+	
+	public Class[] getSelectionChangeArgTypes() {
+		return new Class[] { IStructuredSelection.class };
+	}
+	
+	/*
+	 * Generic reflection util method to execute a named method with unknown
+	 * paramaters on an object
+	 */
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+	 */
+	public void run(IAction action) {
+		try {
+			Object handler = getActionHandler(action);
+			SimpleJSDTActionProxy.executeMethod(handler, "run", getRunArgTypes(), getRunArgs(action)); //$NON-NLS-1$
+		} catch (IllegalArgumentException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (SecurityException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (IllegalAccessException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (NoSuchMethodException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (InstantiationException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (InvocationTargetException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		}
+	}
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		currentSelection = selection;
+		if(targetWorkbenchPart==null) return;
+		
+		try {
+			Object handler = getActionHandler(action);
+			SimpleJSDTActionProxy.executeMethod(handler, "selectionChanged", getSelectionChangeArgTypes(), getSelectionChangeArgs(action, selection)); //$NON-NLS-1$
+		} catch (IllegalArgumentException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (SecurityException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (IllegalAccessException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (NoSuchMethodException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (InstantiationException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (InvocationTargetException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		}
+		
+	}
+	
+	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+		this.targetWorkbenchPart = targetPart;
+	}
+	
+	protected void setSelection(ISelection selection) {
+		this.currentSelection = selection;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SourceActionsAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SourceActionsAction.java
new file mode 100644
index 0000000..75815ea
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SourceActionsAction.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ * 
+ */
+public class SourceActionsAction implements IObjectActionDelegate {
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+	 */
+	public void run(IAction action) {
+	
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+	 *      org.eclipse.jface.viewers.ISelection)
+	 */
+	public void selectionChanged(IAction action, ISelection selection) {
+		action.setEnabled(false);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction,
+	 *      org.eclipse.ui.IWorkbenchPart)
+	 */
+	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+		
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/StandardEditorActionsAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/StandardEditorActionsAction.java
new file mode 100644
index 0000000..8677ee4
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/StandardEditorActionsAction.java
@@ -0,0 +1,233 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
+import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JsJfaceNode;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ * 
+ */
+public class StandardEditorActionsAction implements IObjectActionDelegate {
+	private static final boolean APPEND_NEW_LINES_TO_COPY = true;
+	protected static final String COPY = "org.eclipse.wst.jsdt.web.ui.copy"; //$NON-NLS-1$
+	protected static final String CUT = "org.eclipse.wst.jsdt.web.ui.cut"; //$NON-NLS-1$
+	protected static final String DELETE = "org.eclipse.wst.jsdt.web.ui.delete"; //$NON-NLS-1$
+	private static final char NEW_LINE = '\n';
+	protected static final String PASTE_AFTER = "org.eclipse.wst.jsdt.web.ui.paste.after"; //$NON-NLS-1$
+	protected static final String PASTE_BEFORE = "org.eclipse.wst.jsdt.web.ui.paste.before"; //$NON-NLS-1$
+	protected ISelection selection;
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+	 *      org.eclipse.jface.viewers.ISelection)
+	 */
+	private void copy(IAction action) {
+		JsJfaceNode[] nodes = parseSelection();
+		if (nodes == null || nodes.length == 0) {
+			return;
+		}
+		Clipboard clipboard = null;
+		StringBuffer text = new StringBuffer();
+		if (StandardEditorActionsAction.APPEND_NEW_LINES_TO_COPY) {
+			text.append(StandardEditorActionsAction.NEW_LINE);
+		}
+		try {
+			for (int i = 0; i < nodes.length; i++) {
+				JsJfaceNode currentNode = nodes[i];
+				int start = currentNode.getStartOffset();
+				int length = currentNode.getLength();
+				IStructuredDocument doc = currentNode.getStructuredDocument();
+				try {
+					String elementText = doc.get(start, length);
+					text.append(elementText);
+				} catch (BadLocationException ex) {
+					// TODO Auto-generated catch block
+					ex.printStackTrace();
+				}
+				if (StandardEditorActionsAction.APPEND_NEW_LINES_TO_COPY) {
+					text.append(StandardEditorActionsAction.NEW_LINE);
+				}
+				clipboard = new Clipboard(Display.getCurrent());
+				clipboard.setContents(new Object[] { text.toString() }, new Transfer[] { TextTransfer.getInstance() });
+			}
+		} finally {
+			if (clipboard != null) {
+				clipboard.dispose();
+			}
+		}
+	}
+	
+	private void delete(IAction action) {
+		JsJfaceNode[] nodes = parseSelection();
+		if (nodes == null || nodes.length == 0) {
+			return;
+		}
+		IStructuredDocument lastDoc = null;
+		IModelManager modelManager = StructuredModelManager.getModelManager();
+		IStructuredModel model = null;
+		try {
+			int start;
+			int length;
+			for (int i = 0; i < nodes.length; i++) {
+				JsJfaceNode currentNode = nodes[i];
+				start = currentNode.getStartOffset();
+				length = currentNode.getLength();
+				IStructuredDocument doc = currentNode.getStructuredDocument();
+				if (doc != lastDoc) {
+					lastDoc = doc;
+					if (model != null) {
+						model.endRecording(action);
+						model.changedModel();
+						model.releaseFromEdit();
+					}
+					if (modelManager != null) {
+						model = modelManager.getExistingModelForEdit(doc);
+						model.aboutToChangeModel();
+						model.beginRecording(action, "Delete JavaScript Element", "Delete JavaScript Element");
+					}
+				}
+				doc.replaceText(action, start, length, ""); //$NON-NLS-1$
+			}
+			model.endRecording(action);
+		} catch (Exception e) {
+			System.out.println(Messages.getString("StandardEditorActionsAction.8") + e); //$NON-NLS-1$
+		} finally {
+			if (model != null) {
+				model.changedModel();
+				model.releaseFromEdit();
+			}
+		}
+	}
+	
+	private JsJfaceNode[] parseSelection() {
+		if (selection == null) {
+			return new JsJfaceNode[0];
+		}
+		ArrayList elements = new ArrayList();
+		if (selection instanceof IStructuredSelection) {
+			Iterator itt = ((IStructuredSelection) selection).iterator();
+			while (itt.hasNext()) {
+				Object element = itt.next();
+				if (element instanceof IJavaScriptElement) {
+					elements.add(element);
+				}
+				if (element instanceof IJavaWebNode) {
+					elements.add(element);
+				}
+			}
+			return (JsJfaceNode[]) elements.toArray(new JsJfaceNode[elements.size()]);
+		}
+		return new JsJfaceNode[0];
+	}
+	
+	private void paste(IAction action, boolean atEnd) {
+		JsJfaceNode[] nodes = parseSelection();
+		if (nodes == null || nodes.length == 0) {
+			return;
+		}
+		int startOfPaste = -1;
+		IStructuredDocument doc = null;
+		/* Figure out where to paste the content */
+		if (atEnd) {
+			for (int i = 0; i < nodes.length; i++) {
+				if ((nodes[i].getStartOffset() + nodes[i].getLength()) > startOfPaste) {
+					startOfPaste = (nodes[i].getStartOffset() + nodes[i].getLength());
+					doc = nodes[i].getStructuredDocument();
+				}
+			}
+		} else {
+			for (int i = 0; i < nodes.length; i++) {
+				if ((nodes[i].getStartOffset() < startOfPaste || startOfPaste < 0)) {
+					startOfPaste = nodes[i].getStartOffset();
+					doc = nodes[i].getStructuredDocument();
+				}
+			}
+		}
+		Clipboard clipboard = null;
+		IModelManager modelManager = StructuredModelManager.getModelManager();
+		IStructuredModel model = null;
+		try {
+			clipboard = new Clipboard(Display.getCurrent());
+			String pasteString = (String) clipboard.getContents(TextTransfer.getInstance());
+			model = modelManager.getExistingModelForEdit(doc);
+			model.aboutToChangeModel();
+			model.beginRecording(action, Messages.getString("StandardEditorActionsAction.9") + (atEnd ? Messages.getString("StandardEditorActionsAction.10") : Messages.getString("StandardEditorActionsAction.11")) + Messages.getString("StandardEditorActionsAction.12"), Messages.getString("StandardEditorActionsAction.13") + (atEnd ? Messages.getString("StandardEditorActionsAction.14") : Messages.getString("StandardEditorActionsAction.15")) + Messages.getString("StandardEditorActionsAction.16")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
+			doc.replaceText(action, startOfPaste, 0, pasteString);
+		} finally {
+			if (clipboard != null) {
+				clipboard.dispose();
+			}
+			if (model != null) {
+				model.endRecording(action);
+				model.changedModel();
+				model.releaseFromEdit();
+			}
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+	 */
+	public void run(IAction action) {
+		if (action.getId().equals(StandardEditorActionsAction.CUT)) {
+			copy(action);
+			delete(action);
+		} else if (action.getId().equals(StandardEditorActionsAction.COPY)) {
+			copy(action);
+		} else if (action.getId().equals(StandardEditorActionsAction.PASTE_BEFORE)) {
+			paste(action, false);
+		} else if (action.getId().equals(StandardEditorActionsAction.PASTE_AFTER)) {
+			paste(action, true);
+		} else if (action.getId().equals(StandardEditorActionsAction.DELETE)) {
+			delete(action);
+		}
+	}
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		this.selection = selection;
+	}
+	
+	public void setActivePart(IAction action, IWorkbenchPart targetPart) {}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/messages.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/messages.properties
new file mode 100644
index 0000000..c89b761
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/messages.properties
@@ -0,0 +1,28 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+StandardEditorActionsAction.8=Error in Standard Editor Action : 
+StandardEditorActionsAction.9=Insert Text 
+StandardEditorActionsAction.10=before
+StandardEditorActionsAction.11=after
+StandardEditorActionsAction.12=\ a JavaScript Element.
+StandardEditorActionsAction.13=Insert Text 
+StandardEditorActionsAction.14=before
+StandardEditorActionsAction.15=after
+StandardEditorActionsAction.16=\ a JavaScript Element.
+SimpleJSDTActionProxy.0=Exception : 
+ShowHistoryAction.0=Error Opening in Script View
+ShowHistoryAction.1=Error while displaying element in Script View:\n
+ShowInNavigatorAction.0=Error Opening in Script View
+ShowInNavigatorAction.1=Error while displaying element in Script View:\n
+AddJavaDocStubAction.0=JavaScript Doc
+AddJavaDocStubAction.1=Error while adding comment
+AddJavaDocStubOperation.0=Generate JsDoc
+AddJavaDocStubOperation.1=Generate JsDoc
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionConstantsJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionConstantsJs.java
new file mode 100644
index 0000000..7d1af51
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionConstantsJs.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public interface IActionConstantsJs {
+	public final static String ACTION_NAME_MOVE_ELEMENT = "MoveElement"; //$NON-NLS-1$
+	public final static String ACTION_NAME_RENAME_ELEMENT = "RenameElement"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionDefinitionIdsJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionDefinitionIdsJs.java
new file mode 100644
index 0000000..9161681
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionDefinitionIdsJs.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal;
+
+import org.eclipse.wst.jsdt.ui.actions.IJavaEditorActionDefinitionIds;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public interface IActionDefinitionIdsJs {
+	public final static String MOVE_ELEMENT = IJavaEditorActionDefinitionIds.MOVE_ELEMENT;
+	public final static String RENAME_ELEMENT = IJavaEditorActionDefinitionIds.RENAME_ELEMENT;
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JSPUIPluginResources.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JSPUIPluginResources.properties
new file mode 100644
index 0000000..2cb5d27
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JSPUIPluginResources.properties
@@ -0,0 +1,87 @@
+###############################################################################
+# Copyright (c) 2004, 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+## The following line is a sample JSP document.  Please translate only the following parts:
+## Use below tags ONLY for JSP 1.1
+## Welcome!
+## Use below tags ONLY for JSP 1.2
+## Welcome!
+Sample_JSP_doc=<%@ page \n\tlanguage=\"java\" \n\tcontentType=\"text/html; charset=ISO-8859-1\"\n%>\n<jsp:include flush=\"true\" page=\"titleBar.jsp\"/>\n\n<%-- Use below tags ONLY for JSP 1.1 --%>\n<%\n\tSystem.out.println(\"Welcome!\");\n%>\n<%-- Use below tags ONLY for JSP 1.2 --%>\n<jsp:scriptlet>\n\tSystem.out.println(\"Welcome!\");\n</jsp:scriptlet>
+JSP_Delimiters_UI_=JSP Delimiters
+Refactor_label=Refactor
+RenameElement_label=Rename
+MoveElement_label=Move
+MoveElementWizard=Move the selected elements
+#
+OK=OK
+JSP_changes=JSP changes
+ActionContributorJSP_0=Refa&ctor
+JSPRenameElementAction_0=Editor selection does not resolve to a renamable Java element
+JSPMoveElementAction_0=Editor selection does not resolve to movable Java elements
+BasicRefactorSearchRequestor_0=JSP Rename
+BasicRefactorSearchRequestor_1=in file: {0} line: {1}
+BasicRefactorSearchRequestor_2=Move Type ''{0}'' to package ''{1}''
+BasicRefactorSearchRequestor_3=Rename Method ''{0}'' to ''{1}''
+BasicRefactorSearchRequestor_4=Rename Type ''{0}'' to ''{1}''
+BasicRefactorSearchRequestor_5=Rename Package ''{0}'' to ''{1}''
+BasicRefactorSearchRequestor_6=JSP Rename Change
+#
+_UI_WIZARD_NEW_TITLE = New JavaServer Page
+_UI_WIZARD_NEW_HEADING = JavaServer Page
+_UI_WIZARD_NEW_DESCRIPTION = Create a new JavaServer Page.
+_ERROR_FILENAME_MUST_END_JSP = The file name must end in one of the following extensions {0}. 
+_WARNING_FILE_MUST_BE_INSIDE_JAVA_PROJECT = JavaServer Pages created in projects that do not support Java might not work as expected. 
+_WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT = Files created outside of the Web Content folder will not be included in your deployed Web application. 
+ResourceGroup_nameExists = The same name already exists.
+NewJSPTemplatesWizardPage_0=Select JSP Template
+NewJSPTemplatesWizardPage_1=Select a template as initial content in the JSP page.
+NewJSPTemplatesWizardPage_2=Name
+NewJSPTemplatesWizardPage_3=Description
+NewJSPTemplatesWizardPage_4=Use JSP Template
+NewJSPTemplatesWizardPage_5=Preview
+NewJSPTemplatesWizardPage_6=Templates are 'New JSP' templates found in the <a>JSP Templates</a> preference page.
+# Copied from sse.ui
+CleanupDocument_label=Cleanup Document...
+CleanupDocument_tooltip=Cleanup Document
+CleanupDocument_description=Cleanup Document
+ToggleComment_label=Toggle Comment
+ToggleComment_tooltip=Toggle Comment
+ToggleComment_description=Toggle Comment
+AddBlockComment_label=Add Block Comment
+AddBlockComment_tooltip=Add Block Comment
+AddBlockComment_description=Add Block Comment
+RemoveBlockComment_label=Remove Block Comment
+RemoveBlockComment_tooltip=Remove Block Comment
+RemoveBlockComment_description=Remove Block Comment
+FindOccurrences_label=Occurrences in File
+OccurrencesSearchQuery_0={0} - {1} Occurrences in {2}
+OccurrencesSearchQuery_2=file
+Content_Assist_not_availab_UI_=Content Assist not available at the current location
+Java_Content_Assist_is_not_UI_=Java Content Assist is not available for the current cursor location
+#
+Override_method_in=Override method in '
+Creating_files_encoding=Creating files encoding preference
+#
+JSPSourcePreferencePage_0=JSP Source preferences are based on the content within the JSP.
+JSPSourcePreferencePage_1=See <a>''{0}''</a> for JSP with HTML content.
+JSPSourcePreferencePage_2=See <a>''{0}''</a> for JSP with XML content.
+JSPColorPage_jsp_content=JSP Content
+JSPFilesPreferencePage_0=Validating files
+JSPFilesPreferencePage_1=Validate JSP fragments
+# JSP Fragments
+JSPFContentSettingsPropertyPage_0=none
+JSPFContentSettingsPropertyPage_1=The properties used instead of the page directive that cannot be specified in JSP fragment files.  The project setting is used if you specify "none."
+JSPFContentSettingsPropertyPage_2=Language:
+JSPFContentSettingsPropertyPage_3=Content Type:
+JSPFContentSettingsPropertyPage_4=Enable specific setting:
+ProjectJSPFContentSettingsPropertyPage_0=The properties for J2EE Web projects act as "project" default to be looked up when no properties are specified for a particular JSP fragment file.
+# CSS JSP
+Title_InvalidValue=Invalid Value
+Message_InvalidValue=Invalid property value.
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIMessages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIMessages.java
new file mode 100644
index 0000000..fbd9cf8
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIMessages.java
@@ -0,0 +1,110 @@
+/**********************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation and others. All rights reserved.   This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors: 
+ * IBM - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ 
+ */
+public class JsUIMessages extends NLS {
+	public static String _ERROR_FILENAME_MUST_END_JSP;
+	public static String _UI_WIZARD_NEW_DESCRIPTION;
+	public static String _UI_WIZARD_NEW_HEADING;
+	public static String _UI_WIZARD_NEW_TITLE;
+	public static String _WARNING_FILE_MUST_BE_INSIDE_JAVA_PROJECT;
+	public static String _WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT;
+	public static String ActionContributorJSP_0;
+	public static String AddBlockComment_description; // resource bundle
+	public static String AddBlockComment_label; // resource bundle
+	public static String AddBlockComment_tooltip; // resource bundle
+	public static String BasicRefactorSearchRequestor_0;
+	public static String BasicRefactorSearchRequestor_1;
+	public static String BasicRefactorSearchRequestor_2;
+	public static String BasicRefactorSearchRequestor_3;
+	public static String BasicRefactorSearchRequestor_4;
+	public static String BasicRefactorSearchRequestor_5;
+	public static String BasicRefactorSearchRequestor_6;
+	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.ui.internal.JSPUIPluginResources";//$NON-NLS-1$
+	public static String CleanupDocument_description; // resource bundle
+	public static String CleanupDocument_label; // resource bundle
+	public static String CleanupDocument_tooltip; // resource bundle
+	public static String Content_Assist_not_availab_UI_;
+	public static String Creating_files_encoding;
+	public static String FindOccurrences_label; // resource bundle
+	private static ResourceBundle fResourceBundle;
+	public static String Java_Content_Assist_is_not_UI_;
+	public static String JSP_changes;
+	public static String JSP_Delimiters_UI_;
+	public static String JSPColorPage_jsp_content;
+	public static String JSPFContentSettingsPropertyPage_0;
+	public static String JSPFContentSettingsPropertyPage_1;
+	public static String JSPFContentSettingsPropertyPage_2;
+	public static String JSPFContentSettingsPropertyPage_3;
+	public static String JSPFContentSettingsPropertyPage_4;
+	public static String JSPFilesPreferencePage_0;
+	public static String JSPFilesPreferencePage_1;
+	public static String JSPMoveElementAction_0;
+	public static String JSPRenameElementAction_0;
+	public static String JSPSourcePreferencePage_0;
+	public static String JSPSourcePreferencePage_1;
+	public static String JSPSourcePreferencePage_2;
+	public static String Message_InvalidValue;
+	public static String MoveElement_label; // resource bundle
+	public static String MoveElementWizard;
+	public static String NewJSPTemplatesWizardPage_0;
+	public static String NewJSPTemplatesWizardPage_1;
+	public static String NewJSPTemplatesWizardPage_2;
+	public static String NewJSPTemplatesWizardPage_3;
+	public static String NewJSPTemplatesWizardPage_4;
+	public static String NewJSPTemplatesWizardPage_5;
+	public static String NewJSPTemplatesWizardPage_6;
+	public static String OccurrencesSearchQuery_0;
+	public static String OccurrencesSearchQuery_2;
+	public static String OK;
+	public static String Override_method_in;
+	public static String ProjectJSPFContentSettingsPropertyPage_0;
+	public static String Refactor_label;
+	public static String RemoveBlockComment_description; // resource bundle
+	public static String RemoveBlockComment_label; // resource bundle
+	public static String RemoveBlockComment_tooltip; // resource bundle
+	public static String RenameElement_label; // resource bundle
+	public static String ResourceGroup_nameExists;
+	public static String Sample_JSP_doc;
+	public static String Title_InvalidValue;
+	public static String ToggleComment_description; // resource bundle
+	public static String ToggleComment_label; // resource bundle
+	public static String ToggleComment_tooltip; // resource bundle
+	static {
+		// load message values from bundle file
+		NLS.initializeMessages(JsUIMessages.BUNDLE_NAME, JsUIMessages.class);
+	}
+	
+	public static ResourceBundle getResourceBundle() {
+		try {
+			if (JsUIMessages.fResourceBundle == null) {
+				JsUIMessages.fResourceBundle = ResourceBundle.getBundle(JsUIMessages.BUNDLE_NAME);
+			}
+		} catch (MissingResourceException x) {
+			JsUIMessages.fResourceBundle = null;
+		}
+		return JsUIMessages.fResourceBundle;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIPlugin.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIPlugin.java
new file mode 100644
index 0000000..70b836d
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIPlugin.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal;
+
+import java.io.IOException;
+
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
+import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
+import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistryImpl;
+import org.osgi.framework.BundleContext;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsUIPlugin extends AbstractUIPlugin {
+	public final static String ID = "org.eclipse.wst.jsdt.web.ui"; //$NON-NLS-1$
+	protected static JsUIPlugin instance = null;
+	
+	public static JsUIPlugin getDefault() {
+		return JsUIPlugin.instance;
+	}
+	
+	public synchronized static JsUIPlugin getInstance() {
+		return JsUIPlugin.instance;
+	}
+	/**
+	 * The template context type registry for the jsp editor.
+	 */
+	private ContextTypeRegistry fContextTypeRegistry;
+	/**
+	 * The template store for the jsp editor.
+	 */
+	private TemplateStore fTemplateStore;
+	
+	public JsUIPlugin() {
+		super();
+		JsUIPlugin.instance = this;
+	}
+	
+	public AdapterFactoryRegistry getAdapterFactoryRegistry() {
+		return AdapterFactoryRegistryImpl.getInstance();
+	}
+	
+	/**
+	 * Returns the template context type registry for the jsp plugin.
+	 * 
+	 * @return the template context type registry for the jsp plugin
+	 */
+	public ContextTypeRegistry getTemplateContextRegistry() {
+		if (fContextTypeRegistry == null) {
+// ContributionContextTypeRegistry registry = new
+// ContributionContextTypeRegistry();
+// registry.addContextType(TemplateContextTypeIdsJSP.ALL);
+// registry.addContextType(TemplateContextTypeIdsJSP.NEW);
+// registry.addContextType(TemplateContextTypeIdsJSP.TAG);
+// registry.addContextType(TemplateContextTypeIdsJSP.ATTRIBUTE);
+// registry.addContextType(TemplateContextTypeIdsJSP.ATTRIBUTE_VALUE);
+			fContextTypeRegistry = JavaScriptPlugin.getDefault().getCodeTemplateContextRegistry();
+		}
+		return fContextTypeRegistry;
+	}
+	
+	/**
+	 * Returns the template store for the jsp editor templates.
+	 * 
+	 * @return the template store for the jsp editor templates
+	 */
+	public TemplateStore getTemplateStore() {
+		if (fTemplateStore == null) {
+// fTemplateStore = new ContributionTemplateStore(
+// getTemplateContextRegistry(), getPreferenceStore(),
+// JSPUIPreferenceNames.TEMPLATES_KEY);
+			JavaScriptPlugin jp = JavaScriptPlugin.getDefault();
+			fTemplateStore = jp.getTemplateStore();
+			try {
+				fTemplateStore.load();
+			} catch (IOException e) {
+				Logger.logException(e);
+			}
+		}
+		return fTemplateStore;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		instance = this;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		super.stop(context);
+		instance = null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/Logger.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/Logger.java
new file mode 100644
index 0000000..f79c751
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/Logger.java
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.osgi.framework.Bundle;
+
+import com.ibm.icu.util.StringTokenizer;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class Logger {
+	public static final int ERROR = IStatus.ERROR; // 4
+	public static final int ERROR_DEBUG = 200 + Logger.ERROR;
+	public static final int INFO = IStatus.INFO; // 1
+	public static final int INFO_DEBUG = 200 + Logger.INFO;
+	public static final int OK = IStatus.OK; // 0
+	public static final int OK_DEBUG = 200 + Logger.OK;
+	private static final String PLUGIN_ID = "org.eclipse.wst.jsdt.web.ui"; //$NON-NLS-1$
+	private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
+	public static final int WARNING = IStatus.WARNING; // 2
+	public static final int WARNING_DEBUG = 200 + Logger.WARNING;
+	
+	/**
+	 * Adds message to log.
+	 * 
+	 * @param level
+	 *            severity level of the message (OK, INFO, WARNING, ERROR,
+	 *            OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
+	 * @param message
+	 *            text to add to the log
+	 * @param exception
+	 *            exception thrown
+	 */
+	protected static void _log(int level, String message, Throwable exception) {
+		if (level == Logger.OK_DEBUG || level == Logger.INFO_DEBUG || level == Logger.WARNING_DEBUG || level == Logger.ERROR_DEBUG) {
+			if (!Logger.isDebugging()) {
+				return;
+			}
+		}
+		int severity = IStatus.OK;
+		switch (level) {
+			case INFO_DEBUG:
+			case INFO:
+				severity = IStatus.INFO;
+			break;
+			case WARNING_DEBUG:
+			case WARNING:
+				severity = IStatus.WARNING;
+			break;
+			case ERROR_DEBUG:
+			case ERROR:
+				severity = IStatus.ERROR;
+		}
+		message = (message != null) ? message : "null"; //$NON-NLS-1$
+		Status statusObj = new Status(severity, Logger.PLUGIN_ID, severity, message, exception);
+		Bundle bundle = Platform.getBundle(Logger.PLUGIN_ID);
+		if (bundle != null) {
+			Platform.getLog(bundle).log(statusObj);
+		}
+	}
+	
+	/**
+	 * Prints message to log if category matches /debug/tracefilter option.
+	 * 
+	 * @param message
+	 *            text to print
+	 * @param category
+	 *            category of the message, to be compared with
+	 *            /debug/tracefilter
+	 */
+	protected static void _trace(String category, String message, Throwable exception) {
+		if (Logger.isTracing(category)) {
+			message = (message != null) ? message : "null"; //$NON-NLS-1$
+			Status statusObj = new Status(IStatus.OK, Logger.PLUGIN_ID, IStatus.OK, message, exception);
+			Bundle bundle = Platform.getBundle(Logger.PLUGIN_ID);
+			if (bundle != null) {
+				Platform.getLog(bundle).log(statusObj);
+			}
+		}
+	}
+	
+	/**
+	 * @return true if the platform is debugging
+	 */
+	public static boolean isDebugging() {
+		return Platform.inDebugMode();
+	}
+	
+	/**
+	 * Determines if currently tracing a category
+	 * 
+	 * @param category
+	 * @return true if tracing category, false otherwise
+	 */
+	public static boolean isTracing(String category) {
+		if (!Logger.isDebugging()) {
+			return false;
+		}
+		String traceFilter = Platform.getDebugOption(Logger.PLUGIN_ID + Logger.TRACEFILTER_LOCATION);
+		if (traceFilter != null) {
+			StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
+			while (tokenizer.hasMoreTokens()) {
+				String cat = tokenizer.nextToken().trim();
+				if (category.equals(cat)) {
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+	
+	public static void log(int level, String message) {
+		Logger._log(level, message, null);
+	}
+	
+	public static void log(int level, String message, Throwable exception) {
+		Logger._log(level, message, exception);
+	}
+	
+	public static void logException(String message, Throwable exception) {
+		Logger._log(Logger.ERROR, message, exception);
+	}
+	
+	public static void logException(Throwable exception) {
+		Logger._log(Logger.ERROR, exception.getMessage(), exception);
+	}
+	
+	public static void trace(String category, String message) {
+		Logger._trace(category, message, null);
+	}
+	
+	public static void traceException(String category, String message, Throwable exception) {
+		Logger._trace(category, message, exception);
+	}
+	
+	public static void traceException(String category, Throwable exception) {
+		Logger._trace(category, exception.getMessage(), exception);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForJs.java
new file mode 100644
index 0000000..9c1f97c
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForJs.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.autoedit;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.DocumentCommand;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.internal.ui.text.java.JavaAutoIndentStrategy;
+import org.eclipse.wst.jsdt.internal.ui.text.java.SmartSemicolonAutoEditStrategy;
+import org.eclipse.wst.jsdt.internal.ui.text.javadoc.JavaDocAutoIndentStrategy;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class AutoEditStrategyForJs implements IAutoEditStrategy {
+	private IAutoEditStrategy[] fStrategies;
+	
+	public AutoEditStrategyForJs() {
+		super();
+	}
+	
+	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
+		IAutoEditStrategy[] strats = getAutoEditStrategies(document);
+		for (int i = 0; i < strats.length; i++) {
+			strats[i].customizeDocumentCommand(document, command);
+		}
+	}
+	
+	public IAutoEditStrategy[] getAutoEditStrategies(IDocument document) {
+		if (fStrategies != null) {
+			return fStrategies;
+		}
+		String partitioning = IHTMLPartitions.SCRIPT;
+		fStrategies = new IAutoEditStrategy[] { new SmartSemicolonAutoEditStrategy(partitioning),
+				new JavaAutoIndentStrategy(partitioning, getJavaProject(document), null), new JavaDocAutoIndentStrategy(partitioning) };
+		/* new AutoEditStrategyForTabs() */
+		return fStrategies;
+	}
+	
+	private IJavaScriptProject getJavaProject(IDocument document) {
+		IDOMModel model = null;
+		IJavaScriptProject javaProject = null;
+		try {
+			model = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(document);
+			String baseLocation = model.getBaseLocation();
+			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+			IPath filePath = new Path(baseLocation);
+			IProject project = null;
+			if (filePath.segmentCount() > 0) {
+				project = root.getProject(filePath.segment(0));
+			}
+			if (project != null) {
+				javaProject = JavaScriptCore.create(project);
+			}
+		} finally {
+			if (model != null) {
+				model.releaseFromRead();
+			}
+		}
+		return javaProject;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForTabs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForTabs.java
new file mode 100644
index 0000000..50ab442
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForTabs.java
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.autoedit;
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.ConfigurableLineTracker;
+import org.eclipse.jface.text.DocumentCommand;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ILineTracker;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension3;
+import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
+import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
+import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class AutoEditStrategyForTabs implements IAutoEditStrategy {
+	private final String TAB_CHARACTER = "\t"; //$NON-NLS-1$
+	
+	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
+		// if not in smart insert mode just ignore
+		if (!isSmartInsertMode()) {
+			return;
+		}
+		// spaces for tab character
+		if (command.length == 0 && command.text != null && command.text.length() > 0 && command.text.indexOf(TAB_CHARACTER) != -1) {
+			smartInsertForTab(command, document);
+		}
+	}
+	
+	/**
+	 * Returns indentation width if using spaces for indentation, -1 otherwise
+	 * 
+	 * @return
+	 */
+	private int getIndentationWidth() {
+		int width = -1;
+		Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
+		if (HTMLCorePreferenceNames.SPACE.equals(preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR))) {
+			width = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
+		}
+		return width;
+	}
+	
+	/**
+	 * Calculate number of spaces for next tab stop
+	 */
+	private String getIndentString(int indentationWidth, int lineOffset, ILineTracker lineTracker, int index) {
+		int indentSize = indentationWidth;
+		int offsetInLine = -1;
+		if (lineTracker != null) {
+			try {
+				IRegion lineInfo = lineTracker.getLineInformationOfOffset(index);
+				if (lineInfo.getOffset() == 0 && lineOffset > -1) {
+					offsetInLine = lineOffset + index;
+				} else {
+					offsetInLine = index - lineInfo.getOffset();
+				}
+			} catch (BadLocationException e) {
+				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+			}
+		} else {
+			if (lineOffset > -1) {
+				offsetInLine = lineOffset + index;
+			}
+		}
+		if (offsetInLine > -1 && indentationWidth > 0) {
+			int remainder = offsetInLine % indentationWidth;
+			indentSize = indentationWidth - remainder;
+		}
+		StringBuffer indent = new StringBuffer();
+		for (int i = 0; i < indentSize; i++) {
+			indent.append(' ');
+		}
+		return indent.toString();
+	}
+	
+	/**
+	 * Set up a line tracker for text within command if text is multi-line
+	 */
+	private ILineTracker getLineTracker(IDocument document, String originalText) {
+		ConfigurableLineTracker lineTracker = null;
+		int[] delims = TextUtilities.indexOf(document.getLegalLineDelimiters(), originalText, 0);
+		if (delims[0] != -1 || delims[1] != -1) {
+			lineTracker = new ConfigurableLineTracker(document.getLegalLineDelimiters());
+			lineTracker.set(originalText);
+		}
+		return lineTracker;
+	}
+	
+	/**
+	 * Return true if active editor is in smart insert mode, false otherwise
+	 * 
+	 * @return
+	 */
+	private boolean isSmartInsertMode() {
+		boolean isSmartInsertMode = false;
+		ITextEditor textEditor = null;
+		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+		if (window != null) {
+			IWorkbenchPage page = window.getActivePage();
+			if (page != null) {
+				IEditorPart editor = page.getActiveEditor();
+				if (editor != null) {
+					if (editor instanceof ITextEditor) {
+						textEditor = (ITextEditor) editor;
+					} else {
+						textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
+					}
+				}
+			}
+		}
+		// check if smart insert mode
+		if (textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT) {
+			isSmartInsertMode = true;
+		}
+		return isSmartInsertMode;
+	}
+	
+	/**
+	 * Insert spaces for tabs
+	 * 
+	 * @param command
+	 */
+	private void smartInsertForTab(DocumentCommand command, IDocument document) {
+		// tab key was pressed. now check preferences to see if need to insert
+		// spaces instead of tab
+		int indentationWidth = getIndentationWidth();
+		if (indentationWidth > -1) {
+			String originalText = command.text;
+			StringBuffer newText = new StringBuffer(originalText);
+			// determine where in line this command begins
+			int lineOffset = -1;
+			try {
+				IRegion lineInfo = document.getLineInformationOfOffset(command.offset);
+				lineOffset = command.offset - lineInfo.getOffset();
+			} catch (BadLocationException e) {
+				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+			}
+			ILineTracker lineTracker = getLineTracker(document, originalText);
+			int startIndex = 0;
+			int index = newText.indexOf(TAB_CHARACTER);
+			while (index != -1) {
+				String indent = getIndentString(indentationWidth, lineOffset, lineTracker, index);
+				// replace \t character with spaces
+				newText.replace(index, index + 1, indent);
+				if (lineTracker != null) {
+					try {
+						lineTracker.replace(index, 1, indent);
+					} catch (BadLocationException e) {
+						// if something goes wrong with replacing text, just
+						// reset to current string
+						lineTracker.set(newText.toString());
+						Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+					}
+				}
+				startIndex = index + indent.length();
+				index = newText.indexOf(TAB_CHARACTER, startIndex);
+			}
+			command.text = newText.toString();
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTCompletionProposal.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTCompletionProposal.java
new file mode 100644
index 0000000..a42e3fd
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTCompletionProposal.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.wst.jsdt.internal.ui.text.java.JavaCompletionProposal;
+import org.eclipse.wst.jsdt.internal.ui.text.java.LazyJavaCompletionProposal;
+import org.eclipse.wst.jsdt.internal.ui.text.java.LazyJavaTypeCompletionProposal;
+import org.eclipse.wst.jsdt.ui.text.java.IJavaCompletionProposal;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JSDTCompletionProposal extends JavaCompletionProposal implements IJavaCompletionProposal {
+	/*
+	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
+	 * 
+	 * This is a wrapped proposal so we don't need to make "slow" calls to the
+	 * java proposal up front, only when needed for example, getAdditionalInfo()
+	 * reads external javadoc, and it makes no sense
+	 */
+	ICompletionProposal fJavaCompletionProposal = null;
+	
+	public JSDTCompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image,
+			String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance,
+			boolean updateReplacementLengthOnValidate) {
+		super(replacementString, replacementOffset, replacementLength, image, displayString, relevance);
+		super.setCursorPosition(cursorPosition);
+		super.setContextInformation(contextInformation);
+// super(replacementString, replacementOffset, replacementLength,
+// cursorPosition, image, displayString, contextInformation,
+// additionalProposalInfo, relevance,
+// updateReplacementLengthOnValidate);
+	}
+	
+	/**
+	 * <p>Uses the wrapped proposal if its lazy</p>
+	 */
+	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
+		if (this.fJavaCompletionProposal instanceof LazyJavaCompletionProposal) {
+			((LazyJavaCompletionProposal) this.fJavaCompletionProposal).apply(viewer, trigger, stateMask, offset);
+		}
+		else {
+			super.apply(viewer, trigger, stateMask, offset);
+		}
+	}
+	
+	/**
+	 * <p>Uses the wrapped proposal if its lazy</p>
+	 *
+	 * @return the selection after the proposal has been applied
+	 */
+	public Point getSelection(IDocument document) {
+		Point selection;
+		if (this.fJavaCompletionProposal instanceof LazyJavaCompletionProposal) {
+			selection = this.fJavaCompletionProposal.getSelection(document);
+		}
+		else {
+			selection = super.getSelection(document);
+		}
+		return selection;
+	}
+	
+	public String getAdditionalProposalInfo() {
+		String additionalInfo = super.getAdditionalProposalInfo();
+		ICompletionProposal javaProposal = getJavaCompletionProposal();
+		if (javaProposal != null) {
+			additionalInfo = javaProposal.getAdditionalProposalInfo();
+		}
+		return additionalInfo;
+	}
+	
+	final public ICompletionProposal getJavaCompletionProposal() {
+		return fJavaCompletionProposal;
+	}
+	
+	final public void setJavaCompletionProposal(ICompletionProposal javaCompletionProposal) {
+		fJavaCompletionProposal = javaCompletionProposal;
+	}
+	
+	protected boolean isValidPrefix(String prefix) {
+		if (this.fJavaCompletionProposal instanceof LazyJavaTypeCompletionProposal) {
+			return ((LazyJavaTypeCompletionProposal) this.fJavaCompletionProposal).isValidTypePrefix(prefix);
+		}
+		return super.isValidPrefix(prefix);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java
new file mode 100644
index 0000000..3e383b4
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Vector;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JSDTContentAssistant extends AbstractContentAssistProcessor implements ICompletionProposalComputer {
+	private JSDTContentAssistantProcessor fContentAssistProcessor;
+	private JSDTTemplateAssistProcessor fTemplateAssistProcessor;
+	private JSDTHtmlCompletionProcessor fHhtmlcomp;
+	
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition) {
+		Vector proposals = new Vector();
+		ICompletionProposal[] completionProposals;
+		ICompletionProposal endScript = getHtmlContentAssistProcessor().getEndScriptProposal(viewer, documentPosition);
+		if(endScript!=null) {
+			return new ICompletionProposal[] {endScript};
+			//proposals.add(endScript);
+		}
+		JSDTProposalCollector theCollector = getProposalCollector(viewer, documentPosition);
+		/* add end script tag if needed */
+
+		/* --------- Content Assistant --------- */
+		if(theCollector==null) return new ICompletionProposal[0];
+		
+		getContentAssistProcessor().setProposalCollector(theCollector);
+		completionProposals = getContentAssistProcessor().computeCompletionProposals(viewer, documentPosition);
+		proposals.addAll(Arrays.asList(completionProposals));
+		/* HTML Proposals */
+		completionProposals = getHtmlContentAssistProcessor().computeCompletionProposals(viewer, documentPosition);
+		proposals.addAll(Arrays.asList(completionProposals));
+		/* --------- template completions --------- */
+		getTemplateCompletionProcessor().setProposalCollector(theCollector);
+		completionProposals = getTemplateCompletionProcessor().computeCompletionProposals(viewer, documentPosition);
+		proposals.addAll(Arrays.asList(completionProposals));
+		return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[0]);
+	}
+	
+	private JSDTHtmlCompletionProcessor getHtmlContentAssistProcessor() {
+		if (fHhtmlcomp == null) {
+			fHhtmlcomp = new JSDTHtmlCompletionProcessor();
+		}
+		return fHhtmlcomp;
+	}
+	
+	private JSDTContentAssistantProcessor getContentAssistProcessor() {
+		if (fContentAssistProcessor == null) {
+			fContentAssistProcessor = new JSDTContentAssistantProcessor();
+		}
+		return fContentAssistProcessor;
+	}
+	private IJsTranslation getJSPTranslation(ITextViewer viewer, int offset) {
+		IDOMModel xmlModel = null;
+		try {
+			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
+			IDOMDocument xmlDoc = xmlModel.getDocument();
+
+			JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+			
+			if (translationAdapter != null) {
+				return translationAdapter.getJsTranslation(true);
+			}
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} finally {
+			if (xmlModel != null) {
+				xmlModel.releaseFromRead();
+			}
+		}
+		return null;
+	}
+	
+	protected JSDTProposalCollector getProposalCollector(ITextViewer viewer, int offset) {
+		IJsTranslation tran = getJSPTranslation(viewer, offset);
+		if(tran==null) return null;
+		return new JSDTProposalCollector(tran);
+	}
+	
+	private JSDTTemplateAssistProcessor getTemplateCompletionProcessor() {
+		if (fTemplateAssistProcessor == null) {
+			fTemplateAssistProcessor = new JSDTTemplateAssistProcessor();
+		}
+		return fTemplateAssistProcessor;
+	}
+
+	public void sessionStarted() {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		Vector proposals = new Vector();
+		ICompletionProposal[] completionProposals;
+		ICompletionProposal endScript = getHtmlContentAssistProcessor().getEndScriptProposal(context.getViewer(), context.getInvocationOffset());
+		if(endScript!=null) {
+			return new ArrayList(0);
+			//proposals.add(endScript);
+		}
+		JSDTProposalCollector theCollector = getProposalCollector(context.getViewer(), context.getInvocationOffset());
+		/* add end script tag if needed */
+
+		/* --------- Content Assistant --------- */
+		if(theCollector==null) return new ArrayList(0);
+		
+		getContentAssistProcessor().setProposalCollector(theCollector);
+		completionProposals = getContentAssistProcessor().computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
+		proposals.addAll(Arrays.asList(completionProposals));
+		/* HTML Proposals */
+		completionProposals = getHtmlContentAssistProcessor().computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
+		proposals.addAll(Arrays.asList(completionProposals));
+		/* --------- template completions --------- */
+		getTemplateCompletionProcessor().setProposalCollector(theCollector);
+		completionProposals = getTemplateCompletionProcessor().computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
+		proposals.addAll(Arrays.asList(completionProposals));
+		return proposals;
+	}
+
+	public List computeContextInformation(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		return Arrays.asList(computeContextInformation(context.getViewer(), context.getInvocationOffset()));
+	}
+
+	public void sessionEnded() {
+		fContentAssistProcessor = null;
+		fTemplateAssistProcessor = null;
+		fHhtmlcomp = null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistantProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistantProcessor.java
new file mode 100644
index 0000000..29b5e26
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistantProcessor.java
@@ -0,0 +1,244 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
+import org.osgi.framework.Bundle;
+
+/**
+ * Provisional API: This class/interface is part of an interim API that is
+ * still under development and expected to change significantly before
+ * reaching stability. It is being made available at this early stage to
+ * solicit feedback from pioneering adopters on the understanding that any
+ * code that uses this API will almost certainly be broken (repeatedly) as the
+ * API evolves.
+ * 
+ * This class is not intended to be subclassed.
+ */
+public class JSDTContentAssistantProcessor extends AbstractContentAssistProcessor {
+	private static final String JSDT_CORE_PLUGIN_ID = "org.eclipse.wst.jsdt.core"; //$NON-NLS-1$
+//	static {
+//		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsptranslation"); //$NON-NLS-1$
+//		//DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+//	}
+	protected String fErrorMessage = null;
+	protected int fJspSourcePosition, fJavaPosition;
+	private JSDTProposalCollector fProposalCollector;
+	protected ITextViewer fViewer = null;
+	
+	public JSDTContentAssistantProcessor() {
+		super();
+	}
+	
+	/**
+	 * Returns a list of completion proposals based on the specified location
+	 * within the document that corresponds to the current cursor position
+	 * within the text viewer.
+	 * 
+	 * @param viewer
+	 *            the viewer whose document is used to compute the proposals
+	 * @param documentPosition
+	 *            an offset within the document for which completions should be
+	 *            computed
+	 * @return an array of completion proposals or <code>null</code> if no
+	 *         proposals are possible
+	 */
+	
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int pos) {
+		initialize(pos);
+		JSDTProposalCollector collector = null;
+		IDOMModel xmlModel = null;
+		try {
+			fViewer = viewer;
+			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(fViewer.getDocument());
+			IDOMDocument xmlDoc = xmlModel.getDocument();
+			JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+			
+			if (translationAdapter != null) {
+				IJsTranslation translation = translationAdapter.getJsTranslation(true);
+				fJavaPosition = getDocumentPosition();
+				try {
+					IJavaScriptUnit cu = translation.getCompilationUnit();
+					// can't get java proposals w/out a compilation unit
+					// or without a valid position
+					if (cu == null || -1 == fJavaPosition) {
+						return new ICompletionProposal[0];
+					}
+					collector = getProposalCollector();
+					synchronized (cu) {
+						cu.codeComplete(fJavaPosition, collector, null);
+					}
+				} catch (CoreException coreEx) {
+					// a possible Java Model Exception due to not being a Web
+					// (Java) Project
+					coreEx.printStackTrace();
+				}
+			}
+		} catch (Exception exc) {
+			exc.printStackTrace();
+			// throw out exceptions on code assist.
+		} finally {
+			if (xmlModel != null) {
+				xmlModel.releaseFromRead();
+			}
+		}
+		ICompletionProposal[] results = new ICompletionProposal[0];
+		if (collector != null) {
+			results = collector.getJSPCompletionProposals();
+			if (results == null || results.length < 1) {
+				fErrorMessage = JsUIMessages.Java_Content_Assist_is_not_UI_;
+			}
+		}
+		return results;
+	}
+	
+	/**
+	 * Returns information about possible contexts based on the specified
+	 * location within the document that corresponds to the current cursor
+	 * position within the text viewer.
+	 * 
+	 * @param viewer
+	 *            the viewer whose document is used to compute the possible
+	 *            contexts
+	 * @param documentPosition
+	 *            an offset within the document for which context information
+	 *            should be computed
+	 * @return an array of context information objects or <code>null</code> if
+	 *         no context could be found
+	 */
+	
+	public org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(org.eclipse.jface.text.ITextViewer viewer, int documentOffset) {
+		return null;
+	}
+	
+	/**
+	 * Returns a string of characters which when pressed should automatically
+	 * display content-assist proposals.
+	 * 
+	 * @return string of characters
+	 */
+	public java.lang.String getAutoProposalInvocationCharacters() {
+		return null;
+	}
+	
+	/**
+	 * Returns a string of characters which when pressed should automatically
+	 * display a content-assist tip.
+	 * 
+	 * @return string of characters
+	 */
+	public java.lang.String getAutoTipInvocationCharacters() {
+		return null;
+	}
+	
+	/**
+	 * Returns the characters which when entered by the user should
+	 * automatically trigger the presentation of possible completions.
+	 * 
+	 * @return the auto activation characters for completion proposal or
+	 *         <code>null</code> if no auto activation is desired
+	 */
+	
+	public char[] getCompletionProposalAutoActivationCharacters() {
+		return null;
+	}
+	
+	/**
+	 * Returns the characters which when entered by the user should
+	 * automatically trigger the presentation of context information.
+	 * 
+	 * @return the auto activation characters for presenting context information
+	 *         or <code>null</code> if no auto activation is desired
+	 */
+	
+	public char[] getContextInformationAutoActivationCharacters() {
+		return null;
+	}
+	
+	/**
+	 * Returns a validator used to determine when displayed context information
+	 * should be dismissed. May only return <code>null</code> if the processor
+	 * is incapable of computing context information.
+	 * 
+	 * @return a context information validator, or <code>null</code> if the
+	 *         processor is incapable of computing context information
+	 */
+	
+	public org.eclipse.jface.text.contentassist.IContextInformationValidator getContextInformationValidator() {
+		return null;
+	}
+	
+	protected int getDocumentPosition() {
+		return fJspSourcePosition;
+	}
+	
+	
+	public String getErrorMessage() {
+		// TODO: get appropriate error message
+		// if (fCollector.getErrorMessage() != null &&
+		// fCollector.getErrorMessage().length() > 0)
+		// return fCollector.getErrorMessage();
+		return fErrorMessage;
+	}
+	
+	protected JSDTProposalCollector getProposalCollector() {
+		return fProposalCollector;
+		// return new JSPProposalCollector(translation);
+	}
+	
+	/**
+	 * Initialize the code assist processor.
+	 */
+	protected void initialize(int pos) {
+		initializeJavaPlugins();
+		fJspSourcePosition = pos;
+		fErrorMessage = null;
+	}
+	
+	/**
+	 * Initialize the Java Plugins that the JSP processor requires. See
+	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=143765 We should not call
+	 * "start", because that will cause that state to be remembered, and
+	 * re-started automatically during the next boot up sequence.
+	 * 
+	 * ISSUE: we may be able to get rid of this all together, in future, since
+	 * 99% we probably have already used some JDT class by the time we need JDT
+	 * to be active ... but ... this is the safest fix for this point in 1.5
+	 * stream. Next release, let's just remove this, re-discover what ever bug
+	 * this was fixing (if any) and if there is one, then we'll either put back
+	 * in, as is, or come up with a more appropriate fix.
+	 * 
+	 */
+	protected void initializeJavaPlugins() {
+		try {
+			Bundle bundle = Platform.getBundle(JSDTContentAssistantProcessor.JSDT_CORE_PLUGIN_ID);
+			bundle.loadClass("dummyClassNameThatShouldNeverExist"); //$NON-NLS-1$
+		} catch (ClassNotFoundException e) {
+			// this is the expected result, we just want to
+			// nudge the bundle to be sure its activated.
+		}
+	}
+	
+	public void setProposalCollector(JSDTProposalCollector translation) {
+		this.fProposalCollector = translation;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContetAssistInvocationContext.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContetAssistInvocationContext.java
new file mode 100644
index 0000000..dcd07a8
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContetAssistInvocationContext.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.wst.jsdt.ui.text.java.JavaContentAssistInvocationContext;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JSDTContetAssistInvocationContext extends JavaContentAssistInvocationContext {
+	public static JSDTContetAssistInvocationContext getInstance(ITextViewer viewer, int offset, JSDTProposalCollector theCollector) {
+		JSDTContetAssistInvocationContext.getJSPTranslation(viewer);
+		return new JSDTContetAssistInvocationContext(viewer, offset, theCollector);
+	}
+	
+	private static IJsTranslation getJSPTranslation(ITextViewer viewer) {
+		IJsTranslation fTranslation = null;
+		
+		IDOMModel xmlModel = null;
+		try {
+			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
+			IDOMDocument xmlDoc = xmlModel.getDocument();
+			JsTranslationAdapter fTranslationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+			if (fTranslationAdapter != null) {
+				fTranslation = fTranslationAdapter.getJsTranslation(true);
+			}
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} finally {
+			if (xmlModel != null) {
+				xmlModel.releaseFromRead();
+			}
+		}
+		return fTranslation;
+	}
+	ITextViewer viewer;
+	
+	private JSDTContetAssistInvocationContext(ITextViewer viewer, int offset, JSDTProposalCollector theCollector) {
+		super(viewer, offset, null);
+		this.viewer = viewer;
+		// this.offset=getJSPTranslation().getJavaOffset(offset);
+		// CompletionProposalCollector theCollector = getProposalCollector();
+		super.setCollector(theCollector);
+	}
+	
+// public IDocument getDocument() {
+// return
+// ((JSPTranslationExtension)getJSPTranslation(viewer)).getJavaDocument();
+//      
+// }
+// protected CompletionProposalCollector getProposalCollector() {
+//       
+// return ((CompletionProposalCollector) ( new JSPProposalCollector(
+// getJSPTranslation()) ));
+// }
+	
+	public IDocument getDocument() {
+		return viewer.getDocument();
+	}
+// public IJavaScriptUnit getCompilationUnit() {
+// return getJSPTranslation(viewer).getCompilationUnit();
+// }
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java
new file mode 100644
index 0000000..21727a6
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
+import java.util.ArrayList;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JSDTHtmlCompletionProcessor {
+	
+	public JSDTHtmlCompletionProcessor() {}
+	
+	
+	
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
+		/* add </script if necisary */
+		ArrayList allProposals = new ArrayList();
+		getJSPTranslation(viewer);
+		
+		return (ICompletionProposal[])allProposals.toArray(new ICompletionProposal[allProposals.size()]);
+	}
+	
+	public ICompletionProposal getEndScriptProposal(ITextViewer viewer, int offset) {
+		/* add </script if necisary */
+	
+		IJsTranslation tran = getJSPTranslation(viewer);
+		if(tran==null) return null;
+		
+		int missingAtOffset = tran.getMissingTagStart();
+		
+		if(offset>=missingAtOffset&& missingAtOffset>-1) {
+			
+			String allText = viewer.getDocument().get();
+			String text = "</script>"; //$NON-NLS-1$
+			
+			int startInTag = -1;
+			
+			for(int i=0;i<text.length() && allText.length()>offset-1;i++) {
+				if(allText.charAt(offset-1)==text.charAt(i)) {
+					startInTag = i;
+					break;
+				}
+			}
+			
+			if(startInTag==-1 ) {
+				String displayText = Messages.getString("JSDTHtmlCompletionProcessor.1"); //$NON-NLS-1$
+				return new CustomCompletionProposal("\n" + text + "\n" ,offset,0,offset,null,displayText,null,Messages.getString("JSDTHtmlCompletionProcessor.4"),100); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			}
+			
+			String text1 = allText.substring(offset - startInTag - 1, offset).toLowerCase();
+			String text2 = text.substring(0, startInTag+1).toLowerCase();
+			if(startInTag>-1  && text2.compareTo(text1)==0 ) {
+				String displayText = Messages.getString("JSDTHtmlCompletionProcessor.5"); //$NON-NLS-1$
+				return new CustomCompletionProposal(text  ,offset-startInTag-1,0,text.length(),null,displayText,null,Messages.getString("JSDTHtmlCompletionProcessor.6"),100); //$NON-NLS-1$
+			}
+			
+		}
+		
+		return null;
+	}
+	private IJsTranslation getJSPTranslation(ITextViewer viewer) {
+		IDOMModel xmlModel = null;
+		try {
+			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
+			IDOMDocument xmlDoc = xmlModel.getDocument();
+			
+			JsTranslationAdapter fTranslationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+			
+			if (fTranslationAdapter != null) {
+				return fTranslationAdapter.getJsTranslation(true);
+			}
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} finally {
+			if (xmlModel != null) {
+				xmlModel.releaseFromRead();
+			}
+		}
+		return null;
+	}
+	
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java
new file mode 100644
index 0000000..c59550d
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java
@@ -0,0 +1,222 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.jsdt.core.CompletionProposal;
+import org.eclipse.wst.jsdt.core.Signature;
+import org.eclipse.wst.jsdt.ui.text.java.CompletionProposalCollector;
+import org.eclipse.wst.jsdt.ui.text.java.CompletionProposalComparator;
+import org.eclipse.wst.jsdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JSDTProposalCollector extends CompletionProposalCollector {
+	static char[] getTypeTriggers() {
+		return CompletionProposalCollector.TYPE_TRIGGERS;
+	}
+	private Comparator fComparator;
+	private IJsTranslation fTranslation;
+	
+// public List getGeneratedFunctionNames(){
+// if(fGeneratedFunctionNames==null){
+// fGeneratedFunctionNames = fTranslation.getGeneratedFunctionNames();
+// }
+// return fGeneratedFunctionNames;
+// }
+	public JSDTProposalCollector(IJsTranslation translation) {
+		super(translation!=null?translation.getCompilationUnit():null);
+		if (translation == null) {
+			throw new IllegalArgumentException("JSPTranslation cannot be null"); //$NON-NLS-1$
+		}
+		fTranslation = translation;
+	}
+	
+	/**
+	 * Cacluates the where the cursor should be after applying this proposal.
+	 * eg. method(|) if the method proposal chosen had params.
+	 * 
+	 * @param proposal
+	 * @param completion
+	 * @return
+	 */
+	private int calculatePositionAfter(CompletionProposal proposal, String completion) {
+		int positionAfter = completion.length();
+		int kind = proposal.getKind();
+		// may need better logic here...
+		// put cursor inside parenthesis if there's params
+		// only checking for any kind of declaration
+		if (kind == CompletionProposal.ANONYMOUS_CLASS_DECLARATION || kind == CompletionProposal.METHOD_DECLARATION || kind == CompletionProposal.POTENTIAL_METHOD_DECLARATION || kind == CompletionProposal.METHOD_REF) {
+			int paramCount = Signature.getParameterCount(proposal.getSignature());
+			if (completion.length() > 0 && paramCount > 0) {
+				positionAfter--;
+			}
+		}
+		return positionAfter;
+	}
+	
+	/**
+	 * Overridden to: - translate Java -> JSP offsets - fix
+	 * cursor-position-after - fix mangled servlet name in display string -
+	 * remove unwanted proposals (servlet constructor)
+	 */
+	
+	protected IJavaCompletionProposal createJavaCompletionProposal(CompletionProposal proposal) {
+		JSDTCompletionProposal jspProposal = null;
+		// ignore constructor proposals (they're not relevant for our JSP
+		// proposal list)
+		if (!proposal.isConstructor()) {
+// if (proposal.getKind() == CompletionProposal.TYPE_REF) {
+// String signature = String.valueOf(proposal
+// .getDeclarationSignature());
+// String completion = String.valueOf(proposal.getCompletion());
+// if (completion.indexOf(signature) != -1) {
+// jspProposal = createAutoImportProposal(proposal);
+// }
+// }
+			// default behavior
+// if (jspProposal == null) {
+// for(int i = 0;i<getGeneratedFunctionNames().size();i++){
+// if((new
+// String(proposal.getName())).equalsIgnoreCase((String)getGeneratedFunctionNames().get(i)))
+// return jspProposal;
+// }
+			jspProposal = createJspProposal(proposal);
+			// }
+		}
+		return jspProposal;
+	}
+	
+// private JSPCompletionProposal createAutoImportProposal(
+// CompletionProposal proposal) {
+//
+// JSPCompletionProposal jspProposal = null;
+//
+// String signature = new String(proposal.getDeclarationSignature());
+// String completion = new String(proposal.getCompletion());
+//
+// // it's fully qualified so we should
+// // add an import statement
+// // create an autoimport proposal
+// String newCompletion = completion.replaceAll(signature + ".", "");
+// //$NON-NLS-1$ //$NON-NLS-2$
+//
+// // java offset
+// int offset = proposal.getReplaceStart();
+// // replacement length
+// int length = proposal.getReplaceEnd() - offset;
+// // translate offset from Java > JSP
+// offset = fTranslation.getJspOffset(offset);
+// // cursor position after must be calculated
+// int positionAfter = calculatePositionAfter(proposal, newCompletion,
+// offset);
+//
+// // from java proposal
+// IJavaCompletionProposal javaProposal = super
+// .createJavaCompletionProposal(proposal);
+// proposal.getDeclarationSignature();
+// Image image = javaProposal.getImage();
+// String displayString = javaProposal.getDisplayString();
+// displayString = getTranslation().fixupMangledName(displayString);
+// IContextInformation contextInformation = javaProposal
+// .getContextInformation();
+// // don't do this, it's slow
+// // String additionalInfo = javaProposal.getAdditionalProposalInfo();
+// int relevance = javaProposal.getRelevance();
+//
+// boolean updateLengthOnValidate = true;
+//
+// jspProposal = new AutoImportProposal(completion, newCompletion, offset,
+// length, positionAfter, image, displayString,
+// contextInformation, null, relevance, updateLengthOnValidate);
+//
+// // https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
+// // set wrapped java proposal so additional info can be calculated on
+// // demand
+// jspProposal.setJavaCompletionProposal(javaProposal);
+//
+// return jspProposal;
+// }
+	private JSDTCompletionProposal createJspProposal(CompletionProposal proposal) {
+		JSDTCompletionProposal jspProposal;
+		String completion = String.valueOf(proposal.getCompletion());
+		// java offset
+		int offset = proposal.getReplaceStart();
+		// replacement length
+		int length = proposal.getReplaceEnd() - offset;
+		// translate offset from Java > JSP
+		// cursor position after must be calculated
+		int positionAfter = calculatePositionAfter(proposal, completion);
+		// from java proposal
+		IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
+		proposal.getDeclarationSignature();
+		Image image = javaProposal.getImage();
+		String displayString = javaProposal.getDisplayString();
+		displayString = getTranslation().fixupMangledName(displayString);
+// for(int i = 0;i<getGeneratedFunctionNames().size();i++){
+// displayString.replace((String)getGeneratedFunctionNames().get(i), "");
+// }
+		IContextInformation contextInformation = javaProposal.getContextInformation();
+		// String additionalInfo = javaProposal.getAdditionalProposalInfo();
+		int relevance = javaProposal.getRelevance();
+		boolean updateLengthOnValidate = true;
+		jspProposal = new JSDTCompletionProposal(completion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
+		// set wrapped java proposal so additional info can be calculated on
+		// demand
+		jspProposal.setJavaCompletionProposal(javaProposal);
+		return jspProposal;
+	}
+	
+	private Comparator getComparator() {
+		if (fComparator == null) {
+			fComparator = new CompletionProposalComparator();
+		}
+		return fComparator;
+	}
+	
+	/**
+	 * Ensures that we only return JSPCompletionProposals.
+	 * 
+	 * @return an array of JSPCompletionProposals
+	 */
+	public JSDTCompletionProposal[] getJSPCompletionProposals() {
+		List results = new ArrayList();
+		IJavaCompletionProposal[] javaProposals = getJavaCompletionProposals();
+		// need to filter out non JSPCompletionProposals
+		// because their offsets haven't been translated
+		for (int i = 0; i < javaProposals.length; i++) {
+			if (javaProposals[i] instanceof JSDTCompletionProposal) {
+				results.add(javaProposals[i]);
+			}
+		}
+		Collections.sort(results, getComparator());
+		return (JSDTCompletionProposal[]) results.toArray(new JSDTCompletionProposal[results.size()]);
+	}
+	
+	public IJsTranslation getTranslation() {
+		return fTranslation;
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTTemplateAssistProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTTemplateAssistProcessor.java
new file mode 100644
index 0000000..1f98178
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTTemplateAssistProcessor.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.jsdt.internal.ui.text.java.TemplateCompletionProposalComputer;
+import org.eclipse.wst.jsdt.ui.text.java.JavaContentAssistInvocationContext;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JSDTTemplateAssistProcessor {
+	TemplateCompletionProposalComputer fJavaTemplateCompletion;
+	JSDTProposalCollector fProposalCollector;
+	JsTranslationAdapter fTranslationAdapter;
+	IProgressMonitor monitor;
+	
+	public JSDTTemplateAssistProcessor() {
+		monitor = new NullProgressMonitor();
+	}
+	
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
+		JavaContentAssistInvocationContext context = getInvocationContext(viewer, offset);
+		List props = getTemplateCompletionProposalComputer().computeCompletionProposals(context, monitor);
+		return (ICompletionProposal[]) props.toArray(new ICompletionProposal[] {});
+	}
+	
+	private JavaContentAssistInvocationContext getInvocationContext(ITextViewer viewer, int offset) {
+		return JSDTContetAssistInvocationContext.getInstance(viewer, offset, getProposalCollector());
+	}
+	
+	protected JSDTProposalCollector getProposalCollector() {
+		return fProposalCollector;
+		// return new JSPProposalCollector(translation);
+	}
+	
+	private TemplateCompletionProposalComputer getTemplateCompletionProposalComputer() {
+		if (fJavaTemplateCompletion == null) {
+			fJavaTemplateCompletion = new TemplateCompletionProposalComputer();
+		}
+		return fJavaTemplateCompletion;
+	}
+	
+	public void setProposalCollector(JSDTProposalCollector translation) {
+		this.fProposalCollector = translation;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/Messages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/Messages.java
new file mode 100644
index 0000000..d59e216
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/Messages.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class Messages {
+	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.ui.internal.contentassist.messages"; //$NON-NLS-1$
+
+	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+	private Messages() {
+	}
+
+	public static String getString(String key) {
+		try {
+			return RESOURCE_BUNDLE.getString(key);
+		}
+		catch (MissingResourceException e) {
+			return '!' + key + '!';
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/messages.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/messages.properties
new file mode 100644
index 0000000..fbdf808
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/messages.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+JSDTHtmlCompletionProcessor.1=<> end with </script>
+JSDTHtmlCompletionProcessor.4=Close the script tag.
+JSDTHtmlCompletionProcessor.5=<> end with </script>
+JSDTHtmlCompletionProcessor.6=Close the script tag.
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/derived/SingleCharReader.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/derived/SingleCharReader.java
new file mode 100644
index 0000000..e893d44
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/derived/SingleCharReader.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.derived;
+
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public abstract class SingleCharReader extends Reader {
+	/**
+	 * Gets the content as a String
+	 */
+	public String getString() throws IOException {
+		StringBuffer buf = new StringBuffer();
+		int ch;
+		while ((ch = read()) != -1) {
+			buf.append((char) ch);
+		}
+		return buf.toString();
+	}
+	
+	/**
+	 * @see Reader#read()
+	 */
+	
+	public abstract int read() throws IOException;
+	
+	/**
+	 * @see Reader#read(char[],int,int)
+	 */
+	
+	public int read(char cbuf[], int off, int len) throws IOException {
+		int end = off + len;
+		for (int i = off; i < end; i++) {
+			int ch = read();
+			if (ch == -1) {
+				if (i == off) {
+					return -1;
+				}
+				return i - off;
+			}
+			cbuf[i] = (char) ch;
+		}
+		return len;
+	}
+	
+	/**
+	 * @see Reader#ready()
+	 */
+	
+	public boolean ready() throws IOException {
+		return true;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/ActionContributorJSP.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/ActionContributorJSP.java
new file mode 100644
index 0000000..7a9f5d9
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/ActionContributorJSP.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.editor;
+
+import java.util.ResourceBundle;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.RetargetTextEditorAction;
+import org.eclipse.wst.html.ui.internal.edit.ui.ActionContributorHTML;
+import org.eclipse.wst.jsdt.ui.actions.RefactorActionGroup;
+import org.eclipse.wst.jsdt.web.ui.internal.IActionConstantsJs;
+import org.eclipse.wst.jsdt.web.ui.internal.IActionDefinitionIdsJs;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class ActionContributorJSP extends ActionContributorHTML {
+	private static final String[] EDITOR_IDS = { "org.eclipse.wst.html.core.htmlsource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor" }; //$NON-NLS-1$ //$NON-NLS-2$
+	private RetargetTextEditorAction moveElementAction = null;
+	private IMenuManager refactorMenu = null;
+	private RetargetTextEditorAction renameElementAction = null;
+	
+	public ActionContributorJSP() {
+		super();
+		ResourceBundle bundle = JsUIMessages.getResourceBundle();
+		this.renameElementAction = new RetargetTextEditorAction(bundle, IActionConstantsJs.ACTION_NAME_RENAME_ELEMENT + StructuredTextEditorActionConstants.UNDERSCORE);
+		this.renameElementAction.setActionDefinitionId(IActionDefinitionIdsJs.RENAME_ELEMENT);
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(this.renameElementAction, IHelpContextIds.JSP_REFACTORRENAME_HELPID);
+		this.moveElementAction = new RetargetTextEditorAction(bundle, IActionConstantsJs.ACTION_NAME_MOVE_ELEMENT + StructuredTextEditorActionConstants.UNDERSCORE);
+		this.moveElementAction.setActionDefinitionId(IActionDefinitionIdsJs.MOVE_ELEMENT);
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(this.moveElementAction, IHelpContextIds.JSP_REFACTORMOVE_HELPID);
+		// the refactor menu, add the menu itself to add all refactor actions
+		this.refactorMenu = new MenuManager(JsUIMessages.ActionContributorJSP_0, RefactorActionGroup.MENU_ID);
+		refactorMenu.add(this.renameElementAction);
+		refactorMenu.add(this.moveElementAction);
+	}
+	
+	
+	protected void addToMenu(IMenuManager menu) {
+		super.addToMenu(menu);
+		menu.insertAfter(IWorkbenchActionConstants.M_EDIT, this.refactorMenu);
+	}
+	
+	
+	protected String[] getExtensionIDs() {
+		return ActionContributorJSP.EDITOR_IDS;
+	}
+	
+	
+	public void setActiveEditor(IEditorPart activeEditor) {
+		super.setActiveEditor(activeEditor);
+		this.renameElementAction.setAction(getAction(getTextEditor(getActiveEditorPart()), IActionConstantsJs.ACTION_NAME_RENAME_ELEMENT));
+		this.moveElementAction.setAction(getAction(getTextEditor(getActiveEditorPart()), IActionConstantsJs.ACTION_NAME_MOVE_ELEMENT));
+	}
+	
+	
+	public void setViewerSpecificContributionsEnabled(boolean enabled) {
+		super.setViewerSpecificContributionsEnabled(enabled);
+		this.renameElementAction.setEnabled(enabled);
+		this.moveElementAction.setEnabled(enabled);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/IHelpContextIds.java
new file mode 100644
index 0000000..c4418fb
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/IHelpContextIds.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.editor;
+
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIPlugin;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public interface IHelpContextIds {
+	// JSP Fragment Property Page
+	public static final String JSP_FRAGMENT_HELPID = IHelpContextIds.PREFIX + "jspf1000"; //$NON-NLS-1$
+	// // figured out on the fly
+	// // JSP Source page editor
+	// public static final String JSP_SOURCEVIEW_HELPID =
+	// ContentTypeIdForJSP.ContentTypeID_JSP +"_source_HelpId"; //$NON-NLS-1$
+	// JSP New File Wizard - Template Page
+	public static final String JSP_NEWWIZARD_TEMPLATE_HELPID = IHelpContextIds.PREFIX + "jspw0010"; //$NON-NLS-1$
+	// JSP Files Preference page
+	public static final String JSP_PREFWEBX_FILES_HELPID = IHelpContextIds.PREFIX + "webx0050"; //$NON-NLS-1$
+	// JSP Styles Preference page
+	public static final String JSP_PREFWEBX_STYLES_HELPID = IHelpContextIds.PREFIX + "webx0051"; //$NON-NLS-1$
+	// JSP Templates Preference page
+	public static final String JSP_PREFWEBX_TEMPLATES_HELPID = IHelpContextIds.PREFIX + "webx0052"; //$NON-NLS-1$
+	// Refactor Move
+	public static final String JSP_REFACTORMOVE_HELPID = IHelpContextIds.PREFIX + "jspr0020"; //$NON-NLS-1$
+	// JSP Source Editor Context Menu
+	// Refactor Rename
+	public static final String JSP_REFACTORRENAME_HELPID = IHelpContextIds.PREFIX + "jspr0010"; //$NON-NLS-1$
+	// org.eclipse.wst.jsdt.web.ui.
+	public static final String PREFIX = JsUIPlugin.ID + "."; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java
new file mode 100644
index 0000000..6ff69e0
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java
@@ -0,0 +1,247 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.format;
+
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentPartitioningListener;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.TypedPosition;
+import org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy;
+import org.eclipse.jface.text.formatter.FormattingContextProperties;
+import org.eclipse.jface.text.formatter.IFormattingContext;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.core.formatter.CodeFormatter;
+import org.eclipse.wst.jsdt.internal.corext.util.CodeFormatterUtil;
+import org.eclipse.wst.jsdt.internal.formatter.DefaultCodeFormatter;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslator;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class FormattingStrategyJSDT extends ContextBasedFormattingStrategy {
+	private static final String XML_COMMENT_START = "<!--"; //$NON-NLS-1$
+	private static final String XML_COMMENT_END = "//-->"; //$NON-NLS-1$
+	
+	/** matches on <!-- at beginning of script region */
+	private static final Pattern START_PATTERN = Pattern.compile("(\\A(\\s*<!--))");
+	
+	/** matches on //--> or --> at end of script region */
+	private static final Pattern END_PATTERN = Pattern.compile("(((//\\s*)?-->\\s*)\\z)");
+	
+	private static final int regionStartIndentLevel = 1;
+	/** Documents to be formatted by this strategy */
+	private final LinkedList fDocuments = new LinkedList();
+	/** Partitions to be formatted by this strategy */
+	private final LinkedList fPartitions = new LinkedList();
+	private int startIndentLevel;
+	
+	/**
+	 * Creates a new java formatting strategy.
+	 */
+	public FormattingStrategyJSDT() {
+		super();
+	}
+	
+	class ModelIrritant implements IDocumentPartitioningListener {
+		public ModelIrritant(IDocument attachedDoc) {}
+		
+		public void documentPartitioningChanged(IDocument document) {
+			document.removeDocumentPartitioningListener(this);
+			if (document instanceof BasicStructuredDocument) {
+				try {
+					((BasicStructuredDocument) document).replace(0, document.getLength(), document.get());
+				} catch (BadLocationException ex) {
+					// TODO Auto-generated catch block
+					ex.printStackTrace();
+				}
+			}
+		}
+	}
+	
+	/*
+	 * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#format()
+	 */
+	
+	public void format() {
+		super.format();
+		final IStructuredDocument document = (IStructuredDocument) fDocuments.removeFirst();
+		final TypedPosition partition = (TypedPosition) fPartitions.removeFirst();
+		if (document != null) {
+			String lineDelim = TextUtilities.getDefaultLineDelimiter(document);
+			try {
+				//get the JS text from the document (not translated)
+				String jsTextNotTranslated = document.get(partition.getOffset(), partition.getLength());
+				
+				//deal with getting the JS text and unwrapping it from any <!-- //--> statements
+				String preText = "";
+				String postText = lineDelim;
+
+				//find start comment tag
+				Matcher matcher = START_PATTERN.matcher(jsTextNotTranslated);
+				if(matcher.find()) {
+					jsTextNotTranslated = matcher.replaceAll("");
+					preText = lineDelim + XML_COMMENT_START;
+				}
+				
+				//find end tag
+				matcher = END_PATTERN.matcher(jsTextNotTranslated);
+				if(matcher.find()) {
+					jsTextNotTranslated = matcher.replaceAll("");
+					postText = lineDelim + XML_COMMENT_END + lineDelim;
+				}
+				
+				//replace the text in the document with the none-translated JS text but without HTML leading and trailing comments
+				TextEdit replaceEdit = new ReplaceEdit(partition.getOffset(), partition.getLength(), jsTextNotTranslated);
+				replaceEdit.apply(document);
+				int jsRegionLength = jsTextNotTranslated.length();
+				
+				//translate the updated document
+				IJsTranslation translation = getTranslation(document);
+				String jsTextTranslated = translation.getJsText();
+				
+				//format the text translated text
+				TextEdit edit = CodeFormatterUtil.format2(CodeFormatter.K_JAVASCRIPT_UNIT, jsTextTranslated, partition.getOffset(), jsRegionLength, startIndentLevel, lineDelim, getPreferences());
+				IDocument jsDoc = new Document(jsTextTranslated);
+				
+				//Undo the text replacements done by the translator so that it could build a CU for the JS region
+				if(translation instanceof JsTranslation) {
+					IJsTranslator translator = ((JsTranslation)translation).getTranslator();
+					
+					if(translator instanceof JsTranslator) {
+						Region[] regions = ((JsTranslator)translator).getGeneratedRanges();
+						//for each generated range, replace it with the original text
+						for(int r = 0; r < regions.length; ++r) {
+							jsDoc.replace(regions[r].getOffset(), regions[r].getLength(),
+									document.get(regions[r].getOffset(), regions[r].getLength()));
+						}
+					}
+				}
+				
+				/* error formating the code so abort */
+				if(edit==null) return;
+				edit.apply(jsDoc);
+				String replaceText = lineDelim + getIndentationString(getPreferences(), startIndentLevel) + (jsDoc.get(edit.getOffset(), edit.getLength())).trim();
+				
+				//apply edit to html doc using the formated translated text and the possible leading and trailing html comments
+				replaceText = preText + replaceText + postText;
+				replaceEdit = new ReplaceEdit(partition.getOffset(), jsRegionLength, replaceText);
+				replaceEdit.apply(document);
+			} catch (BadLocationException e) {
+			}
+		}
+	}
+	
+	/*
+	 * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStarts(org.eclipse.jface.text.formatter.IFormattingContext)
+	 */
+	
+	public void formatterStarts(final IFormattingContext context) {
+		fPartitions.addLast(context.getProperty(FormattingContextProperties.CONTEXT_PARTITION));
+		fDocuments.addLast(context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM));
+		startIndentLevel = FormattingStrategyJSDT.regionStartIndentLevel + 0;
+		Map projectOptions = (Map) context.getProperty(FormattingContextProperties.CONTEXT_PREFERENCES);
+		if (projectOptions == null) {
+			IDocument doc = (IDocument) context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM);
+			context.setProperty(FormattingContextProperties.CONTEXT_PREFERENCES, getProjectOptions(doc));
+		}
+		super.formatterStarts(context);
+	}
+	
+	/*
+	 * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStops()
+	 */
+	
+	public void formatterStops() {
+		super.formatterStops();
+		fPartitions.clear();
+		fDocuments.clear();
+		startIndentLevel = 0;
+	}
+	
+	public String getIndentationString(Map options, int indentationLevel) {
+		DefaultCodeFormatter formatter = new DefaultCodeFormatter(options);
+		return formatter.createIndentationString(indentationLevel);
+	}
+	
+	private Map getProjectOptions(IDocument baseDocument) {
+		IJavaScriptProject javaProject = null;
+		IDOMModel xmlModel = null;
+		Map options = null;
+		try {
+			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(baseDocument);
+			String baseLocation = xmlModel.getBaseLocation();
+			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+			IPath filePath = new Path(baseLocation);
+			IProject project = null;
+			if (filePath.segmentCount() > 0) {
+				project = root.getProject(filePath.segment(0));
+			}
+			if (project != null) {
+				javaProject = JavaScriptCore.create(project);
+			}
+		} finally {
+			if (xmlModel != null) {
+				xmlModel.releaseFromRead();
+			}
+		}
+		if (javaProject != null) {
+			options = javaProject.getOptions(true);
+		}
+		return options;
+	}
+	
+	public IJsTranslation getTranslation(IStructuredDocument document) {
+		IJsTranslation tran = null;
+		IDOMModel xmlModel = null;
+		try {
+			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(document);
+			IDOMDocument xmlDoc = xmlModel.getDocument();
+			JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+			if (translationAdapter != null) {
+				tran = translationAdapter.getJsTranslation(true);
+			}
+		} finally {
+			if (xmlModel != null) {
+				xmlModel.releaseFromRead();
+			}
+		}
+		return tran;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileEditorInput.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileEditorInput.java
new file mode 100644
index 0000000..018c424
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileEditorInput.java
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPathEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.editors.text.ILocationProvider;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+class ExternalFileEditorInput implements IEditorInput, ILocationProvider {
+	// copies of this class exist in:
+	// org.eclipse.wst.xml.ui.internal.hyperlink
+	// org.eclipse.wst.html.ui.internal.hyperlink
+	// org.eclipse.wst.jsdt.web.ui.internal.hyperlink
+	/**
+	 * The workbench adapter which simply provides the label.
+	 * 
+	 * @see Eclipse 3.1
+	 */
+	private class WorkbenchAdapter implements IWorkbenchAdapter {
+		/*
+		 * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
+		 */
+		public Object[] getChildren(Object o) {
+			return null;
+		}
+		
+		/*
+		 * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
+		 */
+		public ImageDescriptor getImageDescriptor(Object object) {
+			return null;
+		}
+		
+		/*
+		 * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
+		 */
+		public String getLabel(Object o) {
+			return ((ExternalFileEditorInput) o).getName();
+		}
+		
+		/*
+		 * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
+		 */
+		public Object getParent(Object o) {
+			return null;
+		}
+	}
+	private File fFile;
+	private WorkbenchAdapter fWorkbenchAdapter = new WorkbenchAdapter();
+	
+	public ExternalFileEditorInput(File file) {
+		super();
+		fFile = file;
+		fWorkbenchAdapter = new WorkbenchAdapter();
+	}
+	
+	/*
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	
+	public boolean equals(Object o) {
+		if (o == this) {
+			return true;
+		}
+		if (o instanceof ExternalFileEditorInput) {
+			ExternalFileEditorInput input = (ExternalFileEditorInput) o;
+			return fFile.equals(input.fFile);
+		}
+		if (o instanceof IPathEditorInput) {
+			IPathEditorInput input = (IPathEditorInput) o;
+			return getPath().equals(input.getPath());
+		}
+		return false;
+	}
+	
+	/*
+	 * @see org.eclipse.ui.IEditorInput#exists()
+	 */
+	public boolean exists() {
+		return fFile.exists();
+	}
+	
+	/*
+	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+	 */
+	public Object getAdapter(Class adapter) {
+		if (ILocationProvider.class.equals(adapter)) {
+			return this;
+		}
+		if (IWorkbenchAdapter.class.equals(adapter)) {
+			return fWorkbenchAdapter;
+		}
+		return Platform.getAdapterManager().getAdapter(this, adapter);
+	}
+	
+	/*
+	 * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+	 */
+	public ImageDescriptor getImageDescriptor() {
+		return null;
+	}
+	
+	/*
+	 * @see org.eclipse.ui.IEditorInput#getName()
+	 */
+	public String getName() {
+		return fFile.getName();
+	}
+	
+	/*
+	 * @see org.eclipse.ui.IPathEditorInput#getPath()
+	 * @since 3.1
+	 */
+	public IPath getPath() {
+		return Path.fromOSString(fFile.getAbsolutePath());
+	}
+	
+	/*
+	 * @see org.eclipse.ui.editors.text.ILocationProvider#getPath(java.lang.Object)
+	 */
+	public IPath getPath(Object element) {
+		if (element instanceof ExternalFileEditorInput) {
+			ExternalFileEditorInput input = (ExternalFileEditorInput) element;
+			return Path.fromOSString(input.fFile.getAbsolutePath());
+		}
+		return null;
+	}
+	
+	/*
+	 * @see org.eclipse.ui.IEditorInput#getPersistable()
+	 */
+	public IPersistableElement getPersistable() {
+		return null;
+	}
+	
+	/*
+	 * @see org.eclipse.ui.IEditorInput#getToolTipText()
+	 */
+	public String getToolTipText() {
+		return fFile.getAbsolutePath();
+	}
+	
+	/*
+	 * @see java.lang.Object#hashCode()
+	 */
+	
+	public int hashCode() {
+		return fFile.hashCode();
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java
new file mode 100644
index 0000000..d8905ef
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
+
+import java.io.File;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+class ExternalFileHyperlink implements IHyperlink {
+	// copies of this class exist in:
+	// org.eclipse.wst.xml.ui.internal.hyperlink
+	// org.eclipse.wst.html.ui.internal.hyperlink
+	// org.eclipse.wst.jsdt.web.ui.internal.hyperlink
+	private File fHyperlinkFile;
+	private IRegion fHyperlinkRegion;
+	
+	public ExternalFileHyperlink(IRegion region, File file) {
+		fHyperlinkFile = file;
+		fHyperlinkRegion = region;
+	}
+	
+	public IRegion getHyperlinkRegion() {
+		return fHyperlinkRegion;
+	}
+	
+	public String getHyperlinkText() {
+		String path = fHyperlinkFile.getPath();
+		if (path.length() > 60) {
+			path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+		}
+		return NLS.bind(HTMLUIMessages.Open, path);
+	}
+	
+	public String getTypeLabel() {
+		return null;
+	}
+	
+	public void open() {
+		if (fHyperlinkFile != null) {
+			IEditorInput input = new ExternalFileEditorInput(fHyperlinkFile);
+			IEditorDescriptor descriptor;
+			try {
+				descriptor = IDE.getEditorDescriptor(input.getName(), true);
+				if (descriptor != null) {
+					IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+					IDE.openEditor(page, input, descriptor.getId(), true);
+				}
+			} catch (PartInitException e) {
+				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java
new file mode 100644
index 0000000..b0c8096
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.internal.ui.actions.ActionMessages;
+import org.eclipse.wst.jsdt.ui.JavaScriptUI;
+import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+class JSDTHyperlink implements IHyperlink {
+	private IJavaScriptElement fElement;
+	private IRegion fRegion;
+	
+	public JSDTHyperlink(IRegion region, IJavaScriptElement element) {
+		fRegion = region;
+		fElement = element;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()
+	 */
+	public IRegion getHyperlinkRegion() {
+		return fRegion;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
+	 */
+	public String getHyperlinkText() {
+		return ActionMessages.OpenAction_declaration_label;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
+	 */
+	public String getTypeLabel() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
+	 */
+	public void open() {
+		try {
+			IEditorPart editor = JavaScriptUI.openInEditor(fElement);
+			if (editor != null) {
+				JavaScriptUI.revealInEditor(editor, fElement);
+			}
+		} catch (Exception e) {
+			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlinkDetector.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlinkDetector.java
new file mode 100644
index 0000000..2193098
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlinkDetector.java
@@ -0,0 +1,263 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.wst.jsdt.core.IClassFile;
+import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.ILocalVariable;
+import org.eclipse.wst.jsdt.core.ISourceRange;
+import org.eclipse.wst.jsdt.core.ISourceReference;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.internal.core.JavaElement;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JSDTHyperlinkDetector extends AbstractHyperlinkDetector {
+	private IHyperlink createHyperlink(IJavaScriptElement element, IRegion region, IDocument document) {
+		IHyperlink link = null;
+		if (region != null) {
+			// open local variable in the JSP file...
+			if (element instanceof ISourceReference) {
+				IFile file = null;
+				IPath outsidePath = null;
+				int jspOffset = 0;
+				IStructuredModel sModel = null;
+				// try to locate the file in the workspace
+				try {
+					sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+					if (sModel != null) {
+						//URIResolver resolver = sModel.getResolver();
+						//if (resolver != null) {
+						//	String uriString = resolver.getFileBaseLocation();
+						String uriString = sModel.getBaseLocation();
+							file = getFile(uriString);
+					//	}
+					}
+				} finally {
+					if (sModel != null) {
+						sModel.releaseFromRead();
+					}
+				}
+				// get Java range, translate coordinate to JSP
+				try {
+					ISourceRange range = null;
+					IJsTranslation jspTranslation = getJsTranslation(document);
+					if (jspTranslation != null) {
+						// link to local variable definitions
+						if (element instanceof ILocalVariable) {
+							range = ((ILocalVariable) element).getNameRange();
+							IJavaScriptElement unit=((ILocalVariable) element).getParent();
+							IJavaScriptUnit myUnit = jspTranslation.getCompilationUnit();
+							
+							while(!(unit instanceof IJavaScriptUnit || unit instanceof IClassFile || unit==null)) {
+								unit = ((JavaElement) unit).getParent();
+							}
+							if(unit instanceof IJavaScriptUnit) {
+								IJavaScriptUnit cu = (IJavaScriptUnit)unit;
+								if(cu!=myUnit) {
+									file = getFile(cu.getPath().toString());
+									if(file==null) {
+										outsidePath = cu.getPath();
+									}
+								}
+							}else if(unit instanceof IClassFile) {
+								IClassFile cu = (IClassFile)unit;
+								if(cu!=myUnit) {
+									file = getFile(cu.getPath().toString());
+									if(file==null) {
+										outsidePath = cu.getPath();
+									}
+								}
+							}
+							
+						}
+						// linking to fields of the same compilation unit
+						else if (element.getElementType() == IJavaScriptElement.FIELD) {
+							Object cu = ((IField) element).getJavaScriptUnit();
+							if (cu != null && cu.equals(jspTranslation.getCompilationUnit())) {
+								range = ((ISourceReference) element).getSourceRange();
+							}
+						}
+						// linking to methods of the same compilation unit
+						else if (element.getElementType() == IJavaScriptElement.METHOD) {
+							Object cu = ((IFunction) element).getJavaScriptUnit();
+							if (cu != null && cu.equals(jspTranslation.getCompilationUnit())) {
+								range = ((ISourceReference) element).getSourceRange();
+							}
+						}
+					}
+					if (range != null && file != null) {
+						jspOffset = range.getOffset();
+						if (jspOffset >= 0) {
+							link = new WorkspaceFileHyperlink(region, file, new Region(jspOffset, range.getLength()));
+						}
+					}else if (range!=null && outsidePath!=null) {
+						jspOffset = range.getOffset();
+						if (jspOffset >= 0) {
+							link = new ExternalFileHyperlink(region,outsidePath.toFile());
+						}
+					}
+				} catch (JavaScriptModelException jme) {
+					Logger.log(Logger.WARNING_DEBUG, jme.getMessage(), jme);
+				}
+			}
+			if (link == null) {
+				link = new JSDTHyperlink(region, element);
+			}
+		}
+		return link;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlinkDetector#detectHyperlinks(org.eclipse.jface.text.ITextViewer,
+	 *      org.eclipse.jface.text.IRegion, boolean)
+	 */
+	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
+		List hyperlinks = new ArrayList(0);
+		if (region != null && textViewer != null) {
+			IDocument document = textViewer.getDocument();
+			IJsTranslation jsTranslation = getJsTranslation(document);
+			if (jsTranslation != null) {
+				IJavaScriptElement[] elements = jsTranslation.getElementsFromJsRange(region.getOffset(), region.getOffset() + region.getLength());
+				if (elements != null && elements.length > 0) {
+					// create a hyperlink for each JavaScript element
+					for (int i = 0; i < elements.length; ++i) {
+						IJavaScriptElement element = elements[i];
+						// find hyperlink range for Java element
+						IRegion hyperlinkRegion = selectWord(document, region.getOffset());
+						IHyperlink link = createHyperlink(element, hyperlinkRegion, document);
+						if (link != null) {
+							hyperlinks.add(link);
+						}
+					}
+				}
+			}
+		}
+		if (hyperlinks.size() == 0) {
+			return null;
+		}
+		return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
+	}
+	
+	/**
+	 * Returns an IFile from the given uri if possible, null if cannot find file
+	 * from uri.
+	 * 
+	 * @param fileString
+	 *            file system path
+	 * @return returns IFile if fileString exists in the workspace
+	 */
+	private IFile getFile(String fileString) {
+		IFile file = null;
+		if (fileString != null) {
+			IResource resource  = ResourcesPlugin.getWorkspace().getRoot().findMember(fileString);
+			if(resource!=null && resource instanceof IFile) {
+				file = (IFile)resource;
+			}
+		}
+		return file;
+	}
+	
+	/**
+	 * Get JSP translation object
+	 * 
+	 * @return JSPTranslation if one exists, null otherwise
+	 */
+	private IJsTranslation getJsTranslation(IDocument document) {
+		IJsTranslation translation = null;
+		IDOMModel xmlModel = null;
+		try {
+			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(document);
+			if (xmlModel != null) {
+				IDOMDocument xmlDoc = xmlModel.getDocument();
+				JsTranslationAdapter adapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+				if (adapter != null) {
+					translation = adapter.getJsTranslation(true);
+				}
+			}
+		} finally {
+			if (xmlModel != null) {
+				xmlModel.releaseFromRead();
+			}
+		}
+		return translation;
+	}
+	
+	/**
+	 * Java always selects word when defining region
+	 * 
+	 * @param document
+	 * @param anchor
+	 * @return IRegion
+	 */
+	private IRegion selectWord(IDocument document, int anchor) {
+		try {
+			int offset = anchor;
+			char c;
+			while (offset >= 0) {
+				c = document.getChar(offset);
+				if (!Character.isJavaIdentifierPart(c)) {
+					break;
+				}
+				--offset;
+			}
+			int start = offset;
+			offset = anchor;
+			int length = document.getLength();
+			while (offset < length) {
+				c = document.getChar(offset);
+				if (!Character.isJavaIdentifierPart(c)) {
+					break;
+				}
+				++offset;
+			}
+			int end = offset;
+			if (start == end) {
+				return new Region(start, 0);
+			}
+			return new Region(start + 1, end - start - 1);
+		} catch (BadLocationException x) {
+			return null;
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java
new file mode 100644
index 0000000..ea48fbb
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+
+class WorkspaceFileHyperlink implements IHyperlink {
+	// copies of this class exist in:
+	// org.eclipse.wst.xml.ui.internal.hyperlink
+	// org.eclipse.wst.html.ui.internal.hyperlink
+	// org.eclipse.wst.jsdt.web.ui.internal.hyperlink
+	private IFile fFile;
+	private IRegion fHighlightRange;
+	private IRegion fRegion;
+	
+	public WorkspaceFileHyperlink(IRegion region, IFile file) {
+		fRegion = region;
+		fFile = file;
+	}
+	
+	public WorkspaceFileHyperlink(IRegion region, IFile file, IRegion range) {
+		fRegion = region;
+		fFile = file;
+		fHighlightRange = range;
+	}
+	
+	public IRegion getHyperlinkRegion() {
+		return fRegion;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
+	 */
+	public String getHyperlinkText() {
+		String path = fFile.getFullPath().toString();
+		if (path.length() > 60) {
+			path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+		}
+		return NLS.bind(HTMLUIMessages.Open, path);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
+	 */
+	public String getTypeLabel() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+	public void open() {
+		if (fFile != null && fFile.exists()) {
+			try {
+				IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+				IEditorPart editor = IDE.openEditor(page, fFile, true);
+				// highlight range in editor if possible
+				if (fHighlightRange != null && editor instanceof ITextEditor) {
+					((ITextEditor) editor).selectAndReveal(fHighlightRange.getOffset(), fHighlightRange.getLength());
+				}
+			} catch (PartInitException pie) {
+				Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/XMLHyperlinkDetector.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/XMLHyperlinkDetector.java
new file mode 100644
index 0000000..bf603d0
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/XMLHyperlinkDetector.java
@@ -0,0 +1,502 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
+
+import java.io.File;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
+import org.eclipse.jface.text.hyperlink.URLHyperlink;
+import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.w3c.dom.Attr;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+import com.ibm.icu.util.StringTokenizer;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class XMLHyperlinkDetector implements IHyperlinkDetector {
+	// copies of this class exist in:
+	// org.eclipse.wst.xml.ui.internal.hyperlink
+	// org.eclipse.wst.html.ui.internal.hyperlink
+	// org.eclipse.wst.jsdt.web.ui.internal.hyperlink
+	private final String HTTP_PROTOCOL = "http://";//$NON-NLS-1$
+	private final String NO_NAMESPACE_SCHEMA_LOCATION = "noNamespaceSchemaLocation"; //$NON-NLS-1$
+	private final String SCHEMA_LOCATION = "schemaLocation"; //$NON-NLS-1$
+	private final String XMLNS = "xmlns"; //$NON-NLS-1$
+	private final String XSI_NAMESPACE_URI = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
+	
+	/**
+	 * Create the appropriate hyperlink
+	 * 
+	 * @param uriString
+	 * @param hyperlinkRegion
+	 * @return IHyperlink
+	 */
+	private IHyperlink createHyperlink(String uriString, IRegion hyperlinkRegion, IDocument document, Node node) {
+		IHyperlink link = null;
+		if (isHttp(uriString)) {
+			link = new URLHyperlink(hyperlinkRegion, uriString);
+		} else {
+			// try to locate the file in the workspace
+			File systemFile = getFileFromUriString(uriString);
+			if (systemFile != null) {
+				String systemPath = systemFile.getPath();
+				IFile file = getFile(systemPath);
+				if (file != null) {
+					// this is a WorkspaceFileHyperlink since file exists in
+					// workspace
+					link = new WorkspaceFileHyperlink(hyperlinkRegion, file);
+				} else {
+					// this is an ExternalFileHyperlink since file does not
+					// exist in workspace
+					link = new ExternalFileHyperlink(hyperlinkRegion, systemFile);
+				}
+			}
+		}
+		return link;
+	}
+	
+	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
+		// for now, only capable of creating 1 hyperlink
+		List hyperlinks = new ArrayList(0);
+		if (region != null && textViewer != null) {
+			IDocument document = textViewer.getDocument();
+			Node currentNode = getCurrentNode(document, region.getOffset());
+			if (currentNode != null) {
+				String uriString = null;
+				if (currentNode.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
+					// doctype nodes
+					uriString = getURIString(currentNode, document);
+				} else if (currentNode.getNodeType() == Node.ELEMENT_NODE) {
+					// element nodes
+					Attr currentAttr = getCurrentAttrNode(currentNode, region.getOffset());
+					if (currentAttr != null) {
+						// try to find link for current attribute
+						// resolve attribute value
+						uriString = getURIString(currentAttr, document);
+						// verify validity of uri string
+						if (uriString == null || !isValidURI(uriString)) {
+							// reset current attribute
+							currentAttr = null;
+						}
+					}
+					if (currentAttr == null) {
+						// try to find a linkable attribute within element
+						currentAttr = getLinkableAttr((Element) currentNode);
+						if (currentAttr != null) {
+							uriString = getURIString(currentAttr, document);
+						}
+					}
+					currentNode = currentAttr;
+				}
+				// try to create hyperlink from information gathered
+				if (uriString != null && currentNode != null && isValidURI(uriString)) {
+					IRegion hyperlinkRegion = getHyperlinkRegion(currentNode);
+					IHyperlink hyperlink = createHyperlink(uriString, hyperlinkRegion, document, currentNode);
+					if (hyperlink != null) {
+						hyperlinks.add(hyperlink);
+					}
+				}
+			}
+		}
+		if (hyperlinks.size() == 0) {
+			return null;
+		}
+		return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
+	}
+	
+	/**
+	 * Get the base location from the current model (local file system)
+	 */
+	private String getBaseLocation(IDocument document) {
+		String baseLoc = null;
+		// get the base location from the current model
+		IStructuredModel sModel = null;
+		try {
+			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+			if (sModel != null) {
+				IPath location = new Path(sModel.getBaseLocation());
+				if (location.toFile().exists()) {
+					baseLoc = location.toString();
+				} else {
+					if (location.segmentCount() > 1) {
+						baseLoc = ResourcesPlugin.getWorkspace().getRoot().getFile(location).getLocation().toString();
+					} else {
+						baseLoc = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(location).toString();
+					}
+				}
+			}
+		} finally {
+			if (sModel != null) {
+				sModel.releaseFromRead();
+			}
+		}
+		return baseLoc;
+	}
+	
+	/**
+	 * Get the CMElementDeclaration for an element
+	 * 
+	 * @param element
+	 * @return CMElementDeclaration
+	 */
+	private CMElementDeclaration getCMElementDeclaration(Element element) {
+		CMElementDeclaration ed = null;
+		ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
+		if (mq != null) {
+			ed = mq.getCMElementDeclaration(element);
+		}
+		return ed;
+	}
+	
+	/**
+	 * Returns the attribute node within node at offset
+	 * 
+	 * @param node
+	 * @param offset
+	 * @return Attr
+	 */
+	private Attr getCurrentAttrNode(Node node, int offset) {
+		if ((node instanceof IndexedRegion) && ((IndexedRegion) node).contains(offset) && (node.hasAttributes())) {
+			NamedNodeMap attrs = node.getAttributes();
+			// go through each attribute in node and if attribute contains
+			// offset, return that attribute
+			for (int i = 0; i < attrs.getLength(); ++i) {
+				// assumption that if parent node is of type IndexedRegion,
+				// then its attributes will also be of type IndexedRegion
+				IndexedRegion attRegion = (IndexedRegion) attrs.item(i);
+				if (attRegion.contains(offset)) {
+					return (Attr) attrs.item(i);
+				}
+			}
+		}
+		return null;
+	}
+	
+	/**
+	 * Returns the node the cursor is currently on in the document. null if no
+	 * node is selected
+	 * 
+	 * @param offset
+	 * @return Node either element, doctype, text, or null
+	 */
+	private Node getCurrentNode(IDocument document, int offset) {
+		// get the current node at the offset (returns either: element,
+		// doctype, text)
+		IndexedRegion inode = null;
+		IStructuredModel sModel = null;
+		try {
+			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+			inode = sModel.getIndexedRegion(offset);
+			if (inode == null) {
+				inode = sModel.getIndexedRegion(offset - 1);
+			}
+		} finally {
+			if (sModel != null) {
+				sModel.releaseFromRead();
+			}
+		}
+		if (inode instanceof Node) {
+			return (Node) inode;
+		}
+		return null;
+	}
+	
+	/**
+	 * Returns an IFile from the given uri if possible, null if cannot find file
+	 * from uri.
+	 * 
+	 * @param fileString
+	 *            file system path
+	 * @return returns IFile if fileString exists in the workspace
+	 */
+	private IFile getFile(String fileString) {
+		IFile file = null;
+		if (fileString != null) {
+			IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(fileString));
+			for (int i = 0; i < files.length && file == null; i++) {
+				if (files[i].exists()) {
+					file = files[i];
+				}
+			}
+		}
+		return file;
+	}
+	
+	/**
+	 * Create a file from the given uri string
+	 * 
+	 * @param uriString -
+	 *            assumes uriString is not http://
+	 * @return File created from uriString if possible, null otherwise
+	 */
+	private File getFileFromUriString(String uriString) {
+		File file = null;
+		try {
+			// first just try to create a file directly from uriString as
+			// default in case create file from uri does not work
+			file = new File(uriString);
+			// try to create file from uri
+			URI uri = new URI(uriString);
+			file = new File(uri);
+		} catch (Exception e) {
+			// if exception is thrown while trying to create File just ignore
+			// and file will be null
+		}
+		return file;
+	}
+	
+	private IRegion getHyperlinkRegion(Node node) {
+		IRegion hyperRegion = null;
+		if (node != null) {
+			short nodeType = node.getNodeType();
+			if (nodeType == Node.DOCUMENT_TYPE_NODE) {
+				// handle doc type node
+				IDOMNode docNode = (IDOMNode) node;
+				hyperRegion = new Region(docNode.getStartOffset(), docNode.getEndOffset() - docNode.getStartOffset());
+			} else if (nodeType == Node.ATTRIBUTE_NODE) {
+				// handle attribute nodes
+				IDOMAttr att = (IDOMAttr) node;
+				// do not include quotes in attribute value region
+				int regOffset = att.getValueRegionStartOffset();
+				ITextRegion valueRegion = att.getValueRegion();
+				if (valueRegion != null) {
+					int regLength = valueRegion.getTextLength();
+					String attValue = att.getValueRegionText();
+					if (StringUtils.isQuoted(attValue)) {
+						++regOffset;
+						regLength = regLength - 2;
+					}
+					hyperRegion = new Region(regOffset, regLength);
+				}
+			}
+		}
+		return hyperRegion;
+	}
+	
+	/**
+	 * Attempts to find an attribute within element that is openable.
+	 * 
+	 * @param element -
+	 *            cannot be null
+	 * @return Attr attribute that can be used for open on, null if no attribute
+	 *         could be found
+	 */
+	private Attr getLinkableAttr(Element element) {
+		CMElementDeclaration ed = getCMElementDeclaration(element);
+		// get the list of attributes for this node
+		NamedNodeMap attrs = element.getAttributes();
+		for (int i = 0; i < attrs.getLength(); ++i) {
+			// check if this attribute is "openOn-able"
+			Attr att = (Attr) attrs.item(i);
+			if (isLinkableAttr(att, ed)) {
+				return att;
+			}
+		}
+		return null;
+	}
+	
+	/**
+	 * Find the location hint for the given namespaceURI if it exists
+	 * 
+	 * @param elementNode -
+	 *            cannot be null
+	 * @param namespaceURI -
+	 *            cannot be null
+	 * @return location hint (systemId) if it was found, null otherwise
+	 */
+	private String getLocationHint(Element elementNode, String namespaceURI) {
+		Attr schemaLocNode = elementNode.getAttributeNodeNS(XSI_NAMESPACE_URI, SCHEMA_LOCATION);
+		if (schemaLocNode != null) {
+			StringTokenizer st = new StringTokenizer(schemaLocNode.getValue());
+			while (st.hasMoreTokens()) {
+				String publicId = st.hasMoreTokens() ? st.nextToken() : null;
+				String systemId = st.hasMoreTokens() ? st.nextToken() : null;
+				// found location hint
+				if (namespaceURI.equalsIgnoreCase(publicId)) {
+					return systemId;
+				}
+			}
+		}
+		return null;
+	}
+	
+	/**
+	 * Returns the URI string
+	 * 
+	 * @param node -
+	 *            assumes not null
+	 */
+	private String getURIString(Node node, IDocument document) {
+		String resolvedURI = null;
+		// need the base location, publicId, and systemId for URIResolver
+		String baseLoc = null;
+		String publicId = null;
+		String systemId = null;
+		short nodeType = node.getNodeType();
+		// handle doc type node
+		if (nodeType == Node.DOCUMENT_TYPE_NODE) {
+			baseLoc = getBaseLocation(document);
+			publicId = ((DocumentType) node).getPublicId();
+			systemId = ((DocumentType) node).getSystemId();
+		} else if (nodeType == Node.ATTRIBUTE_NODE) {
+			// handle attribute node
+			Attr attrNode = (Attr) node;
+			String attrName = attrNode.getName();
+			String attrValue = attrNode.getValue();
+			attrValue = StringUtils.strip(attrValue);
+			if (attrValue != null && attrValue.length() > 0) {
+				baseLoc = getBaseLocation(document);
+				// handle schemaLocation attribute
+				String prefix = DOMNamespaceHelper.getPrefix(attrName);
+				String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attrName);
+				if ((XMLNS.equals(prefix)) || (XMLNS.equals(unprefixedName))) {
+					publicId = attrValue;
+					systemId = getLocationHint(attrNode.getOwnerElement(), publicId);
+					if (systemId == null) {
+						systemId = attrValue;
+					}
+				} else if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attrNode))) && (SCHEMA_LOCATION.equals(unprefixedName))) {
+					// for now just use the first pair
+					// need to look into being more precise
+					StringTokenizer st = new StringTokenizer(attrValue);
+					publicId = st.hasMoreTokens() ? st.nextToken() : null;
+					systemId = st.hasMoreTokens() ? st.nextToken() : null;
+					// else check if xmlns publicId = value
+				} else {
+					systemId = attrValue;
+				}
+			}
+		}
+		resolvedURI = resolveURI(baseLoc, publicId, systemId);
+		return resolvedURI;
+	}
+	
+	/**
+	 * Returns true if this uriString is an http string
+	 * 
+	 * @param uriString
+	 * @return true if uriString is http string, false otherwise
+	 */
+	private boolean isHttp(String uriString) {
+		boolean isHttp = false;
+		if (uriString != null) {
+			String tempString = uriString.toLowerCase();
+			if (tempString.startsWith(HTTP_PROTOCOL)) {
+				isHttp = true;
+			}
+		}
+		return isHttp;
+	}
+	
+	/**
+	 * Checks to see if the given attribute is openable. Attribute is openable
+	 * if it is a namespace declaration attribute or if the attribute value is
+	 * of type URI.
+	 * 
+	 * @param attr
+	 *            cannot be null
+	 * @param cmElement
+	 *            CMElementDeclaration associated with the attribute (can be
+	 *            null)
+	 * @return true if this attribute is "openOn-able" false otherwise
+	 */
+	private boolean isLinkableAttr(Attr attr, CMElementDeclaration cmElement) {
+		String attrName = attr.getName();
+		String prefix = DOMNamespaceHelper.getPrefix(attrName);
+		String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attrName);
+		// determine if attribute is namespace declaration
+		if ((XMLNS.equals(prefix)) || (XMLNS.equals(unprefixedName))) {
+			return true;
+		}
+		// determine if attribute contains schema location
+		if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attr))) && ((SCHEMA_LOCATION.equals(unprefixedName)) || (NO_NAMESPACE_SCHEMA_LOCATION.equals(unprefixedName)))) {
+			return true;
+		}
+		// determine if attribute value is of type URI
+		if (cmElement != null) {
+			CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) cmElement.getAttributes().getNamedItem(attrName);
+			if ((attrDecl != null) && (attrDecl.getAttrType() != null) && (CMDataType.URI.equals(attrDecl.getAttrType().getDataTypeName()))) {
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	/**
+	 * Checks whether the given uriString is really pointing to a file
+	 * 
+	 * @param uriString
+	 * @return boolean
+	 */
+	private boolean isValidURI(String uriString) {
+		boolean isValid = false;
+		if (isHttp(uriString)) {
+			isValid = true;
+		} else {
+			File file = getFileFromUriString(uriString);
+			if (file != null) {
+				isValid = file.isFile();
+			}
+		}
+		return isValid;
+	}
+	
+	/**
+	 * Resolves the given URI information
+	 * 
+	 * @param baseLocation
+	 * @param publicId
+	 * @param systemId
+	 * @return String resolved uri.
+	 */
+	private String resolveURI(String baseLocation, String publicId, String systemId) {
+		// dont resolve if there's nothing to resolve
+		if ((baseLocation == null) && (publicId == null) && (systemId == null)) {
+			return null;
+		}
+		return URIResolverPlugin.createResolver().resolve(baseLocation, publicId, systemId);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
new file mode 100644
index 0000000..e165f7d
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
@@ -0,0 +1,347 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.DocumentChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.text.edits.MalformedTreeException;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.search.SearchDocument;
+import org.eclipse.wst.jsdt.core.search.SearchMatch;
+import org.eclipse.wst.jsdt.core.search.SearchRequestor;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JSDTSearchDocumentDelegate;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+import org.eclipse.wst.sse.core.internal.document.DocumentReader;
+import org.eclipse.wst.sse.core.internal.encoding.CodedStreamCreator;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class BasicRefactorSearchRequestor extends SearchRequestor {
+	/**
+	 * Change class that wraps a text edit on the jsp document
+	 */
+	private class RenameChange extends DocumentChange {
+		private String fDescription = JsUIMessages.BasicRefactorSearchRequestor_0;
+		private TextEdit fEdit = null;
+		private IDocument fJSPDoc = null;
+		private IFile fJSPFile = null;
+		
+		public RenameChange(IFile jspFile, IDocument jspDoc, TextEdit edit, String description) {
+			super(JsUIMessages.BasicRefactorSearchRequestor_6, jspDoc);
+			this.fEdit = edit;
+			this.fJSPFile = jspFile;
+			this.fJSPDoc = jspDoc;
+			this.fDescription = description;
+		}
+		
+		
+		public Object getModifiedElement() {
+			return getElement();
+		}
+		
+		
+		public String getName() {
+			return this.fDescription;
+		}
+		
+		
+		public IDocument getPreviewDocument(IProgressMonitor pm) throws CoreException {
+			IDocument copyDoc = new Document(fJSPDoc.get());
+			try {
+				fEdit.apply(copyDoc);
+			} catch (MalformedTreeException e) {
+				// ignore
+			} catch (BadLocationException e) {
+				// ignore
+			}
+			return copyDoc;
+		}
+		
+		/**
+		 * Checks if a document is open in an editor
+		 * 
+		 * @param jspDoc
+		 * @return
+		 */
+		private boolean isOpenInEditor(IDocument jspDoc) {
+			IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+			IWorkbenchWindow w = null;
+			for (int i = 0; i < windows.length; i++) {
+				w = windows[i];
+				IWorkbenchPage page = w.getActivePage();
+				if (page != null) {
+					IEditorReference[] references = page.getEditorReferences();
+					IEditorPart editor = null;
+					Object o = null;
+					IDocument doc = null;
+					for (int j = 0; j < references.length; j++) {
+						editor = references[j].getEditor(true);
+						// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3764
+						// use adapter to get ITextEditor (for things like
+						// page designer)
+						o = editor.getAdapter(ITextEditor.class);
+						if (o != null && o instanceof ITextEditor) {
+							doc = ((ITextEditor) o).getDocumentProvider().getDocument(editor.getEditorInput());
+							if (doc != null && doc.equals(jspDoc)) {
+								return true;
+							}
+						}
+					}
+				}
+			}
+			return false;
+		}
+		
+		
+		public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
+			return new RefactoringStatus();
+		}
+		
+		
+		public Change perform(IProgressMonitor pm) throws CoreException {
+			RenameChange undoChange = null;
+			try {
+				if (!isOpenInEditor(this.fJSPDoc)) {
+					// apply edit to JSP doc AND save model
+					undoChange = new RenameChange(this.fJSPFile, this.fJSPDoc, this.fEdit.apply(fJSPDoc), this.fDescription);
+					saveFile(this.fJSPFile, this.fJSPDoc);
+				} else {
+					// just apply edit to JSP document
+					undoChange = new RenameChange(this.fJSPFile, this.fJSPDoc, this.fEdit.apply(fJSPDoc), this.fDescription);
+				}
+			} catch (MalformedTreeException e) {
+				Logger.logException(e);
+			} catch (BadLocationException e) {
+				Logger.logException(e);
+			}
+			return undoChange;
+		}
+		
+		/**
+		 * Performed in an operation since it modifies resources in the
+		 * workspace
+		 * 
+		 * @param jspDoc
+		 * @throws CoreException
+		 */
+		private void saveFile(IFile jspFile, IDocument jspDoc) {
+			SaveJspFileOp op = new SaveJspFileOp(jspFile, jspDoc);
+			try {
+				op.run(JsSearchSupport.getInstance().getProgressMonitor());
+			} catch (InvocationTargetException e) {
+				Logger.logException(e);
+			} catch (InterruptedException e) {
+				Logger.logException(e);
+			}
+		}
+	}
+	// end inner class SaveJspFileOp
+	/**
+	 * Workspace operation to perform save on model for updated documents.
+	 * Should only be done on models not open in an editor.
+	 */
+	private class SaveJspFileOp extends WorkspaceModifyOperation {
+		private IDocument fJSPDoc = null;
+		private IFile fJSPFile = null;
+		
+		public SaveJspFileOp(IFile jspFile, IDocument jspDoc) {
+			this.fJSPDoc = jspDoc;
+			this.fJSPFile = jspFile;
+		}
+		
+		
+		protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
+			// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3765
+			// save file w/ no intermediate model creation
+			CodedStreamCreator codedStreamCreator = new CodedStreamCreator();
+			Reader reader = new DocumentReader(this.fJSPDoc);
+			codedStreamCreator.set(this.fJSPFile, reader);
+			ByteArrayOutputStream codedByteStream = null;
+			InputStream codedStream = null;
+			try {
+				codedByteStream = codedStreamCreator.getCodedByteArrayOutputStream();
+				codedStream = new ByteArrayInputStream(codedByteStream.toByteArray());
+				if (this.fJSPFile.exists()) {
+					this.fJSPFile.setContents(codedStream, true, true, null);
+				} else {
+					this.fJSPFile.create(codedStream, false, null);
+				}
+			} catch (CoreException e) {
+				Logger.logException(e);
+			} catch (IOException e) {
+				Logger.logException(e);
+			} finally {
+				try {
+					if (codedByteStream != null) {
+						codedByteStream.close();
+					}
+					if (codedStream != null) {
+						codedStream.close();
+					}
+				} catch (IOException e) {
+					// unlikely
+				}
+			}
+		}
+	}
+	// end inner class RenameChange
+	/** The type being renamed (the old type) */
+	IJavaScriptElement fElement = null;
+	/** The new name of the type being renamed */
+	private String fNewName = ""; //$NON-NLS-1$
+	/** maps a JSPSearchDocument path -> MultiTextEdit for the java file */
+	private HashMap fSearchDocPath2JavaEditMap = null;
+	
+	public BasicRefactorSearchRequestor(IJavaScriptElement element, String newName) {
+		this.fNewName = newName;
+		this.fElement = element;
+		this.fSearchDocPath2JavaEditMap = new HashMap();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.wst.jsdt.core.search.SearchMatch)
+	 */
+	
+	public void acceptSearchMatch(SearchMatch javaMatch) throws CoreException {
+		String matchDocumentPath = javaMatch.getResource().getFullPath().toString();
+		SearchDocument searchDoc = JsSearchSupport.getInstance().getSearchDocument(matchDocumentPath);
+		if (searchDoc != null && searchDoc instanceof JSDTSearchDocumentDelegate) {
+			String renameText = getRenameText((JSDTSearchDocumentDelegate) searchDoc, javaMatch);
+			// add it for the correct document
+			addJavaEdit(searchDoc.getPath(), new ReplaceEdit(javaMatch.getOffset(), javaMatch.getLength(), renameText));
+		}
+	}
+	
+	/**
+	 * Adds to the multi edit for a give java document.
+	 * 
+	 * @param javaDocument
+	 * @param javaEdit
+	 */
+	private void addJavaEdit(String searchDocPath, ReplaceEdit javaEdit) {
+		Object o = this.fSearchDocPath2JavaEditMap.get(searchDocPath);
+		if (o != null) {
+			MultiTextEdit multi = (MultiTextEdit) o;
+			multi.addChild(javaEdit);
+		} else {
+			// use a multi edit so doc position offsets get updated
+			// automatically
+			// when adding multiple child edits
+			MultiTextEdit multi = new MultiTextEdit();
+			multi.addChild(javaEdit);
+			this.fSearchDocPath2JavaEditMap.put(searchDocPath, multi);
+		}
+	}
+	
+	private Change createChange(JSDTSearchDocumentDelegate searchDoc, TextEdit edit) {
+		IDocument doc = searchDoc.getJspTranslation().getHtmlDocument();
+		String file = searchDoc.getFile().getName();
+		String description = getDescription();
+		try {
+			// document lines are 0 based
+			String lineNumber = Integer.toString(doc.getLineOfOffset(edit.getOffset()) + 1);
+			description += " " + NLS.bind(JsUIMessages.BasicRefactorSearchRequestor_1, new String[] { file, lineNumber }); //$NON-NLS-1$
+		} catch (BadLocationException e) {
+			Logger.logException(e);
+		}
+		return new RenameChange(searchDoc.getFile(), doc, edit, description);
+	}
+	
+	/**
+	 * 
+	 * @return all JSP changes for the search matches for the given Type
+	 */
+	public Change[] getChanges() {
+		JsSearchSupport support = JsSearchSupport.getInstance();
+		List changes = new ArrayList();
+		Iterator keys = fSearchDocPath2JavaEditMap.keySet().iterator();
+		String searchDocPath = null;
+		SearchDocument delegate = null;
+		while (keys.hasNext()) {
+			// create on the fly
+			searchDocPath = (String) keys.next();
+			MultiTextEdit javaEdit = (MultiTextEdit) fSearchDocPath2JavaEditMap.get(searchDocPath);
+			delegate = support.getSearchDocument(searchDocPath);
+			if (delegate != null && delegate instanceof JSDTSearchDocumentDelegate) {
+				JSDTSearchDocumentDelegate javaDelegate = (JSDTSearchDocumentDelegate) delegate;
+				changes.add(createChange(javaDelegate, javaEdit));
+			}
+		}
+		return (Change[]) changes.toArray(new Change[changes.size()]);
+	}
+	
+	/**
+	 * Subclasses should override to better describe the change.
+	 * 
+	 * @return
+	 */
+	protected String getDescription() {
+		return ""; //$NON-NLS-1$
+	}
+	
+	public IJavaScriptElement getElement() {
+		return this.fElement;
+	}
+	
+	/**
+	 * @return the new name for the Type
+	 */
+	public String getNewName() {
+		return this.fNewName;
+	}
+	
+	/**
+	 * @param searchDoc
+	 * @return
+	 */
+	protected String getRenameText(JSDTSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
+		return getNewName();
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPJavaSelectionProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
new file mode 100644
index 0000000..d671fcf
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+class JSPJavaSelectionProvider {
+	static IJavaScriptElement[] getSelection(ITextEditor textEditor) {
+		IJavaScriptElement[] elements = null;
+		IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
+		ISelection selection = textEditor.getSelectionProvider().getSelection();
+		if (selection instanceof ITextSelection) {
+			ITextSelection textSelection = (ITextSelection) selection;
+			// get the JSP translation object for this editor's document
+			IStructuredModel model = null;
+			try {
+				model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+				if (model instanceof IDOMModel) {
+					IDOMModel xmlModel = (IDOMModel) model;
+					IDOMDocument xmlDoc = xmlModel.getDocument();
+					JsTranslationAdapter adapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+					if (adapter != null) {
+						IJsTranslation translation = adapter.getJsTranslation(true);
+						elements = translation.getElementsFromJsRange(textSelection.getOffset(), textSelection.getOffset() + textSelection.getLength());
+					}
+				}
+			} finally {
+				if (model != null) {
+					model.releaseFromRead();
+				}
+			}
+		}
+		if (elements == null) {
+			elements = new IJavaScriptElement[0];
+		}
+		return elements;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameChange.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameChange.java
new file mode 100644
index 0000000..447afce
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameChange.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class JSPMethodRenameChange extends Change {
+	public static Change[] createChangesFor(IFunction method, String newName) {
+		JsSearchSupport support = JsSearchSupport.getInstance();
+		// should be handled by JSPIndexManager
+		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
+		// support.indexWorkspaceAndWait();
+		BasicRefactorSearchRequestor requestor = new JSPMethodRenameRequestor(method, newName);
+		support.searchRunnable(method, new JsSearchScope(), requestor);
+		return requestor.getChanges();
+	}
+	
+	
+	public Object getModifiedElement() {
+		// pa_TODO Auto-generated method stub
+		return null;
+	}
+	
+	
+	public String getName() {
+		return JsUIMessages.JSP_changes;
+	}
+	
+	
+	public void initializeValidationData(IProgressMonitor pm) {
+	// pa_TODO implement
+	// must be implemented to decide correct value of isValid
+	}
+	
+	
+	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
+		// pa_TODO implement
+		// This method must ensure that the change object is still valid.
+		// This is in particular interesting when performing an undo change
+		// since the workspace could have changed since the undo change has
+		// been created.
+		return new RefactoringStatus();
+	}
+	
+	
+	public Change perform(IProgressMonitor pm) throws CoreException {
+		// pa_TODO return the "undo" change here
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
new file mode 100644
index 0000000..27f7ddb
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/*
+ * Created on May 6, 2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class JSPMethodRenameParticipant extends RenameParticipant {
+	private IFunction fMethod = null;
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor,
+	 *      org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+	 */
+	
+	public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	
+	public Change createChange(IProgressMonitor pm) throws CoreException {
+		Change[] changes = JSPMethodRenameChange.createChangesFor(this.fMethod, getArguments().getNewName());
+		CompositeChange multiChange = null;
+		if (changes.length > 0) {
+			multiChange = new CompositeChange(JsUIMessages.JSP_changes, changes);
+		}
+		return multiChange;
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
+	 */
+	
+	public String getName() {
+		String name = ""; //$NON-NLS-1$
+		if (this.fMethod != null) {
+			try {
+				name = this.fMethod.getSource();
+			} catch (JavaScriptModelException e) {
+				Logger.logException(e);
+			}
+		}
+		return name;
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
+	 */
+	
+	protected boolean initialize(Object element) {
+		if (element instanceof IFunction) {
+			this.fMethod = (IFunction) element;
+			return true;
+		}else if (element instanceof IJavaWebNode) {
+			if(((IJavaWebNode)element).getJavaElement() instanceof IFunction) {
+				this.fMethod = (IFunction) ((IJavaWebNode)element).getJavaElement();
+				return true;
+			}
+		}
+		return false;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameRequestor.java
new file mode 100644
index 0000000..11e6833
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameRequestor.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import java.text.MessageFormat;
+
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.search.SearchMatch;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JSDTSearchDocumentDelegate;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class JSPMethodRenameRequestor extends BasicRefactorSearchRequestor {
+	public JSPMethodRenameRequestor(IJavaScriptElement element, String newName) {
+		super(element, newName);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
+	 */
+	
+	protected String getDescription() {
+		String methodName = getElement().getElementName();
+		String newName = getNewName();
+		String description = MessageFormat.format(JsUIMessages.BasicRefactorSearchRequestor_3, new String[] { methodName, newName });
+		return description;
+	}
+	
+	
+	protected String getRenameText(JSDTSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
+		String javaText = searchDoc.getJspTranslation().getJsText();
+		String methodText = javaText.substring(javaMatch.getOffset(), javaMatch.getOffset() + javaMatch.getLength());
+		String methodSuffix = methodText.substring(methodText.indexOf("(")); //$NON-NLS-1$
+		return getNewName() + methodSuffix;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
new file mode 100644
index 0000000..0679a10
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IActionDelegate2;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * An action delegate that launches JDT move element wizard
+ * 
+ * Still relies heavily on internal API will change post 3.0 with public move
+ * support https://bugs.eclipse.org/bugs/show_bug.cgi?id=61817
+ */
+public class JSPMoveElementActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
+	// private IEditorPart fEditor;
+	public void dispose() {
+	// nulling out just in case
+	// fEditor = null;
+	}
+	
+	public void init(IAction action) {
+		if (action != null) {
+			action.setText(JsUIMessages.MoveElement_label);
+			action.setToolTipText(JsUIMessages.MoveElement_label);
+		}
+	}
+	
+	public void init(IViewPart view) {
+	// do nothing
+	}
+	
+	public void run(IAction action) {
+	// no-op until we know how we're supposed to use this
+	// eclipse 3.2M5
+	// public move support:
+	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=61817
+	// IJavaScriptElement[] elements = getSelectedElements();
+	// if (elements.length > 0) {
+	//
+	// // need to check if it's movable
+	// try {
+	// JavaMoveProcessor processor =
+	// JavaMoveProcessor.create(getResources(elements), elements);
+	//				
+	// Shell parent =
+	// PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+	// MoveRefactoring refactoring = new MoveRefactoring(processor);
+	//
+	// RefactoringWizard wizard = createWizard(refactoring);
+	//
+	// /*
+	// * We want to get the shell from the refactoring dialog but
+	// * it's not known at this point, so we pass the wizard and
+	// * then, once the dialog is open, we will have access to its
+	// * shell.
+	// */
+	//
+	// processor.setCreateTargetQueries(new CreateTargetQueries(wizard));
+	// processor.setReorgQueries(new ReorgQueries(wizard));
+	// // String openRefactoringWizMsg =
+	// //
+	// RefactoringMessages.getString("OpenRefactoringWizardAction.refactoring");
+	// // //$NON-NLS-1$
+	// String openRefactoringWizMsg = JSPUIMessages.MoveElementWizard; //
+	// "Move
+	// // the
+	// // selected
+	// // elements";
+	// // //$NON-NLS-1$
+	// new RefactoringStarter().activate(refactoring, wizard, parent,
+	// openRefactoringWizMsg, true);
+	//
+	// PlatformStatusLineUtil.clearStatusLine();
+	//
+	// }
+	// catch (JavaScriptModelException e) {
+	// Logger.logException(e);
+	// }
+	// }
+	// else {
+	// PlatformStatusLineUtil.displayErrorMessage(JSPUIMessages.JSPMoveElementAction_0);
+	// //$NON-NLS-1$
+	// }
+	}
+	
+	public void runWithEvent(IAction action, Event event) {
+		run(action);
+	}
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		PlatformStatusLineUtil.clearStatusLine();
+	}
+	
+	public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+	// fEditor = targetEditor;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameChange.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameChange.java
new file mode 100644
index 0000000..8a8a378
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameChange.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.wst.jsdt.core.IPackageFragment;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class JSPPackageRenameChange extends Change {
+	public static Change[] createChangesFor(IPackageFragment pkg, String newName) {
+		JsSearchSupport support = JsSearchSupport.getInstance();
+		// should be handled by JSPIndexManager
+		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
+		// support.indexWorkspaceAndWait();
+		BasicRefactorSearchRequestor requestor = new JSPPackageRenameRequestor(pkg, newName);
+		support.searchRunnable(pkg, new JsSearchScope(), requestor);
+		return requestor.getChanges();
+	}
+	
+	
+	public Object getModifiedElement() {
+		// return this.pkg;
+		return null;
+	}
+	
+	
+	public String getName() {
+		return JsUIMessages.JSP_changes;
+	}
+	
+	
+	public void initializeValidationData(IProgressMonitor pm) {
+	// pa_TODO implement
+	// must be implemented to decide correct value of isValid
+	}
+	
+	
+	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
+		// pa_TODO implement
+		// This method must ensure that the change object is still valid.
+		// This is in particular interesting when performing an undo change
+		// since the workspace could have changed since the undo change has
+		// been created.
+		return new RefactoringStatus();
+	}
+	
+	
+	public Change perform(IProgressMonitor pm) throws CoreException {
+		// TODO return the "undo" change here
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
new file mode 100644
index 0000000..161f73a
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+import org.eclipse.wst.jsdt.core.IPackageFragment;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * Remember to change the plugin.xml file if the name of this class changes.
+ * 
+ * @author pavery
+ */
+public class JSPPackageRenameParticipant extends RenameParticipant {
+	private IPackageFragment fPkg = null;
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor,
+	 *      org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+	 */
+	
+	public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	
+	public Change createChange(IProgressMonitor pm) throws CoreException {
+		Change[] changes = JSPPackageRenameChange.createChangesFor(this.fPkg, getArguments().getNewName());
+		CompositeChange multiChange = null;
+		if (changes.length > 0) {
+			multiChange = new CompositeChange(JsUIMessages.JSP_changes, changes);
+		}
+		return multiChange;
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
+	 */
+	
+	public String getName() {
+		String name = ""; //$NON-NLS-1$
+		if (this.fPkg != null) {
+			name = this.fPkg.getElementName();
+		}
+		return name;
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
+	 */
+	
+	protected boolean initialize(Object element) {
+		if (element instanceof IPackageFragment) {
+			this.fPkg = (IPackageFragment) element;
+			return true;
+		}
+		return false;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameRequestor.java
new file mode 100644
index 0000000..6fa4592
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameRequestor.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class JSPPackageRenameRequestor extends BasicRefactorSearchRequestor {
+	/**
+	 * Element is the old package. newName is the new package name.
+	 * 
+	 * @param element
+	 * @param newName
+	 */
+	public JSPPackageRenameRequestor(IJavaScriptElement element, String newName) {
+		super(element, newName);
+	}
+	
+	/*
+	 * @see org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
+	 */
+	
+	protected String getDescription() {
+		String packageName = getElement().getElementName();
+		String newName = getNewName();
+		String description = NLS.bind(JsUIMessages.BasicRefactorSearchRequestor_5, (new String[] { packageName, newName }));
+		return description;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java
new file mode 100644
index 0000000..7fd2fb5
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IActionDelegate2;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IPackageFragment;
+import org.eclipse.wst.jsdt.core.IType;
+import org.eclipse.wst.jsdt.ui.refactoring.RenameSupport;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JSPRenameElementActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
+	private IEditorPart fEditor;
+	
+	public void dispose() {
+		// nulling out just in case
+		fEditor = null;
+	}
+	
+	private IJavaScriptElement getSelectedElement() {
+		IJavaScriptElement element = null;
+		if (fEditor instanceof ITextEditor) {
+			IJavaScriptElement[] elements = JSPJavaSelectionProvider.getSelection((ITextEditor) fEditor);
+			if (elements.length == 1) {
+				element = elements[0];
+			}
+		}
+		return element;
+	}
+	
+	public void init(IAction action) {
+		if (action != null) {
+			action.setText(JsUIMessages.RenameElement_label);
+			action.setToolTipText(JsUIMessages.RenameElement_label);
+		}
+	}
+	
+	public void init(IViewPart view) {
+	// do nothing
+	}
+	
+	public void run(IAction action) {
+		IJavaScriptElement element = getSelectedElement();
+		if (element != null) {
+			RenameSupport renameSupport = null;
+			try {
+				switch (element.getElementType()) {
+					case IJavaScriptElement.TYPE:
+						renameSupport = RenameSupport.create((IType) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
+					break;
+					case IJavaScriptElement.METHOD:
+						renameSupport = RenameSupport.create((IFunction) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
+					break;
+					case IJavaScriptElement.PACKAGE_FRAGMENT:
+						renameSupport = RenameSupport.create((IPackageFragment) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
+					break;
+				}
+				if (renameSupport != null) {
+					renameSupport.openDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+					PlatformStatusLineUtil.clearStatusLine();
+				}
+			} catch (CoreException e) {
+				Logger.logException(e);
+			}
+		} else {
+			PlatformStatusLineUtil.displayErrorMessage(JsUIMessages.JSPRenameElementAction_0);
+			PlatformStatusLineUtil.addOneTimeClearListener();
+		}
+	}
+	
+	public void runWithEvent(IAction action, Event event) {
+		run(action);
+	}
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		PlatformStatusLineUtil.clearStatusLine();
+	}
+	
+	public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+		fEditor = targetEditor;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveChange.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveChange.java
new file mode 100644
index 0000000..6eaa39b
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveChange.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.wst.jsdt.core.IType;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JSPTypeMoveChange extends Change {
+	public static Change[] createChangesFor(IType type, String newName) {
+		JsSearchSupport support = JsSearchSupport.getInstance();
+		// should be handled by JSPIndexManager
+		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
+		// support.indexWorkspaceAndWait();
+		JSPTypeMoveRequestor requestor = new JSPTypeMoveRequestor(type, newName);
+		support.searchRunnable(type, new JsSearchScope(), requestor);
+		return requestor.getChanges();
+	}
+	
+	
+	public Object getModifiedElement() {
+		return null;
+	}
+	
+	
+	public String getName() {
+		return JsUIMessages.JSP_changes;
+	}
+	
+	
+	public void initializeValidationData(IProgressMonitor pm) {
+	// pa_TODO implement
+	// must be implemented to decide correct value of isValid
+	}
+	
+	
+	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
+		// pa_TODO implement
+		// This method must ensure that the change object is still valid.
+		// This is in particular interesting when performing an undo change
+		// since the workspace could have changed since the undo change has
+		// been created.
+		return new RefactoringStatus();
+	}
+	
+	
+	public Change perform(IProgressMonitor pm) throws CoreException {
+		// TODO return the "undo" change here
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
new file mode 100644
index 0000000..8088e46
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
+import org.eclipse.wst.jsdt.core.IPackageFragment;
+import org.eclipse.wst.jsdt.core.IType;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JSPTypeMoveParticipant extends MoveParticipant {
+	IType fType = null;
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor,
+	 *      org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+	 */
+	
+	public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	
+	public Change createChange(IProgressMonitor pm) throws CoreException {
+		if (pm != null && pm.isCanceled()) {
+			return null;
+		}
+		CompositeChange multiChange = null;
+		Object dest = getArguments().getDestination();
+		if (dest instanceof IPackageFragment) {
+			Change[] changes = JSPTypeMoveChange.createChangesFor(fType, ((IPackageFragment) dest).getElementName());
+			if (changes.length > 0) {
+				multiChange = new CompositeChange(JsUIMessages.JSP_changes, changes);
+			}
+		}
+		return multiChange;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
+	 */
+	
+	public String getName() {
+		String name = ""; //$NON-NLS-1$
+		if (this.fType != null) {
+			name = this.fType.getElementName();
+		}
+		return name;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
+	 */
+	
+	protected boolean initialize(Object element) {
+		if (element instanceof IType) {
+			this.fType = (IType) element;
+			return true;
+		}
+		return false;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
new file mode 100644
index 0000000..e760809
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import java.text.MessageFormat;
+
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.search.SearchMatch;
+//import org.eclipse.wst.jsdt.web.core.internal.java.JsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JSDTSearchDocumentDelegate;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class JSPTypeMoveRequestor extends BasicRefactorSearchRequestor {
+	/**
+	 * @param element
+	 * @param newName
+	 */
+	public JSPTypeMoveRequestor(IJavaScriptElement element, String newPackage) {
+		super(element, newPackage);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
+	 */
+	
+	protected String getDescription() {
+		String typeName = getElement().getElementName();
+		String newName = getNewName();
+		String description = MessageFormat.format(JsUIMessages.BasicRefactorSearchRequestor_2, new String[] { typeName, newName });
+		return description;
+	}
+	
+	
+	protected String getRenameText(JSDTSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
+		String renameText = getElement().getElementName();
+	//	JsTranslation trans = searchDoc.getJspTranslation();
+		//String matchText = trans.getJsText().substring(javaMatch.getOffset(), javaMatch.getOffset() + javaMatch.getLength());
+		// if it's an import or jsp:useBean, we need to add the package name as
+		// well
+// if (trans.isImport(javaMatch.getOffset())
+//			
+// || isFullyQualified(matchText)) {
+// if (!getNewName().equals("")) {
+// // getNewName() is the pkg name
+// renameText = getNewName() + "." + renameText; //$NON-NLS-1$
+// }
+// }
+		return renameText;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameChange.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameChange.java
new file mode 100644
index 0000000..10ad88a
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameChange.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.wst.jsdt.core.IType;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class JSPTypeRenameChange extends Change {
+	public static Change[] createChangesFor(IType type, String newName) {
+		JsSearchSupport support = JsSearchSupport.getInstance();
+		// should be handled by JSPIndexManager
+		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
+		// support.indexWorkspaceAndWait();
+		JSPTypeRenameRequestor requestor = new JSPTypeRenameRequestor(type, newName);
+		support.searchRunnable(type, new JsSearchScope(), requestor);
+		return requestor.getChanges();
+	}
+	
+	
+	public Object getModifiedElement() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+	
+	public String getName() {
+		return JsUIMessages.JSP_changes;
+	}
+	
+	
+	public void initializeValidationData(IProgressMonitor pm) {
+	// pa_TODO implement
+	// must be implemented to decide correct value of isValid
+	}
+	
+	
+	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
+		// pa_TODO implement
+		// This method must ensure that the change object is still valid.
+		// This is in particular interesting when performing an undo change
+		// since the workspace could have changed since the undo change has
+		// been created.
+		return new RefactoringStatus();
+	}
+	
+	
+	public Change perform(IProgressMonitor pm) throws CoreException {
+		// TODO return the "undo" change here
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
new file mode 100644
index 0000000..56a46dd
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+import org.eclipse.wst.jsdt.core.IType;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * Remember to change the plugin.xml file if the name of this class changes.
+ * 
+ * @author pavery
+ */
+public class JSPTypeRenameParticipant extends RenameParticipant {
+	private IType fType = null;
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor,
+	 *      org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+	 */
+	
+	public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	
+	public Change createChange(IProgressMonitor pm) throws CoreException {
+		Change[] changes = JSPTypeRenameChange.createChangesFor(fType, getArguments().getNewName());
+		CompositeChange multiChange = null;
+		if (changes.length > 0) {
+			multiChange = new CompositeChange(JsUIMessages.JSP_changes, changes);
+		}
+		return multiChange;
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
+	 */
+	
+	public String getName() {
+		String name = ""; //$NON-NLS-1$
+		if (this.fType != null) {
+			try {
+				name = this.fType.getSource();
+			} catch (JavaScriptModelException e) {
+				Logger.logException(e);
+			}
+		}
+		return name;
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
+	 */
+	
+	protected boolean initialize(Object element) {
+		if (element instanceof IType) {
+			this.fType = (IType) element;
+			return true;
+		}else if (element instanceof IJavaWebNode) {
+			if(((IJavaWebNode)element).getJavaElement() instanceof IType) {
+				this.fType = (IType) ((IJavaWebNode)element).getJavaElement();
+				return true;
+			}
+		}
+		return false;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
new file mode 100644
index 0000000..fbce86e
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
+
+import java.text.MessageFormat;
+
+import org.eclipse.wst.jsdt.core.IType;
+import org.eclipse.wst.jsdt.core.search.SearchMatch;
+//import org.eclipse.wst.jsdt.web.core.internal.java.JsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JSDTSearchDocumentDelegate;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * Creates document change(s) for a type rename. Changes are created for every
+ * type "match" in the workspace
+ * 
+ * @author pavery
+ */
+public class JSPTypeRenameRequestor extends BasicRefactorSearchRequestor {
+	public JSPTypeRenameRequestor(IType type, String newName) {
+		super(type, newName);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
+	 */
+	
+	protected String getDescription() {
+		String typeName = getElement().getElementName();
+		String newName = getNewName();
+		String description = MessageFormat.format(JsUIMessages.BasicRefactorSearchRequestor_4, new String[] { typeName, newName });
+		return description;
+	}
+	
+	
+	protected String getRenameText(JSDTSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
+		String renameText = getNewName();
+	//	String pkg = getType().getPackageFragment().getElementName();
+	//	JsTranslation trans = searchDoc.getJspTranslation();
+	//	String matchText = trans.getJsText().substring(javaMatch.getOffset(), javaMatch.getOffset() + javaMatch.getLength());
+		// if it's an import or jsp:useBean or fully qualified type, we need to
+		// add the package name as well
+// if (trans.isImport(javaMatch.getOffset())
+// || /* trans.isUseBean(javaMatch.getOffset()) ||
+// */isFullyQualified(matchText)) {
+// if (!pkg.equals("")) {
+// renameText = pkg + "." + renameText; //$NON-NLS-1$
+// }
+// }
+		return renameText;
+	}
+	
+//	private IType getType() {
+//		return (IType) getElement();
+//	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/BasicJsSearchRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/BasicJsSearchRequestor.java
new file mode 100644
index 0000000..31d10ba
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/BasicJsSearchRequestor.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.search;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.wst.jsdt.core.search.SearchDocument;
+import org.eclipse.wst.jsdt.core.search.SearchMatch;
+import org.eclipse.wst.jsdt.core.search.SearchParticipant;
+import org.eclipse.wst.jsdt.core.search.SearchRequestor;
+
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JSDTSearchDocumentDelegate;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class BasicJsSearchRequestor extends SearchRequestor {
+	// for debugging
+	private static final boolean DEBUG;
+	static {
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jspsearch"); //$NON-NLS-1$
+		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+	
+	/**
+	 * Maps java search coordinates to corresponding JSP coordinates. Adds the
+	 * matches to the Search Results view.
+	 * 
+	 * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.wst.jsdt.core.search.SearchMatch)
+	 */
+	
+	public void acceptSearchMatch(SearchMatch match) throws CoreException {
+		if (JsSearchSupport.getInstance().isCanceled()) {
+			return;
+		}
+		String matchDocumentPath = match.getResource().getFullPath().toString();
+		SearchDocument searchDoc = JsSearchSupport.getInstance().getSearchDocument(matchDocumentPath);
+		if (searchDoc != null && searchDoc instanceof JSDTSearchDocumentDelegate) {
+			JSDTSearchDocumentDelegate javaSearchDoc = (JSDTSearchDocumentDelegate) searchDoc;
+			int jspStart = match.getOffset();
+			int jspEnd = match.getOffset() + match.getLength();
+			IJsTranslation trans = javaSearchDoc.getJspTranslation();
+			String jspText = trans.getHtmlText();
+			String javaText = javaSearchDoc.getJavaText();
+			if (BasicJsSearchRequestor.DEBUG) {
+				displayDebugInfo(match, jspStart, jspEnd, jspText, javaText);
+			}
+			if (jspStart > -1 && jspEnd > -1) {
+				addSearchMatch(new Document(trans.getHtmlText()), javaSearchDoc.getFile(), jspStart, jspEnd, jspText);
+			}
+		}
+	}
+	
+	/**
+	 * @param searchDoc
+	 * @param jspStart
+	 * @param jspEnd
+	 * @param jspTranslation
+	 * @param jspText
+	 * @throws CoreException
+	 */
+	protected void addSearchMatch(IDocument jspDocument, IFile jspFile, int jspStart, int jspEnd, String jspText) {
+	// implement in subclass
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#beginReporting()
+	 */
+	
+	public void beginReporting() {
+		if (BasicJsSearchRequestor.DEBUG) {
+			System.out.println("JSP Search requestor: beginReporting()"); //$NON-NLS-1$
+		}
+	}
+	
+	/**
+	 * For debug.
+	 * 
+	 * @param origMatch
+	 * @param jspStart
+	 * @param jspEnd
+	 * @param jspText
+	 * @param javaText
+	 */
+	private void displayDebugInfo(SearchMatch origMatch, int jspStart, int jspEnd, String jspText, String javaText) {
+		if (origMatch == null || jspStart == -1 || jspEnd == -1 || jspEnd < jspStart || jspText == null || javaText == null) {
+			return;
+		}
+		System.out.println("+-----------------------------------------+"); //$NON-NLS-1$
+		System.out.println("accept possible match [jspDoc: " + origMatch.getResource().getFullPath().toOSString() + " " + origMatch.getOffset() + ":" + origMatch.getOffset() + origMatch.getLength() + "]?"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		System.out.println("match info:"); //$NON-NLS-1$
+		System.out.println("the java text is:" + javaText.substring(origMatch.getOffset(), origMatch.getOffset() + origMatch.getLength())); //$NON-NLS-1$
+		System.out.println("java search match translates to jsp coords [start: " + jspStart + " end:" + jspEnd + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		System.out.println(" the jsp text is:" + jspText.substring(jspStart, jspEnd)); //$NON-NLS-1$
+	}
+	
+	/**
+	 * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#endReporting()
+	 */
+	
+	public void endReporting() {
+		if (BasicJsSearchRequestor.DEBUG) {
+			System.out.println("JSP Search requestor: endReporting()"); //$NON-NLS-1$
+		}
+	}
+	
+	/**
+	 * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#enterParticipant(org.eclipse.wst.jsdt.core.search.SearchParticipant)
+	 */
+	
+	public void enterParticipant(SearchParticipant participant) {
+		if (BasicJsSearchRequestor.DEBUG) {
+			System.out.println("JSP Search requestor: enterParticipant()"); //$NON-NLS-1$
+		}
+	}
+	
+	/**
+	 * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#exitParticipant(org.eclipse.wst.jsdt.core.search.SearchParticipant)
+	 */
+	
+	public void exitParticipant(SearchParticipant participant) {
+		if (BasicJsSearchRequestor.DEBUG) {
+			System.out.println("JSP Search requestor: exitParticipant()"); //$NON-NLS-1$
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesActionDelegate.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesActionDelegate.java
new file mode 100644
index 0000000..bbfc633
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesActionDelegate.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.search;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesProcessor;
+import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionDelegate;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsFindOccurrencesActionDelegate extends FindOccurrencesActionDelegate {
+	private List fProcessors;
+	
+	
+	protected List getProcessors() {
+		if (fProcessors == null) {
+			fProcessors = new ArrayList();
+			HTMLFindOccurrencesProcessor htmlProcessor = new HTMLFindOccurrencesProcessor();
+			fProcessors.add(htmlProcessor);
+			// temporary, workaround to disable function, since using the
+			// function
+			// can easily cause deadlock to occur.
+			// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=103662
+// JSPFindOccurrencesProcessor jspProcessor = new
+// JSPFindOccurrencesProcessor();
+// fProcessors.add(jspProcessor);
+		}
+		return fProcessors;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesProcessor.java
new file mode 100644
index 0000000..7a0d93d
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesProcessor.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.search;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.search.ui.ISearchQuery;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.jsdt.web.core.text.IJsPartitions;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsFindOccurrencesProcessor extends FindOccurrencesProcessor {
+	private IJavaScriptElement getJavaElement(IDocument document, ITextSelection textSelection) {
+		IJavaScriptElement[] elements = getJavaElementsForCurrentSelection(document, textSelection);
+		return elements.length > 0 ? elements[0] : null;
+	}
+	
+	/**
+	 * uses JSPTranslation to get currently selected Java elements.
+	 * 
+	 * @return currently selected IJavaElements
+	 */
+	private IJavaScriptElement[] getJavaElementsForCurrentSelection(IDocument document, ITextSelection selection) {
+		IJavaScriptElement[] elements = new IJavaScriptElement[0];
+		// get JSP translation object for this viewer's document
+		IStructuredModel model = null;
+		try {
+			model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+			if (model != null && model instanceof IDOMModel) {
+				IDOMDocument xmlDoc = ((IDOMModel) model).getDocument();
+				JsTranslationAdapter adapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+				if (adapter != null) {
+					IJsTranslation translation = adapter.getJsTranslation(false);
+					// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102211
+					elements = translation.getElementsFromJsRange(selection.getOffset(), selection.getOffset() + selection.getLength());
+				}
+			}
+		} finally {
+			if (model != null) {
+				model.releaseFromRead();
+			}
+		}
+		return elements;
+	}
+	
+	
+	protected String[] getPartitionTypes() {
+		return new String[] { IJsPartitions.HtmlJsPartition };
+	}
+	
+	
+	protected String[] getRegionTypes() {
+		return new String[] { DOMRegionContext.BLOCK_TEXT };
+	}
+	
+	
+	protected ISearchQuery getSearchQuery(IFile file, IStructuredDocument document, String regionText, String regionType, ITextSelection textSelection) {
+		IJavaScriptElement javaScriptElement = getJavaElement(document, textSelection);
+		if (javaScriptElement != null) {
+			return new JsSearchQuery(file, javaScriptElement);
+		}
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsOccurrencesSearchResult.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsOccurrencesSearchResult.java
new file mode 100644
index 0000000..504987e
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsOccurrencesSearchResult.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.search;
+
+import org.eclipse.search.ui.ISearchQuery;
+import org.eclipse.search.ui.text.Match;
+import org.eclipse.wst.sse.ui.internal.search.OccurrencesSearchResult;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class JsOccurrencesSearchResult extends OccurrencesSearchResult {
+	public JsOccurrencesSearchResult(ISearchQuery query) {
+		super(query);
+	}
+	
+	
+	public Match[] getMatches() {
+		return super.getMatches();
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchQuery.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchQuery.java
new file mode 100644
index 0000000..d3807e0
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchQuery.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.search;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.search.ui.ISearchResult;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.search.SearchDocument;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
+import org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class JsSearchQuery extends BasicSearchQuery {
+	/** the IJavaScriptElement we are searching for in the file * */
+	private IJavaScriptElement fElement = null;
+	
+	public JsSearchQuery(IFile file, IJavaScriptElement element) {
+		super(file);
+		this.fElement = element;
+	}
+	
+	
+	public boolean canRerun() {
+		return false;
+	}
+	
+	/**
+	 * @see org.eclipse.search.ui.ISearchQuery#canRunInBackground()
+	 */
+	
+	public boolean canRunInBackground() {
+		return true;
+	}
+	
+	
+	protected IStatus doQuery() {
+		IStatus status = Status.OK_STATUS;
+		try {
+			JsSearchSupport support = JsSearchSupport.getInstance();
+			// index the file
+			SearchDocument delegate = support.addJspFile(getFile());
+			String scopePath = delegate.getPath();
+			JsSearchScope singleFileScope = new JsSearchScope(new String[] { getFile().getFullPath().toString(), scopePath });
+			// perform a searchs
+			// by passing in this jsp search query, requstor can add matches
+			// support.searchRunnable(getJavaElement(), singleFileScope, new
+			// JSPSingleFileSearchRequestor(getInstance()));
+			support.searchRunnable(getJavaElement(), singleFileScope, new JsSingleFileSearchRequestor(getInstance()));
+		} catch (Exception e) {
+			status = new Status(IStatus.ERROR, "org.eclipse.wst.sse.ui", IStatus.OK, "", null); //$NON-NLS-1$	//$NON-NLS-2$
+		}
+		return status;
+	}
+	
+	private String getFilename() {
+		String filename = JsUIMessages.OccurrencesSearchQuery_2;
+		if (getFile() != null) {
+			filename = getFile().getName();
+		}
+		return filename;
+	}
+	
+	// for access by inner class
+	public JsSearchQuery getInstance() {
+		return this;
+	}
+	
+	public IJavaScriptElement getJavaElement() {
+		return this.fElement;
+	}
+	
+	/**
+	 * @see org.eclipse.search.ui.ISearchQuery#getLabel()
+	 */
+	
+	public String getLabel() {
+		String[] args = { getSearchText(), getOccurrencesCountText(), getFilename() };
+		return NLS.bind(JsUIMessages.OccurrencesSearchQuery_0, args);
+	}
+	
+	private String getOccurrencesCountText() {
+		String count = ""; //$NON-NLS-1$
+		// pa_TODO make dynamic
+		return count;
+	}
+	
+	/**
+	 * @see org.eclipse.search.ui.ISearchQuery#getSearchResult()
+	 */
+	
+	public ISearchResult getSearchResult() {
+		return new JsOccurrencesSearchResult(this);
+	}
+	
+	
+	protected String getSearchText() {
+		return fElement.getElementName();
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchRequestor.java
new file mode 100644
index 0000000..33feb50
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchRequestor.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.search;
+
+import java.util.HashMap;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.search.ui.NewSearchUI;
+import org.eclipse.search.ui.text.Match;
+import org.eclipse.wst.jsdt.ui.search.ISearchRequestor;
+import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class JsSearchRequestor extends BasicJsSearchRequestor {
+	private ISearchRequestor fJavaRequestor = null;
+	
+	public JsSearchRequestor() {
+		super();
+	}
+	
+	public JsSearchRequestor(ISearchRequestor javaRequestor) {
+		// need to report matches to javaRequestor
+		this.fJavaRequestor = javaRequestor;
+	}
+	
+	
+	protected void addSearchMatch(IDocument jspDocument, IFile jspFile, int jspStart, int jspEnd, String jspText) {
+		if (!jspFile.exists()) {
+			return;
+		}
+		int lineNumber = -1;
+		try {
+			lineNumber = jspDocument.getLineOfOffset(jspStart);
+		} catch (BadLocationException e) {
+			Logger.logException("offset: " + Integer.toString(jspStart), e); //$NON-NLS-1$
+		}
+		createSearchMarker(jspFile, jspStart, jspEnd, lineNumber);
+		if (this.fJavaRequestor != null) {
+			Match match = new Match(jspFile, jspStart, jspEnd - jspStart);
+			this.fJavaRequestor.reportMatch(match);
+		}
+	}
+	
+	/**
+	 * @param jspFile
+	 * @param jspStart
+	 * @param jspEnd
+	 */
+	private void createSearchMarker(IFile jspFile, int jspStart, int jspEnd, int lineNumber) {
+		try {
+			IMarker marker = jspFile.createMarker(NewSearchUI.SEARCH_MARKER);
+			HashMap attributes = new HashMap(4);
+			attributes.put(IMarker.CHAR_START, new Integer(jspStart));
+			attributes.put(IMarker.CHAR_END, new Integer(jspEnd));
+			attributes.put(IMarker.LINE_NUMBER, new Integer(lineNumber));
+			marker.setAttributes(attributes);
+		} catch (CoreException e) {
+			Logger.logException(e);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSingleFileSearchRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSingleFileSearchRequestor.java
new file mode 100644
index 0000000..9556525
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSingleFileSearchRequestor.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.search;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.IDocument;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class JsSingleFileSearchRequestor extends BasicJsSearchRequestor {
+	private JsSearchQuery fQuery = null;
+	
+	public JsSingleFileSearchRequestor(JsSearchQuery query) {
+		this.fQuery = query;
+	}
+	
+	
+	protected void addSearchMatch(IDocument jspDocument, IFile jspFile, int jspStart, int jspEnd, String jspText) {
+		// add match to JSP query...
+		this.fQuery.addMatch(jspDocument, jspStart, jspEnd);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsMatchPresentation.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsMatchPresentation.java
new file mode 100644
index 0000000..aaa8880
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsMatchPresentation.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.search.ui;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.search.ui.text.Match;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.wst.jsdt.ui.search.IMatchPresentation;
+import org.eclipse.wst.sse.ui.internal.search.BasicSearchLabelProvider;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class JsMatchPresentation implements IMatchPresentation {
+	/**
+	 * @see org.eclipse.wst.jsdt.ui.search.IMatchPresentation#createLabelProvider()
+	 */
+	public ILabelProvider createLabelProvider() {
+		return new BasicSearchLabelProvider();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.jsdt.ui.search.IMatchPresentation#showMatch(org.eclipse.search.ui.text.Match,
+	 *      int, int, boolean)
+	 */
+	public void showMatch(Match match, int currentOffset, int currentLength, boolean activate) throws PartInitException {
+		// pa_TODO implement
+		// Object obj = match.getElement();
+		// show match in JSP editor
+		if (activate) {
+			// use show in target?
+		} else {
+			// just select
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsQueryParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsQueryParticipant.java
new file mode 100644
index 0000000..faf5291
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsQueryParticipant.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.java.search.ui;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.search.SearchPattern;
+import org.eclipse.wst.jsdt.core.search.SearchRequestor;
+import org.eclipse.wst.jsdt.ui.search.ElementQuerySpecification;
+import org.eclipse.wst.jsdt.ui.search.IMatchPresentation;
+import org.eclipse.wst.jsdt.ui.search.IQueryParticipant;
+import org.eclipse.wst.jsdt.ui.search.ISearchRequestor;
+import org.eclipse.wst.jsdt.ui.search.PatternQuerySpecification;
+import org.eclipse.wst.jsdt.ui.search.QuerySpecification;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
+import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
+import org.eclipse.wst.jsdt.web.ui.internal.java.search.JsSearchRequestor;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author pavery
+ */
+public class JsQueryParticipant implements IQueryParticipant {
+	// for debugging
+	private static final boolean DEBUG;
+	static {
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jspsearch"); //$NON-NLS-1$
+		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+	
+	/**
+	 * @see org.eclipse.wst.jsdt.ui.search.IQueryParticipant#estimateTicks(org.eclipse.wst.jsdt.ui.search.QuerySpecification)
+	 */
+	public int estimateTicks(QuerySpecification data) {
+		// pa_TODO use project file counter from JSPSearchSupport...
+		return 0;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.jsdt.ui.search.IQueryParticipant#getUIParticipant()
+	 */
+	public IMatchPresentation getUIParticipant() {
+		return new JsMatchPresentation();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.jsdt.ui.search.IQueryParticipant#search(org.eclipse.wst.jsdt.ui.search.ISearchRequestor,
+	 *      org.eclipse.wst.jsdt.ui.search.QuerySpecification,
+	 *      org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public void search(ISearchRequestor requestor, QuerySpecification querySpecification, IProgressMonitor monitor) throws CoreException {
+		// indexIfNeeded();
+		// do search based on the particular Java query
+		if (querySpecification instanceof ElementQuerySpecification) {
+			// element search (eg. from global find references in Java file)
+			ElementQuerySpecification elementQuery = (ElementQuerySpecification) querySpecification;
+			IJavaScriptElement element = elementQuery.getElement();
+			if (JsQueryParticipant.DEBUG) {
+				System.out.println("JSP Query Participant searching on ELEMENT: " + element); //$NON-NLS-1$
+			}
+			SearchRequestor jspRequestor = new JsSearchRequestor(requestor);
+			// pa_TODO need to adapt JavaSearchScope to a JSPSearchScope
+			JsSearchSupport.getInstance().search(element, new JsSearchScope(), jspRequestor);
+		} else if (querySpecification instanceof PatternQuerySpecification) {
+			// pattern search (eg. from Java search page)
+			PatternQuerySpecification patternQuery = (PatternQuerySpecification) querySpecification;
+			String pattern = patternQuery.getPattern();
+			if (JsQueryParticipant.DEBUG) {
+				System.out.println("JSP Query Participant searching on PATTERN: " + pattern); //$NON-NLS-1$
+			}
+			SearchRequestor jspRequestor = new JsSearchRequestor(requestor);
+			JsSearchSupport.getInstance().search(pattern, new JsSearchScope(), patternQuery.getSearchFor(), patternQuery.getLimitTo(), SearchPattern.R_PATTERN_MATCH, false, jspRequestor);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/registry/AdapterFactoryProviderForJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/registry/AdapterFactoryProviderForJSDT.java
new file mode 100644
index 0000000..f4b6a69
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/registry/AdapterFactoryProviderForJSDT.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.registry;
+
+import org.eclipse.wst.html.core.internal.modelhandler.ModelHandlerForHTML;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapterFactory;
+import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JFaceNodeAdapterFactoryForJSDT;
+import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
+import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
+import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
+import org.eclipse.wst.sse.ui.internal.util.Assert;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class AdapterFactoryProviderForJSDT implements AdapterFactoryProvider {
+	/*
+	 * @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
+	 */
+	public void addAdapterFactories(IStructuredModel structuredModel) {
+		// these are the main factories, on model's factory registry
+		addContentBasedFactories(structuredModel);
+		// -------
+		// Must update/add to propagating adapters here too
+		addPropagatingAdapters(structuredModel);
+	}
+	
+	protected void addContentBasedFactories(IStructuredModel structuredModel) {
+		FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
+		Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
+		INodeAdapterFactory factory = null;
+		factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
+		if (!(factory instanceof JFaceNodeAdapterFactoryForJSDT)) {
+			factoryRegistry.removeFactoriesFor(IJFaceNodeAdapter.class);
+			factory = new JFaceNodeAdapterFactoryForJSDT(IJFaceNodeAdapter.class, true);
+			factoryRegistry.addFactory(factory);
+		}
+		
+		JsTranslationAdapterFactory.setupAdapterFactory(structuredModel);
+	}
+	
+	protected void addPropagatingAdapters(IStructuredModel structuredModel) {}
+	
+	/*
+	 * @see AdapterFactoryProvider#isFor(ContentTypeDescription)
+	 */
+	public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
+		// return (contentTypeDescription instanceof ModelHandlerForJSP);
+		return (contentTypeDescription instanceof ModelHandlerForHTML);
+	}
+	
+	public void reinitializeFactories(IStructuredModel structuredModel) {
+		addAdapterFactories(structuredModel);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/IStyleConstantsJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/IStyleConstantsJs.java
new file mode 100644
index 0000000..4a237d6
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/IStyleConstantsJs.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.style;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public interface IStyleConstantsJs {
+	public static final String JSP_CONTENT = "jsp_content"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/IStyleConstantsJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/IStyleConstantsJSDT.java
new file mode 100644
index 0000000..625fec6
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/IStyleConstantsJSDT.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.style.java;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public interface IStyleConstantsJSDT {
+	String JAVA_DEFAULT = "default"; //$NON-NLS-1$
+	String JAVA_KEYWORD = "keyword"; //$NON-NLS-1$
+	String JAVA_SINGLE_LINE_COMMENT = "single_line_comment"; //$NON-NLS-1$
+	String JAVA_STRING = "string"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JSDTCodeScanner.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JSDTCodeScanner.java
new file mode 100644
index 0000000..f74f1b0
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JSDTCodeScanner.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.style.java;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.MultiLineRule;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WordRule;
+import org.eclipse.wst.jsdt.web.core.javascript.JsDataTypes;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+class JSDTCodeScanner extends org.eclipse.jface.text.rules.RuleBasedScanner {
+	private static String[] fgConstants = JsDataTypes.CONSTANTS;
+	private static String[] fgKeywords = JsDataTypes.KEYWORDS;
+	private static String[] fgTypes = JsDataTypes.TYPES;
+	private IToken fDefaultToken;
+	private IToken fKeywordToken;
+	private IToken fSingleLineCommentToken;
+	private IToken fStringToken;
+	private IToken fTypeToken;
+	
+	/**
+	 * Creates a Java code scanner
+	 */
+	public JSDTCodeScanner() {
+		super();
+	}
+	
+	public void initializeRules() {
+		List rules = new ArrayList();
+		// Add rule for multiple line comments.
+		rules.add(new MultiLineRule("/*", "*/", fSingleLineCommentToken));//$NON-NLS-1$ //$NON-NLS-2$
+		// Add rule for single line comments.
+		rules.add(new EndOfLineRule("//", fSingleLineCommentToken));//$NON-NLS-1$
+		// Add rule for strings and character constants.
+		rules.add(new SingleLineRule("\"", "\"", fStringToken, '\\'));//$NON-NLS-2$//$NON-NLS-1$
+		rules.add(new SingleLineRule("'", "'", fStringToken, '\\'));//$NON-NLS-2$//$NON-NLS-1$
+		// Add generic whitespace rule.
+		// rules.add(new WhitespaceRule(new JavaWhitespaceDetector()));
+		// Add word rule for keywords, types, and constants.
+		WordRule wordRule = new WordRule(new JavaWordDetector(), fDefaultToken);
+		for (int i = 0; i < JSDTCodeScanner.fgKeywords.length; i++) {
+			wordRule.addWord(JSDTCodeScanner.fgKeywords[i], fKeywordToken);
+		}
+		for (int i = 0; i < JSDTCodeScanner.fgTypes.length; i++) {
+			wordRule.addWord(JSDTCodeScanner.fgTypes[i], fTypeToken);
+		}
+		for (int i = 0; i < JSDTCodeScanner.fgConstants.length; i++) {
+			wordRule.addWord(JSDTCodeScanner.fgConstants[i], fTypeToken);
+		}
+		rules.add(wordRule);
+		IRule[] result = new IRule[rules.size()];
+		rules.toArray(result);
+		setRules(result);
+	}
+	
+	public void setTokenData(String tokenKey, Object data) {
+		if (tokenKey == IStyleConstantsJSDT.JAVA_KEYWORD) {
+			fKeywordToken = new Token(data);
+			fTypeToken = new Token(data);
+		} else if (tokenKey == IStyleConstantsJSDT.JAVA_STRING) {
+			fStringToken = new Token(data);
+		} else if (tokenKey == IStyleConstantsJSDT.JAVA_SINGLE_LINE_COMMENT) {
+			fSingleLineCommentToken = new Token(data);
+		} else if (tokenKey == IStyleConstantsJSDT.JAVA_DEFAULT) {
+			fDefaultToken = new Token(data);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JavaWordDetector.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JavaWordDetector.java
new file mode 100644
index 0000000..a16268a
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JavaWordDetector.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.style.java;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JavaWordDetector implements org.eclipse.jface.text.rules.IWordDetector {
+	/**
+	 * @see org.eclipse.jface.text.rules.IWordDetector#isWordIdentifierPart
+	 */
+	public boolean isWordPart(char c) {
+		return Character.isJavaIdentifierPart(c);
+	}
+	
+	/**
+	 * @see org.eclipse.jface.text.rules.IWordDetector#isWordIdentifierStart
+	 */
+	public boolean isWordStart(char c) {
+		return Character.isJavaIdentifierStart(c);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/LineStyleProviderForJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/LineStyleProviderForJSDT.java
new file mode 100644
index 0000000..fe6ad6d
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/LineStyleProviderForJSDT.java
@@ -0,0 +1,339 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.style.java;
+
+import java.util.Collection;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
+import org.eclipse.wst.jsdt.ui.PreferenceConstants;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIPlugin;
+import org.eclipse.wst.jsdt.web.ui.internal.style.IStyleConstantsJs;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class LineStyleProviderForJSDT extends AbstractLineStyleProvider implements LineStyleProvider {
+	/** The scanner it uses */
+	private JSDTCodeScanner fScanner;
+	
+	private IPropertyChangeListener fPreferenceListener = new IPropertyChangeListener() {
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+		 */
+		public void propertyChange(PropertyChangeEvent event) {
+			// have to do it this way so others can override the method
+			handlePropertyChange(event);
+		}
+	};
+	
+	public LineStyleProviderForJSDT() {
+		super();
+		fScanner = new JSDTCodeScanner();
+	}
+	
+	/**
+	 * Looks up the colorKey in the preference store and adds the style
+	 * information to list of TextAttributes
+	 * 
+	 * @param colorKey
+	 */
+	private void addJavaTextAttribute(String colorKey) {
+		IPreferenceStore store = getJavaColorPreferences();
+		if (store != null && colorKey != null) {
+			TextAttribute ta = null;
+			if (colorKey == IStyleConstantsJSDT.JAVA_KEYWORD) {
+				// keyword
+				RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR);
+				boolean bold = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD);
+				boolean italics = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC);
+				boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_STRIKETHROUGH);
+				boolean underline = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_UNDERLINE);
+				int style = SWT.NORMAL;
+				if (bold) {
+					style = style | SWT.BOLD;
+				}
+				if (italics) {
+					style = style | SWT.ITALIC;
+				}
+				if (strikethrough) {
+					style = style | TextAttribute.STRIKETHROUGH;
+				}
+				if (underline) {
+					style = style | TextAttribute.UNDERLINE;
+				}
+				ta = createTextAttribute(foreground, null, style);
+			} else if (colorKey == IStyleConstantsJSDT.JAVA_STRING) {
+				// string
+				RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_STRING_COLOR);
+				boolean bold = store.getBoolean(PreferenceConstants.EDITOR_STRING_BOLD);
+				boolean italics = store.getBoolean(PreferenceConstants.EDITOR_STRING_ITALIC);
+				boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_STRING_STRIKETHROUGH);
+				boolean underline = store.getBoolean(PreferenceConstants.EDITOR_STRING_UNDERLINE);
+				int style = SWT.NORMAL;
+				if (bold) {
+					style = style | SWT.BOLD;
+				}
+				if (italics) {
+					style = style | SWT.ITALIC;
+				}
+				if (strikethrough) {
+					style = style | TextAttribute.STRIKETHROUGH;
+				}
+				if (underline) {
+					style = style | TextAttribute.UNDERLINE;
+				}
+				ta = createTextAttribute(foreground, null, style);
+			} else if (colorKey == IStyleConstantsJSDT.JAVA_SINGLE_LINE_COMMENT) {
+				// single line comment
+				RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR);
+				boolean bold = store.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD);
+				boolean italics = store.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_ITALIC);
+				boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_STRIKETHROUGH);
+				boolean underline = store.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_UNDERLINE);
+				int style = SWT.NORMAL;
+				if (bold) {
+					style = style | SWT.BOLD;
+				}
+				if (italics) {
+					style = style | SWT.ITALIC;
+				}
+				if (strikethrough) {
+					style = style | TextAttribute.STRIKETHROUGH;
+				}
+				if (underline) {
+					style = style | TextAttribute.UNDERLINE;
+				}
+				ta = createTextAttribute(foreground, null, style);
+			} else if (colorKey == IStyleConstantsJSDT.JAVA_DEFAULT) {
+				// default
+				RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR);
+				boolean bold = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD);
+				boolean italics = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_ITALIC);
+				boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_STRIKETHROUGH);
+				boolean underline = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_UNDERLINE);
+				int style = SWT.NORMAL;
+				if (bold) {
+					style = style | SWT.BOLD;
+				}
+				if (italics) {
+					style = style | SWT.ITALIC;
+				}
+				if (strikethrough) {
+					style = style | TextAttribute.STRIKETHROUGH;
+				}
+				if (underline) {
+					style = style | TextAttribute.UNDERLINE;
+				}
+				ta = createTextAttribute(foreground, null, style);
+			}
+			if (ta != null) {
+				getTextAttributes().put(colorKey, ta);
+				fScanner.setTokenData(colorKey, ta);
+			}
+		}
+	}
+	
+	/**
+	 * Adds style information to the given text presentation.
+	 * 
+	 * @param presentation
+	 *            the text presentation to be extended
+	 * @param offset
+	 *            the offset of the range to be styled
+	 * @param length
+	 *            the length of the range to be styled
+	 * @param attr
+	 *            the attribute describing the style of the range to be styled
+	 */
+	private void addRange(Collection presentation, int offset, int length, TextAttribute attr) {
+		// support for user defined backgroud for JSP scriptlet regions
+		TextAttribute ta = (TextAttribute) getTextAttributes().get(IStyleConstantsJs.JSP_CONTENT);
+		Color bgColor = ta.getBackground();
+		if (bgColor == null) {
+			bgColor = attr.getBackground();
+		}
+		StyleRange result = new StyleRange(offset, length, attr.getForeground(), bgColor, attr.getStyle());
+		if ((attr.getStyle() & TextAttribute.STRIKETHROUGH) != 0) {
+			result.strikeout = true;
+		}
+		if ((attr.getStyle() & TextAttribute.UNDERLINE) != 0) {
+			result.underline = true;
+		}
+		presentation.add(result);
+	}
+	
+	protected IPreferenceStore getColorPreferences() {
+		return JsUIPlugin.getDefault().getPreferenceStore();
+	}
+	
+	private IPreferenceStore getJavaColorPreferences() {
+		return PreferenceConstants.getPreferenceStore();
+	}
+	
+	/**
+	 * Returns a text attribute encoded in the given token. If the token's data
+	 * is not <code>null</code> and a text attribute it is assumed that it is
+	 * the encoded text attribute. It returns the default text attribute if
+	 * there is no encoded text attribute found.
+	 * 
+	 * @param token
+	 *            the token whose text attribute is to be determined
+	 * @return the token's text attribute
+	 */
+	private TextAttribute getTokenTextAttribute(IToken token) {
+		TextAttribute ta = null;
+		Object data = token.getData();
+		if (data instanceof TextAttribute) {
+			ta = (TextAttribute) data;
+		} else {
+			ta = (TextAttribute) getTextAttributes().get(IStyleConstantsJSDT.JAVA_DEFAULT);
+		}
+		return ta;
+	}
+	
+	protected void handlePropertyChange(PropertyChangeEvent event) {
+		String styleKey = null;
+		String javaStyleKey = null;
+		if (event != null) {
+			String prefKey = event.getProperty();
+			// check if preference changed is a style preference
+			if (IStyleConstantsHTML.SCRIPT_AREA_BORDER.equals(prefKey)) {
+				styleKey = IStyleConstantsHTML.SCRIPT_AREA_BORDER;
+			} else if (IStyleConstantsXML.TAG_ATTRIBUTE_NAME.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_NAME;
+			} else if (IStyleConstantsXML.TAG_ATTRIBUTE_VALUE.equals(prefKey)) {
+				styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_VALUE;
+			} else if (IStyleConstantsJs.JSP_CONTENT.equals(prefKey)) {
+				styleKey = IStyleConstantsJs.JSP_CONTENT;
+			} else if (PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD.equals(prefKey)) || (PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC.equals(prefKey))) {
+				javaStyleKey = IStyleConstantsJSDT.JAVA_KEYWORD;
+			} else if (PreferenceConstants.EDITOR_STRING_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_STRING_BOLD.equals(prefKey)) || (PreferenceConstants.EDITOR_STRING_ITALIC.equals(prefKey))) {
+				javaStyleKey = IStyleConstantsJSDT.JAVA_STRING;
+			} else if (PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD.equals(prefKey)) || (PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_ITALIC.equals(prefKey))) {
+				javaStyleKey = IStyleConstantsJSDT.JAVA_SINGLE_LINE_COMMENT;
+			} else if (PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD.equals(prefKey)) || (PreferenceConstants.EDITOR_JAVA_DEFAULT_ITALIC.equals(prefKey))) {
+				javaStyleKey = IStyleConstantsJSDT.JAVA_DEFAULT;
+			}
+		}
+		if (styleKey != null) {
+			// overwrite style preference with new value
+			addTextAttribute(styleKey);
+		}
+		if (javaStyleKey != null) {
+			// overwrite style preference with new value
+			addJavaTextAttribute(javaStyleKey);
+			fScanner.initializeRules();
+		}
+		if (styleKey != null || javaStyleKey != null) {
+			// force a full update of the text viewer
+			super.getHighlighter().refreshDisplay();
+		}
+	}
+	
+	protected void loadColors() {
+		addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
+		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
+		addTextAttribute(IStyleConstantsJs.JSP_CONTENT);
+		addJavaTextAttribute(IStyleConstantsJSDT.JAVA_KEYWORD);
+		addJavaTextAttribute(IStyleConstantsJSDT.JAVA_STRING);
+		addJavaTextAttribute(IStyleConstantsJSDT.JAVA_SINGLE_LINE_COMMENT);
+		addJavaTextAttribute(IStyleConstantsJSDT.JAVA_DEFAULT);
+		fScanner.initializeRules();
+	}
+	
+	public boolean prepareRegions(ITypedRegion typedRegion, int ssssrequestedStart, int ssssrequestedLength, Collection holdResults) {
+		boolean result = true;
+		/* Initialize the text attributes. Also load the colors and initialize the rules of the scanner */
+		getTextAttributes();
+		try {
+			// ideally, eventually, we'll have a "virtualDocument" we can
+			// refer to, but for now ... we'll simple rescan the one region.
+			// use simple adjustment (since "sub-content" starts at 0
+			int lastStart = typedRegion.getOffset();
+			int length = 0;
+			IToken lastToken = Token.UNDEFINED;
+			fScanner.setRange(getDocument(), lastStart, typedRegion.getLength());
+			while (true) {
+				IToken token = fScanner.nextToken();
+				if (token.isEOF()) {
+					if (!lastToken.isUndefined() && length != 0) {
+						addRange(holdResults, lastStart, length, getTokenTextAttribute(lastToken));
+					}
+					break;
+				}
+				if (token.isWhitespace()) {
+					length += fScanner.getTokenLength();
+					continue;
+				}
+				if (lastToken.isUndefined()) {
+					lastToken = token;
+					length += fScanner.getTokenLength();
+					continue;
+				}
+				if (token != lastToken) {
+					addRange(holdResults, lastStart, length, getTokenTextAttribute(lastToken));
+					lastToken = token;
+					lastStart = fScanner.getTokenOffset();
+					length = fScanner.getTokenLength();
+					continue;
+				}
+				length += fScanner.getTokenLength();
+			}
+		} catch (Exception e) {
+			// shouldn't happen, but we don't want it to stop other
+			// highlighting, if it does.
+			result = false;
+		}
+		return result;
+	}
+
+	protected TextAttribute getAttributeFor(ITextRegion region) {
+		return null;
+	}
+	
+	protected void registerPreferenceManager() {
+		getColorPreferences().addPropertyChangeListener(fPreferenceListener);
+		getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
+	}
+	
+	public void release() {
+		super.release();
+		fScanner = null;
+	}
+	
+	protected void unRegisterPreferenceManager() {
+		getColorPreferences().removePropertyChangeListener(fPreferenceListener);
+		getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/HTMLPrinter.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/HTMLPrinter.java
new file mode 100644
index 0000000..bd00e78
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/HTMLPrinter.java
@@ -0,0 +1,203 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.taginfo;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.net.URL;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+class HTMLPrinter {
+	static RGB BG_COLOR_RGB = null;
+	static {
+		final Display display = Display.getDefault();
+		if (display != null && !display.isDisposed()) {
+			try {
+				display.asyncExec(new Runnable() {
+					/*
+					 * @see java.lang.Runnable#run()
+					 */
+					public void run() {
+						HTMLPrinter.BG_COLOR_RGB = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
+					}
+				});
+			} catch (SWTError err) {
+				// see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=45294
+				if (err.code != SWT.ERROR_DEVICE_DISPOSED) {
+					throw err;
+				}
+			}
+		}
+	}
+	
+	public static void addBullet(StringBuffer buffer, String bullet) {
+		if (bullet != null) {
+			buffer.append("<li>"); //$NON-NLS-1$
+			buffer.append(bullet);
+			buffer.append("</li>"); //$NON-NLS-1$
+		}
+	}
+	
+	public static void addPageEpilog(StringBuffer buffer) {
+		buffer.append("</font></body></html>"); //$NON-NLS-1$
+	}
+	
+	public static void addPageProlog(StringBuffer buffer) {
+		HTMLPrinter.insertPageProlog(buffer, buffer.length());
+	}
+	
+	public static void addParagraph(StringBuffer buffer, Reader paragraphReader) {
+		if (paragraphReader != null) {
+			HTMLPrinter.addParagraph(buffer, HTMLPrinter.read(paragraphReader));
+		}
+	}
+	
+	public static void addParagraph(StringBuffer buffer, String paragraph) {
+		if (paragraph != null) {
+			buffer.append("<p>"); //$NON-NLS-1$
+			buffer.append(paragraph);
+		}
+	}
+	
+	public static void addSmallHeader(StringBuffer buffer, String header) {
+		if (header != null) {
+			buffer.append("<h5>"); //$NON-NLS-1$
+			buffer.append(header);
+			buffer.append("</h5>"); //$NON-NLS-1$
+		}
+	}
+	
+	private static void appendColor(StringBuffer buffer, RGB rgb) {
+		buffer.append('#');
+		buffer.append(Integer.toHexString(rgb.red));
+		buffer.append(Integer.toHexString(rgb.green));
+		buffer.append(Integer.toHexString(rgb.blue));
+	}
+	
+	private static void appendStyleSheetLink(StringBuffer buffer, URL styleSheetURL) {
+		if (styleSheetURL == null) {
+			return;
+		}
+		buffer.append("<head>"); //$NON-NLS-1$
+		buffer.append("<LINK REL=\"stylesheet\" HREF= \""); //$NON-NLS-1$
+		buffer.append(styleSheetURL);
+		buffer.append("\" CHARSET=\"ISO-8859-1\" TYPE=\"text/css\">"); //$NON-NLS-1$
+		buffer.append("</head>"); //$NON-NLS-1$
+	}
+	
+	public static String convertToHTMLContent(String content) {
+		content = HTMLPrinter.replace(content, '&', "&amp;"); //$NON-NLS-1$
+		content = HTMLPrinter.replace(content, '"', "&quot;"); //$NON-NLS-1$
+		content = HTMLPrinter.replace(content, '<', "&lt;"); //$NON-NLS-1$
+		return HTMLPrinter.replace(content, '>', "&gt;"); //$NON-NLS-1$
+	}
+	
+	public static void endBulletList(StringBuffer buffer) {
+		buffer.append("</ul>"); //$NON-NLS-1$
+	}
+	
+	private static RGB getBgColor() {
+		if (HTMLPrinter.BG_COLOR_RGB != null) {
+			return HTMLPrinter.BG_COLOR_RGB;
+		}
+		// RGB value of info bg color on WindowsXP
+		return new RGB(255, 255, 225);
+	}
+	
+	public static void insertPageProlog(StringBuffer buffer, int position) {
+		HTMLPrinter.insertPageProlog(buffer, position, HTMLPrinter.getBgColor());
+	}
+	
+	public static void insertPageProlog(StringBuffer buffer, int position, RGB bgRGB) {
+		if (bgRGB == null) {
+			HTMLPrinter.insertPageProlog(buffer, position);
+		} else {
+			StringBuffer pageProlog = new StringBuffer(60);
+			pageProlog.append("<html><body text=\"#000000\" bgcolor=\""); //$NON-NLS-1$
+			HTMLPrinter.appendColor(pageProlog, bgRGB);
+			pageProlog.append("\"><font size=-1>"); //$NON-NLS-1$
+			buffer.insert(position, pageProlog.toString());
+		}
+	}
+	
+	public static void insertPageProlog(StringBuffer buffer, int position, RGB bgRGB, URL styleSheetURL) {
+		if (bgRGB == null) {
+			HTMLPrinter.insertPageProlog(buffer, position, styleSheetURL);
+		} else {
+			StringBuffer pageProlog = new StringBuffer(300);
+			pageProlog.append("<html>"); //$NON-NLS-1$
+			HTMLPrinter.appendStyleSheetLink(pageProlog, styleSheetURL);
+			pageProlog.append("<body text=\"#000000\" bgcolor=\""); //$NON-NLS-1$
+			HTMLPrinter.appendColor(pageProlog, bgRGB);
+			pageProlog.append("\"><font size=-1>"); //$NON-NLS-1$
+			buffer.insert(position, pageProlog.toString());
+		}
+	}
+	
+	public static void insertPageProlog(StringBuffer buffer, int position, URL styleSheetURL) {
+		HTMLPrinter.insertPageProlog(buffer, position, HTMLPrinter.getBgColor(), styleSheetURL);
+	}
+	
+	static String read(Reader rd) {
+		StringBuffer buffer = new StringBuffer();
+		char[] readBuffer = new char[2048];
+		try {
+			int n = rd.read(readBuffer);
+			while (n > 0) {
+				buffer.append(readBuffer, 0, n);
+				n = rd.read(readBuffer);
+			}
+			return buffer.toString();
+		} catch (IOException x) {
+			// never expected
+			Logger.log(Logger.WARNING_DEBUG, x.getMessage(), x);
+		}
+		return null;
+	}
+	
+	private static String replace(String text, char c, String s) {
+		int previous = 0;
+		int current = text.indexOf(c, previous);
+		if (current == -1) {
+			return text;
+		}
+		StringBuffer buffer = new StringBuffer();
+		while (current > -1) {
+			buffer.append(text.substring(previous, current));
+			buffer.append(s);
+			previous = current + 1;
+			current = text.indexOf(c, previous);
+		}
+		buffer.append(text.substring(previous));
+		return buffer.toString();
+	}
+	
+	public static void startBulletList(StringBuffer buffer) {
+		buffer.append("<ul>"); //$NON-NLS-1$
+	}
+	
+	private HTMLPrinter() {
+	// nothing
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTHoverProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTHoverProcessor.java
new file mode 100644
index 0000000..d5e1669
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTHoverProcessor.java
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.taginfo;
+
+import java.io.Reader;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IMember;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.ui.JSdocContentAccess;
+import org.eclipse.wst.jsdt.ui.JavaScriptElementLabels;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.ui.internal.taginfo.AbstractHoverProcessor;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JSDTHoverProcessor extends AbstractHoverProcessor {
+	/*
+	 * Bulk of the work was copied from
+	 * org.eclipse.wst.jsdt.internal.ui.text.java.hover.JavadocHover
+	 */
+	private final long LABEL_FLAGS = JavaScriptElementLabels.ALL_FULLY_QUALIFIED | JavaScriptElementLabels.M_PRE_RETURNTYPE | JavaScriptElementLabels.M_PARAMETER_TYPES | JavaScriptElementLabels.M_PARAMETER_NAMES | JavaScriptElementLabels.M_EXCEPTIONS | JavaScriptElementLabels.F_PRE_TYPE_SIGNATURE | JavaScriptElementLabels.M_PRE_TYPE_PARAMETERS | JavaScriptElementLabels.T_TYPE_PARAMETERS | JavaScriptElementLabels.USE_RESOLVED;
+	private final long LOCAL_VARIABLE_FLAGS = LABEL_FLAGS & ~JavaScriptElementLabels.F_FULLY_QUALIFIED | JavaScriptElementLabels.F_POST_QUALIFIED;
+	
+	private String getHoverInfo(IJavaScriptElement[] result) {
+		StringBuffer buffer = new StringBuffer();
+		int nResults = result.length;
+		if (nResults == 0) {
+			return null;
+		}
+		if (nResults > 1) {
+			for (int i = 0; i < result.length; i++) {
+				HTMLPrinter.startBulletList(buffer);
+				IJavaScriptElement curr = result[i];
+				if (curr instanceof IMember || curr.getElementType() == IJavaScriptElement.LOCAL_VARIABLE) {
+					HTMLPrinter.addBullet(buffer, getInfoText(curr));
+				}
+				HTMLPrinter.endBulletList(buffer);
+			}
+		} else {
+			IJavaScriptElement curr = result[0];
+			if (curr == null) {
+				return null;
+			}
+			if (curr instanceof IMember) {
+				IMember member = (IMember) curr;
+				HTMLPrinter.addSmallHeader(buffer, getInfoText(member));
+				Reader reader;
+				try {
+					reader = JSdocContentAccess.getHTMLContentReader(member, true, true);
+				} catch (JavaScriptModelException ex) {
+					return null;
+				}
+				if (reader != null) {
+					HTMLPrinter.addParagraph(buffer, reader);
+				}
+			} else if (curr.getElementType() == IJavaScriptElement.LOCAL_VARIABLE) {
+				HTMLPrinter.addSmallHeader(buffer, getInfoText(curr));
+			}
+		}
+		if (buffer.length() > 0) {
+			HTMLPrinter.insertPageProlog(buffer, 0);
+			HTMLPrinter.addPageEpilog(buffer);
+			return buffer.toString();
+		}
+		return null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer,
+	 *      org.eclipse.jface.text.IRegion)
+	 */
+	public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
+		// get JSP translation object for this viewer's document
+		IDOMModel xmlModel = null;
+		try {
+			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(textViewer.getDocument());
+			if (xmlModel != null) {
+				IDOMDocument xmlDoc = xmlModel.getDocument();
+				JsTranslationAdapter adapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+				if (adapter != null) {
+					IJsTranslation translation = adapter.getJsTranslation(true);
+					IJavaScriptElement[] result = translation.getElementsFromJsRange(hoverRegion.getOffset(), hoverRegion.getOffset() + hoverRegion.getLength());
+// Vector filteredResults = new Vector();
+// List badFunctions = translation.getGeneratedFunctionNames();
+// boolean bad = false;
+// for(int i = 0;i<result.length;i++){
+// bad=false;
+// if(result[i] instanceof IFunction){
+// for(int j=0;j<badFunctions.size() && ! bad;j++){
+// if(((IFunction)result[i]).getElementName().equalsIgnoreCase((String)badFunctions.get(j))){
+// bad=true;
+// continue;
+// }
+// }
+// if(!bad)filteredResults.add(result[i]);
+// }
+// }
+// if(filteredResults.size()<1) return new String();
+//					
+// String filteredResult =
+// translation.fixupMangledName(getHoverInfo((IJavaScriptElement[])filteredResults.toArray(new
+// IJavaScriptElement[]{})));
+// for(int i = 0;i<badFunctions.size();i++){
+// filteredResult.replace((String)badFunctions.get(i), "");
+// }
+// return filteredResult;
+					return translation.fixupMangledName(getHoverInfo(result));
+				}
+			}
+		} finally {
+			if (xmlModel != null) {
+				xmlModel.releaseFromRead();
+			}
+		}
+		return null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer,
+	 *      int)
+	 */
+	public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
+		return JsWordFinder.findWord(textViewer.getDocument(), offset);
+	}
+	
+	private String getInfoText(IJavaScriptElement member) {
+		long flags = member.getElementType() == IJavaScriptElement.LOCAL_VARIABLE ? LOCAL_VARIABLE_FLAGS : LABEL_FLAGS;
+		String label = JavaScriptElementLabels.getElementLabel(member, flags);
+		StringBuffer buf = new StringBuffer();
+		for (int i = 0; i < label.length(); i++) {
+			char ch = label.charAt(i);
+			if (ch == '<') {
+				buf.append("&lt;"); //$NON-NLS-1$
+			} else if (ch == '>') {
+				buf.append("&gt;"); //$NON-NLS-1$
+			} else {
+				buf.append(ch);
+			}
+		}
+		return buf.toString();
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JsWordFinder.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JsWordFinder.java
new file mode 100644
index 0000000..b9311af
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JsWordFinder.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.taginfo;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+class JsWordFinder {
+	public static IRegion findWord(IDocument document, int offset) {
+		int start = -1;
+		int end = -1;
+		try {
+			int pos = offset;
+			char c;
+			while (pos >= 0) {
+				c = document.getChar(pos);
+				// System.out.println("JavaWordFinder.findWord() Test java char
+				// (--):" + c);
+				if (!Character.isJavaIdentifierPart(c)) {
+					break;
+				}
+				--pos;
+			}
+			start = pos;
+			pos = offset;
+			int length = document.getLength();
+			while (pos < length) {
+				c = document.getChar(pos);
+				// System.out.println("JavaWordFinder.findWord() Test java char
+				// (++):" + c);
+				if (!Character.isJavaIdentifierPart(c)) {
+					break;
+				}
+				++pos;
+			}
+			end = pos;
+			// System.out.println("Start:" + start + "End:"+end);
+			// System.out.println("JavaWordFinder.findWord() Retrieved java
+			// token of:" + document.get(start, end-start) );
+		} catch (BadLocationException x) {
+		}
+		if (start > -1 && end > -1) {
+			if (start == offset && end == offset) {
+				return new Region(offset, 0);
+			} else if (start == offset) {
+				return new Region(start, end - start);
+			} else {
+				return new Region(start + 1, end - start - 1);
+			}
+		}
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCharacterPairInserter.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCharacterPairInserter.java
new file mode 100644
index 0000000..38d02d7
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCharacterPairInserter.java
@@ -0,0 +1,293 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.text;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.link.ILinkedModeListener;
+import org.eclipse.jface.text.link.LinkedModeModel;
+import org.eclipse.jface.text.link.LinkedModeUI.ExitFlags;
+import org.eclipse.jface.text.link.LinkedModeUI.IExitPolicy;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
+import org.eclipse.wst.jsdt.internal.ui.text.JavaHeuristicScanner;
+import org.eclipse.wst.jsdt.internal.ui.text.Symbols;
+import org.eclipse.wst.jsdt.ui.PreferenceConstants;
+import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter;
+
+/**
+ * <p>Inserts character pairs in script regions in HTML and JSP documents based on the Javascript
+ * character pairing preferences.</p>
+ */
+public class JsCharacterPairInserter extends AbstractCharacterPairInserter implements IPropertyChangeListener{
+
+	private boolean fCloseStrings;
+	private boolean fCloseBrackets;
+	private boolean fCloseBraces;
+	private boolean fCloseAngularBrackets;
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#hasPair(char)
+	 */
+	public boolean hasPair(char c) {
+		switch (c) {
+			case '(':
+			case '<':
+			case '[':
+			case '\'':
+			case '\"':
+			case '{':
+				return true;
+			default:
+				return false;
+		}
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#shouldPair(org.eclipse.jface.text.source.ISourceViewer, char)
+	 */
+	protected boolean shouldPair(ISourceViewer viewer, char c) {
+		IDocument document= viewer.getDocument();
+
+		final Point selection= viewer.getSelectedRange();
+		final int offset= selection.x;
+		final int length= selection.y;
+
+		try {
+			IRegion startLine= document.getLineInformationOfOffset(offset);
+			IRegion endLine= document.getLineInformationOfOffset(offset + length);
+
+			JavaHeuristicScanner scanner= new JavaHeuristicScanner(document);
+			int nextToken= scanner.nextToken(offset + length, endLine.getOffset() + endLine.getLength());
+			String next= nextToken == Symbols.TokenEOF ? null : document.get(offset, scanner.getPosition() - offset).trim();
+			int prevToken= scanner.previousToken(offset - 1, startLine.getOffset());
+			int prevTokenOffset= scanner.getPosition() + 1;
+			String previous= prevToken == Symbols.TokenEOF ? null : document.get(prevTokenOffset, offset - prevTokenOffset).trim();
+
+			switch (c) {
+				case '(':
+					if (!fCloseBrackets
+							|| nextToken == Symbols.TokenLPAREN
+							|| nextToken == Symbols.TokenIDENT
+							|| next != null && next.length() > 1)
+						return false;
+					break;
+
+				case '<':
+					if (!(fCloseAngularBrackets && fCloseBrackets)
+							|| nextToken == Symbols.TokenLESSTHAN
+							|| 		   prevToken != Symbols.TokenLBRACE
+									&& prevToken != Symbols.TokenRBRACE
+									&& prevToken != Symbols.TokenSEMICOLON
+									&& prevToken != Symbols.TokenSYNCHRONIZED
+									&& prevToken != Symbols.TokenSTATIC
+									&& (prevToken != Symbols.TokenIDENT || !isAngularIntroducer(previous))
+									&& prevToken != Symbols.TokenEOF)
+						return false;
+					break;
+
+				case '{':
+					if (!fCloseBraces
+							|| nextToken == Symbols.TokenIDENT
+							|| next != null && next.length() > 1)
+						return false;
+					break;
+				case '[':
+					if (!fCloseBrackets
+							|| nextToken == Symbols.TokenIDENT
+							|| next != null && next.length() > 1)
+						return false;
+					break;
+
+				case '\'':
+				case '"':
+					if (!fCloseStrings
+							|| nextToken == Symbols.TokenIDENT
+							|| prevToken == Symbols.TokenIDENT
+							|| next != null && next.length() > 1
+							|| previous != null && previous.length() > 1)
+						return false;
+					break;
+
+				default:
+					return false;
+			}
+		} catch (BadLocationException e) {
+			return false;
+		}
+		
+		return true;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#getPair(char)
+	 */
+	protected char getPair(char c) {
+		switch (c) {
+			case '(':
+				return ')';
+			case '<':
+				return '>';
+			case '[':
+				return ']';
+			case '{':
+				return '}';
+			case '\'':
+				return c;
+			case '\"':
+				return c;
+			default:
+				throw new IllegalArgumentException();
+		}
+	}
+	
+	/**
+	 * <p>Initialize the preference listener</p>
+	 * 
+	 * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#initialize()
+	 */
+	public void initialize() {
+		super.initialize();
+		IPreferenceStore preferenceStore = JavaScriptPlugin.getDefault().getPreferenceStore();
+		this.fCloseStrings = preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_STRINGS);
+		this.fCloseBrackets = preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_BRACKETS);
+		this.fCloseBraces = preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_BRACES);
+		this.fCloseAngularBrackets = JavaScriptCore.VERSION_1_5.compareTo(
+				preferenceStore.getString(JavaScriptCore.COMPILER_SOURCE)) <= 0;
+		preferenceStore.addPropertyChangeListener(this);
+	}
+	
+	/**
+	 * <p>Dispose the preference listener</p>
+	 * 
+	 * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#dispose()
+	 */
+	public void dispose() {
+		JavaScriptPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
+		super.dispose();
+	}
+
+	/**
+	 * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+	 */
+	public void propertyChange(PropertyChangeEvent event) {
+		if (PreferenceConstants.EDITOR_CLOSE_STRINGS.equals(event.getProperty())){
+			this.fCloseStrings = ((Boolean) event.getNewValue()).booleanValue();
+		} else if (PreferenceConstants.EDITOR_CLOSE_BRACKETS.equals(event.getProperty())) {
+			this.fCloseBrackets = ((Boolean) event.getNewValue()).booleanValue();
+		} else if (PreferenceConstants.EDITOR_CLOSE_BRACES.equals(event.getProperty())) {
+			this.fCloseBraces = ((Boolean) event.getNewValue()).booleanValue();
+		} else if (JavaScriptCore.COMPILER_SOURCE.equals(event.getProperty())) {
+			IPreferenceStore preferenceStore = JavaScriptPlugin.getDefault().getPreferenceStore();
+			this.fCloseAngularBrackets = JavaScriptCore.VERSION_1_5.compareTo(preferenceStore.getString(
+						JavaScriptCore.COMPILER_SOURCE)) <= 0;
+		}
+	}
+	
+	/**
+	 * TODO: IAN: comment me
+	 * @param identifier
+	 * @return
+	 */
+	private boolean isAngularIntroducer(String identifier) {
+		return identifier.length() > 0
+				&& (Character.isUpperCase(identifier.charAt(0))
+						|| identifier.startsWith("final") //$NON-NLS-1$
+						|| identifier.startsWith("public") //$NON-NLS-1$
+						|| identifier.startsWith("public") //$NON-NLS-1$
+						|| identifier.startsWith("protected") //$NON-NLS-1$
+						|| identifier.startsWith("private")); //$NON-NLS-1$
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#getExitPolicy(char, char, org.eclipse.jface.text.IDocument)
+	 */
+	protected IExitPolicy getExitPolicy(char exit, char escape, IDocument document) {
+		return new ExitPolicy(exit, escape, document);
+	}
+	
+	/**
+	 * <p>An exit policy that deals with a user adding a carriage return between {}.
+	 * In that case rather then exiting to the exit position the linked mode is exited
+	 * and the carriage return inserted.</p>
+	 */
+	private static class ExitPolicy implements IExitPolicy {
+
+		/** exit character */
+		private char fExit;
+		
+		/** escape character for the exit character */
+		private char fEscape;
+		
+		/** document to execute this exit policy on */
+		private IDocument fDocument;
+
+		/**
+		 * <p>Default constructor</p>
+		 * 
+		 * @param exit exit character
+		 * @param escape escape character for the exit character
+		 * @param document document to execute this exit policy on
+		 */
+		public ExitPolicy(char exit, char escape, IDocument document) {
+			fExit = exit;
+			fEscape = escape;
+			fDocument = document;
+		}
+
+		/**
+		 * @see org.eclipse.jface.text.link.LinkedModeUI.IExitPolicy#doExit(org.eclipse.jface.text.link.LinkedModeModel, org.eclipse.swt.events.VerifyEvent, int, int)
+		 */
+		public ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length) {
+			if(!isMasked(offset)) {
+				// if exit character then exit to exit location
+				if (event.character == fExit) {
+					return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
+				}
+				
+				// if carriage return and previous character is { then exit linked mode and insert return
+				if (event.character == SWT.CR && offset > 0) {
+					try {
+						if (this.fDocument.getChar(offset - 1) == '{') {
+							return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
+						}
+					} catch (BadLocationException e) {
+						Logger.logException("Error while trying to exit linked mode", e); //$NON-NLS-1$
+					}
+				}
+			}
+			return null;
+		}
+
+		/**
+		 * <p>Determine if the exit character has been escaped.<p>
+		 * 
+		 * @param offset current offset in the document
+		 * @return <code>true</code> if exit character escaped, <code>false</code> otherwise
+		 */
+		private boolean isMasked(int offset) {
+			try {
+				return fEscape == fDocument.getChar(offset - 1);
+			} catch (BadLocationException e) {
+			}
+			return false;
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCodeReader.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCodeReader.java
new file mode 100644
index 0000000..29937d0
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCodeReader.java
@@ -0,0 +1,225 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/*
+ * Created on Sep 2, 2003
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+package org.eclipse.wst.jsdt.web.ui.internal.text;
+
+import java.io.IOException;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.wst.jsdt.web.ui.internal.derived.SingleCharReader;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+class JsCodeReader extends SingleCharReader {
+	/** The EOF character */
+	public static final int EOF = -1;
+	private int fCachedLineNumber = -1;
+	private int fCachedLineOffset = -1;
+	private IDocument fDocument;
+	private int fEnd = -1;
+	private boolean fForward = false;
+	private int fOffset;
+	private boolean fSkipComments = false;
+	private boolean fSkipStrings = false;
+	
+	public JsCodeReader() {}
+	
+	/*
+	 * @see Reader#close()
+	 */
+	
+	public void close() throws IOException {
+		fDocument = null;
+	}
+	
+	public void configureBackwardReader(IDocument document, int offset, boolean skipComments, boolean skipStrings) throws IOException {
+		fDocument = document;
+		fOffset = offset;
+		fSkipComments = skipComments;
+		fSkipStrings = skipStrings;
+		fForward = false;
+		try {
+			fCachedLineNumber = fDocument.getLineOfOffset(fOffset);
+		} catch (BadLocationException x) {
+			throw new IOException(x.getMessage());
+		}
+	}
+	
+	public void configureForwardReader(IDocument document, int offset, int length, boolean skipComments, boolean skipStrings) throws IOException {
+		fDocument = document;
+		fOffset = offset;
+		fSkipComments = skipComments;
+		fSkipStrings = skipStrings;
+		fForward = true;
+		fEnd = Math.min(fDocument.getLength(), fOffset + length);
+	}
+	
+	/**
+	 * Returns the offset of the last read character. Should only be called
+	 * after read has been called.
+	 */
+	public int getOffset() {
+		return fForward ? fOffset - 1 : fOffset;
+	}
+	
+	private void gotoCommentEnd() throws BadLocationException {
+		while (fOffset < fEnd) {
+			char current = fDocument.getChar(fOffset++);
+			if (current == '*') {
+				if (fOffset < fEnd && fDocument.getChar(fOffset) == '/') {
+					++fOffset;
+					return;
+				}
+			}
+		}
+	}
+	
+	private void gotoCommentStart() throws BadLocationException {
+		while (0 < fOffset) {
+			char current = fDocument.getChar(fOffset--);
+			if (current == '*' && 0 <= fOffset && fDocument.getChar(fOffset) == '/') {
+				return;
+			}
+		}
+	}
+	
+	private void gotoLineEnd() throws BadLocationException {
+		int line = fDocument.getLineOfOffset(fOffset);
+		fOffset = fDocument.getLineOffset(line + 1);
+	}
+	
+	private void gotoStringEnd(char delimiter) throws BadLocationException {
+		while (fOffset < fEnd) {
+			char current = fDocument.getChar(fOffset++);
+			if (current == '\\') {
+				// ignore escaped characters
+				++fOffset;
+			} else if (current == delimiter) {
+				return;
+			}
+		}
+	}
+	
+	private void gotoStringStart(char delimiter) throws BadLocationException {
+		while (0 < fOffset) {
+			char current = fDocument.getChar(fOffset);
+			if (current == delimiter) {
+				if (!(0 <= fOffset && fDocument.getChar(fOffset - 1) == '\\')) {
+					return;
+				}
+			}
+			--fOffset;
+		}
+	}
+	
+	private void handleSingleLineComment() throws BadLocationException {
+		int line = fDocument.getLineOfOffset(fOffset);
+		if (line < fCachedLineNumber) {
+			fCachedLineNumber = line;
+			fCachedLineOffset = fDocument.getLineOffset(line);
+			int offset = fOffset;
+			while (fCachedLineOffset < offset) {
+				char current = fDocument.getChar(offset--);
+				if (current == '/' && fCachedLineOffset <= offset && fDocument.getChar(offset) == '/') {
+					fOffset = offset;
+					return;
+				}
+			}
+		}
+	}
+	
+	/*
+	 * @see SingleCharReader#read()
+	 */
+	
+	public int read() throws IOException {
+		try {
+			return fForward ? readForwards() : readBackwards();
+		} catch (BadLocationException x) {
+			throw new IOException(x.getMessage());
+		}
+	}
+	
+	private int readBackwards() throws BadLocationException {
+		while (0 < fOffset) {
+			--fOffset;
+			handleSingleLineComment();
+			char current = fDocument.getChar(fOffset);
+			switch (current) {
+				case '/':
+					if (fSkipComments && fOffset > 1) {
+						char next = fDocument.getChar(fOffset - 1);
+						if (next == '*') {
+							// a comment ends, advance to the comment start
+							fOffset -= 2;
+							gotoCommentStart();
+							continue;
+						}
+					}
+					return current;
+				case '"':
+				case '\'':
+					if (fSkipStrings) {
+						--fOffset;
+						gotoStringStart(current);
+						continue;
+					}
+					return current;
+			}
+			return current;
+		}
+		return JsCodeReader.EOF;
+	}
+	
+	private int readForwards() throws BadLocationException {
+		while (fOffset < fEnd) {
+			char current = fDocument.getChar(fOffset++);
+			switch (current) {
+				case '/':
+					if (fSkipComments && fOffset < fEnd) {
+						char next = fDocument.getChar(fOffset);
+						if (next == '*') {
+							// a comment starts, advance to the comment end
+							++fOffset;
+							gotoCommentEnd();
+							continue;
+						} else if (next == '/') {
+							// '//'-comment starts, advance to the line end
+							gotoLineEnd();
+							continue;
+						}
+					}
+					return current;
+				case '"':
+				case '\'':
+					if (fSkipStrings) {
+						gotoStringEnd(current);
+						continue;
+					}
+					return current;
+			}
+			return current;
+		}
+		return JsCodeReader.EOF;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsDocumentRegionEdgeMatcher.java
new file mode 100644
index 0000000..86c10d8
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsDocumentRegionEdgeMatcher.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.text;
+
+import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
+	protected final static char[] BRACKETS = { '{', '}', '(', ')', '[', ']' };
+	
+	/**
+	 * @param validContexts
+	 * @param nextMatcher
+	 */
+	public JsDocumentRegionEdgeMatcher() {
+		super(new String[] { DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_COMMENT_TEXT, DOMRegionContext.XML_CDATA_TEXT, DOMRegionContext.XML_PI_OPEN,
+				DOMRegionContext.XML_PI_CONTENT }, new JsPairMatcher(JsDocumentRegionEdgeMatcher.BRACKETS));
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsPairMatcher.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsPairMatcher.java
new file mode 100644
index 0000000..a1965a0
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsPairMatcher.java
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.text;
+
+import java.io.IOException;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.source.ICharacterPairMatcher;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+class JsPairMatcher implements ICharacterPairMatcher {
+	protected int fAnchor;
+	protected IDocument fDocument;
+	protected int fEndPos;
+	protected int fOffset;
+	protected char[] fPairs;
+	protected JsCodeReader fReader = new JsCodeReader();
+	protected int fStartPos;
+	
+	public JsPairMatcher(char[] pairs) {
+		fPairs = pairs;
+	}
+	
+	/*
+	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#clear()
+	 */
+	public void clear() {
+		if (fReader != null) {
+			try {
+				fReader.close();
+			} catch (IOException x) {
+				// ignore
+			}
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#dispose()
+	 */
+	public void dispose() {
+		clear();
+		fDocument = null;
+		fReader = null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#getAnchor()
+	 */
+	public int getAnchor() {
+		return fAnchor;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#match(org.eclipse.jface.text.IDocument,
+	 *      int)
+	 */
+	public IRegion match(IDocument document, int offset) {
+		fOffset = offset;
+		if (fOffset < 0) {
+			return null;
+		}
+		fDocument = document;
+		if (fDocument != null && matchPairsAt() && fStartPos != fEndPos) {
+			return new Region(fStartPos, fEndPos - fStartPos + 1);
+		}
+		return null;
+	}
+	
+	protected boolean matchPairsAt() {
+		int i;
+		int pairIndex1 = fPairs.length;
+		int pairIndex2 = fPairs.length;
+		fStartPos = -1;
+		fEndPos = -1;
+		// get the chars preceding and following the start position
+		try {
+			char prevChar = fDocument.getChar(Math.max(fOffset - 1, 0));
+			// modified behavior for
+			// http://dev.eclipse.org/bugs/show_bug.cgi?id=16879
+			// char nextChar= fDocument.getChar(fOffset);
+			// search for opening peer character next to the activation point
+			for (i = 0; i < fPairs.length; i = i + 2) {
+				// if (nextChar == fPairs[i]) {
+				// fStartPos= fOffset;
+				// pairIndex1= i;
+				// } else
+				if (prevChar == fPairs[i]) {
+					fStartPos = fOffset - 1;
+					pairIndex1 = i;
+				}
+			}
+			// search for closing peer character next to the activation point
+			for (i = 1; i < fPairs.length; i = i + 2) {
+				if (prevChar == fPairs[i]) {
+					fEndPos = fOffset - 1;
+					pairIndex2 = i;
+				}
+				// else if (nextChar == fPairs[i]) {
+				// fEndPos= fOffset;
+				// pairIndex2= i;
+				// }
+			}
+			if (fEndPos > -1) {
+				fAnchor = ICharacterPairMatcher.RIGHT;
+				fStartPos = searchForOpeningPeer(fEndPos, fPairs[pairIndex2 - 1], fPairs[pairIndex2], fDocument);
+				if (fStartPos > -1) {
+					return true;
+				} else {
+					fEndPos = -1;
+				}
+			} else if (fStartPos > -1) {
+				fAnchor = ICharacterPairMatcher.LEFT;
+				fEndPos = searchForClosingPeer(fStartPos, fPairs[pairIndex1], fPairs[pairIndex1 + 1], fDocument);
+				if (fEndPos > -1) {
+					return true;
+				} else {
+					fStartPos = -1;
+				}
+			}
+		} catch (BadLocationException x) {
+		} catch (IOException x) {
+		}
+		return false;
+	}
+	
+	protected int searchForClosingPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
+		fReader.configureForwardReader(document, offset + 1, document.getLength(), true, true);
+		int stack = 1;
+		int c = fReader.read();
+		while (c != JsCodeReader.EOF) {
+			if (c == openingPeer && c != closingPeer) {
+				stack++;
+			} else if (c == closingPeer) {
+				stack--;
+			}
+			if (stack == 0) {
+				return fReader.getOffset();
+			}
+			c = fReader.read();
+		}
+		return -1;
+	}
+	
+	protected int searchForOpeningPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
+		fReader.configureBackwardReader(document, offset, true, true);
+		int stack = 1;
+		int c = fReader.read();
+		while (c != JsCodeReader.EOF) {
+			if (c == closingPeer && c != openingPeer) {
+				stack++;
+			} else if (c == openingPeer) {
+				stack--;
+			}
+			if (stack == 0) {
+				return fReader.getOffset();
+			}
+			c = fReader.read();
+		}
+		return -1;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/messages.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/messages.properties
new file mode 100644
index 0000000..c6061c4
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/messages.properties
@@ -0,0 +1,11 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+WebProjectJsGlobalScopeContainerInitializer.0=Web Project support for JSDT
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/rino.jpg b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/rino.jpg
new file mode 100644
index 0000000..b5a6af5
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/rino.jpg
Binary files differ
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/IJavaWebNode.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/IJavaWebNode.java
new file mode 100644
index 0000000..b69918f
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/IJavaWebNode.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.views.contentoutline;
+
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.w3c.dom.Node;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public interface IJavaWebNode {
+	public IJavaScriptElement getJavaElement();
+	
+	public Node getParentNode();
+		
+	public boolean hasChildren();
+	
+	
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java
new file mode 100644
index 0000000..9afa956
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.views.contentoutline;
+
+import org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline.JsContentOutlineConfig;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JFaceNodeAdapterFactoryForJSDT extends JFaceNodeAdapterFactory {
+	public JFaceNodeAdapterFactoryForJSDT() {
+		this(IJFaceNodeAdapter.class, true);
+	}
+	
+	public JFaceNodeAdapterFactoryForJSDT(Object adapterKey, boolean registerAdapters) {
+		super(adapterKey, registerAdapters);
+	}
+	
+	
+	public INodeAdapterFactory copy() {
+		return new JFaceNodeAdapterFactoryForJSDT(getAdapterKey(), isShouldRegisterAdapter());
+	}
+	
+	
+	protected INodeAdapter createAdapter(INodeNotifier node) {
+		if (singletonAdapter == null) {
+			// create the JFaceNodeAdapter
+			// singletonAdapter = new JFaceNodeAdapterForJSDT(this);
+			if (JsContentOutlineConfig.USE_ADVANCED) {
+				singletonAdapter = new org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline.JFaceNodeAdapterForJs(this);
+			} else {
+				singletonAdapter = new org.eclipse.wst.jsdt.web.ui.views.contentoutline.JFaceNodeAdapterForJs(this);
+			}
+			initAdapter(singletonAdapter, node);
+		}
+		return singletonAdapter;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java
new file mode 100644
index 0000000..456ef6f
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java
@@ -0,0 +1,398 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     bug:244839 - eugene@genuitec.com
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.views.contentoutline;
+
+import java.util.Vector;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.text.Position;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterForHTML;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IMember;
+import org.eclipse.wst.jsdt.core.ISourceRange;
+import org.eclipse.wst.jsdt.core.ISourceReference;
+import org.eclipse.wst.jsdt.core.IType;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.internal.core.JavaElement;
+import org.eclipse.wst.jsdt.internal.core.Member;
+import org.eclipse.wst.jsdt.internal.core.SourceRefElement;
+import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
+import org.eclipse.wst.jsdt.ui.StandardJavaScriptElementContentProvider;
+import org.eclipse.wst.jsdt.web.core.internal.Logger;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
+import org.eclipse.wst.xml.core.internal.document.NodeImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
+import org.w3c.dom.Node;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JFaceNodeAdapterForJs extends JFaceNodeAdapterForHTML {
+	
+	public JFaceNodeAdapterForJs(JFaceNodeAdapterFactory adapterFactory) {
+		super(adapterFactory);
+	}
+	
+	private IJavaScriptUnit lazyCu;
+	private IProgressMonitor monitor;
+	private JavaScriptElementLabelProvider javaElementLabelProvider;
+	
+	public Object[] getChildren(Object object) {
+		if (object instanceof IJavaScriptElement) {
+			return getJavaElementProvider().getChildren(object);
+		}
+		if (object instanceof IJavaWebNode) {
+			JavaElement enclosedElement = (JavaElement) ((IJavaWebNode) object).getJavaElement();
+			if (enclosedElement != null) {
+				try {
+					IJavaScriptElement[] children = enclosedElement.getChildren();
+					if (children == null) {
+						return new IJavaScriptElement[0];
+					}
+					Object[] nodes = new Object[children.length];
+					Node parent = ((IJavaWebNode) object).getParentNode();
+					
+					for (int i = 0; i < children.length; i++) {
+					//	int htmllength = ((SourceRefElement) (children[i])).getSourceRange().getLength();
+					//	int htmloffset = ((SourceRefElement) (children[i])).getSourceRange().getOffset();
+						IJavaScriptElement javaElement = children[i];
+						ISourceRange range = null;
+						if (javaElement instanceof Member) {
+								range = ((IMember) javaElement).getNameRange();
+						} else {
+								range = ((ISourceReference) javaElement).getSourceRange();
+						}
+						int htmllength = range.getLength();
+						int htmloffset = range.getOffset();
+
+						
+						Position position = new Position(htmloffset, htmllength);
+						nodes[i] = getJsNode(parent, javaElement, position);
+					}
+					return nodes;
+				} catch (JavaScriptModelException ex) {
+				}
+			}
+		}
+		Node node = (Node) object;
+		if (isJSElementParent(node)) {
+			Object[] results = getJSElementsFromNode(node.getFirstChild(), true);
+			
+			
+			return filter( results );
+		}
+		return super.getChildren(object);
+	}
+	
+	/*
+	 * @GINO: Anonymous -- matches anonymous types on the top level
+	 */
+	protected boolean matches(Object elementObj) {
+		
+		if( elementObj instanceof IJavaWebNode ){
+			IJavaScriptElement element = ((IJavaWebNode)elementObj).getJavaElement();
+			if (element.getElementType() == IJavaScriptElement.TYPE && element.getParent().getElementType() == IJavaScriptElement.JAVASCRIPT_UNIT ) {
+				
+				IType type = (IType)element;
+				try {
+					return type.isAnonymous();
+				} catch (JavaScriptModelException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+			}
+		}
+		
+		return false;
+	}
+
+	/*
+	 * @GINO: Anonymous Filter from top level
+	 *
+	 */
+	protected Object[] filter(Object[] children) {
+		boolean initializers= false;
+		for (int i= 0; i < children.length; i++) {
+			if (matches(children[i])) {
+				initializers= true;
+				break;
+			}
+		}
+
+		if (!initializers)
+			return children;
+
+		Vector v= new Vector();
+		for (int i= 0; i < children.length; i++) {
+			if (matches(children[i]))
+				continue;
+			v.addElement(children[i]);
+		}
+
+		Object[] result= new Object[v.size()];
+		v.copyInto(result);
+		return result;
+	}
+	
+	public Object[] getElements(Object object) {
+		if (object instanceof IJavaScriptElement) {
+			return getJavaElementProvider().getElements(object);
+		}
+		return super.getElements(object);
+	}
+	
+	private JavaScriptElementLabelProvider getJavaElementLabelProvider() {
+		if(javaElementLabelProvider==null) {
+			javaElementLabelProvider = new JavaScriptElementLabelProvider();
+		}
+		return javaElementLabelProvider;
+	}
+	
+	private StandardJavaScriptElementContentProvider getJavaElementProvider() {
+		return new StandardJavaScriptElementContentProvider(true);
+	}
+	
+	private Object[] filterChildrenForRange(IJavaScriptElement[] allChildren, Node node) {
+	//	int javaPositionStart = ((NodeImpl) node).getStartOffset();
+	//	int javaPositionEnd   = ((NodeImpl) node).getEndOffset();
+		
+	//	Object[] result =new Object[0];
+		
+		int javaPositionEnd = ((NodeImpl) node).getEndOffset();
+		int javaPositionStart = ((NodeImpl) node).getStartOffset();
+
+		Vector validChildren = new Vector();
+		for (int i = 0; i < allChildren.length; i++) {
+			if (allChildren[i] instanceof IJavaScriptElement) {
+				ISourceRange range = null;
+				if (allChildren[i] instanceof Member) {
+					try {
+						range = ((Member) allChildren[i]).getNameRange();
+					} catch (JavaScriptModelException e) {
+											// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+				} else if (allChildren[i]  instanceof SourceRefElement) {
+					try {
+						range = ((SourceRefElement)allChildren[i] ).getSourceRange();
+					} catch (JavaScriptModelException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+				}
+				if (allChildren[i].getElementType() == IJavaScriptElement.TYPE || (javaPositionStart <= range.getOffset() && range.getLength() + range.getOffset() <= (javaPositionEnd))) {
+					
+					
+							int htmllength = range == null ? 0 : range.getLength();
+							int htmloffset = range == null ? 0 : range.getOffset();
+							if (htmllength < 0 || htmloffset < 0) {
+								continue;
+							}
+							Position position = new Position(htmloffset, htmllength);
+							validChildren.add(getJsNode(node.getParentNode(), allChildren[i], position));
+					
+				
+				}
+			}
+		}
+		Object[] result = new Object[0];
+
+
+		if (validChildren.size() > 0) {
+			result = validChildren.toArray();
+		}
+		if (result == null || result.length == 0) {
+			return new IJavaScriptElement[0];
+		}
+		return result;
+	}
+	
+	private synchronized Object[] getJSElementsFromNode(Node node, boolean ensureConsistant) {
+				
+//		int startOffset = 0;
+//		int endOffset = 0;
+//		int type = node.getNodeType();
+		Object[] result = null;
+		//JsTranslation translation = null;
+		if (node.getNodeType() == Node.TEXT_NODE && (node instanceof NodeImpl)) {
+//			startOffset = ((NodeImpl) node).getStartOffset();
+//			endOffset = ((NodeImpl) node).getEndOffset();
+			IJavaScriptUnit unit = getLazyCu(node);
+	        // Genuitec Begin Fix 6149: Exception opening external HTML file
+			if (unit == null) {
+			    return new Object[0];
+			}
+	        // Genuitec End Fix 6149: Exception opening external HTML file
+			try {
+				if(ensureConsistant) unit.makeConsistent(getProgressMonitor());
+			} catch (JavaScriptModelException ex1) {
+				// TODO Auto-generated catch block
+				ex1.printStackTrace();
+			}
+			try {
+				result = filterChildrenForRange(unit.getChildren(),node);
+			} catch (JavaScriptModelException ex) {
+				// TODO Auto-generated catch block
+				ex.printStackTrace();
+				result = new Object[0];
+				lazyCu=null;
+			}
+			
+			//translation = getTranslation(node);
+			//result = translation.getAllElementsInJsRange(startOffset, endOffset);
+		}
+		return result;
+	}
+	
+	private IProgressMonitor getProgressMonitor() {
+		if(monitor==null) {
+			monitor = new NullProgressMonitor();
+		}
+		
+		return monitor;
+		
+	}
+	
+	private Object getJsNode(Node parent, IJavaScriptElement root, Position position) {
+		JsJfaceNode instance = null;
+		if (root.getElementType() == IJavaScriptElement.TYPE) {
+			instance = new JsJfaceNode(parent, root, position, ((SourceRefElement) root).getElementName());
+		} else if (root.getElementType() == IJavaScriptElement.FIELD) {
+			/* Field refrence, possibly to a type may need to implement later */
+			instance = new JsJfaceNode(parent, root,  position);
+		} else {
+			instance = new JsJfaceNode(parent, root, position);
+		}
+		String name = getJavaElementLabelProvider().getText(root);
+		instance.setName(name);
+		// ((JsJfaceNode)instance).setAdapterRegistry(registry);
+		INodeAdapter adapter = (instance).getAdapterFor(IJFaceNodeAdapter.class);
+		if (!(adapter instanceof JFaceNodeAdapterForJs)) {
+			(instance).removeAdapter(adapter);
+			(instance).addAdapter(this);
+		}
+		return instance;
+	}
+	
+	
+	public Image getLabelImage(Object node) {
+		if (node instanceof JsJfaceNode) {
+			return ((JsJfaceNode) node).getImage();
+		}
+		if (node instanceof IJavaScriptElement) {
+			return getJavaElementLabelProvider().getImage(node);
+		}
+		return super.getLabelImage(node);
+	}
+	
+	
+	public String getLabelText(Object node) {
+//		if (node instanceof JsJfaceNode) {
+//			return ((JsJfaceNode) node).getName();
+//		}
+		if (node instanceof IJavaScriptElement) {
+			return getJavaElementLabelProvider().getText(node);
+		}
+		return super.getLabelText(node);
+	}
+	
+	
+	public Object getParent(Object element) {
+		if (element instanceof IJavaScriptElement) {
+			return getJavaElementProvider().getParent(element);
+		}
+		return super.getParent(element);
+	}
+	
+	private IJavaScriptUnit getLazyCu(Node node) {
+		if(lazyCu==null) {
+			IJsTranslation tran = getTranslation(node);
+			if(tran== null) return null;
+			lazyCu = tran.getCompilationUnit();
+			if(lazyCu==null) return null;
+			
+			try {
+				lazyCu.makeConsistent( new NullProgressMonitor() );
+			} catch (JavaScriptModelException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		return lazyCu;
+	}
+	
+	private IJsTranslation getTranslation(Node node) {
+		IStructuredModel model = null;
+		IModelManager modelManager = StructuredModelManager.getModelManager();
+		IDOMDocument xmlDoc = null;
+		try {
+			if (modelManager != null) {
+				IStructuredDocument doc = ((NodeImpl) node).getStructuredDocument();
+				model = modelManager.getExistingModelForRead(doc);
+				// model = modelManager.getModelForRead(doc);
+			}
+			IDOMModel domModel = (IDOMModel) model;
+			if(domModel == null) return null;
+			xmlDoc = domModel.getDocument();
+		} catch (Exception e) {
+			Logger.logException(e);
+		} finally {
+			if (model != null) {
+				// model.changedModel();
+				model.releaseFromRead();
+			}
+		}
+		if (xmlDoc == null) {
+			return null;
+		}
+		JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+		return translationAdapter.getJsTranslation(true);
+	}
+	
+	
+	public boolean hasChildren(Object object) {
+		if (object instanceof IJavaScriptElement) {
+			return getJavaElementProvider().hasChildren(object);
+		}
+		Node node = (Node) object;
+		if (node instanceof IJavaWebNode) {
+			return ((IJavaWebNode) object).hasChildren();
+			
+		}
+		if (isJSElementParent(node)) {
+			Object[] nodes = getJSElementsFromNode(node.getFirstChild(),false);
+			boolean hasElements = (nodes != null && nodes.length > 0);
+			return hasElements;
+		}
+		return super.hasChildren(object);
+	}
+	
+	private boolean isJSElementParent(Node node) {
+		return (node.hasChildNodes() && node.getNodeName().equalsIgnoreCase("script")); //$NON-NLS-1$
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java
new file mode 100644
index 0000000..0f5b341
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java
@@ -0,0 +1,280 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.views.contentoutline;
+
+import java.util.Collection;
+
+import org.eclipse.jface.text.Position;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.internal.core.JavaElement;
+import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
+import org.eclipse.wst.jsdt.web.core.internal.Logger;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
+import org.eclipse.wst.sse.core.internal.provisional.AbstractNotifier;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.xml.core.internal.document.ElementImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.w3c.dom.Node;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsJfaceNode extends ElementImpl implements IndexedRegion, INodeNotifier, Node, IJavaWebNode {
+	private class JsAdaptableNode extends AbstractNotifier {
+		
+		public FactoryRegistry getFactoryRegistry() {
+			return adapterRegistry;
+		}
+	}
+	private JsAdaptableNode adaptableDomNode = new JsAdaptableNode();
+	private FactoryRegistry adapterRegistry;
+	private Position fDocPosition;
+//	private Node parent;
+	private String typeName;
+	//private IJavaScriptElement dirtyElement;
+	private boolean hasChildren;
+	//private String name;
+	private Image me;
+	
+	public JsJfaceNode(Node parent, IJavaScriptElement originalElement, Position structureDocLocation) {
+		this(parent, originalElement, structureDocLocation, null);
+	}
+	
+	public JsJfaceNode(Node parent, IJavaScriptElement originalElement, Position structureDocLocation, String typeName) {
+		//super();
+		super(((ElementImpl)parent));
+		// super(parentObject, parentObject.getElementName());
+		fDocPosition = structureDocLocation;
+		//this.parent = parent;
+		this.typeName = typeName;
+		try {
+			hasChildren=((JavaElement)originalElement).hasChildren();
+		} catch (JavaScriptModelException ex) {
+			hasChildren=false;
+		}
+		removeAttributes();
+		me = (new JavaScriptElementLabelProvider(JavaScriptElementLabelProvider.SHOW_DEFAULT|JavaScriptElementLabelProvider.SHOW_SMALL_ICONS)).getImage(originalElement);
+	}
+	
+	public Image getImage() {
+		return me;
+	}
+
+	public boolean hasChildren() {
+//		try {
+//			return ((JavaElement)this.dirtyElement).hasChildren();
+//		} catch (JavaScriptModelException ex) {
+//			// TODO Auto-generated catch block
+//			ex.printStackTrace();
+//		}
+		return hasChildren;
+	}
+	
+
+	public void setName(String name) {
+		super.setTagName(name);
+	}
+		
+	public void addAdapter(INodeAdapter adapter) {
+		adaptableDomNode.addAdapter(adapter);
+	}
+	
+	
+	public boolean contains(int testPosition) {
+		return false;
+	}
+	
+	
+	public boolean equals(Object o) {
+		return (o != null && o instanceof JsJfaceNode && ((JsJfaceNode) o).fDocPosition == this.fDocPosition);
+	}
+	
+// public static Object getInstance(Object parent, Position structureDocLocation
+// ){
+// //return new JsJfaceNode((JavaElement)parent.getParent(),
+// parent.getElementName(),structureDocLocation);
+// Vector interfaces = new Vector();
+// interfaces.addAll(Arrays.asList(parent.getClass().getInterfaces()));
+// JsJfaceNode me = new JsJfaceNode(parent,structureDocLocation);
+// interfaces.addAll(Arrays.asList(me.getClass().getInterfaces()));
+// Object proxy = null;
+// try {
+// proxy= Proxy.newProxyInstance(
+// parent.getClass().getClassLoader(),
+// (Class[])interfaces.toArray(new Class[]{}),me);
+// } catch (Exception e) {
+// // TODO Auto-generated catch block
+// System.out.println(e);
+// }
+// return proxy;
+// }
+//   
+	
+	public INodeAdapter getAdapterFor(Object type) {
+		return adaptableDomNode.getAdapterFor(type);
+	}
+	
+	
+	public Collection getAdapters() {
+		return adaptableDomNode.getAdapters();
+	}
+	
+	
+	public int getEndOffset() {
+		return fDocPosition.getOffset() + fDocPosition.getLength();
+	}
+	
+	
+	public INodeAdapter getExistingAdapter(Object type) {
+		// TODO Auto-generated method stub
+		return adaptableDomNode.getExistingAdapter(type);
+	}
+	
+	public synchronized IJavaScriptElement getJavaElement() {
+		/*
+		 * since this may become 'stale' we need to rediscover our element every
+		 * time we're asked
+		 */
+		IJsTranslation tran = getTranslation();
+		int startOffset = getStartOffset();
+		int endOffset = getLength();
+		if (typeName != null) {
+			IJavaScriptElement myType = tran.getCompilationUnit().getType(typeName);
+			return myType;
+		}
+		IJavaScriptElement elements[] = tran.getAllElementsInJsRange(startOffset, startOffset + endOffset);
+		if (elements != null) {
+			return elements[0];
+		} else {
+			System.out.println(Messages.getString("JsJfaceNode.1")); //$NON-NLS-1$
+			return null;
+		}
+	}
+	
+	
+	public int getLength() {
+		return fDocPosition.getLength();
+	}
+	
+	
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.xml.core.internal.document.NodeImpl#getOwnerDocument()
+	 */
+	
+
+	
+	
+
+	
+	
+	public int getStartOffset() {
+		return fDocPosition.getOffset();
+	}
+	
+// private Method[] getMethods(){
+// // returns the methods this class supports (as declared in interfaces)
+// Class[] interfaces = getClass().getInterfaces();
+// Vector vMethods = new Vector();
+// for(int i = 0;i<interfaces.length;i++){
+// Method methods[] = interfaces[i].getDeclaredMethods();
+// vMethods.addAll(Arrays.asList(methods));
+// }
+//        
+// return (Method[])vMethods.toArray();
+// }
+// public Object invoke(Object proxy, Method method, Object[] args) throws
+// Throwable {
+// Object result;
+// Method[] myMethods = getMethods();
+//        
+// try {
+// for(int i = 0;i<myMethods.length;i++){
+// if(myMethods[i]==method){
+// return method.invoke(this, args);
+// }
+// }
+// result = method.invoke(parentType, args);
+// } catch (InvocationTargetException e) {
+// throw e.getTargetException();
+// } catch (Exception e) {
+// throw new RuntimeException("unexpected invocation exception: " +
+// e.getMessage());
+// }
+//
+// return result;
+// }
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.xml.core.internal.document.NodeImpl#getStructuredDocument()
+	 */
+	
+
+	
+	public IJsTranslation getTranslation() {
+		IStructuredModel model = null;
+		IModelManager modelManager = StructuredModelManager.getModelManager();
+		IDOMDocument xmlDoc = null;
+		try {
+			if (modelManager != null) {
+				IStructuredDocument doc = getStructuredDocument();
+				model = modelManager.getExistingModelForRead(doc);
+				// model = modelManager.getModelForRead(doc);
+			}
+			IDOMModel domModel = (IDOMModel) model;
+			xmlDoc = domModel.getDocument();
+		} catch (Exception e) {
+			Logger.logException(e);
+		} finally {
+			if (model != null) {
+				// model.changedModel();
+				model.releaseFromRead();
+			}
+		}
+		if (xmlDoc == null) {
+			return null;
+		}
+		JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+		return translationAdapter.getJsTranslation(true);
+	}
+	
+	
+	public void notify(int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
+		adaptableDomNode.notify(eventType, changedFeature, oldValue, newValue, pos);
+	}
+	
+	
+	public void removeAdapter(INodeAdapter adapter) {
+		adaptableDomNode.removeAdapter(adapter);
+	}
+	
+	public void setAdapterRegistry(FactoryRegistry registry) {
+		this.adapterRegistry = registry;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/Messages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/Messages.java
new file mode 100644
index 0000000..8a44813
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/Messages.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.views.contentoutline;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ * @author childsb
+ *
+ */
+public class Messages {
+	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.ui.views.contentoutline.messages"; //$NON-NLS-1$
+
+	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+	private Messages() {
+	}
+
+	public static String getString(String key) {
+		try {
+			return RESOURCE_BUNDLE.getString(key);
+		}
+		catch (MissingResourceException e) {
+			return '!' + key + '!';
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/messages.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/messages.properties
new file mode 100644
index 0000000..b36e5be
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/messages.properties
@@ -0,0 +1,11 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+JsJfaceNode.1=error in JsJfaceNode... I couldn't retrieve my java element from the original page
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java
new file mode 100644
index 0000000..6e47c34
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java
@@ -0,0 +1,181 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterForHTML;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
+import org.eclipse.wst.jsdt.ui.StandardJavaScriptElementContentProvider;
+import org.eclipse.wst.jsdt.web.core.internal.Logger;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.xml.core.internal.document.NodeImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
+import org.w3c.dom.Node;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JFaceNodeAdapterForJs extends JFaceNodeAdapterForHTML {
+	public JFaceNodeAdapterForJs(JFaceNodeAdapterFactory adapterFactory) {
+		super(adapterFactory);
+	}
+	
+	
+	public Object[] getChildren(Object object) {
+		if (object instanceof IJavaScriptElement) {
+			return getJavaElementProvider().getChildren(object);
+		}
+		Node node = (Node) object;
+		if (isJSElementParent(node)) {
+// Object[] results = getJSElementsFromNode(node.getFirstChild());
+// IMember[] allResults = new IMember[results.length];
+// for(int i = 0;i<results.length;i++) {
+// if(results[i]==null) continue;
+// IMember member = ((IMember)results[i]);
+// allResults[i] = member;
+			// }
+			return getJSElementsFromNode(node.getFirstChild());
+		}
+		return super.getChildren(object);
+	}
+	
+	
+	public Object[] getElements(Object object) {
+		if (object instanceof IJavaScriptElement) {
+			return getJavaElementProvider().getElements(object);
+		}
+		return super.getElements(object);
+	}
+	
+	private JavaScriptElementLabelProvider getJavaElementLabelProvider() {
+		return new JavaScriptElementLabelProvider();
+	}
+	
+	private StandardJavaScriptElementContentProvider getJavaElementProvider() {
+		return new StandardJavaScriptElementContentProvider(true);
+	}
+	
+	private synchronized Object[] getJSElementsFromNode(Node node) {
+		if (node == null) {
+			return new Object[0];
+		}
+		int startOffset = 0;
+		int endOffset = 0;
+		IJavaScriptElement[] result = null;
+		IJsTranslation translation = null;
+		if (node.getNodeType() == Node.TEXT_NODE && (node instanceof NodeImpl)) {
+			startOffset = ((NodeImpl) node).getStartOffset();
+			endOffset = ((NodeImpl) node).getEndOffset();
+			translation = getTranslation(node);
+			result = translation.getAllElementsInJsRange(startOffset, endOffset);
+		}
+		return result;
+//			
+// if (result == null) return null;
+// Object[] newResults = new Object[result.length];
+// for (int i = 0; i < result.length; i++) {
+// int htmllength = 0;
+// int htmloffset = 0;
+// Position position = null;
+// try {
+// htmllength = ((SourceRefElement) (result[i])).getSourceRange().getLength();
+// htmloffset = translation.getJspOffset(((SourceRefElement)
+// (result[i])).getSourceRange().getOffset());
+// position = new Position(htmloffset, htmllength);
+// } catch (JavaScriptModelException e) {
+// e.printStackTrace();
+// }
+// newResults[i] = getJsNode(node.getParentNode(), (IJavaScriptElement) result[i],
+// position);
+// }
+// return newResults;
+	}
+	
+	
+	public Image getLabelImage(Object node) {
+		if (node instanceof IJavaScriptElement) {
+			return getJavaElementLabelProvider().getImage(node);
+		}
+		return super.getLabelImage(node);
+	}
+	
+	
+	public String getLabelText(Object node) {
+		if (node instanceof IJavaScriptElement) {
+			return getJavaElementLabelProvider().getText(node);
+		}
+		return super.getLabelText(node);
+	}
+	
+	
+	public Object getParent(Object element) {
+		if (element instanceof IJavaScriptElement) {
+			return getJavaElementProvider().getParent(element);
+		}
+		return super.getParent(element);
+	}
+	
+	private IJsTranslation getTranslation(Node node) {
+		IStructuredModel model = null;
+		IModelManager modelManager = StructuredModelManager.getModelManager();
+		IDOMDocument xmlDoc = null;
+		try {
+			if (modelManager != null) {
+				IStructuredDocument doc = ((NodeImpl) node).getStructuredDocument();
+				model = modelManager.getExistingModelForRead(doc);
+				// model = modelManager.getModelForRead(doc);
+			}
+			IDOMModel domModel = (IDOMModel) model;
+			xmlDoc = domModel.getDocument();
+		} catch (Exception e) {
+			Logger.logException(e);
+		} finally {
+			if (model != null) {
+				// model.changedModel();
+				model.releaseFromRead();
+			}
+		}
+		if (xmlDoc == null) {
+			return null;
+		}
+		JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+		return translationAdapter.getJsTranslation(true);
+	}
+	
+	
+	public boolean hasChildren(Object object) {
+		if (object instanceof IJavaScriptElement) {
+			return getJavaElementProvider().hasChildren(object);
+		}
+		Node node = (Node) object;
+		if (isJSElementParent(node)) {
+			Object[] results = getJSElementsFromNode(node.getFirstChild());
+			return (results != null && results.length > 0);
+		}
+		return super.hasChildren(object);
+	}
+	
+	private boolean isJSElementParent(Node node) {
+		return (node.getNodeName().equalsIgnoreCase("script")); //$NON-NLS-1$
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java
new file mode 100644
index 0000000..8889631
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsContentOutlineConfig extends HTMLContentOutlineConfiguration {
+	public static final boolean USE_ADVANCED = false;
+	ILabelProvider fLabelProvider = null;
+	
+	public JsContentOutlineConfig() {}
+	
+	private ILabelProvider getJavaLabelProvider() {
+		if (fLabelProvider == null) {
+			fLabelProvider = new JsLabelProvider();
+		}
+		return fLabelProvider;
+	}
+	
+	
+	public ILabelProvider getLabelProvider(TreeViewer viewer) {
+		if (!JsContentOutlineConfig.USE_ADVANCED) {
+			return super.getLabelProvider(viewer);
+		}
+		return getJavaLabelProvider();
+	}
+	
+	
+	public IMenuListener getMenuListener(TreeViewer treeViewer) {
+		// if(!USE_ADVANCED)
+		// return super.getMenuListener(treeViewer);
+		return new JsMenuListener(treeViewer);
+	}
+	
+	
+	public ILabelProvider getStatusLineLabelProvider(TreeViewer treeViewer) {
+		if (!JsContentOutlineConfig.USE_ADVANCED) {
+			return super.getStatusLineLabelProvider(treeViewer);
+		}
+		return getJavaLabelProvider();
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java
new file mode 100644
index 0000000..9c30f15
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java
@@ -0,0 +1,42 @@
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsLabelProvider extends XMLLabelProvider {
+	JavaScriptElementLabelProvider fLabelProvider = null;
+	
+	
+	public Image getImage(Object o) {
+		if (o instanceof IJavaScriptElement) {
+			return getJavaElementLabelProvider().getImage(o);
+		}
+		return super.getImage(o);
+	}
+	
+	private JavaScriptElementLabelProvider getJavaElementLabelProvider() {
+		if (fLabelProvider == null) {
+			fLabelProvider = new JavaScriptElementLabelProvider();
+		}
+		return fLabelProvider;
+	}
+	
+	
+	public String getText(Object o) {
+		if (o instanceof IJavaScriptElement) {
+			return getJavaElementLabelProvider().getText(o);
+		}
+		return super.getText(o);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java
new file mode 100644
index 0000000..1a0fd0b
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
+
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditorActionContributor;
+import org.eclipse.wst.jsdt.ui.IContextMenuConstants;
+import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.internal.IReleasable;
+import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsMenuListener extends XMLNodeActionManager implements IMenuListener, IReleasable {
+	public static final String EDIT_GROUP_ID = "group.edit"; //$NON-NLS-1$
+	CompilationUnitEditorActionContributor contrib;
+	private XMLNodeActionManager fActionManager;
+	private TreeViewer fTreeViewer;
+	ISelectionProvider selectionProvider;
+	
+	public JsMenuListener(TreeViewer viewer) {
+		super((IStructuredModel) viewer.getInput(), viewer);
+		contrib = new CompilationUnitEditorActionContributor();
+		fTreeViewer = viewer;
+//			
+// fActionGroups= new CompositeActionGroup(new ActionGroup[] {
+// new OpenViewActionGroup(getWorkbenchSite(), getSelectionProvider()),
+// new CCPActionGroup(getWorkbenchSite()),
+// new GenerateActionGroup(getWorkbenchSite()),
+// new RefactorActionGroup(getWorkbenchSite()),
+// new JavaSearchActionGroup(getWorkbenchSite())});
+	}
+	
+	public IAction[] getAllJsActions() {
+		return null;
+	}
+	
+//	private IWorkbenchSite getWorkbenchSite() {
+//		return InternalHandlerUtil.getActiveSite(fTreeViewer);
+//	}
+	
+	public void menuAboutToShow(IMenuManager manager) {
+		ISelection selection = fTreeViewer.getSelection();
+		if (selection instanceof TreeSelection) {
+			TreeSelection tselect = (TreeSelection) selection;
+			Object[] elements = tselect.toArray();
+			int javaCount = 0;
+			for (int i = 0; i < elements.length; i++) {
+				if (elements[i] instanceof IJavaWebNode) {
+					javaCount++;
+				}
+			}
+			//IContributionItem[] items = manager.getItems();
+// manager.add(new Separator(IContextMenuConstants.GROUP_NEW));
+// menu.add(new GroupMarker(IContextMenuConstants.GROUP_GOTO));
+// menu.add(new Separator(IContextMenuConstants.GROUP_OPEN));
+// manager.add(new GroupMarker(IContextMenuConstants.GROUP_SHOW));
+// menu.add(new Separator(ICommonMenuConstants.GROUP_EDIT));
+// menu.add(new Separator(IContextMenuConstants.GROUP_REORGANIZE));
+// menu.add(new Separator(IContextMenuConstants.GROUP_GENERATE));
+// menu.add(new Separator(IContextMenuConstants.GROUP_SEARCH));
+// menu.add(new Separator(IContextMenuConstants.GROUP_BUILD));
+// menu.add(new Separator(IContextMenuConstants.GROUP_ADDITIONS));
+// menu.add(new Separator(IContextMenuConstants.GROUP_VIEWER_SETUP));
+// menu.add(new Separator(IContextMenuConstants.GROUP_PROPERTIES));
+			if (javaCount == elements.length && javaCount != 0) {
+				// see plugin.xml for object contributions that populate these
+				// menus
+				/*
+				 * Menu for:
+				 * 
+				 * Open Type Hierarchy Open Call Hierarchy Show In--> Script
+				 * Explorer Navigator
+				 */
+				manager.add(new Separator(IContextMenuConstants.GROUP_SHOW));
+				manager.add(new GroupMarker(IContextMenuConstants.GROUP_SHOW));
+				/*
+				 * Menu for: Cut Copy Paste Delete
+				 */
+				manager.add(new Separator(JsMenuListener.EDIT_GROUP_ID));
+				manager.add(new GroupMarker(JsMenuListener.EDIT_GROUP_ID));
+				/*
+				 * Menu for:
+				 * 
+				 * Source--> Generate Element Comment
+				 * 
+				 * 
+				 * Refactor--> Rename Move Change Function Signature Inline
+				 * Introduce Indirection Infer Generic Type Arguments
+				 */
+				manager.add(new Separator(IContextMenuConstants.GROUP_SOURCE));
+				manager.add(new GroupMarker(IContextMenuConstants.GROUP_SOURCE));
+				/*
+				 * Menu for:
+				 * 
+				 * Refrences--> Workspace Project Hierarchy Working Set
+				 * 
+				 * Declerations--> Workspace Project Hierarchy Working Set
+				 * 
+				 */
+				manager.add(new Separator(IContextMenuConstants.GROUP_SEARCH));
+				manager.add(new GroupMarker(IContextMenuConstants.GROUP_SEARCH));
+				/* all Java Elements */
+//					
+//					
+//					
+// JavaScriptPlugin.createStandardGroups(manager);
+// String[] actionSets = JSDTActionSetUtil.getAllActionSets();
+//
+// IAction[] actions = JSDTActionSetUtil.getActionsFromSet(actionSets);
+// for(int i = 0;i<actions.length;i++) {
+// manager.add(actions[i]);
+// }
+// fActionGroups.setContext(new ActionContext(selection));
+// fActionGroups.fillContextMenu(manager);
+//					
+			} else if (javaCount == 0) {
+				fillContextMenu(manager, selection);
+			}
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.IReleasable#release()
+	 */
+	public void release() {
+		fTreeViewer = null;
+		if (fActionManager != null) {
+			fActionManager.setModel(null);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java
new file mode 100644
index 0000000..1c0db53
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
+
+import org.eclipse.wst.jsdt.ui.StandardJavaScriptElementContentProvider;
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsWebElementProvider extends StandardJavaScriptElementContentProvider {}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java
new file mode 100644
index 0000000..cf5c62c
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
+
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class XMLLabelProvider extends JFaceNodeLabelProvider {
+	boolean fShowAttributes = false;
+	
+	
+	public String getText(Object o) {
+		StringBuffer text = new StringBuffer(super.getText(o));
+		if (o instanceof Node) {
+			Node node = (Node) o;
+			if ((node.getNodeType() == Node.ELEMENT_NODE) && fShowAttributes) {
+				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88444
+				if (node.hasAttributes()) {
+					Element element = (Element) node;
+					NamedNodeMap attributes = element.getAttributes();
+					Node idTypedAttribute = null;
+					Node requiredAttribute = null;
+					boolean hasId = false;
+					boolean hasName = false;
+					Node shownAttribute = null;
+					// try to get content model element
+					// declaration
+					CMElementDeclaration elementDecl = null;
+					ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
+					if (mq != null) {
+						elementDecl = mq.getCMElementDeclaration(element);
+					}
+					// find an attribute of type (or just named)
+					// ID
+					if (elementDecl != null) {
+						int i = 0;
+						while ((i < attributes.getLength()) && (idTypedAttribute == null)) {
+							Node attr = attributes.item(i);
+							String attrName = attr.getNodeName();
+							CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) elementDecl.getAttributes().getNamedItem(attrName);
+							if (attrDecl != null) {
+								if ((attrDecl.getAttrType() != null) && (CMDataType.ID.equals(attrDecl.getAttrType().getDataTypeName()))) {
+									idTypedAttribute = attr;
+								} else if ((attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED) && (requiredAttribute == null)) {
+									// as a backup, keep tabs on
+									// any required
+									// attributes
+									requiredAttribute = attr;
+								} else {
+									hasId = hasId || attrName.equals("id"); //$NON-NLS-1$
+									hasName = hasName || attrName.equals("name"); //$NON-NLS-1$
+								}
+							}
+							++i;
+						}
+					}
+					/*
+					 * If no suitable attribute was found, try using a
+					 * required attribute, if none, then prefer "id" or
+					 * "name", otherwise just use first attribute
+					 */
+					if (idTypedAttribute != null) {
+						shownAttribute = idTypedAttribute;
+					} else if (requiredAttribute != null) {
+						shownAttribute = requiredAttribute;
+					} else if (hasId) {
+						shownAttribute = attributes.getNamedItem("id"); //$NON-NLS-1$
+					} else if (hasName) {
+						shownAttribute = attributes.getNamedItem("name"); //$NON-NLS-1$
+					}
+					if (shownAttribute == null) {
+						shownAttribute = attributes.item(0);
+					}
+					// display the attribute and value (without quotes)
+					String attributeName = shownAttribute.getNodeName();
+					if ((attributeName != null) && (attributeName.length() > 0)) {
+						text.append(" " + attributeName); //$NON-NLS-1$
+						String attributeValue = shownAttribute.getNodeValue();
+						if ((attributeValue != null) && (attributeValue.length() > 0)) {
+							text.append("=" + StringUtils.strip(attributeValue)); //$NON-NLS-1$
+						}
+					}
+				}
+			}
+		}
+		return text.toString();
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.GIF b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.GIF
new file mode 100644
index 0000000..a9a220d
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.GIF
Binary files differ
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.JPG b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.JPG
new file mode 100644
index 0000000..68bf9c5
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.JPG
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.core/.options b/bundles/org.eclipse.wst.sse.core/.options
index 94d01b5..50b0b16 100644
--- a/bundles/org.eclipse.wst.sse.core/.options
+++ b/bundles/org.eclipse.wst.sse.core/.options
@@ -3,6 +3,7 @@
 org.eclipse.wst.sse.core/dom/adapter/notification/time/criteria=10
 org.eclipse.wst.sse.core/structureddocument=false
 org.eclipse.wst.sse.core/filebuffers/modelmanagement=false
+org.eclipse.wst.sse.core/filebuffers/leaks=true
 org.eclipse.wst.sse.core/filebuffers/lifecycle=false
 org.eclipse.wst.sse.core/structuredmodel/lifecycle=false
 org.eclipse.wst.sse.core/structuredmodel/state=false
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex
index fd5dc23..8a11a4e 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex
@@ -1,5 +1,5 @@
 /*******************************************************************************

- * Copyright (c) 2004, 2008 IBM Corporation and others.

+ * Copyright (c) 2004, 2010 IBM Corporation and others.

  * All rights reserved. This program and the accompanying materials

  * are made available under the terms of the Eclipse Public License v1.0

  * which accompanies this distribution, and is available at

@@ -24,6 +24,7 @@
 

 

 	private boolean hasMore = true;

+	private boolean hasCharsetAttr = false;

 	private final static int MAX_TO_SCAN = 8000;

 	StringBuffer string = new StringBuffer();

 	// state stack for easier state handling

@@ -70,7 +71,7 @@
   		yy_endRead = 0;

 

   		/* number of newlines encountered up to the start of the matched text */

-  		yyline = 0;

+  		// yyline = 0;

 

   		/* the number of characters up to the start of the matched text */

   		yychar = 0;

@@ -79,7 +80,7 @@
   		 * the number of characters from the last newline up to the start

   		 * of the matched text

   		 */

-  		yycolumn = 0; 

+  		// yycolumn = 0; 

 

   		/** 

   		 * yy_atBOL == true <=> the scanner is currently at the beginning 

@@ -97,6 +98,7 @@
   		fStateStack.clear();

   		

   		hasMore = true;

+  		hasCharsetAttr = false;

   		

 		// its a little wasteful to "throw away" first char array generated

 		// by class init (via auto generated code), but we really do want

@@ -111,8 +113,16 @@
 

 	public final HeadParserToken getNextToken() throws IOException {

 		String context = null;

-		context = primGetNextToken();

 		HeadParserToken result = null;

+		try {

+			context = primGetNextToken();

+		}

+		catch (IllegalStateException e) {

+			hasMore = false;

+			result = createToken(HTMLHeadTokenizerConstants.UNDEFINED, yychar, yytext());

+			while(yy_advance() != YYEOF) {}

+			return result;

+		}

 		if (valueText != null) {

 			result = createToken(context, yychar, valueText);

 			valueText = null;

@@ -129,6 +139,9 @@
 		fStateStack.push(yystate());

 

 	}

+	public final boolean hasCharsetAttr() {

+		return hasCharsetAttr;

+	}

 

 	private void popState() {

 		yybegin(fStateStack.pop());

@@ -211,6 +224,7 @@
 

 //	"http-equiv" {S}* \= {S}* \"? "Content-Type" \"? {S}+ "content" {BeginAttribeValue}  {pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType;}

 	{Z}h{Z}t{Z}t{Z}p{Z}-{Z}e{Z}q{Z}u{Z}i{Z}v{Z} {S_UTF}* \= {S_UTF}* {Z}\"?{Z} ({Z}C{Z}o{Z}n{Z}t{Z}e{Z}n{Z}t{Z}-{Z}T{Z}y{Z}p{Z}e{Z}) \"?{Z} ({S_UTF})+ ({Z}c{Z}o{Z}n{Z}t{Z}e{Z}n{Z}t{Z}) {BeginAttributeValueUTF}  {pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType;}

+	{Z}c{Z}h{Z}a{Z}r{Z}s{Z}e{Z}t{Z} {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; hasCharsetAttr=true; return HTMLHeadTokenizerConstants.MetaTagContentType;}

 	{Z}>{Z}    { yybegin(YYINITIAL);  if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd;}

 	{Z}\/{Z}>{Z}    { yybegin(YYINITIAL); if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd;}

 }

diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton
new file mode 100644
index 0000000..4a9b3f7
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton
@@ -0,0 +1,268 @@
+

+  /** this character denotes the end of file */

+  final public static int YYEOF = -1;

+

+  /** lexical states */

+---  lexical states, charmap

+

+  /* error codes */

+  final private static int YY_UNKNOWN_ERROR = 0;

+  final private static int YY_ILLEGAL_STATE = 1;

+  final private static int YY_NO_MATCH = 2;

+  final private static int YY_PUSHBACK_2BIG = 3;

+

+  /* error messages for the codes above */

+  final private static String YY_ERROR_MSG[] = {

+    "Unkown internal scanner error",

+    "Internal error: unknown state",

+    "Error: could not match input",

+    "Error: pushback value was too large"

+  };

+

+--- isFinal list

+  /** the input device */

+  private java.io.Reader yy_reader;

+

+  /** the current state of the DFA */

+  private int yy_state;

+

+  /** the current lexical state */

+  private int yy_lexical_state = YYINITIAL;

+

+  /** this buffer contains the current text to be matched and is

+      the source of the yytext() string */

+  private char yy_buffer[] = new char[16384];

+

+  /** the textposition at the last accepting state */

+  private int yy_markedPos;

+

+  /** the textposition at the last state to be included in yytext */

+  private int yy_pushbackPos;

+

+  /** the current text position in the buffer */

+  private int yy_currentPos;

+

+  /** startRead marks the beginning of the yytext() string in the buffer */

+  private int yy_startRead;

+

+  /** endRead marks the last character in the buffer, that has been read

+      from input */

+  private int yy_endRead;

+

+  /** number of newlines encountered up to the start of the matched text */

+  //private int yyline;

+

+  /** the number of characters up to the start of the matched text */

+  private int yychar;

+

+  /**

+   * the number of characters from the last newline up to the start of the 

+   * matched text

+   */

+  //private int yycolumn; 

+

+  /** 

+   * yy_atBOL == true <=> the scanner is currently at the beginning of a line

+   */

+  private boolean yy_atBOL;

+

+  /** yy_atEOF == true <=> the scanner has returned a value for EOF */

+  private boolean yy_atEOF;

+

+--- user class code

+

+  /**

+   * Creates a new scanner

+   * There is also a java.io.InputStream version of this constructor.

+   *

+   * @param   in  the java.io.Reader to read input from.

+   */

+--- constructor declaration

+

+

+  /**

+   * Gets the next input character.

+   *

+   * @return      the next character of the input stream, EOF if the

+   *              end of the stream is reached.

+   * @exception   IOException  if any I/O-Error occurs

+   */

+  private int yy_advance() throws java.io.IOException {

+

+    /* standard case */

+    if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];

+

+    /* if the eof is reached, we don't need to work hard */ 

+    if (yy_atEOF) return YYEOF;

+

+    /* otherwise: need to refill the buffer */

+

+    /* first: make room (if you can) */

+    if (yy_startRead > 0) {

+      System.arraycopy(yy_buffer, yy_startRead, 

+                       yy_buffer, 0, 

+                       yy_endRead-yy_startRead);

+

+      /* translate stored positions */

+      yy_endRead-= yy_startRead;

+      yy_currentPos-= yy_startRead;

+      yy_markedPos-= yy_startRead;

+      yy_pushbackPos-= yy_startRead;

+      yy_startRead = 0;

+    }

+

+    /* is the buffer big enough? */

+    if (yy_currentPos >= yy_buffer.length) {

+      /* if not: blow it up */

+      char newBuffer[] = new char[yy_currentPos*2];

+      System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);

+      yy_buffer = newBuffer;

+    }

+

+    /* finally: fill the buffer with new input */

+    int numRead = yy_reader.read(yy_buffer, yy_endRead, 

+                                            yy_buffer.length-yy_endRead);

+

+    if ( numRead == -1 ) return YYEOF;

+

+    yy_endRead+= numRead;

+

+    return yy_buffer[yy_currentPos++];

+  }

+

+    

+  /**

+   * Closes the input stream.

+   */

+  final public void yyclose() throws java.io.IOException {

+    yy_atEOF = true;            /* indicate end of file */

+    yy_endRead = yy_startRead;  /* invalidate buffer    */

+    yy_reader.close();

+  }

+

+

+  /**

+   * Returns the current lexical state.

+   */

+  final public int yystate() {

+    return yy_lexical_state;

+  }

+

+  /**

+   * Enters a new lexical state

+   *

+   * @param newState the new lexical state

+   */

+  final public void yybegin(int newState) {

+    yy_lexical_state = newState;

+  }

+

+

+  /**

+   * Returns the text matched by the current regular expression.

+   */

+  final public String yytext() {

+    return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );

+  }

+

+  /**

+   * Returns the length of the matched text region.

+   */

+  final public int yylength() {

+    return yy_markedPos-yy_startRead;

+  }

+

+

+  /**

+   * Reports an error that occured while scanning.

+   *

+   * @param   errorCode  the code of the errormessage to display

+   */

+  private void yy_ScanError(int errorCode) {

+    try {

+      IllegalStateException ise = new IllegalStateException("Instance: " + System.identityHashCode(this) + " offset:" + yychar + " state:" + yystate());

+      System.out.println(YY_ERROR_MSG[errorCode] + "\n" + ise);

+      throw ise;

+    }

+    catch (ArrayIndexOutOfBoundsException e) {

+      System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);

+    }

+

+  } 

+

+

+  /**

+   * Pushes the specified amount of characters back into the input stream.

+   *

+   * They will be read again by then next call of the scanning method

+   *

+   * @param number  the number of characters to be read again.

+   *                This number must not be greater than yylength()!

+   */

+  private void yypushback(int number) {

+    if ( number > yylength() )

+      yy_ScanError(YY_PUSHBACK_2BIG);

+

+    yy_markedPos -= number;

+  }

+

+

+--- yy_doEof

+  /**

+   * Resumes scanning until the next regular expression is matched,

+   * the end of input is encountered or an I/O-Error occurs.

+   *

+   * @return      the next token

+   * @exception   IOException  if any I/O-Error occurs

+   */

+--- yylex declaration

+    int yy_input;

+    int yy_action;

+

+--- local declarations

+

+    while (true) {

+

+--- start admin (line, char, col count)

+      yy_action = -1;

+

+      yy_currentPos = yy_startRead = yy_markedPos;

+

+--- start admin (lexstate etc)

+

+      yy_forAction: {

+        while (true) {

+    

+          yy_input = yy_advance();

+

+          if ( yy_input == YYEOF ) break yy_forAction;

+

+--- line, col, char count, next transition, isFinal action

+            yy_action = yy_state; 

+            yy_markedPos = yy_currentPos; 

+--- line count update

+          }

+

+        }

+      }

+

+--- char count update

+

+      switch (yy_action) {    

+

+--- actions

+        default: 

+          if (yy_input == YYEOF && yy_startRead == yy_currentPos) {

+            yy_atEOF = true;

+--- eofvalue

+          } 

+          else {

+--- no match

+          }

+      }

+    }

+  }    

+

+--- main

+

+}

diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton.readme b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton.readme
new file mode 100644
index 0000000..eb89700
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton.readme
@@ -0,0 +1,6 @@
+The skeleton.sed file contains the modified JFlex 1.2.2 skeleton file with

+changes for use with the tokenizers within the org.eclipse.wst.sse.core.xml and

+org.eclipse.wst.sse.core.jsp plugins.

+

+The skeleton file's method definitions are copied into the generated output

+directly.

diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex
index 1a269c6..ea7c6af2 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex
@@ -1,5 +1,5 @@
 /*******************************************************************************

- * Copyright (c) 2004, 2008 IBM Corporation and others.

+ * Copyright (c) 2004, 2009 IBM Corporation and others.

  * All rights reserved. This program and the accompanying materials

  * are made available under the terms of the Eclipse Public License v1.0

  * which accompanies this distribution, and is available at

@@ -103,7 +103,7 @@
 					spaceFollows = (nextTokenType == CSS_S);

 				}

 				if (nextTokenType != null) { // nextToken is retrieved

-					if (spaceFollows) {

+					if (spaceFollows && (context != CSS_COMMENT)) {

 						// next is space -> append

 //						text.append(yytext());

 						length += yylength();

@@ -364,6 +364,7 @@
  */

 <ST_MEDIA_MEDIUM> {

 	{ident} { yybegin(ST_MEDIA_DELIMITER); return CSS_MEDIUM; }

+	"{" { yybegin(YYINITIAL); return CSS_LBRACE; }

 }

 

 <ST_MEDIA_DELIMITER> {

@@ -462,7 +463,7 @@
  */

 

 <ST_DECLARATION> {

-	{ident} { yybegin(ST_DECLARATION_SEPARATOR); return CSS_DECLARATION_PROPERTY; }

+	\x2A?{ident} { yybegin(ST_DECLARATION_SEPARATOR); return CSS_DECLARATION_PROPERTY; }

 }

 

 <ST_DECLARATION_SEPARATOR> {

diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
index 32fdb7b..dbae01f 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
@@ -1,5 +1,5 @@
 /*******************************************************************************

- * Copyright (c) 2004, 2007 IBM Corporation and others.

+ * Copyright (c) 2004, 2010 IBM Corporation and others.

  * All rights reserved. This program and the accompanying materials

  * are made available under the terms of the Eclipse Public License v1.0

  * which accompanies this distribution, and is available at

@@ -7,6 +7,7 @@
  * 

  * Contributors:

  *     IBM Corporation - initial API and implementation

+ *     Frits Jalvingh - contributions for bug 150794

  *******************************************************************************/

 

 package org.eclipse.jst.jsp.core.internal.parser.internal;

@@ -39,7 +40,8 @@
 	private String fBufferedContext = null;

 	private int fBufferedStart = 1;

 	private int fBufferedLength = 0;

-	private ContextRegionContainer fBufferedEmbeddedContainer = null;

+	private ITextRegion fBufferedEmbeddedContainer = null;

+	private ITextRegion fProxyUnknownRegion = null;

 	private String f_context = null;

 

 	// state stack for handling embedded regions

@@ -49,9 +51,11 @@
 	// a "hint" as to what state to enter once an embedded region has

 	//   been completed

 	private int fEmbeddedPostState = YYINITIAL;

+	

 	// the container used to create embedded regions

 	private ContextRegionContainer fEmbeddedContainer = null;

 	private static final String PROXY_CONTEXT = "PROXY_CONTEXT";

+	private static final String PROXY_UNKNOWN_CONTEXT = "PROXY_UNKNOWN_CONTEXT";

 

 	private String context = null;

 	private int start = 0;

@@ -85,6 +89,15 @@
 

 	private JSPParserRegionFactory fRegionFactory = new JSPParserRegionFactory();

 

+	// Is the embedded tag a JSP tag

+	private boolean fEmbeddedTag = false;

+	// Is the non-embedded tag a JSP tag

+	private boolean fContainerTag = false;

+	// Is the tokenizer in a non-embedded tag (between < and >)

+	private boolean fInTagContainer = false;

+	// Is the tokenizer in an embedded tag (between < and >)

+	private boolean fInTagEmbedded = false;

+

 	/**

 	 * user method 

 	 */

@@ -409,215 +422,221 @@
  */

 private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, String searchContext, int exitState, int immediateFallbackState) throws IOException {

 	boolean stillSearching = true;

-	// Disable further block (probably)

-	fIsBlockingEnabled = false;

-	int searchStringLength = searchString.length();

-	int n = 0;

-	char lastCheckChar;

-	int i;

-	boolean same = false;

-	// Check for JSP starts ("<%") if the tag is global like SCRIPT or STYLE

-	boolean checkJSPs = allowJSP && !fForbidJSP;

-	boolean checkedForJSPsOnce = !checkJSPs;

-	boolean checkedJSPsAtStartOnce = false;

-	

-	while (stillSearching) {

-		n = 0;

-		// Ensure that enough data from the input exists to compare against the search String.

-		n = yy_advance();

-		while(n != YYEOF && yy_currentPos < searchStringLength)

+	boolean wasBlockingEnabled = fIsBlockingEnabled;

+	try {

+		// Disable further block (probably)

+		fIsBlockingEnabled = false;

+		int searchStringLength = searchString.length();

+		int n = 0;

+		char lastCheckChar;

+		int i;

+		boolean same = false;

+		// Check for JSP starts ("<%") if the tag is global like SCRIPT or STYLE

+		boolean checkJSPs = allowJSP && !fForbidJSP;

+		boolean checkedForJSPsOnce = !checkJSPs;

+		boolean checkedJSPsAtStartOnce = false;

+		

+		while (stillSearching) {

+			n = 0;

+			// Ensure that enough data from the input exists to compare against the search String.

 			n = yy_advance();

-//		c = (char) n;

-		// If the input was too short or we've exhausted the input, stop immediately.

-		if (n == YYEOF && checkedForJSPsOnce) {

-			stillSearching = false;

-		}

-		else {

-			/**

-			 * Look for starting JSPs "<%"

-			 */

-			checkedForJSPsOnce = true;

-			// 1) yy_currentPos - searchStringLength : There's at least searchStringLength of input available; once that's read, check for JSPs

-			// ---

-			// Look for a JSP beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.

-			// Ensure that we've not encountered a complete block (<%%>) that was *shorter* than the closeTagString and

-			// thus found twice at current-targetLength [since the first scan would have come out this far anyway].

-			if(checkJSPs && yy_currentPos > searchStringLength && yy_currentPos - searchStringLength != fLastInternalBlockStart && 

-				yy_buffer[yy_currentPos - searchStringLength] == '<' && yy_buffer[yy_currentPos - searchStringLength + 1] == '%') {

-				fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;

-				yy_currentPos = yy_markedPos + 1;

-				int resumeState = yystate();

-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

-				if(yy_markedPos == yy_startRead) {

-					String jspContext = primGetNextToken();

-					yybegin(resumeState);

-					return jspContext;

-				}

-				return searchContext;

-			}

-			// 2) yy_currentPos - jspstarter.length : There's not searchStringLength of input available; check for a JSP 2 spots back in what we could read

-			// ---

-			// Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section

-			// since it relies upon *having* closeTagStringLength amount of input to work as designed.  Must be sure we don't

-			// spill over the end of the buffer while checking.

-			else if(checkJSPs && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&

-					yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {

-				fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;

-				yy_currentPos = yy_markedPos + 1;

-				int resumeState = yystate();

-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

-				if(yy_markedPos == yy_startRead) {

-					String jspContext = primGetNextToken();

-					yybegin(resumeState);

-					return jspContext;

-				}

-				return searchContext;

-			}

-			// 3) yy_currentPos..(yy_currentPos+jspStartlength-1) : Check at the start of the block one time

-			// ---

-			// Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section

-			// since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.

-			else if(checkJSPs && !checkedJSPsAtStartOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&

-					yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {

-				checkedJSPsAtStartOnce = true;

-				fLastInternalBlockStart = yy_markedPos = yy_startRead;

-				yy_currentPos = yy_markedPos + 1;

-				int resumeState = yystate();

-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

-				if(yy_markedPos == yy_startRead) {

-					String jspContext = primGetNextToken();

-					yybegin(resumeState);

-					return jspContext;

-				}

-				return searchContext;

-			}

-

-

-			/**

-			 * Look for starting CDATA "<![CDATA["

-			 */

-			// 1) yy_currentPos - searchStringLength: There's at least searchStringLength of input available; once that's read, check for CDATA

-			// ---

-			// Look for a CDATA beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.

-			// Ensure that we've not encountered a complete block (<[!CDATA[]]>) that was *shorter* than the closeTagString and

-			// thus found twice at current-targetLength [since the first scan would have come out this far anyway].

-/*			if(checkCDATA && yy_currentPos > searchStringLength && yy_currentPos + searchStringLength < yy_buffer.length && yy_currentPos - searchStringLength != fLastInternalBlockStart && 

-				charsMatch(cdataStarter, yy_buffer, 0, yy_currentPos - searchStringLength)) {

-				fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;

-				yy_currentPos = yy_markedPos + 1;

-				int resumeState = yystate();

-				// go to a state where CDATA can be found

-				if (fEmbeddedContainer == null) {

-					fEmbeddedContainer = new ContextRegionContainer();

-					fEmbeddedContainer.setType(searchContext);

-					fEmbeddedContainer.setStart(yychar);

-				}

-				ITextRegion newToken = fRegionFactory.createToken(searchContext, yychar, yylength(), yylength());

-				fEmbeddedContainer.getRegions().add(newToken);

-				fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());

-				fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());

-				yybegin(YYINITIAL);

-				String context = primGetNextToken();

-				if(context.equals(XMLRegionContexts.XML_CDATA_OPEN)) {

-					assembleEmbeddedContainer(XMLRegionContexts.XML_CDATA_OPEN, XMLRegionContexts.XML_CDATA_CLOSE);

-				}

-				yybegin(resumeState);

-				return searchContext;

-			}

-*//*

-			// 2) yy_currentPos - cdataStarter.length: There's not searchStringLength of input available; check for a CDATA right here spots back in what we could read

-			// ---

-			// Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section

-			// since it relies upon *having* closeTagStringLength amount of input to work as designed.  Must be sure we don't

-			// spill over the end of the buffer while checking.

-			else if(checkCDATA && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&

-					yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {

-				fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;

-				yy_currentPos = yy_markedPos + 1;

-				int resumeState = yystate();

-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

-				if(yy_markedPos == yy_startRead) {

-					String jspContext = primGetNextToken();

-					yybegin(resumeState);

-					return jspContext;

-				}

-				return searchContext;

-			}

-			// 3) yy_currentPos : Check at the start of the block one time

-			// ---

-			// Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section

-			// since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.

-			else if(checkCDATA && !checkedForCDATAOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&

-					yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {

-				checkedForCDATAOnce = true;

-				fLastInternalBlockStart = yy_markedPos = yy_startRead;

-				yy_currentPos = yy_markedPos + 1;

-				int resumeState = yystate();

-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

-				if(yy_markedPos == yy_startRead) {

-					String jspContext = primGetNextToken();

-					yybegin(resumeState);

-					return jspContext;

-				}

-				return searchContext;

-			}

-*/

-			// Check the characters in the target versus the last targetLength characters read from the buffer

-			// and see if it matches

-			if (n == YYEOF) {

+			while(n != YYEOF && yy_currentPos < searchStringLength)

+				n = yy_advance();

+	//		c = (char) n;

+			// If the input was too short or we've exhausted the input, stop immediately.

+			if (n == YYEOF && checkedForJSPsOnce) {

 				stillSearching = false;

 			}

 			else {

-				same = true;

-				// safety check for array accesses

-				if(yy_currentPos >= searchStringLength && yy_currentPos <= yy_buffer.length) {

-					for(i = 0; i < searchStringLength; i++) {

-						if(same && fIsCaseSensitiveBlocking)

-							same = yy_buffer[i + yy_currentPos - searchStringLength] == searchString.charAt(i);

-						else if(same && !fIsCaseSensitiveBlocking)

-							same = Character.toLowerCase(yy_buffer[i + yy_currentPos - searchStringLength]) == Character.toLowerCase(searchString.charAt(i));

+				/**

+				 * Look for starting JSPs "<%"

+				 */

+				checkedForJSPsOnce = true;

+				// 1) yy_currentPos - searchStringLength : There's at least searchStringLength of input available; once that's read, check for JSPs

+				// ---

+				// Look for a JSP beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.

+				// Ensure that we've not encountered a complete block (<%%>) that was *shorter* than the closeTagString and

+				// thus found twice at current-targetLength [since the first scan would have come out this far anyway].

+				if(checkJSPs && yy_currentPos > searchStringLength && yy_currentPos - searchStringLength != fLastInternalBlockStart && 

+					yy_buffer[yy_currentPos - searchStringLength] == '<' && yy_buffer[yy_currentPos - searchStringLength + 1] == '%') {

+					fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;

+					yy_currentPos = yy_markedPos + 1;

+					int resumeState = yystate();

+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

+					if(yy_markedPos == yy_startRead) {

+						String jspContext = primGetNextToken();

+						yybegin(resumeState);

+						return jspContext;

+					}

+					return searchContext;

+				}

+				// 2) yy_currentPos - jspstarter.length : There's not searchStringLength of input available; check for a JSP 2 spots back in what we could read

+				// ---

+				// Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section

+				// since it relies upon *having* closeTagStringLength amount of input to work as designed.  Must be sure we don't

+				// spill over the end of the buffer while checking.

+				else if(checkJSPs && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&

+						yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {

+					fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;

+					yy_currentPos = yy_markedPos + 1;

+					int resumeState = yystate();

+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

+					if(yy_markedPos == yy_startRead) {

+						String jspContext = primGetNextToken();

+						yybegin(resumeState);

+						return jspContext;

+					}

+					return searchContext;

+				}

+				// 3) yy_currentPos..(yy_currentPos+jspStartlength-1) : Check at the start of the block one time

+				// ---

+				// Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section

+				// since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.

+				else if(checkJSPs && !checkedJSPsAtStartOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&

+						yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {

+					checkedJSPsAtStartOnce = true;

+					fLastInternalBlockStart = yy_markedPos = yy_startRead;

+					yy_currentPos = yy_markedPos + 1;

+					int resumeState = yystate();

+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

+					if(yy_markedPos == yy_startRead) {

+						String jspContext = primGetNextToken();

+						yybegin(resumeState);

+						return jspContext;

+					}

+					return searchContext;

+				}

+	

+	

+				/**

+				 * Look for starting CDATA "<![CDATA["

+				 */

+				// 1) yy_currentPos - searchStringLength: There's at least searchStringLength of input available; once that's read, check for CDATA

+				// ---

+				// Look for a CDATA beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.

+				// Ensure that we've not encountered a complete block (<[!CDATA[]]>) that was *shorter* than the closeTagString and

+				// thus found twice at current-targetLength [since the first scan would have come out this far anyway].

+	/*			if(checkCDATA && yy_currentPos > searchStringLength && yy_currentPos + searchStringLength < yy_buffer.length && yy_currentPos - searchStringLength != fLastInternalBlockStart && 

+					charsMatch(cdataStarter, yy_buffer, 0, yy_currentPos - searchStringLength)) {

+					fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;

+					yy_currentPos = yy_markedPos + 1;

+					int resumeState = yystate();

+					// go to a state where CDATA can be found

+					if (fEmbeddedContainer == null) {

+						fEmbeddedContainer = new ContextRegionContainer();

+						fEmbeddedContainer.setType(searchContext);

+						fEmbeddedContainer.setStart(yychar);

+					}

+					ITextRegion newToken = fRegionFactory.createToken(searchContext, yychar, yylength(), yylength());

+					fEmbeddedContainer.getRegions().add(newToken);

+					fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());

+					fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());

+					yybegin(YYINITIAL);

+					String context = primGetNextToken();

+					if(context.equals(XMLRegionContexts.XML_CDATA_OPEN)) {

+						assembleEmbeddedContainer(XMLRegionContexts.XML_CDATA_OPEN, XMLRegionContexts.XML_CDATA_CLOSE);

+					}

+					yybegin(resumeState);

+					return searchContext;

+				}

+	*//*

+				// 2) yy_currentPos - cdataStarter.length: There's not searchStringLength of input available; check for a CDATA right here spots back in what we could read

+				// ---

+				// Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section

+				// since it relies upon *having* closeTagStringLength amount of input to work as designed.  Must be sure we don't

+				// spill over the end of the buffer while checking.

+				else if(checkCDATA && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&

+						yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {

+					fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;

+					yy_currentPos = yy_markedPos + 1;

+					int resumeState = yystate();

+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

+					if(yy_markedPos == yy_startRead) {

+						String jspContext = primGetNextToken();

+						yybegin(resumeState);

+						return jspContext;

+					}

+					return searchContext;

+				}

+				// 3) yy_currentPos : Check at the start of the block one time

+				// ---

+				// Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section

+				// since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.

+				else if(checkCDATA && !checkedForCDATAOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&

+						yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {

+					checkedForCDATAOnce = true;

+					fLastInternalBlockStart = yy_markedPos = yy_startRead;

+					yy_currentPos = yy_markedPos + 1;

+					int resumeState = yystate();

+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

+					if(yy_markedPos == yy_startRead) {

+						String jspContext = primGetNextToken();

+						yybegin(resumeState);

+						return jspContext;

+					}

+					return searchContext;

+				}

+	*/

+				// Check the characters in the target versus the last targetLength characters read from the buffer

+				// and see if it matches

+				if (n == YYEOF) {

+					stillSearching = false;

+				}

+				else {

+					same = true;

+					// safety check for array accesses

+					if(yy_currentPos >= searchStringLength && yy_currentPos <= yy_buffer.length) {

+						for(i = 0; i < searchStringLength && same; i++) {

+							if(fIsCaseSensitiveBlocking)

+								same = yy_buffer[i + yy_currentPos - searchStringLength] == searchString.charAt(i);

+							else

+								same = Character.toLowerCase(yy_buffer[i + yy_currentPos - searchStringLength]) == Character.toLowerCase(searchString.charAt(i));

+						}

+					}

+					// safety check failed; no match is possible right now

+					else {

+						same = false;

 					}

 				}

-				// safety check failed; no match is possible right now

+				if (same && requireTailSeparator && yy_currentPos < yy_buffer.length) {

+					// Additional check for close tags to ensure that targetString="</script" doesn't match

+					// "</scriptS"

+					lastCheckChar = yy_buffer[yy_currentPos];

+					// Succeed on "</script>" and "</script "

+					if(lastCheckChar == '>' || Character.isWhitespace(lastCheckChar))

+						stillSearching = false;

+				}

 				else {

-					same = false;

+					stillSearching = !same || (yy_currentPos < yy_startRead + searchStringLength);

 				}

 			}

-			if (same && requireTailSeparator && yy_currentPos < yy_buffer.length) {

-				// Additional check for close tags to ensure that targetString="</script" doesn't match

-				// "</scriptS"

-				lastCheckChar = yy_buffer[yy_currentPos];

-				// Succeed on "</script>" and "</script "

-				if(lastCheckChar == '>' || Character.isWhitespace(lastCheckChar))

-					stillSearching = false;

-			}

-			else {

-				stillSearching = !same || (yy_currentPos < yy_startRead + searchStringLength);

+		}

+		if (n != YYEOF || same) {

+			// We've stopped short of the end or definitely found a match

+			yy_markedPos = yy_currentPos - searchStringLength;

+			yy_currentPos = yy_markedPos + 1;

+			// If the searchString occurs at the very beginning of what would have

+			// been a Block, resume scanning normally immediately

+			if (yy_markedPos == yy_startRead) {

+				yybegin(immediateFallbackState);

+				return primGetNextToken();

 			}

 		}

-	}

-	if (n != YYEOF || same) {

-		// We've stopped short of the end or definitely found a match

-		yy_markedPos = yy_currentPos - searchStringLength;

-		yy_currentPos = yy_markedPos + 1;

-		// If the searchString occurs at the very beginning of what would have

+		else {

+			// We ran through the rest of the input

+			yy_markedPos = yy_currentPos;

+			yy_currentPos++;

+		}

+		yybegin(exitState);

+		// If the ending occurs at the very beginning of what would have

 		// been a Block, resume scanning normally immediately

-		if (yy_markedPos == yy_startRead) {

-			yybegin(immediateFallbackState);

+		if(yy_markedPos == yy_startRead)

 			return primGetNextToken();

-		}

+		return searchContext;

 	}

-	else {

-		// We ran through the rest of the input

-		yy_markedPos = yy_currentPos;

-		yy_currentPos++;

+	finally {

+		fIsBlockingEnabled = wasBlockingEnabled;

 	}

-	yybegin(exitState);

-	// If the ending occurs at the very beginning of what would have

-	// been a Block, resume scanning normally immediately

-	if(yy_markedPos == yy_startRead)

-		return primGetNextToken();

-	return searchContext;

 }

 /**

  * user method 

@@ -689,6 +708,8 @@
 			fIsBlockingEnabled = true;

 		} else if (f_context == XML_END_TAG_OPEN) {

 			fIsBlockingEnabled = false;

+		} else if (f_context == PROXY_UNKNOWN_CONTEXT) {

+			fBufferedEmbeddedContainer = fProxyUnknownRegion;

 		}

 		fBufferedContext = f_context;

 		fBufferedStart = yychar;

@@ -852,6 +873,11 @@
 		//  context as usual.

 		return doScan("--%>", false, false, true, JSP_COMMENT_TEXT, ST_JSP_COMMENT_END, ST_JSP_COMMENT_END);

 	}

+	

+	/* user method */

+	private boolean isJspTag() {

+		return (fContainerTag && fEmbeddedContainer != null) || (fContainerTag && fInTagContainer) || (fEmbeddedTag && fInTagEmbedded);

+	}

 %}

 

 %eof{

@@ -920,6 +946,7 @@
 %state ST_JSP_COMMENT

 %state ST_JSP_COMMENT_END

 

+%state ST_JSP_ATTRIBUTE_VALUE

 %state ST_XML_ATTRIBUTE_VALUE_SQUOTED

 %state ST_XML_ATTRIBUTE_VALUE_DQUOTED

 

@@ -989,7 +1016,10 @@
 

 // \x24 = '$', \x7b = '{', \x23 = '#'

 // [10] AttValue ::= '"' ([^<&"] | Reference)* '"' |  "'" ([^<&'] | Reference)* "'"

-AttValue = ( \"([^<"\x24\x23] | [\x24\x23][^\x7b"] | {Reference})*[\x24\x23]*\" | \'([^<'\x24\x23] | [\x24\x23][^\x7b'] | {Reference})*[\x24\x23]*\'  | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )*)

+AttValue = ( \"([^<"\x24\x23] | [\x24\x23][^\x7b"] | \\[\x24\x23][\x7b] | {Reference})* [\x24\x23]*\" | \'([^<'\x24\x23] | [\x24\x23][^\x7b'] | \\[\x24\x23][\x7b] | {Reference})*[\x24\x23]*\'  | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )*)

+

+// As Attvalue, but accepts escaped versions of the lead-in quote also

+QuotedAttValue = ( \"([^<"\x24\x23] | [\x24\x23][^\x7b"] | \\[\x24\x23][\x7b] | \\\" | {Reference})*[\x24\x23]*\" | \'([^<'\x24\x23] | [\x24\x23][^\x7b'] | \\[\x24\x23][\x7b] | \\\' | {Reference})*[\x24\x23]*\'  | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )*)

 

 // [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") 

 SystemLiteral = ((\" [^\"]* \") | (\' [^\']* \')) 

@@ -1338,7 +1368,7 @@
 %%

 

 /* white space within a tag */

-<ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_PI, ST_XML_PI_EQUALS, ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_ATTRIBUTE_VALUE, ST_XML_DECLARATION, ST_XML_DOCTYPE_DECLARATION, ST_XML_ELEMENT_DECLARATION, ST_XML_ATTLIST_DECLARATION, ST_XML_DECLARATION_CLOSE, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_EXTERNAL_ID, ST_JSP_DIRECTIVE_NAME, ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS, ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE,ST_XML_ATTRIBUTE_VALUE_DQUOTED,ST_XML_ATTRIBUTE_VALUE_SQUOTED,ST_DHTML_ATTRIBUTE_NAME,ST_DHTML_EQUALS,ST_DHTML_ATTRIBUTE_VALUE,ST_DHTML_TAG_CLOSE> {S}* {

+<ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE, ST_PI, ST_XML_PI_EQUALS, ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_ATTRIBUTE_VALUE, ST_XML_DECLARATION, ST_XML_DOCTYPE_DECLARATION, ST_XML_ELEMENT_DECLARATION, ST_XML_ATTLIST_DECLARATION, ST_XML_DECLARATION_CLOSE, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_EXTERNAL_ID, ST_JSP_DIRECTIVE_NAME, ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS, ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE,ST_XML_ATTRIBUTE_VALUE_DQUOTED,ST_XML_ATTRIBUTE_VALUE_SQUOTED,ST_DHTML_ATTRIBUTE_NAME,ST_DHTML_EQUALS,ST_DHTML_ATTRIBUTE_VALUE,ST_DHTML_TAG_CLOSE> {S}* {

 	if(Debug.debugTokenizer)

 		dump("white space");//$NON-NLS-1$

         return WHITE_SPACE;

@@ -1359,14 +1389,16 @@
 /* VERY special cases for tags as values */

 /* quoted JSP */

 <ST_XML_ATTRIBUTE_VALUE_DQUOTED> ["] {

-	return XML_TAG_ATTRIBUTE_VALUE_DQUOTE;

+	return isJspTag()? JSP_TAG_ATTRIBUTE_VALUE_DQUOTE : XML_TAG_ATTRIBUTE_VALUE_DQUOTE;

 }

 <ST_XML_ATTRIBUTE_VALUE_SQUOTED> ['] {

-	return XML_TAG_ATTRIBUTE_VALUE_SQUOTE;

+	return isJspTag() ? JSP_TAG_ATTRIBUTE_VALUE_SQUOTE : XML_TAG_ATTRIBUTE_VALUE_SQUOTE;

 }

-<ST_XML_ATTRIBUTE_VALUE> ["] {

+<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> ["] {

+	String type = yy_lexical_state == ST_XML_ATTRIBUTE_VALUE ? XML_TAG_ATTRIBUTE_VALUE_DQUOTE : JSP_TAG_ATTRIBUTE_VALUE_DQUOTE;

+

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", "+type);//$NON-NLS-1$

 	}

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 	fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;

@@ -1374,16 +1406,21 @@
 	fStateStack.push(yystate());

 	if(Debug.debugTokenizer)

 		dump("JSP attribute value start - complex double quoted");//$NON-NLS-1$

-	assembleEmbeddedContainer(XML_TAG_ATTRIBUTE_VALUE_DQUOTE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE);

+	assembleEmbeddedContainer(type, type);

 	fStateStack.pop();

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;

 	fEmbeddedPostState = ST_XML_EQUALS;

 	yybegin(ST_XML_ATTRIBUTE_NAME);

+	if (fEmbeddedContainer.getLastRegion().getType() == UNDEFINED) {

+		fProxyUnknownRegion = fRegionFactory.createToken(XML_TAG_ATTRIBUTE_VALUE, fEmbeddedContainer.getStart(), fEmbeddedContainer.getTextLength(), fEmbeddedContainer.getLength());

+		return PROXY_UNKNOWN_CONTEXT;

+	}

 	return PROXY_CONTEXT;

 }

-<ST_XML_ATTRIBUTE_VALUE> ['] {

+<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> ['] {

+	String type = yy_lexical_state == ST_XML_ATTRIBUTE_VALUE ? XML_TAG_ATTRIBUTE_VALUE_SQUOTE : JSP_TAG_ATTRIBUTE_VALUE_SQUOTE;

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", "+type);//$NON-NLS-1$

 	}

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 	fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;

@@ -1391,24 +1428,31 @@
 	fStateStack.push(yystate());

 	if(Debug.debugTokenizer)

 		dump("JSP attribute value start - complex single quoted");//$NON-NLS-1$

-	assembleEmbeddedContainer(XML_TAG_ATTRIBUTE_VALUE_SQUOTE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE);

+	assembleEmbeddedContainer(type, type);

 	fStateStack.pop();

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;

 	fEmbeddedPostState = ST_XML_EQUALS;

         yybegin(ST_XML_ATTRIBUTE_NAME);

+    if (fEmbeddedContainer.getLastRegion().getType() == UNDEFINED) {

+		fProxyUnknownRegion = fRegionFactory.createToken(XML_TAG_ATTRIBUTE_VALUE, fEmbeddedContainer.getStart(), fEmbeddedContainer.getTextLength(), fEmbeddedContainer.getLength());

+		return PROXY_UNKNOWN_CONTEXT;

+	}

 	return PROXY_CONTEXT;

 }

 

-<ST_XML_ATTRIBUTE_VALUE_DQUOTED> ([^<"\x24\x23]|[\x24\x23][^\x7b])+ {

+<ST_XML_ATTRIBUTE_VALUE_DQUOTED> ([^<"\x24\x23]+|[\x24\x23]{S}*)

+{

 	return XML_TAG_ATTRIBUTE_VALUE;

 }

-<ST_XML_ATTRIBUTE_VALUE_SQUOTED> ([^<'\x24\x23]|[\x24\x23][^\x7b])+ {

+<ST_XML_ATTRIBUTE_VALUE_SQUOTED> ([^<'\x24\x23]+|[\x24\x23]{S}*)

+{

 	return XML_TAG_ATTRIBUTE_VALUE;

 }

 

+

 <ST_XML_ATTRIBUTE_VALUE_DQUOTED,ST_XML_ATTRIBUTE_VALUE_SQUOTED> {genericTagOpen} {

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", genericTagOpen");//$NON-NLS-1$

 	}

 	int incomingState = yystate();

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

@@ -1423,7 +1467,7 @@
 }

 <ST_XML_ATTRIBUTE_VALUE_DQUOTED,ST_XML_ATTRIBUTE_VALUE_SQUOTED> {genericEndTagOpen} {

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", genericEndTagOpen");//$NON-NLS-1$

 	}

 	int incomingState = yystate();

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

@@ -1440,7 +1484,7 @@
 /* unquoted */

 <ST_XML_ATTRIBUTE_VALUE> {genericTagOpen} {

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", unquoted genericTagOpen");//$NON-NLS-1$

 	}

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

@@ -1456,7 +1500,7 @@
 	return PROXY_CONTEXT;

 }

 

-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_XML_DECLARATION> {genericEndTagOpen} {

+<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE, ST_XML_DECLARATION> {genericEndTagOpen} {

 	if(Debug.debugTokenizer)

 		dump("\nend tag open");//$NON-NLS-1$

 	fEmbeddedHint = XML_TAG_NAME;

@@ -1485,6 +1529,16 @@
 <ST_XML_TAG_NAME> {Name} {

 	if(Debug.debugTokenizer)

 		dump("tag name");//$NON-NLS-1$

+    String tagname = yytext();

+    boolean jspTag = tagname.indexOf(':') != -1;

+	if (fEmbeddedContainer != null) {

+    	fEmbeddedTag = jspTag;

+		fInTagEmbedded = true;

+    }

+	else {

+		fContainerTag = jspTag;

+		fInTagContainer = true;

+	}

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;

 	fEmbeddedPostState = ST_XML_EQUALS;

         yybegin(ST_XML_ATTRIBUTE_NAME);

@@ -1506,11 +1560,11 @@
 		dump("equals");//$NON-NLS-1$

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

-        yybegin(ST_XML_ATTRIBUTE_VALUE);

+        yybegin(isJspTag() ? ST_JSP_ATTRIBUTE_VALUE : ST_XML_ATTRIBUTE_VALUE);

         return XML_TAG_ATTRIBUTE_EQUALS;

 }

 /* the value was found, look for the next name */

-<ST_XML_ATTRIBUTE_VALUE> {AttValue} {

+<ST_XML_ATTRIBUTE_VALUE> {AttValue} { /* only allow for non-JSP tags for this does not obey JSP quoting rules */

 	if(Debug.debugTokenizer)

 		dump("attr value");//$NON-NLS-1$

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;

@@ -1518,8 +1572,17 @@
         yybegin(ST_XML_ATTRIBUTE_NAME);

         return XML_TAG_ATTRIBUTE_VALUE;

 }

+<ST_JSP_ATTRIBUTE_VALUE> {QuotedAttValue} { /* JSP attribute values have escape semantics */

+	if(Debug.debugTokenizer)

+		dump("jsp attr value");//$NON-NLS-1$

+	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;

+	fEmbeddedPostState = ST_XML_EQUALS;

+	yybegin(ST_XML_ATTRIBUTE_NAME);

+	return XML_TAG_ATTRIBUTE_VALUE;

+}

+

 /* the tag's close was found */

-<ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE> {genericTagClose} {

+<ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> {genericTagClose} {

 	if(Debug.debugTokenizer)

 		dump("tag close");//$NON-NLS-1$

 	fEmbeddedHint = UNDEFINED;

@@ -1530,15 +1593,27 @@
 	}

 	else

         	yybegin(YYINITIAL);

-        return XML_TAG_CLOSE;

+

+	if (fEmbeddedContainer != null)

+		fInTagEmbedded = false;

+	else

+		fInTagContainer = false;

+

+	return XML_TAG_CLOSE;

 }

 /* the tag's close was found, but the tag doesn't need a matching end tag */

-<ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE> {genericEmptyTagClose} {

+<ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> {genericEmptyTagClose} {

         yybegin(YYINITIAL);

 	fEmbeddedHint = UNDEFINED;

 	if(Debug.debugTokenizer)

 		dump("empty tag close");//$NON-NLS-1$

-        return XML_EMPTY_TAG_CLOSE;

+

+	if (fEmbeddedContainer != null)

+		fInTagEmbedded = false;

+	else

+		fInTagContainer = false;

+

+	return XML_EMPTY_TAG_CLOSE;

 }

 

 <ST_XML_TAG_NAME> [^</>\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3\u4E00-\u9FA5\u3007\u3021-\u3029]* {

@@ -1546,8 +1621,8 @@
 		dump("inappropriate tag name");//$NON-NLS-1$

 	if(!fStateStack.empty() && (fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_SQUOTED||fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_DQUOTED)) {

 		yybegin(ST_ABORT_EMBEDDED);

-		yypushback(yylength()-1);

-		return XML_TAG_ATTRIBUTE_VALUE;

+		//yypushback(yylength()-1);

+		return UNDEFINED;

 	}

 	yybegin(YYINITIAL);

         return XML_CONTENT;

@@ -1564,7 +1639,7 @@
 	 * If this tag can not be nested or we're already searching for an

 	 * attribute name, equals, or value, return immediately.

 	 */

-	if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE))) {

+	if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE || fStateStack.peek() == ST_JSP_ATTRIBUTE_VALUE))) {

 		yybegin(ST_XML_TAG_NAME);

 		return XML_TAG_OPEN;

 	}

@@ -1580,7 +1655,7 @@
 	yybegin(ST_XML_EQUALS);

 	return PROXY_CONTEXT;

 }

-<ST_XML_ATTRIBUTE_VALUE> <{Name} {

+<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> <{Name} {

 	String tagName = yytext().substring(1);

 	// pushback to just after the opening bracket

 	yypushback(yylength() - 1);

@@ -1588,7 +1663,7 @@
 	 * If this tag can not be nested or we're already searching for an

 	 * attribute name, equals, or value, return immediately.

 	 */

-	if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE))) {

+	if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE || fStateStack.peek() == ST_JSP_ATTRIBUTE_VALUE))) {

 		yybegin(ST_XML_TAG_NAME);

 		return XML_TAG_OPEN;

 	}

@@ -1608,7 +1683,7 @@
 

 // XML & JSP Comments

 

-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_XML_DECLARATION, ST_JSP_DIRECTIVE_NAME, ST_JSP_DIRECTIVE_NAME_WHITESPACE, ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS, ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE> {CommentStart} {

+<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE, ST_XML_DECLARATION, ST_JSP_DIRECTIVE_NAME, ST_JSP_DIRECTIVE_NAME_WHITESPACE, ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS, ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE> {CommentStart} {

 	if(Debug.debugTokenizer)

 		dump("\ncomment start");//$NON-NLS-1$

 	fEmbeddedHint = XML_COMMENT_TEXT;

@@ -1680,7 +1755,7 @@
 	}

 	else {

 		if (Debug.debugTokenizer) {

-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspScriptletStart");//$NON-NLS-1$

 		}

 		if(Debug.debugTokenizer)

 			dump("JSP scriptlet start");//$NON-NLS-1$

@@ -1711,6 +1786,11 @@
 			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 		}

+        else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {

+            fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

+            fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

+        }

+		

 		return PROXY_CONTEXT;

 	}

 }

@@ -1749,7 +1829,7 @@
 	}

 	else {

 		if (Debug.debugTokenizer) {

-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspExpressionStart");//$NON-NLS-1$

 		}

 		if(Debug.debugTokenizer)

 			dump("JSP expression start");//$NON-NLS-1$

@@ -1780,6 +1860,11 @@
 			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 		}

+		else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {

+			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

+			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

+		}

+		

 		return PROXY_CONTEXT;

 	}

 }

@@ -1818,7 +1903,7 @@
 	}

 	else {

 		if (Debug.debugTokenizer) {

-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspDeclarationStart");//$NON-NLS-1$

 		}

 		if(Debug.debugTokenizer)

 			dump("JSP declaration start");//$NON-NLS-1$

@@ -1849,6 +1934,10 @@
 			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 		}

+		else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {

+			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

+			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

+		}

 		return PROXY_CONTEXT;

 	}

 }

@@ -1893,7 +1982,7 @@
 	}

 	else {

 		if (Debug.debugTokenizer) {

-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspCommentStart");//$NON-NLS-1$

 		}

 		if(Debug.debugTokenizer)

 			dump("JSP comment start");//$NON-NLS-1$

@@ -1930,6 +2019,10 @@
 			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 		}

+		else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {

+			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

+			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

+		}

 		return PROXY_CONTEXT;

 	}

 }

@@ -1977,7 +2070,7 @@
 	}

 	else {

 		if (Debug.debugTokenizer) {

-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspDirectiveStart");//$NON-NLS-1$

 		}

 		if(Debug.debugTokenizer)

 			dump("JSP declaration start");//$NON-NLS-1$

@@ -2064,9 +2157,9 @@
 <ST_XML_ATTRIBUTE_VALUE_DQUOTED> \x24\x7b {

 	int enterState = yystate();

 	yybegin(ST_JSP_DQUOTED_EL);

-	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE});

+	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE, JSP_TAG_ATTRIBUTE_VALUE_DQUOTE});

 	// abort early when an unescaped double quote is found in the EL

-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE)) {

+	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_DQUOTE)) {

 		yybegin(ST_ABORT_EMBEDDED);

 		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 	}

@@ -2078,9 +2171,9 @@
 <ST_XML_ATTRIBUTE_VALUE_DQUOTED> \x23\x7b {

 	int enterState = yystate();

 	yybegin(ST_JSP_DQUOTED_VBL);

-	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE});

+	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE, JSP_TAG_ATTRIBUTE_VALUE_DQUOTE});

 	// abort early when an unescaped double quote is found in the VBL

-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE)) {

+	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_DQUOTE)) {

 		yybegin(ST_ABORT_EMBEDDED);

 		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 	}

@@ -2092,9 +2185,9 @@
 <ST_XML_ATTRIBUTE_VALUE_SQUOTED> \x24\x7b {

 	int enterState = yystate();

 	yybegin(ST_JSP_SQUOTED_EL);

-	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE});

+	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE, JSP_TAG_ATTRIBUTE_VALUE_SQUOTE});

 	// abort early when an unescaped single quote is found in the EL

-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {

+	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_SQUOTE)) {

 		yybegin(ST_ABORT_EMBEDDED);

 		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 	}

@@ -2106,9 +2199,9 @@
 <ST_XML_ATTRIBUTE_VALUE_SQUOTED> \x23\x7b {

 	int enterState = yystate();

 	yybegin(ST_JSP_SQUOTED_VBL);

-	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE});

+	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE, JSP_TAG_ATTRIBUTE_VALUE_SQUOTE});

 	// abort early when an unescaped single quote is found in the VBL

-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {

+	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_SQUOTE)) {

 		yybegin(ST_ABORT_EMBEDDED);

 		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 	}

@@ -2120,11 +2213,11 @@
 

 // unescaped double quote, return as ending region

 <ST_JSP_DQUOTED_EL,ST_JSP_DQUOTED_VBL> ["] {

-	return XML_TAG_ATTRIBUTE_VALUE_DQUOTE;

+	return isJspTag() ? JSP_TAG_ATTRIBUTE_VALUE_DQUOTE: XML_TAG_ATTRIBUTE_VALUE_DQUOTE;

 }

 // unescaped single quote, return as ending region

 <ST_JSP_SQUOTED_EL,ST_JSP_SQUOTED_VBL> ['] {

-	return XML_TAG_ATTRIBUTE_VALUE_SQUOTE;

+	return isJspTag() ? JSP_TAG_ATTRIBUTE_VALUE_SQUOTE : XML_TAG_ATTRIBUTE_VALUE_SQUOTE;

 }

 

 

@@ -2236,6 +2329,10 @@
 	yybegin(ST_JSP_EL_DQUOTES);

 	return JSP_EL_DQUOTE;

 }

+<ST_JSP_EL_DQUOTES> \x22 {

+	yybegin(ST_JSP_EL);

+	return JSP_EL_DQUOTE;

+}

 <ST_JSP_EL_DQUOTES> [^\x22]+/\x22 {

 	yybegin(ST_JSP_EL_DQUOTES_END);

 	return JSP_EL_QUOTED_CONTENT;

@@ -2248,6 +2345,10 @@
 	yybegin(ST_JSP_EL_SQUOTES);

 	return JSP_EL_SQUOTE;

 }

+<ST_JSP_EL_SQUOTES> \x27 {

+	yybegin(ST_JSP_EL);

+	return JSP_EL_SQUOTE;

+}

 <ST_JSP_EL_SQUOTES> [^\x27]+/\x27 {

 	yybegin(ST_JSP_EL_SQUOTES_END);

 	return JSP_EL_QUOTED_CONTENT;

@@ -2261,6 +2362,10 @@
 	yybegin(ST_JSP_VBL_DQUOTES);

 	return JSP_VBL_DQUOTE;

 }

+<ST_JSP_VBL_DQUOTES> \x22 {

+	yybegin(ST_JSP_VBL);

+	return JSP_VBL_DQUOTE;

+}

 <ST_JSP_VBL_DQUOTES> [^\x22]+/\x22 {

 	yybegin(ST_JSP_VBL_DQUOTES_END);

 	return JSP_VBL_QUOTED_CONTENT;

@@ -2273,6 +2378,10 @@
 	yybegin(ST_JSP_VBL_SQUOTES);

 	return JSP_VBL_SQUOTE;

 }

+<ST_JSP_VBL_SQUOTES> \x27 {

+	yybegin(ST_JSP_VBL);

+	return JSP_VBL_SQUOTE;

+}

 <ST_JSP_VBL_SQUOTES> [^\x27]+/\x27 {

 	yybegin(ST_JSP_VBL_SQUOTES_END);

 	return JSP_VBL_QUOTED_CONTENT;

@@ -2304,9 +2413,9 @@
 	return JSP_VBL_CONTENT;

 }

 // EL unquoted in tag (section 2.1 declares it as valid in template text (XML_CONTENT) or attribute values

-<ST_XML_ATTRIBUTE_VALUE> \x24\x7b[^\x7d]+/\x7d {

+<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> \x24\x7b[^\x7d]+/\x7d {

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", el-unquoted");//$NON-NLS-1$

 	}

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

@@ -2325,9 +2434,9 @@
 	return PROXY_CONTEXT;

 }

 // VBL unquoted in tag or attribute values

-<ST_XML_ATTRIBUTE_VALUE> \x23\x7b[^\x7d]+/\x7d {

+<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> \x23\x7b[^\x7d]+/\x7d {

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", el-unquoted");//$NON-NLS-1$

 	}

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

@@ -2525,7 +2634,7 @@
 

 // XML declarations

 

-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE> {genericTagOpen}! {

+<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> {genericTagOpen}! {

 	fStateStack.push(yystate());

 	if(Debug.debugTokenizer)

 		dump("\ndeclaration start");//$NON-NLS-1$

@@ -2660,7 +2769,7 @@
 }

 // end DECLARATION handling

 

-<YYINITIAL> ([^<&%\x24\x23]*|\x23+|\x24+|[&%]{S}+{Name}[^&%<]*|[\x24\x23][^\x7b<&%]|[&%]{Name}([^;&%<]*|{S}+;*)) {

+<YYINITIAL> ([^<&%\x24\x23]*|\x23+|\x24+|[&%]{S}+{Name}[^&%<]*|[\x24\x23][^\x7b<&%][^<&%\x24\x23]*|\\[\x24\x23][\x7b]|[&%]{Name}([^;&%<]*|{S}+;*)) {

 	if(Debug.debugTokenizer)

 		dump("\nXML content");//$NON-NLS-1$

 	return XML_CONTENT;

diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex
index f4ef7b0..bf2a91e 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex
@@ -1,5 +1,5 @@
 /*******************************************************************************

- * Copyright (c) 2004, 2007 IBM Corporation and others.

+ * Copyright (c) 2004, 2010 IBM Corporation and others.

  * All rights reserved. This program and the accompanying materials

  * are made available under the terms of the Eclipse Public License v1.0

  * which accompanies this distribution, and is available at

@@ -577,7 +577,7 @@
 EntityValue = (\" ([^%&\"] | {PEReference} | {Reference})* \" |  \' ([^%&\'] | {PEReference} | {Reference})* \')

 

 // [10] AttValue ::= '"' ([^<&"] | Reference)* '"' |  "'" ([^<&'] | Reference)* "'"

-AttValue = ( \" ([^<\"] | {Reference})* \" | \' ([^<\'] | {Reference})* \'  | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* )

+AttValue = ( \" ([^\"] | {Reference})* \" | \' ([^\'] | {Reference})* \'  | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* )

 

 // [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") 

 SystemLiteral = ((\" [^\"]* \") | (\' [^\']* \')) 

diff --git a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
index c96eb0c..8ef9c88 100644
--- a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.sse.core; singleton:=true
-Bundle-Version: 1.1.301.qualifier
+Bundle-Version: 1.1.502.qualifier
 Bundle-Activator: org.eclipse.wst.sse.core.internal.SSECorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -37,14 +37,17 @@
  org.eclipse.wst.sse.core.text,
  org.eclipse.wst.sse.core.utils,
  org.eclipse.wst.sse.internal.contentproperties;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui"
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.text;bundle-version="[3.4.0,4.0.0)";visibility:=reexport,
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.filebuffers;bundle-version="[3.4.0,4.0.0)",
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8"
+Require-Bundle: org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.text;bundle-version="[3.5.0,4.0.0)";visibility:=reexport,
+ org.eclipse.core.jobs;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.filebuffers;bundle-version="[3.5.0,4.0.0)",
  org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
  org.eclipse.emf.common;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,2.0.0)";resolution:=optional,
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)",
- org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)"
+ org.eclipse.wst.validation;bundle-version="[1.2.100,2.0.0)";resolution:=optional,
+ org.eclipse.core.expressions;bundle-version="[3.4.100,4.0.0)",
+ org.eclipse.osgi.services;bundle-version="3.2.0"
 Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.sse.core.internal.propertytester"
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.sse.core/config/charset.properties b/bundles/org.eclipse.wst.sse.core/config/charset.properties
index 004a070..8815e5a 100644
--- a/bundles/org.eclipse.wst.sse.core/config/charset.properties
+++ b/bundles/org.eclipse.wst.sse.core/config/charset.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2006 IBM Corporation and others.
+# Copyright (c) 2001, 2009 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -9,7 +9,7 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 ! the number of codeset names
-totalnumber=25
+totalnumber=26
 
 ! Only translate the xx.label strings.  Do not translate the xx.iana or xx.java strings.
 
@@ -31,66 +31,69 @@
 codeset.5.label=ISO Latin-1
 codeset.5.iana=ISO-8859-1
 
+codeset.6.label=ISO Latin-9
+codeset.6.iana=ISO-8859-15
+
 ! (Slavic: Czech, Croat, German, Hungarian, Polish, Romanian, Slovak, Slovenian)
-codeset.6.label=Central/East European (Slavic) 
-codeset.6.iana=ISO-8859-2
+codeset.7.label=Central/East European (Slavic) 
+codeset.7.iana=ISO-8859-2
 
 ! (Esperanto, Galician, Maltese, Turkish)
-codeset.7.label=Southern European
-codeset.7.iana=ISO-8859-3
+codeset.8.label=Southern European
+codeset.8.iana=ISO-8859-3
 
-codeset.8.label=Arabic, Logical
-codeset.8.iana=ISO-8859-6
+codeset.9.label=Arabic, Logical
+codeset.9.iana=ISO-8859-6
 
-codeset.9.label=Arabic
-codeset.9.iana=windows-1256
+codeset.10.label=Arabic
+codeset.10.iana=windows-1256
 
-codeset.10.label=Chinese, National Standard
-codeset.10.iana=GB18030
+codeset.11.label=Chinese, National Standard
+codeset.11.iana=GB18030
 
-codeset.11.label=Traditional Chinese, Big5
-codeset.11.iana=BIG5
+codeset.12.label=Traditional Chinese, Big5
+codeset.12.iana=BIG5
 
 ! (Estonian, Latvian, Lithuanian)
-codeset.12.label=Cyrillic, ISO-8859-4
-codeset.12.iana=ISO-8859-4
+codeset.13.label=Cyrillic, ISO-8859-4
+codeset.13.iana=ISO-8859-4
 
 ! (Bulgarian, Byelorussian, Macedonian, Serbian, Ukrainian)
-codeset.13.label=Cyrillic, ISO-8859-5
-codeset.13.iana=ISO-8859-5
+codeset.14.label=Cyrillic, ISO-8859-5
+codeset.14.iana=ISO-8859-5
 
-codeset.14.label=Greek
-codeset.14.iana=ISO-8859-7
+codeset.15.label=Greek
+codeset.15.iana=ISO-8859-7
 
-codeset.15.label=Hebrew, Visual
-codeset.15.iana=ISO-8859-8
+codeset.16.label=Hebrew, Visual
+codeset.16.iana=ISO-8859-8
 
 ! label=Hebrew, Logical
 ! iana=ISO-8859-8-I
 
-codeset.16.label=Hebrew
-codeset.16.iana=windows-1255
+codeset.17.label=Hebrew
+codeset.17.iana=windows-1255
 
-codeset.17.label=Japanese, EUC-JP
-codeset.17.iana=EUC-JP
+codeset.18.label=Japanese, EUC-JP
+codeset.18.iana=EUC-JP
 
-codeset.18.label=Japanese, ISO 2022
-codeset.18.iana=ISO-2022-JP
+codeset.19.label=Japanese, ISO 2022
+codeset.19.iana=ISO-2022-JP
 
-codeset.19.label=Japanese, Shift-JIS
-codeset.19.iana=Shift_JIS
+codeset.20.label=Japanese, Shift-JIS
+codeset.20.iana=Shift_JIS
 
-codeset.20.label=Japanese, Windows-31J
-codeset.20.iana=windows-31j
+codeset.21.label=Japanese, Windows-31J
+codeset.21.iana=windows-31j
 
-codeset.21.label=Korean, EUC-KR
-codeset.21.iana=EUC-KR
+codeset.22.label=Korean, EUC-KR
+codeset.22.iana=EUC-KR
 
-codeset.22.label=Korean, ISO 2022
-codeset.22.iana=ISO-2022-KR
+codeset.23.label=Korean, ISO 2022
+codeset.23.iana=ISO-2022-KR
 
-codeset.23.label=Thai, TISI
-codeset.23.iana=TIS-620
+codeset.24.label=Thai, TISI
+codeset.24.iana=TIS-620
 
-codeset.24.label=Turkish
-codeset.24.iana=ISO-8859-9
+codeset.25.label=Turkish
+codeset.25.iana=ISO-8859-9
diff --git a/bundles/org.eclipse.wst.sse.core/plugin.properties b/bundles/org.eclipse.wst.sse.core/plugin.properties
index 651ffcc..1e23274 100644
--- a/bundles/org.eclipse.wst.sse.core/plugin.properties
+++ b/bundles/org.eclipse.wst.sse.core/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2008 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -10,8 +10,8 @@
 #     Jens Lukowski/Innoopract - initial renaming/restructuring
 #     
 ###############################################################################
-providerName=Eclipse.org
-pluginName=Structured Text Model
+providerName=Eclipse Web Tools Platform
+pluginName=Structured Source Model
 # extension names
 Adapt_On_Create_Factory_Extension.name=Adapt On Create Factory Extension
 Document_Types_Extension.name=Document Types Extension
diff --git a/bundles/org.eclipse.wst.sse.core/plugin.xml b/bundles/org.eclipse.wst.sse.core/plugin.xml
index 0036500..1b9d769 100644
--- a/bundles/org.eclipse.wst.sse.core/plugin.xml
+++ b/bundles/org.eclipse.wst.sse.core/plugin.xml
@@ -46,6 +46,7 @@
 	
 	<!-- Define the StructuredFilePropertyTester as it will handle tracing the entire -->
 	<!-- content type hierarchy for a file. Only operates on IFiles                   -->
+	<!-- Deprecated, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=288216         -->
 	<extension point="org.eclipse.core.expressions.propertyTesters">
 		<propertyTester
 			class="org.eclipse.wst.sse.core.internal.propertytester.StructuredFilePropertyTester"
diff --git a/bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd b/bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd
index 1441736..633c80c 100644
--- a/bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd
+++ b/bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd
@@ -1,16 +1,21 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
+<schema targetNamespace="org.eclipse.wst.sse.core" xmlns="http://www.w3.org/2001/XMLSchema">
 <annotation>
-      <appInfo>
+      <appinfo>
          <meta.schema plugin="org.eclipse.wst.sse.core" id="commentElementHandler" name="Comment Element Handler Extension Point"/>
-      </appInfo>
+      </appinfo>
       <documentation>
          &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
       </documentation>
    </annotation>
 
    <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
       <complexType>
          <sequence>
             <element ref="handler-custom"/>
@@ -34,9 +39,9 @@
                <documentation>
                   
                </documentation>
-               <appInfo>
+               <appinfo>
                   <meta.attribute translatable="true"/>
-               </appInfo>
+               </appinfo>
             </annotation>
          </attribute>
       </complexType>
@@ -59,9 +64,9 @@
                <documentation>
                   
                </documentation>
-               <appInfo>
-                  <meta.attribute kind="java"/>
-               </appInfo>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn=":org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler"/>
+               </appinfo>
             </annotation>
          </attribute>
       </complexType>
@@ -80,47 +85,23 @@
    </element>
 
    <annotation>
-      <appInfo>
+      <appinfo>
          <meta.section type="since"/>
-      </appInfo>
+      </appinfo>
       <documentation>
          &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
       </documentation>
    </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
+
+
 
    <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
+      <appinfo>
          <meta.section type="copyright"/>
-      </appInfo>
+      </appinfo>
       <documentation>
-         Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
+         Copyright (c) 2005, 2008 IBM Corporation and others.&lt;br&gt;
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 which accompanies 
 this distribution, and is available at &lt;a
diff --git a/bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd b/bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd
index 1c375bb..ea31dfa 100644
--- a/bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd
+++ b/bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
+<schema targetNamespace="org.eclipse.wst.sse.core" xmlns="http://www.w3.org/2001/XMLSchema">
 <annotation>
       <appInfo>
          <meta.schema plugin="org.eclipse.wst.sse.core" id="modelHandler" name="Model Handler Extension Point"/>
@@ -11,6 +11,11 @@
    </annotation>
 
    <element name="extension">
+      <annotation>
+         <appInfo>
+            <meta.element />
+         </appInfo>
+      </annotation>
       <complexType>
          <sequence minOccurs="0" maxOccurs="unbounded">
             <element ref="modelHandler"/>
@@ -49,6 +54,9 @@
                <documentation>
                   
                </documentation>
+               <appInfo>
+                  <meta.attribute kind="identifier"/>
+               </appInfo>
             </annotation>
          </attribute>
          <attribute name="class" type="string" use="required">
@@ -57,7 +65,7 @@
                   
                </documentation>
                <appInfo>
-                  <meta.attribute kind="java"/>
+                  <meta.attribute kind="java" basedOn="org.eclipse.wst.sse.core.internal.ltk.modelhandler.AbstractModelHandler:"/>
                </appInfo>
             </annotation>
          </attribute>
@@ -87,39 +95,15 @@
       </documentation>
    </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
 
    <annotation>
       <appInfo>
          <meta.section type="copyright"/>
       </appInfo>
       <documentation>
-         Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
+         Copyright (c) 2005, 2009 IBM Corporation and others.&lt;br&gt;
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 which accompanies 
 this distribution, and is available at &lt;a
diff --git a/bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd b/bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd
index 46c03fb..1f80a82 100644
--- a/bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd
+++ b/bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
+<schema targetNamespace="org.eclipse.wst.sse.core" xmlns="http://www.w3.org/2001/XMLSchema">
 <annotation>
       <appInfo>
          <meta.schema plugin="org.eclipse.wst.sse.core" id="taskscanner" name="Task Scanner Extension Point"/>
@@ -11,6 +11,11 @@
    </annotation>
 
    <element name="extension">
+      <annotation>
+         <appInfo>
+            <meta.element internal="true" />
+         </appInfo>
+      </annotation>
       <complexType>
          <sequence>
             <element ref="scanner"/>
@@ -47,17 +52,17 @@
          <attribute name="contentTypeIds" type="string" use="required">
             <annotation>
                <documentation>
-                  
+                  Content type identifiers for which this scanner applies, separated by commas.
                </documentation>
             </annotation>
          </attribute>
          <attribute name="class" type="string" use="required">
             <annotation>
                <documentation>
-                  
+                  Scanner implementation.
                </documentation>
                <appInfo>
-                  <meta.attribute kind="java"/>
+                  <meta.attribute kind="java" basedOn=":org.eclipse.wst.sse.core.internal.provisional.tasks.IFileTaskScanner"/>
                </appInfo>
             </annotation>
          </attribute>
@@ -80,32 +85,8 @@
       </documentation>
    </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
 
    <annotation>
       <appInfo>
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java
index 0c797e3..8dca387 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     David Carver (Intalio) - bug 300443 - some constants aren't static final
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.internal.contentproperties;
@@ -58,13 +59,13 @@
 
 	private String contentSettingsPath;
 	private IProject currProject;
-	private final String fileElementName = "file";//$NON-NLS-1$
-	private final String PATHATTR = "path"; //$NON-NLS-1$
-	private final String projectElementName = "project";//$NON-NLS-1$
+	private static final String fileElementName = "file";//$NON-NLS-1$
+	private static final String PATHATTR = "path"; //$NON-NLS-1$
+	private static final String projectElementName = "project";//$NON-NLS-1$
 
 
 
-	private final String rootElementName = "contentsettings";//$NON-NLS-1$
+	private static final String rootElementName = "contentsettings";//$NON-NLS-1$
 
 
 
@@ -122,10 +123,10 @@
 
 		Element e = null;
 		if (resource.getType() == IResource.PROJECT) {
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 			if (e == null) {
 				// create project Element and add it into tree
-				e = (Element) domOperator.addElementUnderRoot(this.projectElementName);
+				e = (Element) domOperator.addElementUnderRoot(projectElementName);
 			}
 		}
 		else if (resource.getType() == IResource.FILE) {
@@ -133,7 +134,7 @@
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 			if (e == null) {
 				// create file Element and add path into it.
-				e = (Element) domOperator.addElementUnderRoot(this.fileElementName);
+				e = (Element) domOperator.addElementUnderRoot(fileElementName);
 				domOperator.addAttributeAt(e, getPathAttr(), getRelativePathFromProject(resource));
 			}
 		}
@@ -222,10 +223,10 @@
 
 		Element e = null;
 		if (resource.getType() == IResource.PROJECT) {
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 			if (e == null) {
 				// create project Element and add it into tree
-				e = (Element) domOperator.addElementUnderRoot(this.projectElementName);
+				e = (Element) domOperator.addElementUnderRoot(projectElementName);
 			}
 		}
 		else if (resource.getType() == IResource.FILE) {
@@ -233,7 +234,7 @@
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 			if (e == null) {
 				// create file Element and add path into it.
-				e = (Element) domOperator.addElementUnderRoot(this.fileElementName);
+				e = (Element) domOperator.addElementUnderRoot(fileElementName);
 				domOperator.addAttributeAt(e, getPathAttr(), getRelativePathFromProject(resource));
 			}
 		}
@@ -330,7 +331,7 @@
 		Element e = null;
 		if (deletedFile.getType() == IResource.PROJECT)
 			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 		else if (deletedFile.getType() == IResource.FILE)
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(deletedFile));
 		if (e == null) {
@@ -341,7 +342,7 @@
 
 		// when deletedFile entry exists.
 		if (deletedFile.getType() == IResource.PROJECT)
-			domOperator.removeElementWith(this.projectElementName);
+			domOperator.removeElementWith(projectElementName);
 		else if (deletedFile.getType() == IResource.FILE)
 			domOperator.removeElementWith(getPathAttr(), getRelativePathFromProject(deletedFile));
 
@@ -397,7 +398,7 @@
 		Element e = null;
 		if (resource.getType() == IResource.PROJECT)
 			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 		else if (resource.getType() == IResource.FILE)
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 
@@ -458,7 +459,7 @@
 		Element e = null;
 		if (resource.getType() == IResource.PROJECT)
 			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 		else if (resource.getType() == IResource.FILE)
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 
@@ -542,7 +543,7 @@
 		Element e = null;
 		if (resource.getType() == IResource.PROJECT)
 			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 		else if (resource.getType() == IResource.FILE)
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 
@@ -607,7 +608,7 @@
 		Element e = null;
 		if (resource.getType() == IResource.PROJECT)
 			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 		else if (resource.getType() == IResource.FILE)
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java
index 0dc38b1..e698b65 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300434 - Make inner classes static where possible
  *******************************************************************************/
 package org.eclipse.wst.sse.internal.contentproperties;
 
@@ -28,7 +28,7 @@
  *             org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
  */
 public class ContentSettingsSynchronizer implements IResourceChangeListener {
-	class ContentSettingsVisitor implements IResourceDeltaVisitor {
+	static class ContentSettingsVisitor implements IResourceDeltaVisitor {
 		// redefinition in ContentSettings.java
 		private String contentSettingsName = ContentSettings.getContentSettingsName(); //$NON-NLS-1$
 		private IResourceChangeEvent fEvent;
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java
index 16da926..ace7a38 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300434 - Make inner classes static where possible
  *******************************************************************************/
 package org.eclipse.wst.sse.internal.contentproperties;
 
@@ -51,7 +51,7 @@
 */
 class SimpleNodeOperator {
 
-	class CreateContentSettingsFailureException extends Exception {
+	static class CreateContentSettingsFailureException extends Exception {
 		/**
 		 * Comment for <code>serialVersionUID</code>
 		 */
@@ -63,7 +63,7 @@
 	}
 
 
-	class ReadContentSettingsFailureException extends Exception {
+	static class ReadContentSettingsFailureException extends Exception {
 		/**
 		 * Comment for <code>serialVersionUID</code>
 		 */
@@ -86,7 +86,7 @@
 	}
 
 	// writer class for .contentSettings.
-	class XMLDocumentWriter {
+	static class XMLDocumentWriter {
 		OutputStream fOut;
 
 		protected XMLDocumentWriter(OutputStream out) {
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java
index d191e71..34b9c07 100644
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java
+++ b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300434 - Make inner classes static where possibl *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.tasks;
 
@@ -29,7 +29,7 @@
 import org.eclipse.wst.sse.core.utils.StringUtils;
 
 public class FileTaskScannerRegistryReader {
-	private class ScannerInfo {
+	private static class ScannerInfo {
 		String fId;
 		IFileTaskScanner fScanner;
 
@@ -43,10 +43,6 @@
 			return obj instanceof ScannerInfo && fId.equals(((ScannerInfo) obj).fId);
 		}
 
-		public String getId() {
-			return fId;
-		}
-
 		public IFileTaskScanner getScanner() {
 			return fScanner;
 		}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java
index 1183beb..92fda63 100644
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java
+++ b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     David Carver (Intalio) - bug 300443 - some constants aren't static final
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.tasks;
@@ -40,13 +41,13 @@
  * Queueing Job for processing deltas and projects.
  */
 class TaskScanningJob extends Job {
-	static final int JOB_DELAY_DELTA = 400;
-	private static final int JOB_DELAY_PROJECT = 2000;
+	static final int JOB_DELAY_DELTA = 1000;
+	private static final int JOB_DELAY_PROJECT = 5000;
 	static final String TASK_TAG_PROJECTS_ALREADY_SCANNED = "task-tag-projects-already-scanned"; //$NON-NLS-1$
 	private List fQueue = null;
 
 	/** symbolic name for OSGI framework */
-	private final String OSGI_FRAMEWORK_ID = "org.eclipse.osgi"; //$NON-NLS-1$
+	private static final String OSGI_FRAMEWORK_ID = "org.eclipse.osgi"; //$NON-NLS-1$
 
 	TaskScanningJob() {
 		super(SSECoreMessages.TaskScanner_0);
@@ -153,6 +154,14 @@
 
 		IStatus status = null;
 		List currentQueue = retrieveQueue();
+		
+		try {
+			Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
+		}
+		catch (SecurityException e) {
+			// not a critical problem
+		}
+		
 		List errors = null;
 		int ticks = currentQueue.size();
 		String taskName = null;
@@ -167,7 +176,7 @@
 		IProgressMonitor scanMonitor = null;
 		while (!currentQueue.isEmpty()) {
 			Object o = currentQueue.remove(0);
-			if (frameworkIsShuttingDown())
+			if (frameworkIsShuttingDown() || monitor.isCanceled())
 				return Status.CANCEL_STATUS;
 			try {
 				scanMonitor = new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java
index 1ae5680..6095a6d 100644
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java
+++ b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java
@@ -28,7 +28,7 @@
 import org.eclipse.wst.sse.core.utils.StringUtils;
 
 public class TaskScanningScheduler {
-	private class ListenerVisitor implements IResourceChangeListener, IResourceDeltaVisitor {
+	class ListenerVisitor implements IResourceChangeListener, IResourceDeltaVisitor {
 		public void resourceChanged(IResourceChangeEvent event) {
 			IResourceDelta delta = event.getDelta();
 			if (delta.getResource() != null) {
@@ -89,13 +89,19 @@
 	 */
 	public static void shutdown() {
 		if (scheduler != null) {
-			scheduler.fJob.cancel();
 			ResourcesPlugin.getWorkspace().removeResourceChangeListener(scheduler.visitor);
+			scheduler.fJob.cancel();
+			try {
+				scheduler.fJob.join();
+			}
+			catch (InterruptedException e) {
+				Logger.logException(e);
+			}
 		}
 	}
 
 	/**
-	 * Only for use by SSECorePlugin class
+	 * Only for use by SSEUIPlugin class, UI by nature of its output being meant for the user
 	 */
 	public static void startup() {
 		scheduler = new TaskScanningScheduler();
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java
index ad34bad..a47d297 100644
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java
+++ b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     David Carver (Intalio) - bug 300443 - some constants aren't static final
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.tasks;
@@ -52,6 +53,7 @@
 	private static WorkspaceTaskScanner _instance = null;
 	static final String SYNTHETIC_TASK = "org.eclipse.wst.sse.task-synthetic";
 	static final String MODIFICATION_STAMP = "org.eclipse.wst.sse.modification-stamp";
+	private boolean proceed = false;
 
 	static synchronized WorkspaceTaskScanner getInstance() {
 		if (_instance == null) {
@@ -60,7 +62,7 @@
 		return _instance;
 	}
 
-	final String DEFAULT_MARKER_TYPE = IFileTaskScanner.TASK_MARKER_ID;
+	static final String DEFAULT_MARKER_TYPE = IFileTaskScanner.TASK_MARKER_ID;
 	private List fActiveScanners = null;
 	private IContentType[] fCurrentIgnoreContentTypes = null;
 	private TaskTag[] fCurrentTaskTags = null;
@@ -282,7 +284,7 @@
 						finally {
 							progressMonitor.worked(1);
 						}
-						if (markerAttributeMaps != null && markerAttributeMaps.length > 0) {
+						if (proceed && markerAttributeMaps != null && markerAttributeMaps.length > 0) {
 							if (Logger.DEBUG_TASKS) {
 								System.out.println("" + markerAttributeMaps.length + " tasks for " + file.getFullPath()); //$NON-NLS-1$ //$NON-NLS-2$
 							}
@@ -331,10 +333,10 @@
 		if (Logger.DEBUG_TASKSOVERALLPERF) {
 			time0 = System.currentTimeMillis();
 		}
-		if (init(project)) {
-			internalScan(project, project, scanMonitor);
-			shutdownDelegates(project);
-		}
+		proceed = init(project);
+		internalScan(project, project, scanMonitor);
+		shutdownDelegates(project);
+		
 		if (Logger.DEBUG_TASKSOVERALLPERF) {
 			System.out.println("" + (System.currentTimeMillis() - time0) + "ms for " + project.getFullPath()); //$NON-NLS-1$ //$NON-NLS-2$
 		}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java
index 346f987..76e8d31 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,7 +18,7 @@
 import org.osgi.framework.Bundle;
 
 /**
- * Class to allow access to ModelManager. Not intended to be subclassed.
+ * Class to allow access to properly configured implementors of IModelManager.
  * 
  * @since  1.5  org.eclipse.wst.sse.core
  */
@@ -36,7 +36,8 @@
 	 * shutting down).
 	 * 
 	 * @return IModelManager - returns the one model manager for structured
-	 *         model
+	 *         models or null if the owning bundle is neither active nor
+	 *         starting.
 	 */
 	public static IModelManager getModelManager() {
 		boolean isReady = false;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java
index 0de5ec0..734c86a 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300434 - Make inner classes static where possible
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal;
 
@@ -102,7 +102,7 @@
 	/**
 	 * A URIResolver instance of models built on java.io.Files
 	 */
-	class ExternalURIResolver implements URIResolver {
+	static class ExternalURIResolver implements URIResolver {
 		IPath fLocation;
 
 		ExternalURIResolver(IPath location) {
@@ -164,7 +164,7 @@
 	 * A URIResolver instance of models built on the extensible WST URI
 	 * resolver
 	 */
-	class CommonURIResolver implements URIResolver {
+	static class CommonURIResolver implements URIResolver {
 		String fLocation;
 		IPath fPath;
 		private IProject fProject;
@@ -243,7 +243,8 @@
 
 	/**
 	 * Maps interesting documents in file buffers to those file buffers.
-	 * Required to allows us to go from documents to complete models.
+	 * Required to allow us to go from the document instances to complete
+	 * models.
 	 */
 	class FileBufferMapper implements IFileBufferListener {
 		public void bufferContentAboutToBeReplaced(IFileBuffer buffer) {
@@ -257,6 +258,7 @@
 				ITextFileBuffer textBuffer = (ITextFileBuffer) buffer;
 				if (!(textBuffer.getDocument() instanceof IStructuredDocument))
 					return;
+
 				if (Logger.DEBUG_TEXTBUFFERLIFECYCLE) {
 					Logger.log(Logger.INFO, "Learned new buffer: " + buffer.getLocation().toString() + " " + buffer + " " + ((ITextFileBuffer) buffer).getDocument()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 				}
@@ -279,8 +281,7 @@
 				DocumentInfo info = (DocumentInfo) fDocumentMap.get(textBuffer.getDocument());
 				if (info != null) {
 					info.bufferReferenceCount--;
-					if (info.bufferReferenceCount == 0 && info.modelReferenceCount == 0)
-						fDocumentMap.remove(textBuffer.getDocument());
+					checkReferenceCounts(info, textBuffer.getDocument());
 				}
 			}
 		}
@@ -336,45 +337,39 @@
 		}
 	}
 
-	private static FileBufferModelManager instance;
+	private static FileBufferModelManager instance = new FileBufferModelManager();
 
 	public static FileBufferModelManager getInstance() {
-		if (instance == null) {
-			instance = new FileBufferModelManager();
-		}
 		return instance;
 	}
 
-	static final void shutdown() {
-		if (instance != null) {
-			if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
-				IDocument[] danglingDocuments = (IDocument[]) instance.fDocumentMap.keySet().toArray(new IDocument[0]);
-				for (int i = 0; i < danglingDocuments.length; i++) {
-					DocumentInfo info = (DocumentInfo) instance.fDocumentMap.get(danglingDocuments[i]);
-					if (info.modelReferenceCount > 0)
-						System.err.println("LEAKED MODEL: " + info.buffer.getLocation() + " " + (info.model != null ? info.model.getId() : null)); //$NON-NLS-1$ //$NON-NLS-2$
-					if (info.bufferReferenceCount > 0)
-						System.err.println("LEAKED BUFFER: " + info.buffer.getLocation() + " " + info.buffer.getDocument()); //$NON-NLS-1$ //$NON-NLS-2$
-				}
+	static synchronized final void shutdown() {
+		FileBuffers.getTextFileBufferManager().removeFileBufferListener(instance.fFileBufferListener);
+
+		if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT || Logger.DEBUG_FILEBUFFERMODELLEAKS) {
+			IDocument[] danglingDocuments = (IDocument[]) instance.fDocumentMap.keySet().toArray(new IDocument[0]);
+			for (int i = 0; i < danglingDocuments.length; i++) {
+				DocumentInfo info = (DocumentInfo) instance.fDocumentMap.get(danglingDocuments[i]);
+				if (info.modelReferenceCount > 0)
+					System.err.println("LEAKED MODEL: " + info.buffer.getLocation() + " " + (info.model != null ? info.model.getId() : null)); //$NON-NLS-1$ //$NON-NLS-2$
+				if (info.bufferReferenceCount > 0)
+					System.err.println("LEAKED BUFFER: " + info.buffer.getLocation() + " " + info.buffer.getDocument()); //$NON-NLS-1$ //$NON-NLS-2$
 			}
-			FileBuffers.getTextFileBufferManager().removeFileBufferListener(instance.fFileBufferListener);
-			instance = null;
 		}
 	}
 
-	static final void startup() {
-		getInstance();
+	static synchronized final void startup() {
+		FileBuffers.getTextFileBufferManager().addFileBufferListener(getInstance().fFileBufferListener);
 	}
 
 	// a map of IStructuredDocuments to DocumentInfo objects
 	Map fDocumentMap = null;
 
-	IFileBufferListener fFileBufferListener = null;
+	FileBufferMapper fFileBufferListener = new FileBufferMapper();
 
 	FileBufferModelManager() {
 		super();
 		fDocumentMap = new Hashtable(4);
-		FileBuffers.getTextFileBufferManager().addFileBufferListener(fFileBufferListener = new FileBufferMapper());
 	}
 
 	public String calculateId(IFile file) {
@@ -420,11 +415,17 @@
 	/**
 	 * Registers "interest" in a document, or rather the file buffer that
 	 * backs it. Intentionally used to alter the reference count of the file
-	 * buffer so it is not accidentally disposed of.
+	 * buffer so it is not accidentally disposed of while we have a model open
+	 * on top of it.
 	 */
 	public boolean connect(IDocument document) {
+		if (document == null) {
+			Exception iae = new IllegalArgumentException("can not connect() without a document"); //$NON-NLS-1$ 
+			Logger.logException(iae);
+			return false;
+		}
 		DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
-		if( info == null)
+		if (info == null)
 			return false;
 		ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
 		IPath bufferLocation = info.buffer.getLocation();
@@ -530,6 +531,11 @@
 	 * buffer so that it knows it can safely be disposed of.
 	 */
 	public boolean disconnect(IDocument document) {
+		if (document == null) {
+			Exception iae = new IllegalArgumentException("can not disconnect() without a document"); //$NON-NLS-1$ 
+			Logger.logException(iae);
+			return false;
+		}
 		DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
 		if( info == null)
 			return false;
@@ -742,6 +748,19 @@
 		return new NullProgressMonitor();
 	}
 
+	/**
+	 * Will remove the entry corresponding to <code>document</code> if both
+	 * there are no more buffer or model reference counts for <code>info</code>
+	 * 
+	 * @param info the document info to check for reference counts
+	 * @param document the key to remove from the document map if there are no more
+	 * references
+	 */
+	private void checkReferenceCounts(DocumentInfo info, IDocument document) {
+		if (info.bufferReferenceCount == 0 && info.modelReferenceCount == 0)
+			fDocumentMap.remove(document);
+	}
+
 	public boolean isExistingBuffer(IDocument document) {
 		if (document == null) {
 			Exception iae = new IllegalArgumentException("can not check for an existing buffer without a document reference"); //$NON-NLS-1$ 
@@ -778,6 +797,11 @@
 					Logger.logException("Error releasing model for " + location, e); //$NON-NLS-1$
 				}
 			}
+			// [265899]
+			// In some scenarios, a model can be held onto after the editor has been disposed even if the lifecycle is
+			// maintained properly (e.g., an editor being closed before a DirtyRegionProcessor has a chance to complete). Because of this,
+			// the manager cannot be reliant upon the FileBufferMapper having the sole responsibility of the fDocumentMap cleanup
+			checkReferenceCounts(info, document);
 		}
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java
index 097eb6d..63c5894 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,8 +13,15 @@
 
 package org.eclipse.wst.sse.core.internal;
 
+import org.eclipse.core.runtime.ISafeRunnable;
 
+/**
+ * An abstraction that allows even processing to be performed in a different
+ * context, e.g. a different Thread, if needed.
+ * 
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
 public interface IExecutionDelegate {
 
-	void execute(Runnable runnable);
+	void execute(ISafeRunnable runnable);
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java
index 6219ddc..f826867 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java
@@ -46,6 +46,11 @@
 	 */
 	public static final boolean DEBUG_FILEBUFFERMODELMANAGEMENT = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/filebuffers/modelmanagement")); //$NON-NLS-1$ //$NON-NLS-2$
 	/**
+	 * true if platform and plugin are in debug mode and debugging file buffer
+	 * models not being released on shutdown
+	 */
+	public static final boolean DEBUG_FILEBUFFERMODELLEAKS = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/filebuffers/leaks")); //$NON-NLS-1$ //$NON-NLS-2$
+	/**
 	 * true if platform and plugin are in debug mode and debugging formatting
 	 */
 	public static final boolean DEBUG_FORMAT = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/format")); //$NON-NLS-1$ //$NON-NLS-2$
@@ -115,6 +120,17 @@
 	public static final int INFO = IStatus.INFO;
 	public static final int WARNING = IStatus.WARNING;
 	public static final int ERROR = IStatus.ERROR;
+	public static final int OK_DEBUG = 200 + OK;
+	public static final int INFO_DEBUG = 200 + INFO;
+	public static final int WARNING_DEBUG = 200 + WARNING;
+	public static final int ERROR_DEBUG = 200 + ERROR;
+
+	/**
+	 * @return true if the platform is debugging
+	 */
+	private static boolean isDebugging() {
+		return Platform.inDebugMode();
+	}
 
 	/**
 	 * Adds message to log.
@@ -127,8 +143,26 @@
 	 *            exception thrown
 	 */
 	private static void _log(int level, String message, Throwable exception) {
+		if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
+			if (!isDebugging())
+				return;
+		}
+		int severity = IStatus.OK;
+		switch (level) {
+			case INFO_DEBUG :
+			case INFO :
+				severity = IStatus.INFO;
+				break;
+			case WARNING_DEBUG :
+			case WARNING :
+				severity = IStatus.WARNING;
+				break;
+			case ERROR_DEBUG :
+			case ERROR :
+				severity = IStatus.ERROR;
+		}
 		message = (message != null) ? message : ""; //$NON-NLS-1$
-		Status statusObj = new Status(level, PLUGIN_ID, level, message, exception);
+		Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
 		Bundle bundle = Platform.getBundle(PLUGIN_ID);
 		if (bundle != null)
 			Platform.getLog(bundle).log(statusObj);
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java
index bb4e8f3..15e32bb 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java
@@ -19,6 +19,7 @@
 import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerRegistry;
 import org.eclipse.wst.sse.core.internal.preferences.CommonModelPreferenceNames;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.tasks.TaskScanningScheduler;
 import org.osgi.framework.BundleContext;
 
 
@@ -60,6 +61,9 @@
 	 */
 	public void stop(BundleContext context) throws Exception {
 		savePluginPreferences();
+		
+		TaskScanningScheduler.shutdown();
+
 		FileBufferModelManager.shutdown();
 
 		super.stop(context);
@@ -75,6 +79,16 @@
 
 		// initialize FileBuffer handling
 		FileBufferModelManager.startup();
+
+		/**
+		 * If the user starts the workbench with
+		 * -Dorg.eclipse.wst.sse.core.taskscanner=off, the scanner should be
+		 * disabled
+		 */
+		String scan = System.getProperty("org.eclipse.wst.sse.core.taskscanner"); //$NON-NLS-1$
+		if (scan == null || !scan.equalsIgnoreCase("off")) { //$NON-NLS-1$
+			TaskScanningScheduler.startup();
+		}
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentLoader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentLoader.java
index 20a99d6..b7eff1e 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentLoader.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentLoader.java
@@ -23,8 +23,15 @@
 import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
 
 
+/**
+ * Provides methods for the creation of an IStructuredDocument correctly
+ * prepared to work with a particular type of content.
+ */
 public interface IDocumentLoader {
 
+	/**
+	 * @return a new IStructuredDocument prepared by this loader
+	 */
 	IEncodedDocument createNewStructuredDocument();
 
 	/**
@@ -50,12 +57,15 @@
 
 	IEncodedDocument createNewStructuredDocument(String filename, InputStream istream, EncodingRule encodingRule) throws java.io.IOException;
 
+	/**
+	 * @return the document partitioner
+	 */
 	IDocumentPartitioner getDefaultDocumentPartitioner();
 
 	IDocumentCharsetDetector getDocumentEncodingDetector();
 
 	/**
-	 * A utility method, but depends on subclasses to impliment the preferred
+	 * A utility method, but depends on subclasses to implement the preferred
 	 * end of line for a particular content type. Note: subclasses should not
 	 * re-implement this method (there's no reason to, even though its part of
 	 * interface). This method not only converts end-of-line characters, if
@@ -63,6 +73,8 @@
 	 * structuredDocument. The returned value is either the original string,
 	 * if no conversion is needed, or a new string with end-of-lines
 	 * converted.
+	 * 
+	 * @deprecated - the content's line delimiters should be preserved
 	 */
 	StringBuffer handleLineDelimiter(StringBuffer originalString, IEncodedDocument theStructuredDocument);
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java
index 4b554be..1e8d690 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
  *     Jesper Steen Møller - initial IDocumentExtension4 support - #102822
+ *     David Carver (Intalio) - bug 300443 - some constants aren't static final
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.format;
@@ -45,7 +46,7 @@
 	 * Max length of text to be formatted to be considered a "small change"
 	 * Used for document rewrite session type.
 	 */
-	private final int MAX_SMALL_FORMAT_SIZE = 1000;
+	private static final int MAX_SMALL_FORMAT_SIZE = 1000;
 
 	protected void ensureClosed(OutputStream outputStream, InputStream inputStream) {
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/EmbeddedTypeHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/EmbeddedTypeHandler.java
index 2e4d314..b551190 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/EmbeddedTypeHandler.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/EmbeddedTypeHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,7 +14,7 @@
 
 import java.util.List;
 
-import org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser;
+import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
 import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
 
 
@@ -24,9 +24,10 @@
 
 	/**
 	 * These AdapterFactories are NOT added to IStructuredModel's
-	 * IAdapterFactory Registry ... they are for use by "JSP Aware
-	 * AdapterFactories" The are added to the "registry" in the
-	 * PageDirectiveAdapter.
+	 * IAdapterFactory Registry, but instead expected to be consulted as
+	 * needed by functionality aware of embedded content types.  Additions
+	 * to the model's own factory registry should be done in
+	 * {@link #initializeFactoryRegistry(FactoryRegistry)}
 	 */
 	List getAdapterFactories();
 
@@ -56,16 +57,18 @@
 	 * @return true if this handler thinks can handle the given mimeType
 	 */
 	boolean canHandleMimeType(String mimeType);
+
 	/**
 	 * This method is to give the EmbeddedContentType an opportunity to add
-	 * factories directly to the IStructuredModel's IAdapterFactory registry.
+	 * factories directly to the IStructuredModel's IAdapterFactory registry. 
 	 */
 	void initializeFactoryRegistry(FactoryRegistry registry);
 
 	/**
-	 * initializeParser Its purpose is to setBlockTags
+	 * initializeParser, for example, setting up a "block" tags list using an
+	 * extended interface
 	 */
-	void initializeParser(JSPCapableParser parser);
+	void initializeParser(RegionParser parser);
 
 	boolean isDefault();
 
@@ -73,5 +76,5 @@
 
 	void uninitializeFactoryRegistry(FactoryRegistry registry);
 
-	void uninitializeParser(JSPCapableParser parser);
+	void uninitializeParser(RegionParser parser);
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IDocumentTypeHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IDocumentTypeHandler.java
index d4862a4..aa62963 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IDocumentTypeHandler.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IDocumentTypeHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,8 +16,8 @@
 import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
 
 /**
- * Interface to allow custom content types to be defined as extension points
- * in plugins.
+ * Responsible for providing the mechanisms used in the correct loading of an
+ * IStructuredDocument's contents and determine its self-described encoding.
  */
 public interface IDocumentTypeHandler {
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IModelHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IModelHandler.java
index c2947d4..588f39e 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IModelHandler.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IModelHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,6 +17,10 @@
 import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
 
 
+/**
+ * Responsible for providing the mechanisms used in the correct loading of an
+ * IStructuredModel's contents and initialization of its adapter factories.
+ */
 public interface IModelHandler extends IDocumentTypeHandler {
 	/**
 	 * This method should return Factories which are added automatically by
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelManagerImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelManagerImpl.java
index 06f6906..09a96e1 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelManagerImpl.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelManagerImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *  *     Frank Zigler/Web Performance, Inc. - 288196 - Deadlock in ModelManagerImpl after IOException
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.model;
@@ -40,9 +41,12 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.content.IContentDescription;
 import org.eclipse.core.runtime.jobs.ILock;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.text.BadLocationException;
@@ -81,65 +85,103 @@
 import org.eclipse.wst.sse.core.internal.util.Utilities;
 
 /**
- * Not intended to be subclassed, referenced or instantiated by clients.
+ * <p>Not intended to be subclassed, referenced or instantiated by clients.
+ * Clients should obtain an instance of the IModelManager interface through
+ * {@link StructuredModelManager#getModelManager()}.</p>
  * 
- * This class is responsible for creating, retrieving, and caching
+ * <p>This class is responsible for creating, retrieving, and caching
  * StructuredModels It retrieves the cached objects by an id which is
  * typically a String representing the resources URI. Note: Its important that
  * all clients that share a resource do so using <b>identical </b>
  * identifiers, or else different instances will be created and retrieved,
  * even if they all technically point to the same resource on the file system.
  * This class also provides a convenient place to register Model Loaders and
- * Dumpers based on 'type'.
+ * Dumpers based on 'type'.</p>
  */
 public class ModelManagerImpl implements IModelManager {
 
+	
+	
 	static class ReadEditType {
 		ReadEditType(String type) {
 		}
 	}
 
-	/**
-	 * A Data class to track our shared objects
-	 */
-	 static class SharedObject {
+	class SharedObject {
 		int referenceCountForEdit;
 		int referenceCountForRead;
-		IStructuredModel theSharedModel;
-		boolean initializing = true;
-		boolean doWait = true;
-		
-		SharedObject(IStructuredModel sharedModel) {
-			theSharedModel = sharedModel;
-			referenceCountForRead = 0;
-			referenceCountForEdit = 0;
+		volatile IStructuredModel theSharedModel;
+		final ILock LOAD_LOCK = Job.getJobManager().newLock();
+		volatile boolean initializing = true;
+		volatile boolean doWait = true;
+		// The field 'id' is only meant for debug
+		final String id;
+
+		SharedObject(String id) {
+			this.id=id;
+			// be aware, this lock will leak and cause the deadlock detector to be horrible if we never release it
+			LOAD_LOCK.acquire();
 		}
-		
+
 		/**
-		 * Waits until this shared object has been attempted to be loaded. 
-		 * The load is "attempted" because not all loads result in a model. 
-		 * However, upon leaving this method, theShareModel variable
-		 * is up-to-date.
+		 * Waits until this shared object has been attempted to be loaded. The
+		 * load is "attempted" because not all loads result in a model. However,
+		 * upon leaving this method, theShareModel variable is up-to-date.
 		 */
-		public synchronized void waitForLoadAttempt() {
-			while(initializing) {
-				try {
-					wait();
+		public void waitForLoadAttempt() {
+			final boolean allowInterrupt = PrefUtil.ALLOW_INTERRUPT_WAITING_THREAD;
+			final long timeLimit = (PrefUtil.WAIT_DELAY==0) ? Long.MAX_VALUE : PrefUtil.now() + PrefUtil.WAIT_DELAY;
+			final Job current = Job.getJobManager().currentJob();
+			boolean interrupted = false;
+			try {
+				while (initializing) {
+					if (current!=null) {
+						current.yieldRule(null);
+					}
+					try {
+						loop();
+					} catch (InterruptedException e) {
+						if (allowInterrupt) {
+							throw new OperationCanceledException("Waiting thread interrupted while waiting for model id: "+id + " to load");
+						} else {
+							interrupted=true;
+						}
+					}
+					if (PrefUtil.now() >= timeLimit	)
+						throw new OperationCanceledException("Waiting thread timeout exceeded while waiting for model id: "+id + " to load");
 				}
-				catch (InterruptedException e) {
-					// ignore interruption!
+			}
+			finally {
+				if (interrupted) {
+					Thread.currentThread().interrupt();
 				}
 			}
 		}
-		
+
+		private void loop() throws InterruptedException {	
+			if (initializing) {
+				if (LOAD_LOCK.acquire(PrefUtil.WAIT_INTERVAL_MS)) {
+					// if we got the lock, but initializing is still not true the deadlock detector gave us
+					// the lock and caused reentrancy into this critical section. This is invalid and the 
+					// sign of a cyclical load attempt. In this case, we through an 
+					// OperationCanceledException in lew of entering a spin-loop. 
+					if (initializing) {
+						LOAD_LOCK.release();
+						throw new OperationCanceledException("Aborted cyclic load attempt for model with id: "+ id );
+					} else {
+						LOAD_LOCK.release();
+					}
+				}
+			}
+		}
+
 		/**
-		 * Flags this model as loaded. All waiting methods on 
-		 * {@link #waitForLoadAttempt()} will proceed after this 
-		 * method returns. 
+		 * Flags this model as loaded. All waiting methods on
+		 * {@link #waitForLoadAttempt()} will proceed after this method returns.
 		 */
-		public synchronized void setLoaded() {
+		public void setLoaded() {
 			initializing = false;
-			notifyAll();
+			LOAD_LOCK.release();
 		}
 	}
 
@@ -207,7 +249,7 @@
 			SharedObject testObject = (SharedObject) fManagedObjects.get(id);
 			if (testObject==null) {
 				// null means it's been disposed, we need to do the work to reload it.
-				sharedObject = new SharedObject(null);
+				sharedObject = new SharedObject(id);
 				fManagedObjects.put(id, sharedObject);
 				SYNC.release();
 				_doCommonCreateModel(file, id, handler, resolver, rwType, encodingRule,
@@ -258,7 +300,9 @@
 	private void _doCommonCreateModel(IFile file, String id, IModelHandler handler,
 			URIResolver resolver, ReadEditType rwType, EncodingRule encodingRule,
 			SharedObject sharedObject) throws CoreException, IOException {
-		boolean doRemove = false;
+		// XXX: Does not integrate with FileBuffers
+		boolean doRemove = true;
+		try {
 		synchronized(sharedObject) {
 			InputStream inputStream = null;
 			IStructuredModel model = null;
@@ -283,16 +327,18 @@
 				// add to our cache
 				sharedObject.theSharedModel=model;
 				_initCount(sharedObject, rwType);
-			} else {
-				doRemove = true;
+				doRemove = false;
 			}
 		}
+		}
+		finally{
 		if (doRemove) {
 			SYNC.acquire();	
 			fManagedObjects.remove(id);	
 			SYNC.release();
 		}
 		sharedObject.setLoaded();
+		}
 	}
 
 	private IStructuredModel _commonCreateModel(InputStream inputStream, String id, IModelHandler handler, URIResolver resolver, ReadEditType rwType, String encoding, String lineDelimiter) throws IOException {
@@ -314,7 +360,7 @@
 			SharedObject testObject = (SharedObject) fManagedObjects.get(id);
 			if (testObject==null) {
 				// it was removed ,so lets create it
-				sharedObject = new SharedObject(null);
+				sharedObject = new SharedObject(id);
 				fManagedObjects.put(id, sharedObject);
 				SYNC.release();
 				_doCommonCreateModel(inputStream, id, handler, resolver, rwType,
@@ -344,7 +390,8 @@
 	private void _doCommonCreateModel(InputStream inputStream, String id, IModelHandler handler,
 			URIResolver resolver, ReadEditType rwType, String encoding, String lineDelimiter,
 			SharedObject sharedObject) throws IOException {
-		boolean doRemove = false;
+		boolean doRemove = true;
+		try {
 		synchronized(sharedObject) {
 			IStructuredModel model = null;
 			try {
@@ -360,12 +407,31 @@
 				handleProgramError(e);
 			}
 			if (model != null) {
+				/**
+				 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=264228
+				 * 
+				 * Ensure that the content type identifier field of the model
+				 * is properly set. This is normally handled by the
+				 * FileBufferModelManager when working with files as it knows
+				 * the content type in advance; here is where we handle it for
+				 * streams.
+				 */
+				if (model instanceof AbstractStructuredModel) {
+					DocumentReader reader = new DocumentReader(model.getStructuredDocument());
+					IContentDescription description = Platform.getContentTypeManager().getDescriptionFor(reader, id, new QualifiedName[0]);
+					reader.close();
+					if (description != null && description.getContentType() != null) {
+						((AbstractStructuredModel) model).setContentTypeIdentifier(description.getContentType().getId());
+					}
+				}
+
 				sharedObject.theSharedModel = model;
 				_initCount(sharedObject, rwType);
-			} else {
-				doRemove = true;
+				doRemove = false;
 			}
 		}
+		}
+		finally {
 		if (doRemove) {
 			SYNC.acquire();
 			// remove it if we didn't get one back
@@ -373,6 +439,7 @@
 			SYNC.release();
 		}
 		sharedObject.setLoaded();
+		}
 	}
 
 	private IStructuredModel _commonCreateModel(String id, IModelHandler handler, URIResolver resolver) throws ResourceInUse {
@@ -411,14 +478,12 @@
 
 	private IStructuredModel _commonGetModel(IFile iFile, ReadEditType rwType, String encoding, String lineDelimiter) throws UnsupportedEncodingException, IOException, CoreException {
 		String id = calculateId(iFile);
-		IModelHandler handler = calculateType(iFile);
-		URIResolver resolver = calculateURIResolver(iFile);
-		IStructuredModel model = _commonGetModel(iFile, id, handler, resolver, rwType, encoding, lineDelimiter);
+		IStructuredModel model = _commonGetModel(iFile, id, rwType, encoding, lineDelimiter);
 
 		return model;
 	}
 
-	private IStructuredModel _commonGetModel(IFile file, String id, IModelHandler handler, URIResolver resolver, ReadEditType rwType, String encoding, String lineDelimiter) throws IOException, CoreException {
+	private IStructuredModel _commonGetModel(IFile file, String id, ReadEditType rwType, String encoding, String lineDelimiter) throws IOException, CoreException {
 		if (id == null)
 			throw new IllegalArgumentException("Program Error: id may not be null"); //$NON-NLS-1$
 
@@ -436,7 +501,7 @@
 				SharedObject testObject = (SharedObject) fManagedObjects.get(id);
 				if (testObject==null) {
 					// it was removed ,so lets create it
-					sharedObject = new SharedObject(null);
+					sharedObject = new SharedObject(id);
 					fManagedObjects.put(id, sharedObject);
 					
 					SYNC.release();
@@ -470,24 +535,32 @@
 	}
 
 	private void _doCommonGetModel(IFile file, String id, SharedObject sharedObject,ReadEditType rwType) {
-		boolean doRemove = false;
-		synchronized(sharedObject) {
-			sharedObject.doWait=false;
-			IStructuredModel model = FileBufferModelManager.getInstance().getModel(file);
-			sharedObject.doWait=true;
-			if (model != null) {
-				sharedObject.theSharedModel=model;
-				_initCount(sharedObject, rwType);
-			} else {
-				doRemove = true;
+		boolean doRemove = true;
+		try {
+			synchronized(sharedObject) {
+				sharedObject.doWait=false;
+				IStructuredModel model = null;
+				try {
+					model = FileBufferModelManager.getInstance().getModel(file);
+				}
+				finally {
+					sharedObject.doWait=true;
+				}
+				if (model != null) {
+					sharedObject.theSharedModel=model;
+					_initCount(sharedObject, rwType);
+					doRemove = false;
+				}
 			}
 		}
-		if (doRemove) {
-			SYNC.acquire();
-			fManagedObjects.remove(id);
-			SYNC.release();
+		finally {
+			if (doRemove) {
+				SYNC.acquire();
+				fManagedObjects.remove(id);
+				SYNC.release();
+			}
+			sharedObject.setLoaded();
 		}
-		sharedObject.setLoaded();
 	}
 
 	private SharedObject _commonNewModel(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException {
@@ -513,7 +586,7 @@
 				throw new ResourceInUse();
 			}
 			
-			sharedObject = new SharedObject(null);
+			sharedObject = new SharedObject(id);
 			fManagedObjects.put(id, sharedObject);
 			
 		} finally {
@@ -538,7 +611,13 @@
 	public IStructuredModel _getModelFor(IStructuredDocument document, ReadEditType accessType) {
 
 		String id = FileBufferModelManager.getInstance().calculateId(document);
-		Assert.isNotNull(id, "unknown IStructuredDocument " + document); //$NON-NLS-1$
+		if (id == null) {
+			if (READ == accessType)
+				return getExistingModelForRead(document);
+			if (EDIT == accessType)
+				return getExistingModelForEdit(document);
+			Assert.isNotNull(id, "unknown IStructuredDocument " + document); //$NON-NLS-1$
+		}
 		
 		SharedObject sharedObject = null;
 		SYNC.acquire();
@@ -552,7 +631,7 @@
 			SYNC.acquire();
 			SharedObject testObject = (SharedObject) fManagedObjects.get(id);
 			if (testObject==null) {
-				sharedObject = new SharedObject(null);
+				sharedObject = new SharedObject(id);
 				fManagedObjects.put(id, sharedObject);
 				SYNC.release();
 				synchronized(sharedObject) {
@@ -563,7 +642,7 @@
 				break;
 			} else if (sharedObject == testObject) {
 				synchronized(sharedObject) {
-					Assert.isTrue(sharedObject.referenceCountForEdit + sharedObject.referenceCountForRead > 0);
+					Assert.isTrue(sharedObject.referenceCountForEdit + sharedObject.referenceCountForRead > 0, "reference count was less than zero");
 					if (sharedObject.theSharedModel!=null) {
 						_incrCount(sharedObject, accessType);
 					}
@@ -612,7 +691,7 @@
 	private void addFactories(IStructuredModel model, IModelHandler handler) {
 		Assert.isNotNull(model, "model can not be null"); //$NON-NLS-1$
 		FactoryRegistry registry = model.getFactoryRegistry();
-		Assert.isNotNull(registry, "Factory Registry can not be null"); //$NON-NLS-1$
+		Assert.isNotNull(registry, "model's Factory Registry can not be null"); //$NON-NLS-1$
 		List factoryList = handler.getAdapterFactories();
 		addFactories(model, factoryList);
 	}
@@ -620,7 +699,7 @@
 	private void addFactories(IStructuredModel model, List factoryList) {
 		Assert.isNotNull(model, "model can not be null"); //$NON-NLS-1$
 		FactoryRegistry registry = model.getFactoryRegistry();
-		Assert.isNotNull(registry, "Factory Registry can not be null"); //$NON-NLS-1$
+		Assert.isNotNull(registry, "model's Factory Registry can not be null"); //$NON-NLS-1$
 		// Note: we add all of them from handler, even if
 		// already exists. May need to reconsider this.
 		if (factoryList != null) {
@@ -770,7 +849,7 @@
 			if (sharedObject != null) {
 				throw new ResourceInUse();
 			}
-			sharedObject = new SharedObject(null);
+			sharedObject = new SharedObject(newId);
 			fManagedObjects.put(newId,sharedObject);
 		} finally {
 			SYNC.release();
@@ -1298,7 +1377,7 @@
 	 */
 	public  IStructuredModel getModelForEdit(Object id, InputStream inputStream, URIResolver resolver) throws java.io.UnsupportedEncodingException, IOException {
 
-		Assert.isNotNull(id, "IFile parameter can not be null"); //$NON-NLS-1$
+		Assert.isNotNull(id, "requested model id can not be null"); //$NON-NLS-1$
 		String stringId = id.toString();
 		return getModelForEdit(stringId, Utilities.getMarkSupportedStream(inputStream), resolver);
 	}
@@ -1599,7 +1678,8 @@
 	 * not to use this function
 	 */
 	public void moveModel(Object oldId, Object newId) {
-		org.eclipse.wst.sse.core.internal.util.Assert.isNotNull(oldId, "id parameter can not be null"); //$NON-NLS-1$
+		Assert.isNotNull(oldId, "old id parameter can not be null"); //$NON-NLS-1$
+		Assert.isNotNull(newId, "new id parameter can not be null"); //$NON-NLS-1$
 		SYNC.acquire();
 		SharedObject sharedObject = (SharedObject) fManagedObjects.get(oldId);
 		// if not found in cache, ignore request.
@@ -1718,7 +1798,6 @@
 			
 			Assert.isNotNull(sharedObject, "release was requested on a model that was not being managed"); //$NON-NLS-1$
 			sharedObject.waitForLoadAttempt();
-			
 			SYNC.acquire();
 			synchronized(sharedObject) {
 				_decrCount(sharedObject, EDIT);
@@ -1856,6 +1935,7 @@
 	 * @deprecated - will become protected, use reload directly on model
 	 */
 	public  IStructuredModel reloadModel(Object id, java.io.InputStream inputStream) throws java.io.UnsupportedEncodingException {
+		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
 
 		// get the existing model associated with this id
 		IStructuredModel structuredModel = getExistingModel(id);
@@ -1877,6 +1957,8 @@
 	}
 
 	public void saveModel(IFile iFile, String id, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
+		Assert.isNotNull(iFile, "file parameter can not be null"); //$NON-NLS-1$
+		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
 
 		// let's see if we already have it in our cache
 	
@@ -1932,6 +2014,7 @@
 	 * @throws CoreException
 	 */
 	public void saveModel(String id, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
+		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
 
 		// let's see if we already have it in our cache
 
@@ -1979,6 +2062,8 @@
 	 *             in favor of the IFile form.
 	 */
 	public void saveModel(String id, OutputStream outputStream, EncodingRule encodingRule) throws UnsupportedEncodingException, CoreException, IOException {
+		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
+
 		SYNC.acquire();
 		// let's see if we already have it in our cache
 		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
@@ -2008,6 +2093,7 @@
 	}
 
 	public void saveStructuredDocument(IStructuredDocument structuredDocument, IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, CoreException, IOException {
+		Assert.isNotNull(iFile, "file parameter can not be null"); //$NON-NLS-1$
 		if (FileBufferModelManager.getInstance().isExistingBuffer(structuredDocument)) {
 			ITextFileBuffer buffer = FileBufferModelManager.getInstance().getBuffer(structuredDocument);
 			if (buffer.getLocation().equals(iFile.getFullPath()) || buffer.getLocation().equals(iFile.getLocation())) {
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/PrefUtil.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/PrefUtil.java
new file mode 100644
index 0000000..ee29ad3
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/PrefUtil.java
@@ -0,0 +1,146 @@
+/*******************************************************************************

+ * Copyright (c) 2010 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *     

+ *******************************************************************************/

+package org.eclipse.wst.sse.core.internal.model;

+

+import org.eclipse.core.runtime.Platform;

+import org.eclipse.core.runtime.preferences.ConfigurationScope;

+import org.eclipse.core.runtime.preferences.IEclipsePreferences;

+import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;

+import org.eclipse.core.runtime.preferences.IPreferencesService;

+import org.eclipse.core.runtime.preferences.InstanceScope;

+import org.eclipse.osgi.util.NLS;

+import org.eclipse.wst.sse.core.internal.SSECorePlugin;

+import org.osgi.service.prefs.Preferences;

+

+class PrefUtil {

+

+	static long WAIT_INTERVAL_MS = 500;

+	static int WAIT_DELAY = getInt("org.eclipse.wst.sse.core.modelmanager.maxWaitDuringConcurrentLoad");

+	static boolean ALLOW_INTERRUPT_WAITING_THREAD = getBoolean("org.eclipse.wst.sse.core.modelmanager.allowInterruptsDuringConcurrentLoad");

+

+	/** Base of millisecond timings, to avoid wrapping */

+	private static final long MILLI_ORIGIN = System.currentTimeMillis();

+

+	/**

+	 * Returns millisecond time offset by origin

+	 */

+	static final long now() {

+		return System.currentTimeMillis() - MILLI_ORIGIN;

+	}

+	

+	private static IEclipsePreferences.IPreferenceChangeListener LISTENER;

+	static {

+		InstanceScope scope = new InstanceScope();

+		IEclipsePreferences instancePrefs = scope.getNode(SSECorePlugin.ID);

+		LISTENER = new IEclipsePreferences.IPreferenceChangeListener() {

+

+			public void preferenceChange(PreferenceChangeEvent event) {

+

+				if ("modelmanager.maxWaitDuringConcurrentLoad".equals(event.getKey())) {

+					WAIT_DELAY = getInt("org.eclipse.wst.sse.core.modelmanager.maxWaitDuringConcurrentLoad");

+				}

+				else if ("modelmanager.allowInterruptsDuringConcurrentLoad".equals(event.getKey())) {

+					ALLOW_INTERRUPT_WAITING_THREAD = getBoolean("org.eclipse.wst.sse.core.modelmanager.allowInterruptsDuringConcurrentLoad");

+				}

+			}

+		};

+		instancePrefs.addPreferenceChangeListener(LISTENER);

+	}

+

+	private static String getProperty(String property) {

+		// Importance order is:

+		// default-default < instanceScope < configurationScope < systemProperty

+		// < envVar

+		String value = null;

+

+		if (value == null) {

+			value = System.getenv(property);

+		}

+		if (value == null) {

+			value = System.getProperty(property);

+		}

+		if (value == null) {

+			IPreferencesService preferencesService = Platform.getPreferencesService();

+			

+			String key = property;

+			if (property != null && property.startsWith(SSECorePlugin.ID)) {

+				// +1, include the "."

+				key = property.substring(SSECorePlugin.ID.length() + 1, property.length());

+			}

+			InstanceScope instance = new InstanceScope();

+			ConfigurationScope config = new ConfigurationScope();

+			

+			Preferences instanceNode = instance.getNode(SSECorePlugin.ID);

+			Preferences configNode = config.getNode(SSECorePlugin.ID);

+			value = preferencesService.get(key, getDefault(property), new Preferences[]{configNode,instanceNode});

+		}

+

+		return value;

+	}

+

+	private static String getDefault(String property) {

+		// this is the "default-default"

+		if ("org.eclipse.wst.sse.core.modelmanager.maxWaitDuringConcurrentLoad".equals(property)) {

+			return "0";

+		}

+		else if ("org.eclipse.wst.sse.core.modelmanager.allowInterruptsDuringConcurrentLoad".equals(property)) {

+			return "false";

+		}

+		return null;

+	}

+

+	private static boolean getBoolean(String key) {

+		String property = getProperty(key);

+		// if (property != null) {

+		//			System.out.println("Tweak: " + key + "=" + Boolean.parseBoolean(property)); //$NON-NLS-1$ //$NON-NLS-2$

+		// }

+		return (property != null ? Boolean.valueOf(property) : Boolean.valueOf(getDefault(key)))

+				.booleanValue();

+	}

+

+	private static int getInt(String key) {

+		String property = getProperty(key);

+		int size = 0;

+		if (property != null) {

+			try {

+				size = Integer.parseInt(property);

+				//	System.out.println("Tweak: " + key + "=" + size); //$NON-NLS-1$ //$NON-NLS-2$

+			}

+			catch (NumberFormatException e) {

+				size = getDefaultInt(key, property, size);

+			}

+		}

+		else {

+			size = getDefaultInt(key, property, size);

+		}

+		return size;

+	}

+

+	private static int getDefaultInt(String key, String property, int size) {

+		// ignored

+		try {

+			size = Integer.parseInt(getDefault(key));

+		}

+		catch (NumberFormatException e1) {

+			handleIntParseException(key, property, e1);

+			size = 0;

+		}

+		return size;

+	}

+

+	private static void handleIntParseException(String key, String property, NumberFormatException e1) {

+		Exception n = new Exception(NLS.bind(

+				"Exception during parse of default value for key ''{0}'' value was ''{1}''. Using 0 instead", //$NON-NLS-1$

+				key, property), e1);

+		n.printStackTrace();

+	}

+}

diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java
index af83ded..72bfa13 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -113,13 +113,14 @@
 	 * type.
 	 * 
 	 * @param file
+	 * @param provideDefault should the default extension be used in the absence of other methods
 	 * @return The IModelHandler registered for the content type of the given
 	 *         file. If an exact match is not found, the most-specific match
 	 *         according to IContentType.isKindOf() will be returned. If none
 	 *         are found, either a default or null will be returned.
 	 * @throws CoreException
 	 */
-	public IModelHandler getHandlerFor(IFile file) throws CoreException {
+	public IModelHandler getHandlerFor(IFile file, boolean provideDefault) throws CoreException {
 		IModelHandler modelHandler = null;
 		IContentDescription contentDescription = null;
 		IContentType contentType = null;
@@ -135,7 +136,7 @@
 				/* use the more thorough discovery method to get a description */
 				InputStream contents = null;
 				try {
-					contents = file.getContents(true);
+					contents = file.getContents(false);
 					contentDescription = Platform.getContentTypeManager().getDescriptionFor(contents, file.getName(), IContentDescription.ALL);
 					if (contentDescription != null) {
 						contentType = contentDescription.getContentType();
@@ -169,7 +170,7 @@
 		if (contentType != null) {
 			modelHandler = getHandlerForContentType(contentType);
 		}
-		else {
+		else if (contentType == null && provideDefault) {
 			// hard coding for null content type
 			modelHandler = getHandlerExtension(INTERNAL_DEFAULT_EXTENSION); //$NON-NLS-1$
 		}
@@ -177,6 +178,21 @@
 		return modelHandler;
 	}
 
+	/**
+	 * Finds the registered IModelHandler for a given named file's content
+	 * type. Will check for a default.
+	 * 
+	 * @param file
+	 * @return The IModelHandler registered for the content type of the given
+	 *         file. If an exact match is not found, the most-specific match
+	 *         according to IContentType.isKindOf() will be returned. If none
+	 *         are found, either a default or null will be returned.
+	 * @throws CoreException
+	 */
+	public IModelHandler getHandlerFor(IFile file) throws CoreException {
+		return getHandlerFor(file, true);
+	}
+
 
 	/**
 	 * Finds the registered IModelHandler for a given named InputStream.
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/propertytester/StructuredFilePropertyTester.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/propertytester/StructuredFilePropertyTester.java
index a64b6b7..184bc03 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/propertytester/StructuredFilePropertyTester.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/propertytester/StructuredFilePropertyTester.java
@@ -23,6 +23,9 @@
  * 
  * Based on org.eclipse.core.internal.propertytester.FilePropertyTester
  * 
+ * @deprecated use org.eclipse.core.resources.contentTypeId instead
+ * 
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=288216 
  */
 public class StructuredFilePropertyTester extends PropertyTester {
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java
index 6217f99..6f18471 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -53,7 +53,7 @@
 		fAdapters[adapterCount++] = adapter;
 	}
 
-	private void ensureCapacity(int needed) {
+	private synchronized void ensureCapacity(int needed) {
 		if (fAdapters == null) {
 			// first time
 			fAdapters = new INodeAdapter[needed + growthConstant];
@@ -80,7 +80,7 @@
 	/**
 	 * Default behavior for getting an adapter.
 	 */
-	public INodeAdapter getAdapterFor(Object type) {
+	public synchronized INodeAdapter getAdapterFor(Object type) {
 		// first, we'll see if we already have one
 		INodeAdapter result = getExistingAdapter(type);
 		// if we didn't find one in our list already,
@@ -108,7 +108,7 @@
 	 * Returns a shallow clone of list, since clients should not manipulate
 	 * our list directly. Instead, they should use add/removeAdapter.
 	 */
-	public Collection getAdapters() {
+	public synchronized Collection getAdapters() {
 		if (fAdapters != null) {
 			if (adapterCount == 0) {
 				fAdapters = null;
@@ -153,7 +153,7 @@
 		return criteria;
 	}
 
-	public INodeAdapter getExistingAdapter(Object type) {
+	public synchronized INodeAdapter getExistingAdapter(Object type) {
 		INodeAdapter result = null;
 		for (int i = 0; i < adapterCount; i++) {
 			INodeAdapter a = fAdapters[i];
@@ -171,49 +171,49 @@
 
 	public void notify(int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
 
-		if (fAdapters != null) {
-			int localAdapterCount = 0;
-			INodeAdapter[] localAdapters = null;
+		int localAdapterCount = 0;
+		INodeAdapter[] localAdapters = null;
 
-			// lock object while making local assignments
-			synchronized (this) {
+		// lock object while making local assignments
+		synchronized (this) {
+			if (fAdapters != null) {
 				localAdapterCount = adapterCount;
 				localAdapters = new INodeAdapter[localAdapterCount];
 				System.arraycopy(fAdapters, 0, localAdapters, 0, localAdapterCount);
 			}
+		}
 
-			for (int i = 0; i < localAdapterCount; i++) {
-				INodeAdapter a = localAdapters[i];
+		for (int i = 0; i < localAdapterCount; i++) {
+			INodeAdapter a = localAdapters[i];
 
-				if (Logger.DEBUG_ADAPTERNOTIFICATIONTIME) {
-					long getAdapterTimeCriteria = getAdapterTimeCriteria();
-					long startTime = System.currentTimeMillis();
-					// ** keep this line identical with non-debug version!!
-					a.notifyChanged(this, eventType, changedFeature, oldValue, newValue, pos);
-					long notifyDuration = System.currentTimeMillis() - startTime;
-					if (getAdapterTimeCriteria >= 0 && notifyDuration > getAdapterTimeCriteria) {
-						System.out.println("adapter notifyDuration: " + notifyDuration + "  class: " + a.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
-					}
+			if (Logger.DEBUG_ADAPTERNOTIFICATIONTIME) {
+				long getAdapterTimeCriteria = getAdapterTimeCriteria();
+				long startTime = System.currentTimeMillis();
+				// ** keep this line identical with non-debug version!!
+				a.notifyChanged(this, eventType, changedFeature, oldValue, newValue, pos);
+				long notifyDuration = System.currentTimeMillis() - startTime;
+				if (getAdapterTimeCriteria >= 0 && notifyDuration > getAdapterTimeCriteria) {
+					System.out.println("adapter notifyDuration: " + notifyDuration + "  class: " + a.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
 				}
-				else {
-					try {
-						// ** keep this line identical with debug version!!
-						a.notifyChanged(this, eventType, changedFeature, oldValue, newValue, pos);
-					}
-					catch (Exception e) {
-						// Its important to "keep going", since notifications
-						// occur between an
-						// aboutToChange event and a changed event -- the
-						// changed event typically being require
-						// to restore state, etc. So, we just log message, do
-						// not re-throw it, but
-						// typically the exception does indicate a serious
-						// program error.
-						Logger.logException("A structured model client, " + a + " threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[eventType] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					}
-				}
-
 			}
+			else {
+				try {
+					// ** keep this line identical with debug version!!
+					a.notifyChanged(this, eventType, changedFeature, oldValue, newValue, pos);
+				}
+				catch (Exception e) {
+					// Its important to "keep going", since notifications
+					// occur between an
+					// aboutToChange event and a changed event -- the
+					// changed event typically being require
+					// to restore state, etc. So, we just log message, do
+					// not re-throw it, but
+					// typically the exception does indicate a serious
+					// program error.
+					Logger.logException("A structured model client, " + a + " threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[eventType] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+				}
+			}
+
 		}
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelManager.java
index d299322..b23d0fa 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelManager.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,25 +20,70 @@
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jface.text.IDocument;
+import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
 import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceAlreadyExists;
 import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceInUse;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.util.URIResolver;
 
-
 /**
- * Responsible for providing a set of APIs for creating a new model manager,
- * for managing (add or remove) model loaders and model dumpers, and for
- * managing (get, release, save, and save as) models.
+ * <p>
+ * Provides APIs for managing (get, release, save, and save as) SSE Structured
+ * Models.
+ * </p>
+ * <p>
+ * Structured Models created from an implementor of this interface can be
+ * either managed or unmanaged. Managed models are shared using reference
+ * counts, so until that count has been decremented to zero, the model will
+ * continue to exist in memory. When managed, models can be looked up using
+ * their IDs or their IStructuredDocuments, which can be advantageous when
+ * building on APIs that aren't specifically designed for SSE (such as those
+ * revolving around IDocuments). Unmanaged models offer no such features, and
+ * are largely used for tasks where their contents are ephemeral, such as for
+ * populating a source viewer with syntax-colored content.
+ * </p>
+ * <p>
+ * There are two types of access used when retrieving a model from the model
+ * manager: READ and EDIT. The contents of a model can be modified regardless
+ * of which access type is used, but any client who gets a model for EDIT is
+ * explicitly declaring that they are interested in saving those changed
+ * contents. The EDIT and READ reference counts are visible to everyone, as
+ * are convenience methods for determining whether a managed model is shared
+ * among multiple clients accessing it for READ or EDIT.
+ * </p>
+ * <p>
+ * Managed models whose contents are "dirty" with READ and EDIT counts above
+ * zero will be reverted to the on-disk content if the EDIT count drops to
+ * zero while the READ count remains above zero.
+ * </p>
+ * <p>
+ * Shared models for which the read and edit counts have both dropped to zero
+ * are no longer valid for use, regardless of whether they have been garbage
+ * collected or not. It is possible, but not guaranteed, that the underlying
+ * structured document is still valid and may even be used in constructing a
+ * new shared model.
+ * </p>
+ * <p>
  * 
- * Clients can reference, but should not implement.
- * 
- * @see StructuredModelManger
+ * @noimplement This interface is not intended to be implemented by clients.
+ * Clients should obtain an instance of the IModelManager interface through
+ * {@link StructuredModelManager#getModelManager()}.</p>
+ *              </p>
+ *              <p>
+ * @see {@link StructuredModelManager}</p>
  */
 public interface IModelManager {
 
+	/**
+	 * A fixed ID used for models which were created as duplicates of existing
+	 * models
+	 */
 	public final static String DUPLICATED_MODEL = "org.eclipse.wst.sse.core.IModelManager.DUPLICATED_MODEL"; //$NON-NLS-1$
+
+	/**
+	 * A fixed ID used for unmanaged models
+	 */
 	public final static String UNMANAGED_MODEL = "org.eclipse.wst.sse.core.IModelManager.UNMANAGED_MODEL"; //$NON-NLS-1$
 
 	/**
@@ -48,22 +93,37 @@
 	 */
 	public String calculateId(IFile file);
 
+	/**
+	 * Copies a model with the old id 
+	 * @param oldId - the old model's ID
+	 * @param newId - the new model's ID
+	 * @return the new model
+	 * @throws ResourceInUse if the given new ID is already in use by a managed model
+	 */
 	IStructuredModel copyModelForEdit(String oldId, String newId) throws ResourceInUse;
 
 	/**
-	 * createNewInstance is similar to clone, except the new instance has no
-	 * content. Note: this produces an unmanaged model, for temporary use. If
-	 * a true shared model is desired, use "copy".
+	 * Creates a new, but empty, unmanaged model of the same kind as the one
+	 * given. For a managed model with the same contents, use "copy".
+	 * 
+	 * @param model
+	 * @return the model, or null of one could not be created
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
 	 */
 	public IStructuredModel createNewInstance(IStructuredModel model) throws IOException;
 
 	/**
 	 * Factory method, since a proper IStructuredDocument must have a proper
-	 * parser assigned. Note: its assume that IFile does not actually exist as
-	 * a resource yet. If it does, ResourceAlreadyExists exception is thrown.
-	 * If the resource does already exist, then createStructuredDocumentFor is
-	 * the right API to use.
+	 * parser assigned. If the resource does already exist, then
+	 * createStructuredDocumentFor is the right API to use.
 	 * 
+	 * @param iFile
+	 * @return the document, or null if one could not be created
+	 * @throws ResourceAlreadyExists
+	 *             if the IFile already exists
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 * @throws ResourceAlreadyExists if the give file already exists
 	 */
 	IStructuredDocument createNewStructuredDocumentFor(IFile iFile) throws ResourceAlreadyExists, IOException, CoreException;
 
@@ -71,112 +131,277 @@
 	 * Factory method, since a proper IStructuredDocument must have a proper
 	 * parser assigned. Note: clients should verify IFile exists before using
 	 * this method. If this IFile does not exist, then
-	 * createNewStructuredDocument is the correct API to use.
+	 * {@link #createNewStructuredDocumentFor(IFile)} is the correct API to use.
+	 * 
+	 * @param iFile - the file
+	 * @return the document, or null if one could not be created
+	 * 
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
 	 */
 	IStructuredDocument createStructuredDocumentFor(IFile iFile) throws IOException, CoreException;
 
 	/**
-	 * Conveience method, since a proper IStructuredDocument must have a
+	 * Convenience method, since a proper IStructuredDocument must have a
 	 * proper parser assigned. It should only be used when an empty
 	 * structuredDocument is needed. Otherwise, use IFile form.
+	 * 
+	 * @param contentTypeId
+	 * @return a structured document with the correct parsing setup for the
+	 *         given content type ID, or null if one could not be created or
+	 *         the given content type ID is unknown or unsupported
 	 */
 	IStructuredDocument createStructuredDocumentFor(String contentTypeId);
 
 	/**
-	 * @deprecated -- I marked as deprecated to discouage use of this method.
-	 *             It does not really work for JSP fragments, since JSP
-	 *             Fragments need an IFile to correctly look up the content
-	 *             settings. Use IFile form instead. Note: some confustion
-	 *             with it and the form for HTPP encoding, so once a null arg
-	 *             is allowed in that API ... we can remove this one. (after
-	 *             verifying again with Tom/Linksbuild)
-	 */
-	IStructuredDocument createStructuredDocumentFor(String filename, InputStream inputStream, URIResolver resolver) throws IOException;
+	 * @deprecated - use IFile form instead as the correct encoding and content rules may not be applied otherwise
+	 * 
+	 * Creates and returns a properly configured structured document for the given contents with the given name
+	 * 
+	 * @param filename - the filename, which may be used to guess the content type
+	 * @param contents - the contents to load
+	 * @param resolver - the URIResolver to use for locating any needed resources
+	 * @return the IStructuredDocument or null of one could not be created
+	 * @throws IOException if the file's contents can not be read or its content type can not be determined
+	 */ 
+	IStructuredDocument createStructuredDocumentFor(String filename, InputStream contents, URIResolver resolver) throws IOException;
 
+	/**
+	 * Creates and returns a properly configured structured document for the given contents with the given name
+	 * 
+	 * @param filename - the filename, which may be used to guess the content type
+	 * @param inputStream - the contents to load
+	 * @param resolver - the URIResolver to use for locating any needed resources
+	 * @param ianaEncodingName - the IANA specified encoding to use when reading the contents
+	 * @return the IStructuredDocument or null if one could not be created
+	 * @throws IOException if the file's contents can not be read or its content type can not be determined
+	 * @deprecated - clients should convert the InputStream into text themselves
+	 *             and then use the version of this method taking a String for its
+	 *             content
+	 */
 	IStructuredDocument createStructuredDocumentFor(String filename, InputStream inputStream, URIResolver resolver, String ianaEncodingName) throws IOException;
 
+	/**
+	 * Creates and returns a properly configured structured document for the given contents with the given name
+	 * 
+	 * @param filename - the filename, which may be used to guess the content type
+	 * @param content - the contents to load
+	 * @param resolver - the URIResolver to use for locating any referenced resources
+	 * @return a structured document with the correct parsing setup for the
+	 *         given filename, or null if one could not be created
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 */
 	IStructuredDocument createStructuredDocumentFor(String filename, String content, URIResolver resolver) throws IOException;
 
 	/**
-	 * Conveience method. It depends on the loaders newModel method to return
-	 * an appropriate StrucuturedModel appropriately initialized.
+	 * Creates and returns an unmanaged model populated with the given IFile's
+	 * contents
+	 * 
+	 * @param iFile
+	 * @return a structured model, or null if one could not be created
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
 	 */
 	IStructuredModel createUnManagedStructuredModelFor(IFile iFile) throws IOException, CoreException;
 
 	/**
-	 * Conveience method. It depends on the loaders newModel method to return
+	 * Convenience method. It depends on the loader's newModel method to return
 	 * an appropriate StrucuturedModel appropriately initialized.
+	 * 
+	 * @param contentTypeId
+	 * @return a structured model for the given content type, or null if one could not be created or the content type is unsupported
 	 */
 	IStructuredModel createUnManagedStructuredModelFor(String contentTypeId);
 
+	/**
+	 * @deprecated
+	 */
 	IStructuredModel createUnManagedStructuredModelFor(String contentTypeId, URIResolver resolver);
 
 	/**
-	 * Note: users of this 'model' must still release it when finished.
-	 * Returns null if there's not a model corresponding to document.
+	 * Note: callers of this method must still release the model when finished.
+	 * 
+	 * @param document
+	 * @return the structured model containing the give document, incrementing
+	 *         its edit count, or null if there is not a model corresponding
+	 *         to this document.
 	 */
 	IStructuredModel getExistingModelForEdit(IDocument document);
 
-	public IStructuredModel getExistingModelForEdit(IFile iFile);
+	/**
+	 * @param file
+	 * @return the structured model for the given file, incrementing its edit
+	 *         count, or null if one does not already exist for this file.
+	 */
+	IStructuredModel getExistingModelForEdit(IFile file);
 
 	/**
-	 * This is similar to the getModel method, except this method does not
-	 * create a model. This method does increment the reference count (if it
-	 * exists). If the model does not already exist in the cache of models,
-	 * null is returned.
+	 * @param id
+	 * @return the structured model with the given ID, incrementing its edit
+	 *         count, or null if one does not already exist for this ID
 	 */
 	public IStructuredModel getExistingModelForEdit(Object id);
 
 	/**
-	 * Note: users of this 'model' must still release it when finished.
-	 * Returns null if there's not a model corresponding to document.
+	 * Note: callers of this method must still release the model when finished.
+	 * 
+	 * @param document
+	 * @return the structured model containing the give document, incrementing
+	 *         its read count, or null if there is not a model corresponding
+	 *         to this document.
 	 */
 	IStructuredModel getExistingModelForRead(IDocument document);
 
+	/**
+	 * @param file
+	 * @return the structured model for the given file, incrementing its read
+	 *         count, or null if one does not already exist for this file.
+	 */
 	public IStructuredModel getExistingModelForRead(IFile iFile);
 
 	/**
-	 * This is similar to the getModel method, except this method does not
-	 * create a model. This method does increment the reference count (if it
-	 * exists). If the model does not already exist in the cache of models,
-	 * null is returned.
+	 * @param id
+	 * @return the structured model with the given ID, incrementing its edit
+	 *         count, or null if one does not already exist for this ID
 	 */
 	public IStructuredModel getExistingModelForRead(Object id);
 
+	/**
+	 * @deprecated - internal information
+	 */
 	public Enumeration getExistingModelIds();
 
+	/**
+	 * Returns a structured model for the given file. If one does not already
+	 * exists, one will be created with an edit count of 1. If one already
+	 * exists, its edit count will be incremented before it is returned.
+	 * 
+	 * @param iFile
+	 * @return a structured model for the given file, or null if one could not
+	 *         be found or created
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 */
 	public IStructuredModel getModelForEdit(IFile iFile) throws IOException, CoreException;
 
-	/*
-	 * @deprecated - encoding is handled automatically
+	/**
+	 * Returns a structured model for the given file. If one does not already
+	 * exists, one will be created with an edit count of 1. If one already
+	 * exists, its edit count will be incremented before it is returned.
+	 * 
+	 * @param iFile
+	 * @param encodingRule the rule for handling encoding
+	 * @return a structured model for the given file, or null if one could not
+	 *         be found or created
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 * @deprecated - encoding is handled automatically based on the file's
+	 *             contents or user preferences
 	 */
 	public IStructuredModel getModelForEdit(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
 
+	/**
+	 * @deprecated - Encoding and the line delimiter used are handled
+	 *             automatically based on the file's contents or user
+	 *             preferences.
+	 */
 	public IStructuredModel getModelForEdit(IFile iFile, String encoding, String lineDelimiter) throws UnsupportedEncodingException, IOException, CoreException;
 
+	/**
+	 * Returns a structured model for the given document. If one does not
+	 * already exists, one will be created with an edit count of 1. If one
+	 * already exists, its edit count will be incremented before it is
+	 * returned. This method is intended only to interact with documents
+	 * contained within File Buffers.
+	 * 
+	 * @param textFileBufferDocument
+	 * @return a structured model for the given document, or null if there is
+	 *         insufficient information known about the document instance to
+	 *         do so
+	 */
 	public IStructuredModel getModelForEdit(IStructuredDocument textFileBufferDocument);
 
-	/*
+	/**
+	 * Returns a structured model for the given contents using the given ID.
+	 * If one does not already exist, one will be created with an edit count
+	 * of 1. If one already exists, its edit count will be incremented before
+	 * it is returned.
+	 * 
+	 * @param id
+	 *            - the id for the model
+	 * @param inStream
+	 *            - the initial contents of the model
+	 * @param resolver
+	 *            - the URIResolver to use for locating any needed resources
+	 * @return a structured model for the given content, or null if one could
+	 *         not be found or created
+	 * @throws UnsupportedEncodingException
+	 * @throws IOException
+	 *             if the contents can not be read or its detected encoding
+	 *             does not support its contents
 	 * @deprecated - a URI resolver should be automatically created when
 	 *             needed
 	 */
 	public IStructuredModel getModelForEdit(String id, InputStream inStream, URIResolver resolver) throws UnsupportedEncodingException, IOException;
 
+	/**
+	 * Returns a structured model for the given file. If one does not already
+	 * exists, one will be created with a read count of 1. If one already
+	 * exists, its read count will be incremented before it is returned.
+	 * 
+	 * @param iFile
+	 * @return a structured model for the given file, or null if one could not
+	 *         be found or created
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 */
 	public IStructuredModel getModelForRead(IFile iFile) throws IOException, CoreException;
 
-	/*
-	 * @deprecated - encoding is handled automatically
+	/**
+	 * @deprecated - encoding is handled automatically based on the file's
+	 *             contents or user preferences
 	 */
 	public IStructuredModel getModelForRead(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
 
-	/*
-	 * @deprecated - encoding and line delimiters are handled automatically
+	/**
+	 * @deprecated - Encoding and the line delimiter used are handled
+	 *             automatically based on the file's contents or user
+	 *             preferences.
 	 */
 	public IStructuredModel getModelForRead(IFile iFile, String encoding, String lineDelimiter) throws UnsupportedEncodingException, IOException, CoreException;
 
+	/**
+	 * Returns a structured model for the given document. If one does not
+	 * already exists, one will be created with a read count of 1. If one
+	 * already exists, its read count will be incremented before it is
+	 * returned. This method is intended only to interact with documents
+	 * contained within File Buffers.
+	 * 
+	 * @param textFileBufferDocument
+	 * @return a structured model for the given document, or null if there is
+	 *         insufficient information known about the document instance to
+	 *         do so
+	 */
 	public IStructuredModel getModelForRead(IStructuredDocument textFileBufferDocument);
 
-	/*
+	/**
+	 * Returns a structured model for the given contents using the given ID.
+	 * If one does not already exist, one will be created with an read count
+	 * of 1. If one already exists, its read count will be incremented before
+	 * it is returned.
+	 * 
+	 * @param id
+	 *            - the id for the model
+	 * @param inStream
+	 *            - the initial contents of the model
+	 * @param resolver
+	 *            - the URIResolver to use for locating any needed resources
+	 * @return a structured model for the given content, or null if one could
+	 *         not be found or created
+	 * @throws UnsupportedEncodingException
+	 * @throws IOException
+	 *             if the contents can not be read or its detected encoding
+	 *             does not support its contents
 	 * @deprecated - a URI resolver should be automatically created when
 	 *             needed
 	 */
@@ -187,6 +412,14 @@
 	 * force is false. The idea is that a client should call this method once
 	 * with force set to false. If the exception is thrown, then prompt client
 	 * if they want to overwrite.
+	 * 
+	 * @param iFile
+	 * @param force
+	 * @return the new structured model, or 
+	 * @throws ResourceInUse if the given new ID is already in use by a managed model
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 * @throws ResourceAlreadyExists if the give file already exists
 	 */
 	IStructuredModel getNewModelForEdit(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException;
 
@@ -195,36 +428,44 @@
 	 * force is false. The idea is that a client should call this method once
 	 * with force set to false. If the exception is thrown, then prompt client
 	 * if they want to overwrite.
+	 * 
+	 * @param iFile
+	 * @param force
+	 * @return the new structured model, or 
+	 * @throws ResourceInUse if the given new ID is already in use by a managed model
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 * @throws ResourceAlreadyExists if the give file already exists
 	 */
 	IStructuredModel getNewModelForRead(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException;
 
 	/**
-	 * This function returns the reference count of underlying model.
+	 * This function returns the combined "read" and "edit" reference counts
+	 * of underlying model.
 	 * 
 	 * @param id
-	 *            Object The id of the model TODO: try to refine the design
-	 *            not to use this function
-	 * @deprecated
+	 *            Object The id of the model
+	 * @deprecated - internal information that can be obtained from the model
+	 *             itself
 	 */
 	int getReferenceCount(Object id);
 
 	/**
-	 * This function returns the reference count of underlying model.
+	 * This function returns the "edit" reference count of underlying model.
 	 * 
 	 * @param id
-	 *            Object The id of the model TODO: try to refine the design
-	 *            not to use this function
-	 * @deprecated
+	 *            Object The id of the model
+	 * @deprecated - internal information that can be obtained from the model itself
 	 */
 	int getReferenceCountForEdit(Object id);
 
 	/**
-	 * This function returns the reference count of underlying model.
+	 * This function returns the "read" reference count of underlying model.
 	 * 
 	 * @param id
 	 *            Object The id of the model TODO: try to refine the design
 	 *            not to use this function
-	 * @deprecated
+	 * @deprecated - internal information that can be obtained from the model itself
 	 */
 	int getReferenceCountForRead(Object id);
 
@@ -238,7 +479,7 @@
 	boolean isShared(Object id);
 
 	/**
-	 * This function returns true if there are other references to the
+	 * This function returns true if there are other "edit" references to the
 	 * underlying model.
 	 * 
 	 * @param id
@@ -247,7 +488,7 @@
 	boolean isSharedForEdit(Object id);
 
 	/**
-	 * This function returns true if there are other references to the
+	 * This function returns true if there are other "read" references to the
 	 * underlying model.
 	 * 
 	 * @param id
@@ -256,13 +497,17 @@
 	boolean isSharedForRead(Object id);
 
 	/**
+	 * @deprecated - not granular enough
+	 * 
 	 * This method can be called to determine if the model manager is within a
 	 * "aboutToChange" and "changed" sequence.
 	 */
 	public boolean isStateChanging();
 
 	/**
-	 * This method changes the id of the model. TODO: try to refine the design
+	 * This method changes the id of the model. 
+	 * 
+	 * TODO: try to refine the design
 	 * not to use this function
 	 * 
 	 * @deprecated
@@ -270,7 +515,7 @@
 	void moveModel(Object oldId, Object newId);
 
 	/**
-	 * This method can be called when the content type of a model changes. Its
+	 * This method can be called when the content type of a model changes. It's
 	 * assumed the contentType has already been changed, and this method uses
 	 * the text of the old one, to repopulate the text of the new one. In
 	 * theory, the actual instance could change, (e.g. using 'saveAs' to go
@@ -292,6 +537,18 @@
 	 */
 	IStructuredModel reloadModel(Object id, InputStream inStream) throws UnsupportedEncodingException;
 
+	/**
+	 * Saves the contents of the given structured document to the given file. If
+	 * the document belongs to a managed model, that model will be saved and
+	 * marked as non-dirty.
+	 * 
+	 * @param structuredDocument
+	 *            - the structured document
+	 * @param iFile
+	 *            - the file to save to
+	 * @throws UnsupportedEncodingException
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 */
 	void saveStructuredDocument(IStructuredDocument structuredDocument, IFile iFile) throws UnsupportedEncodingException, IOException, CoreException;
-
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeNotifier.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeNotifier.java
index 88d1888..a76fe75 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeNotifier.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeNotifier.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -55,9 +55,9 @@
 
 
 	/**
-	 * NOT API: these strings are for printing, such as during debuging
+	 * NOT API: these strings are for printing, such as during debugging
 	 */
-	static final String[] EVENT_TYPE_STRINGS = new String[]{"undefined", "CHANGE", "ADD", "REMOVE", "STRUCUTRED_CHANGED", "CONTENT_CHANGED"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+	static final String[] EVENT_TYPE_STRINGS = new String[]{"undefined", "CHANGE", "ADD", "REMOVE", "STRUCTURE_CHANGED", "CONTENT_CHANGED"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
 
 
 	/**
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IStructuredModel.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IStructuredModel.java
index 7370e92..5d67830 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IStructuredModel.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IStructuredModel.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -36,15 +36,11 @@
  * implementers. The main purposed of this abstraction is to provide a common
  * means to manage models that have an associated structured document.
  * 
- * @plannedfor 2.0
- * 
  * <p>
- * ISSUE: this interface needs ton of cleanup!
+ * TODO: this interface needs ton of cleanup!
  * </p>
  * 
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
+ * @noimplement This interface is not intended to be implemented by clients.
  */
 public interface IStructuredModel extends IAdaptable {
 
@@ -123,16 +119,25 @@
 
 	/**
 	 * @deprecated
+	 * @see IModelManager#copyModelForEdit(String, String)
 	 */
 	IStructuredModel copy(String id) throws ResourceInUse, ResourceAlreadyExists;
 
 	/**
 	 * Disable undo management.
+	 * 
+	 * @deprecated - the ability to enable and disable Undo management for the
+	 *             model cannot be guaranteed as it implicitly requires
+	 *             knowledge of the underlying undo/redo implementation
 	 */
 	void disableUndoManagement();
 
 	/**
 	 * Enable undo management.
+	 * 
+	 * @deprecated - the ability to enable and disable Undo management for the
+	 *             model cannot be guaranteed as it implicitly requires
+	 *             knowledge of the underlying undo/redo implementation
 	 */
 	void enableUndoManagement();
 
@@ -156,6 +161,10 @@
 
 	/**
 	 * @return The associated content type identifier (String) for this model.
+	 *         This value may be more accurate than the content type against
+	 *         which the model handler was registered.
+	 *         
+	 *         @see IModelHandler#getAssociatedContentTypeId()
 	 */
 	String getContentTypeIdentifier();
 
@@ -178,6 +187,9 @@
 	 */
 	IndexedRegion getIndexedRegion(int offset);
 
+	/**
+	 * @return the model's handler
+	 */
 	IModelHandler getModelHandler();
 
 	IModelManager getModelManager();
@@ -215,7 +227,7 @@
 	/**
 	 * Get URI resolution helper
 	 * 
-	 * @deprecated
+	 * @deprecated - use org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin.createResolver(*) instead
 	 */
 	URIResolver getResolver();
 
@@ -338,10 +350,16 @@
 
 	void save() throws UnsupportedEncodingException, IOException, CoreException;
 
+	/**
+	 * @deprecated - will save according to the encoding priorities specified for the IFile 
+	 */
 	void save(EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
 
 	void save(IFile iFile) throws UnsupportedEncodingException, IOException, CoreException;
 
+	/**
+	 * @deprecated - will save according to the encoding priorities specified for the IFile 
+	 */
 	void save(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
 
 	void save(OutputStream outputStream) throws UnsupportedEncodingException, IOException, CoreException;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IndexedRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IndexedRegion.java
index bf9b7bc..a9e9538 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IndexedRegion.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IndexedRegion.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -32,7 +32,7 @@
  * original source. They currently often do, so thought I'd mention explicitly
  * this may not always be true.
  * 
- * @plannedfor 1.0
+ * @noimplement This interface is not intended to be implemented by clients.
  */
 public interface IndexedRegion {
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java
index a136922..baebc44 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -39,7 +39,7 @@
 	 * @return IModelManager - returns the one model manager for structured
 	 *         model
 	 * @deprecated - use the one that is in
-	 *             org.eclipse.wst.sse.core.SttructuredModelManager
+	 *             org.eclipse.wst.sse.core.StructuredModelManager
 	 */
 	public static IModelManager getModelManager() {
 		boolean isReady = false;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IStructuredDocumentProposed.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IStructuredDocumentProposed.java
index 39832af..0c0f47d 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IStructuredDocumentProposed.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IStructuredDocumentProposed.java
@@ -32,7 +32,7 @@
  * 
  * Clients should not implement.
  * 
- * @plannedfor 1.0
+ * @deprecated - was never used
  */
 public interface IStructuredDocumentProposed extends IDocument, IDocumentExtension, IAdaptable {
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentRegionsReplacedEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentRegionsReplacedEvent.java
index 6942bf7..8f08b88 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentRegionsReplacedEvent.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentRegionsReplacedEvent.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,6 +29,8 @@
 	private IStructuredDocumentRegionList fNewStructuredDocumentRegions;
 	private IStructuredDocumentRegionList fOldStructuredDocumentRegions;
 
+	private boolean fIsEntireDocumentReplaced;
+
 	/**
 	 * Creates an instance of StructuredDocumentRegionsReplacedEvent
 	 * 
@@ -53,6 +55,11 @@
 		fNewStructuredDocumentRegions = newStructuredDocumentRegions;
 	}
 
+	public StructuredDocumentRegionsReplacedEvent(IStructuredDocument document, Object originalRequester, IStructuredDocumentRegionList oldStructuredDocumentRegions, IStructuredDocumentRegionList newStructuredDocumentRegions, String changes, int offset, int lengthToReplace, boolean entireDocumentReplaced) {
+		this(document, originalRequester, oldStructuredDocumentRegions, newStructuredDocumentRegions, changes, offset, lengthToReplace);
+		fIsEntireDocumentReplaced = entireDocumentReplaced;
+	}
+
 	/**
 	 * Returns the new structured document regions.
 	 * 
@@ -70,4 +77,8 @@
 	public IStructuredDocumentRegionList getOldStructuredDocumentRegions() {
 		return fOldStructuredDocumentRegions;
 	}
+
+	public boolean isEntireDocumentReplaced() {
+		return fIsEntireDocumentReplaced;
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java
index a796e90..79ff0e6 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,6 +14,10 @@
 
 
 
+/**
+ * Indicates that a Resource which a model or document was expected to create
+ * already exists.
+ */
 public class ResourceAlreadyExists extends Exception {
 
 	/**
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java
index e4f1ac1..5ecbfad 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,6 +14,9 @@
 
 
 
+/**
+ * Indicates that a model with a particular ID already exists
+ */
 public class ResourceInUse extends Exception {
 
 	/**
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java
index c0e46d6..594d3e8 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -37,7 +37,7 @@
 	 * 
 	 * @param insertPos
 	 * @param newRegions
-	 * @return
+	 * @return whether the contents of this list were modified
 	 */
 	public boolean addAll(int insertPos, ITextRegionList newRegions);
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java
index 3452d7a..6cafd4d 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,6 +9,9 @@
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
  *     Jesper Steen Møller - initial IDocumentExtension4 support - #102822
+ *                           (see also #239115)
+ *     David Carver (Intalio) - bug 300434 - Make inner classes static where possible
+ *     David Carver (Intalio) - bug 300443 - some constants aren't static final
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.text;
@@ -21,7 +24,9 @@
 import java.util.List;
 import java.util.Map;
 
+import org.eclipse.core.runtime.ISafeRunnable;
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.SafeRunner;
 import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.core.runtime.preferences.InstanceScope;
 import org.eclipse.jface.text.BadLocationException;
@@ -54,7 +59,6 @@
 import org.eclipse.jface.text.ITextStore;
 import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.SequentialRewriteTextStore;
 import org.eclipse.jface.text.TypedRegion;
 import org.eclipse.wst.sse.core.internal.Logger;
 import org.eclipse.wst.sse.core.internal.document.StructuredDocumentFactory;
@@ -103,7 +107,7 @@
 		// jobs -- found not to be a good assumption. See below.
 		private List cachedRegionPositionArray = Collections.synchronizedList(new ArrayList());
 		private final boolean DEBUG = false;
-		private final int MAX_SIZE = 50;
+		private static final int MAX_SIZE = 50;
 
 
 		private ThreadLocal threadLocalCachePosition = new ThreadLocal();
@@ -184,11 +188,6 @@
 			return region;
 		}
 
-		// TODO: make privite if used, else delete
-		void set(int pos, IStructuredDocumentRegion region) {
-			cachedRegionPositionArray.set(pos, region);
-		}
-
 		void set(IStructuredDocumentRegion region) {
 			try {
 				int pos = getThreadLocalPosition();
@@ -226,7 +225,7 @@
 		}
 	}
 
-	class RegisteredReplace {
+	static class RegisteredReplace {
 		/** The owner of this replace operation. */
 		IDocumentListener fOwner;
 		/** The replace operation */
@@ -268,7 +267,7 @@
 	private IStructuredDocumentRegion cachedDocumentRegion;
 	private EncodingMemento encodingMemento;
 	private boolean fAcceptPostNotificationReplaces = true;
-	private CurrentDocumentRegionCache fCurrentDocumnetRegionCache;
+	private CurrentDocumentRegionCache fCurrentDocumentRegionCache;
 	private DocumentEvent fDocumentEvent;
 	private IDocumentListener[] fDocumentListeners;
 
@@ -306,7 +305,7 @@
 	 * user's preference is usually to be internally consistent.
 	 */
 	private String fInitialLineDelimiter;
-	private final String READ_ONLY_REGIONS_CATEGORY = "_READ_ONLY_REGIONS_CATEGORY_"; //$NON-NLS-1$
+	private static final String READ_ONLY_REGIONS_CATEGORY = "_READ_ONLY_REGIONS_CATEGORY_"; //$NON-NLS-1$
 	/**
 	 * Current rewrite session, or none if not presently rewriting.
 	 */
@@ -334,8 +333,8 @@
 
 	public BasicStructuredDocument() {
 		super();
-		fCurrentDocumnetRegionCache = new CurrentDocumentRegionCache();
-		fStore = new StructuredDocumentTextStore(50, 300);
+		fCurrentDocumentRegionCache = new CurrentDocumentRegionCache();
+		setTextStore(new StructuredDocumentTextStore(50, 300));
 		setLineTracker(new DefaultLineTracker());
 		NULL_DOCUMENT_EVENT = new NullDocumentEvent();
 
@@ -458,7 +457,6 @@
 						((IDocumentListener) holdListeners[i]).documentChanged(NULL_DOCUMENT_EVENT);
 					}
 					else {
-						fDocumentEvent.fModificationStamp = getModificationStamp();
 						((IDocumentListener) holdListeners[i]).documentChanged(fDocumentEvent);
 					}
 				}
@@ -1261,7 +1259,7 @@
 	IStructuredDocumentRegion getCachedDocumentRegion() {
 		IStructuredDocumentRegion result = null;
 		if (USE_LOCAL_THREAD) {
-			result = fCurrentDocumnetRegionCache.get();
+			result = fCurrentDocumentRegionCache.get();
 		}
 		else {
 			result = cachedDocumentRegion;
@@ -1807,7 +1805,6 @@
 	}
 
 	private ITextStore getStore() {
-		Assert.isNotNull(fStore);
 		return fStore;
 	}
 
@@ -1823,7 +1820,6 @@
 	 * @return the document's line tracker
 	 */
 	private ILineTracker getTracker() {
-		Assert.isNotNull(fTracker);
 		return fTracker;
 	}
 
@@ -1894,9 +1890,11 @@
 	 * @param start
 	 * @param replacementLength
 	 * @param changes
+	 * @param modificationStamp
+	 * @param ignoreReadOnlySettings
 	 * @return
 	 */
-	private StructuredDocumentEvent internalReplaceText(Object requester, int start, int replacementLength, String changes, boolean ignoreReadOnlySettings) {
+	private StructuredDocumentEvent internalReplaceText(Object requester, int start, int replacementLength, String changes, long modificationStamp, boolean ignoreReadOnlySettings) {
 		StructuredDocumentEvent result = null;
 
 		stopPostNotificationProcessing();
@@ -1944,12 +1942,14 @@
 			// fireStructuredDocumentEvent must be called in order to end
 			// documentAboutToBeChanged state
 
+
 			// increment modification stamp if modifications were made
 			if (result != null && !(result instanceof NoChangeEvent)) {
-				fModificationStamp++;
+				fModificationStamp= modificationStamp;
 				fNextModificationStamp= Math.max(fModificationStamp, fNextModificationStamp);
+				fDocumentEvent.fModificationStamp = fModificationStamp;
 			}
-
+				
 			if (result == null) {
 				// result should not be null, but if an exception was thrown,
 				// it will be
@@ -1996,6 +1996,7 @@
 					}
 				}
 			}
+
 			if (Debug.perfTest || Debug.perfTestStructuredDocumentOnly) {
 				long stopStreamTime = System.currentTimeMillis();
 				System.out.println("\n\t\t\t\t Total Time for IStructuredDocument event signaling/processing in replaceText: " + (stopStreamTime - startStreamTime)); //$NON-NLS-1$
@@ -2332,8 +2333,9 @@
 		stopPostNotificationProcessing();
 		clearReadOnly();
 
-		acquireLock();
 		try {
+			acquireLock();
+
 			CharSequenceReader subSetTextStoreReader = new CharSequenceReader((CharSequence) getStore(), 0, getStore().getLength());
 			resetParser(subSetTextStoreReader, 0);
 			//
@@ -2355,11 +2357,11 @@
 	 * @exception BadLocationException
 	 *                If position is not a valid range in the document
 	 */
-	public void replace(int pos, int length, String string) throws BadLocationException {
+	public void replace(int offset, int length, String text) throws BadLocationException {
 		if (Debug.displayWarnings) {
 			System.out.println("Note: IStructuredDocument::replace(int, int, String) .... its better to use replaceText(source, string, int, int) API for structuredDocument updates"); //$NON-NLS-1$
 		}
-		replaceText(this, pos, length, string);
+		replaceText(this, offset, length, text);
 	}
 
 	/**
@@ -2367,13 +2369,13 @@
 	 * length of "replaceLength".
 	 * <p>
 	 * 
-	 * @param start
+	 * @param pos
 	 *            start offset of text to replace None of the offsets include
 	 *            delimiters of preceeding lines. Offset 0 is the first
 	 *            character of the document.
-	 * @param replaceLength
+	 * @param length
 	 *            start offset of text to replace
-	 * @param newText
+	 * @param text
 	 *            start offset of text to replace
 	 *            <p>
 	 *            Implementors have to notify TextChanged listeners after the
@@ -2395,8 +2397,11 @@
 	/**
 	 * One of the APIs to manipulate the IStructuredDocument in terms of text.
 	 */
-	public StructuredDocumentEvent replaceText(Object requester, int start, int replacementLength, String changes) {
-		return replaceText(requester, start, replacementLength, changes, false);
+	public StructuredDocumentEvent replaceText(Object requester, int pos, int length, String text) {
+		if (length == 0 && (text == null || text.length() == 0))
+			return replaceText(requester, pos, length, text, getModificationStamp(), true);
+		else
+			return replaceText(requester, pos, length, text, getNextModificationStamp(), true);
 	}
 
 	public StructuredDocumentEvent replaceText(Object requester, int start, int replacementLength, String changes, boolean ignoreReadOnlySettings) {
@@ -2407,13 +2412,11 @@
 		else
 			modificationStamp = getNextModificationStamp();
 		
-		return replaceText(requester, start, replacementLength, changes, ignoreReadOnlySettings, modificationStamp);
+		return replaceText(requester, start, replacementLength, changes, modificationStamp, ignoreReadOnlySettings);
 	}
 	
-	private StructuredDocumentEvent replaceText(Object requester, int start, int replacementLength, String changes, boolean ignoreReadOnlySettings, long modificationStamp) {
-		StructuredDocumentEvent event = internalReplaceText(requester, start, replacementLength, changes, ignoreReadOnlySettings);
-		fModificationStamp = modificationStamp;
-		fNextModificationStamp= Math.max(fModificationStamp, fNextModificationStamp);
+	private StructuredDocumentEvent replaceText(Object requester, int start, int replacementLength, String changes, long modificationStamp, boolean ignoreReadOnlySettings) {
+		StructuredDocumentEvent event = internalReplaceText(requester, start, replacementLength, changes, modificationStamp, ignoreReadOnlySettings);
 		return event;
 	}
 
@@ -2484,7 +2487,7 @@
 	 */
 	public void setCachedDocumentRegion(IStructuredDocumentRegion structuredRegion) {
 		if (USE_LOCAL_THREAD) {
-			fCurrentDocumnetRegionCache.set(structuredRegion);
+			fCurrentDocumentRegionCache.set(structuredRegion);
 		}
 		else {
 			cachedDocumentRegion = structuredRegion;
@@ -2568,6 +2571,7 @@
 	 *            the document's line tracker
 	 */
 	private void setLineTracker(ILineTracker tracker) {
+		Assert.isNotNull(tracker);
 		fTracker = tracker;
 	}
 
@@ -2599,9 +2603,7 @@
 	 */
 	public StructuredDocumentEvent setText(Object requester, String theString) {
 		StructuredDocumentEvent result = null;
-
-		result = replaceText(requester, 0, getLength(), theString, true, getNextModificationStamp());
-
+		result = replaceText(requester, 0, getLength(), theString, getNextModificationStamp(), true);
 		return result;
 	}
 
@@ -2613,6 +2615,7 @@
 	 *            the document's text store
 	 */
 	private void setTextStore(ITextStore store) {
+		Assert.isNotNull(store);
 		fStore = store;
 	}
 
@@ -2630,9 +2633,10 @@
 	}
 
 
+	/*
+	 * {@inheritDoc}
+	 */
 	public void startSequentialRewrite(boolean normalized) {
-		ITextStore store = new SequentialRewriteTextStore(getStore());
-		setTextStore(store);
 	}
 
 	/*
@@ -2645,13 +2649,10 @@
 	}
 
 
+	/*
+	 * {@inheritDoc}
+	 */
 	public void stopSequentialRewrite() {
-		if (getStore() instanceof SequentialRewriteTextStore) {
-			SequentialRewriteTextStore srws = (SequentialRewriteTextStore) getStore();
-			ITextStore source = srws.getSourceStore();
-			setTextStore(source);
-			srws.dispose();
-		}
 	}
 
 	/*
@@ -2739,7 +2740,7 @@
 	 * Class which implements the rewritable session for the SSE.
 	 * 
 	 */
-	class StructuredDocumentRewriteSession extends DocumentRewriteSession {
+	static class StructuredDocumentRewriteSession extends DocumentRewriteSession {
 
 		/**
 		 * Creates a new session.
@@ -2840,9 +2841,9 @@
 				extension.stopRewriteSession(session, get());
 			}
 
+			fActiveRewriteSession = null;
 			DocumentRewriteSessionEvent event = new DocumentRewriteSessionEvent(this, session, DocumentRewriteSessionEvent.SESSION_STOP);
 			fireDocumentRewriteSessionEvent(event);
-			fActiveRewriteSession = null;
 		}
 	}
 
@@ -2916,7 +2917,7 @@
 	 *      java.lang.String, long)
 	 */
 	public void replace(int offset, int length, String text, long modificationStamp) throws BadLocationException {
-		replaceText(this, offset, length, text, false, modificationStamp);
+		replaceText(this, offset, length, text, modificationStamp, true);
 	}
 
 	/*
@@ -2927,7 +2928,7 @@
 	 */
 	public void set(String text, long modificationStamp) {
 		// bug 151069 - overwrite read only regions when setting entire document
-		 replaceText(null, 0, getLength(), text, true, modificationStamp);
+		 replaceText(null, 0, getLength(), text, modificationStamp, true);
 	}
 
 	/*
@@ -2954,15 +2955,21 @@
 	 * @param event
 	 *            The event to fire, either a start or stop event.
 	 */
-	private void fireDocumentRewriteSessionEvent(DocumentRewriteSessionEvent event) {
+	private void fireDocumentRewriteSessionEvent(final DocumentRewriteSessionEvent event) {
 		if (fDocumentRewriteSessionListeners == null || fDocumentRewriteSessionListeners.size() == 0)
 			return;
 
-		List list = new ArrayList(fDocumentRewriteSessionListeners);
-		Iterator e = list.iterator();
-		while (e.hasNext()) {
-			IDocumentRewriteSessionListener l = (IDocumentRewriteSessionListener) e.next();
-			l.documentRewriteSessionChanged(event);
+		Object[] listeners = fDocumentRewriteSessionListeners.toArray();
+		for (int i = 0; i < listeners.length; i++) {
+			final IDocumentRewriteSessionListener l = (IDocumentRewriteSessionListener) listeners[i];
+			SafeRunner.run(new ISafeRunnable() {
+				public void run() throws Exception {
+					l.documentRewriteSessionChanged(event);
+				}
+				public void handleException(Throwable exception) {
+					// logged for us
+				}
+			});
 		}
 	}
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java
index 624956f..7fba9b3 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,8 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300430 - String concatenation
+ *     David Carver (Intalio) - bug 300427 - Comparison of String Objects == or !=
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.text;
 
@@ -163,11 +164,13 @@
 		ITextRegion region = null;
 		String result = ""; //$NON-NLS-1$
 		int length = getRegions().size();
+		StringBuffer sb = new StringBuffer(result);
 		for (int i = 0; i < length; i++) {
 			region = getRegions().get(i);
-			if (region.getType() == context)
-				result += getFullText(region);
+			if (region.getType().equals(context))
+				sb.append(getFullText(region));
 		}
+		result = sb.toString();
 		return result;
 	}
 
@@ -202,16 +205,27 @@
 	 * The parameter offset refers to the overall offset in the document.
 	 */
 	public ITextRegion getRegionAtCharacterOffset(int offset) {
-		ITextRegion result = null;
 		if (_getRegions() != null) {
+			int thisStartOffset = getStartOffset();
+			if (offset < thisStartOffset)
+				return null;
+			int thisEndOffset = getStartOffset() + getLength();
+			if (offset > thisEndOffset)
+				return null;
 			// transform the requested offset to the "scale" that
 			// regions are stored in, which are all relative to the
 			// start point.
 			// int transformedOffset = offset - getStartOffset();
 			//
-			int length = getRegions().size();
-			for (int i = 0; i < length; i++) {
-				ITextRegion region = getRegions().get(i);
+			ITextRegionList regions = getRegions();
+			int length = regions.size();
+			int low = 0;
+			int high = length;
+			int mid = 0;
+			// Binary search for the region
+			while (low < high) {
+				mid = low + ((high - low) >> 1);
+				ITextRegion region = regions.get(mid);
 				if (Debug.debugStructuredDocument) {
 					System.out.println("region(s) in IStructuredDocumentRegion::getRegionAtCharacterOffset: " + region); //$NON-NLS-1$
 					System.out.println("       requested offset: " + offset); //$NON-NLS-1$
@@ -223,13 +237,16 @@
 					System.out.println("       region class: " + region.getClass()); //$NON-NLS-1$
 
 				}
-				if ((getStartOffset(region) <= offset) && (offset < getEndOffset(region))) {
-					result = region;
-					break;
-				}
+				// Region is before this one
+				if (offset < region.getStart() + thisStartOffset)
+					high = mid;
+				else if (offset > (region.getEnd() + thisStartOffset - 1))
+					low = mid + 1;
+				else
+					return region;
 			}
 		}
-		return result;
+		return null;
 	}
 
 	public ITextRegionList getRegions() {
@@ -304,7 +321,7 @@
 		int length = getRegions().size();
 		for (int i = 0; i < length; i++) {
 			region = getRegions().get(i);
-			if (region.getType() == context) {
+			if (region.getType().equals(context)) {
 				result = getText(region);
 				break;
 			}
@@ -381,7 +398,7 @@
 				// offset,
 				// since that would decide many cases right away and avoid the
 				// text comparison
-				if (getType() == region.getType()) {
+				if (getType().equals(region.getType())) {
 					if (sameOffsetsAs(region, shift) && sameTextAs(region, shift)) {
 						result = true;
 					}
@@ -406,7 +423,7 @@
 				// offset,
 				// since that would decide many cases right away and avoid the
 				// text comparison
-				if (oldRegion.getType() == newRegion.getType()) {
+				if (oldRegion.getType().equals(newRegion.getType())) {
 					if (sameOffsetsAs(oldRegion, newDocumentRegion, newRegion, shift)) {
 						if (sameTextAs(oldRegion, newDocumentRegion, newRegion, shift)) {
 							result = true;
@@ -469,7 +486,10 @@
 	 * @see org.eclipse.wst.sse.core.text.IStructuredDocumentRegion#setDelete(boolean)
 	 */
 	public void setDeleted(boolean isDeleted) {
-		fIsDeletedOrEnded = (byte) (isDeleted ? fIsDeletedOrEnded | MASK_IS_DELETED : 0);
+		if (isDeleted)
+			fIsDeletedOrEnded |= MASK_IS_DELETED;
+		else
+			fIsDeletedOrEnded &= ~MASK_IS_DELETED;
 	}
 
 	/**
@@ -478,7 +498,10 @@
 	 *            boolean
 	 */
 	public void setEnded(boolean newHasEnd) {
-		fIsDeletedOrEnded = (byte) (newHasEnd ? fIsDeletedOrEnded | MASK_IS_ENDED : 0);
+		if (newHasEnd)
+			fIsDeletedOrEnded |= MASK_IS_ENDED;
+		else
+			fIsDeletedOrEnded &= ~MASK_IS_ENDED;
 	}
 
 	public void setLength(int newLength) {
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java
index 5848016..502b508 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,21 +12,41 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.text;
 
-import org.eclipse.core.runtime.Platform;
+import java.util.Stack;
+
+import org.eclipse.core.runtime.ISafeRunnable;
 import org.eclipse.core.runtime.jobs.ILock;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.DocumentRewriteSession;
 import org.eclipse.jface.text.DocumentRewriteSessionType;
 import org.eclipse.wst.sse.core.internal.IExecutionDelegate;
 import org.eclipse.wst.sse.core.internal.ILockable;
 import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
+import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
 import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
 
-
-
+/**
+ * An IStructuredDocument that performs most of its computation and event
+ * notification through an IExecutionDelegate.
+ * 
+ * If the delegate has not been set, we execute on current thread, like
+ * "normal". This is the case for normal non-editor use (which should still,
+ * ultimately, be protected by a scheduling rule). For every operation, a
+ * runnable is created, even if later (in the execution delegate instance) it
+ * is decided nothing special is needed (that is, in fact being called from an
+ * editor's display thread, in which case its just executed) in the UI.
+ */
 public class JobSafeStructuredDocument extends BasicStructuredDocument implements IExecutionDelegatable, ILockable {
 
-	private IExecutionDelegate fExecutionDelegate;
-	private ILock fLockable = Platform.getJobManager().newLock();
+	private static abstract class JobSafeRunnable implements ISafeRunnable {
+		public void handleException(Throwable exception) {
+			// logged in SafeRunner
+		}
+	}
+	
+	private Stack fExecutionDelegates = new Stack();
+	private ILock fLockable = Job.getJobManager().newLock();
 
 	public JobSafeStructuredDocument() {
 		super();
@@ -46,9 +66,11 @@
 	}
 
 	private IExecutionDelegate getExecutionDelegate() {
-		return fExecutionDelegate;
+		if (!fExecutionDelegates.isEmpty())
+			return (IExecutionDelegate) fExecutionDelegates.peek();
+		return null;
 	}
-
+	
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -66,160 +88,137 @@
 	protected final void releaseLock() {
 		getLockObject().release();
 	}
-
+	
 	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.text.IStructuredDocument#replaceText(java.lang.Object,
-	 *      int, int, java.lang.String, boolean)
+	 * @see org.eclipse.jface.text.IDocument.replace(int, int, String)
+	 */
+	public void replace(final int offset, final int length, final String text) throws BadLocationException {
+		IExecutionDelegate delegate = getExecutionDelegate();
+		if (delegate == null) {
+			super.replace(offset, length, text);
+		}
+		else {
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					JobSafeStructuredDocument.super.replace(offset, length, text);
+				}
+			};
+			delegate.execute(runnable);
+		}
+	}
+	
+	/*
+	 * @see org.eclipse.jface.text.IDocumentExtension4.replace(int, int, String, long)
+	 */
+	public void replace(final int offset, final int length, final String text, final long modificationStamp) throws BadLocationException {
+		IExecutionDelegate delegate = getExecutionDelegate();
+		if (delegate == null) {
+			super.replace(offset, length, text, modificationStamp);
+		}
+		else {
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					JobSafeStructuredDocument.super.replace(offset, length, text, modificationStamp);
+				}
+			};
+			delegate.execute(runnable);
+		}
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument#replaceText(java.lang.Object, int, int, java.lang.String)
+	 */
+	public StructuredDocumentEvent replaceText(final Object requester, final int start, final int replacementLength, final String changes) {
+		StructuredDocumentEvent event = null;
+		IExecutionDelegate delegate = getExecutionDelegate();
+		if (delegate == null) {
+			event = super.replaceText(requester, start, replacementLength, changes);
+		}
+		else {
+			final Object[] resultSlot = new Object[1];
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					resultSlot[0] = JobSafeStructuredDocument.super.replaceText(requester, start, replacementLength, changes);
+				}
+			};
+			delegate.execute(runnable);
+			event = (StructuredDocumentEvent) resultSlot[0];
+		}
+		return event;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument#replaceText(java.lang.Object, int, int, java.lang.String, boolean)
 	 */
 	public StructuredDocumentEvent replaceText(final Object requester, final int start, final int replacementLength, final String changes, final boolean ignoreReadOnlySettings) {
 		StructuredDocumentEvent event = null;
-		if (getExecutionDelegate() == null) {
-			// if the delegate has not been set, we execute on current
-			// thread, like "normal". This is the case for normal
-			// non-editor
-			// use (which should still, ultimately, be protected by
-			// a scheduling rule).
+		IExecutionDelegate delegate = getExecutionDelegate();
+		if (delegate == null) {
 			event = super.replaceText(requester, start, replacementLength, changes, ignoreReadOnlySettings);
 		}
 		else {
-			// If document is being used by an editor, a runnable is
-			// created,
-			// even if later (in the execution delegate instance) it is
-			// decided
-			// nothing special is needed (that is, in fact being called
-			// from
-			// editor's display thread, in which case its just executed)
 			final Object[] resultSlot = new Object[1];
-			Runnable runnable = new Runnable() {
-				public void run() {
-					try {
-						resultSlot[0] = JobSafeStructuredDocument.super.replaceText(requester, start, replacementLength, changes, ignoreReadOnlySettings);
-					}
-					catch (Throwable e) {
-						resultSlot[0] = e;
-					}
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					resultSlot[0] = JobSafeStructuredDocument.super.replaceText(requester, start, replacementLength, changes, ignoreReadOnlySettings);
+				}
+
+				public void handleException(Throwable exception) {
+					resultSlot[0] = new NoChangeEvent(JobSafeStructuredDocument.this, requester, changes, start, replacementLength);
+					super.handleException(exception);
 				}
 			};
-			// strongly assumes synchronous call, to "wait" for
-			// results
-			// basically just routes to Display.synchExec(runnable),
-			// if not already running on display thread.
-			getExecutionDelegate().execute(runnable);
-
-			// this remembering and re-throwing of exception is just to
-			// get an
-			// exception that occurred on one thread, to be thrown on
-			// callers
-			// thread.
-			if (resultSlot[0] instanceof Throwable) {
-				throw new RuntimeException((Throwable) resultSlot[0]);
-			}
-			else {
-				event = (StructuredDocumentEvent) resultSlot[0];
-			}
+			delegate.execute(runnable);
+			event = (StructuredDocumentEvent) resultSlot[0];
 		}
 		return event;
 	}
 
 	public void setExecutionDelegate(IExecutionDelegate delegate) {
-		fExecutionDelegate = delegate;
+		if (delegate != null)
+			fExecutionDelegates.push(delegate);
+		else if (!fExecutionDelegates.isEmpty())
+			fExecutionDelegates.pop();
 	}
 
-
 	public StructuredDocumentEvent setText(final Object requester, final String theString) {
 		StructuredDocumentEvent event = null;
-		if (getExecutionDelegate() == null) {
-			// if the delegate has not been set, we execute on current
-			// thread, like "normal". This is the case for normal
-			// non-editor
-			// use (which should still, ultimately, be protected by
-			// a scheduling rule).
+		IExecutionDelegate executionDelegate = getExecutionDelegate();
+		if (executionDelegate == null) {
 			event = super.setText(requester, theString);
 		}
 		else {
-			// If document is being used by an editor, a runnable is
-			// created,
-			// even if later (in the execution delegate instance) it is
-			// decided
-			// nothing special is needed (that is, in fact being called
-			// from
-			// editor's display thread, in which case its just executed)
 			final Object[] resultSlot = new Object[1];
-			Runnable runnable = new Runnable() {
-				public void run() {
-					try {
-						resultSlot[0] = JobSafeStructuredDocument.super.setText(requester, theString);
-					}
-					catch (Throwable e) {
-						resultSlot[0] = e;
-					}
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					resultSlot[0] = JobSafeStructuredDocument.super.setText(requester, theString);
+				}
+				public void handleException(Throwable exception) {
+					resultSlot[0] = new NoChangeEvent(JobSafeStructuredDocument.this, requester, theString, 0, 0);
+					super.handleException(exception);
 				}
 			};
-			// strongly assumes synchronous call, to "wait" for
-			// results
-			// basically just routes to Display.synchExec(runnable),
-			// if not already running on display thread.
-			getExecutionDelegate().execute(runnable);
-
-			// this remembering and re-throwing of exception is just to
-			// get an
-			// exception that occurred on one thread, to be thrown on
-			// callers
-			// thread.
-			if (resultSlot[0] instanceof Throwable) {
-				throw new RuntimeException((Throwable) resultSlot[0]);
-			}
-			else {
-				event = (StructuredDocumentEvent) resultSlot[0];
-			}
+			executionDelegate.execute(runnable);
+			event = (StructuredDocumentEvent) resultSlot[0];
 		}
 		return event;
 	}
 
 	public DocumentRewriteSession startRewriteSession(DocumentRewriteSessionType sessionType) throws IllegalStateException {
 		DocumentRewriteSession session = null;
-		if (getExecutionDelegate() == null) {
-			// if the delegate has not been set, we execute on current
-			// thread, like "normal". This is the case for normal
-			// non-editor
-			// use (which should still, ultimately, be protected by
-			// a scheduling rule).
+		IExecutionDelegate executionDelegate = getExecutionDelegate();
+		if (executionDelegate == null) {
 			session = internalStartRewriteSession(sessionType);
 		}
 		else {
-			// If document is being used by an editor, a runnable is
-			// created,
-			// even if later (in the execution delegate instance) it is
-			// decided
-			// nothing special is needed (that is, in fact being called
-			// from
-			// editor's display thread, in which case its just executed)
 			final Object[] resultSlot = new Object[1];
 			final DocumentRewriteSessionType finalSessionType = sessionType;
-			Runnable runnable = new Runnable() {
-				public void run() {
-					try {
-						resultSlot[0] = internalStartRewriteSession(finalSessionType);
-
-					}
-					catch (Throwable e) {
-						resultSlot[0] = e;
-					}
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					resultSlot[0] = internalStartRewriteSession(finalSessionType);
 				}
 			};
-			// strongly assumes synchronous call, to "wait" for
-			// results
-			// basically just routes to Display.synchExec(runnable),
-			// if not already running on display thread.
-			getExecutionDelegate().execute(runnable);
-
-			// this remembering and re-throwing of exception is just to
-			// get an
-			// exception that occurred on one thread, to be thrown on
-			// callers
-			// thread.
+			executionDelegate.execute(runnable);
 			if (resultSlot[0] instanceof Throwable) {
 				throw new RuntimeException((Throwable) resultSlot[0]);
 			}
@@ -231,49 +230,18 @@
 	}
 
 	public void stopRewriteSession(DocumentRewriteSession session) {
-		if (getExecutionDelegate() == null) {
-			// if the delegate has not been set, we execute on current
-			// thread, like "normal". This is the case for normal
-			// non-editor
-			// use (which should still, ultimately, be protected by
-			// a scheduling rule).
+		IExecutionDelegate executionDelegate = getExecutionDelegate();
+		if (executionDelegate == null) {
 			internalStopRewriteSession(session);
 		}
 		else {
-			// If document is being used by an editor, a runnable is
-			// created,
-			// even if later (in the execution delegate instance) it is
-			// decided
-			// nothing special is needed (that is, in fact being called
-			// from
-			// editor's display thread, in which case its just executed)
-			final Object[] resultSlot = new Object[1];
 			final DocumentRewriteSession finalSession = session;
-			Runnable runnable = new Runnable() {
-				public void run() {
-					try {
-						internalStopRewriteSession(finalSession);
-
-					}
-					catch (Throwable e) {
-						resultSlot[0] = e;
-					}
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					internalStopRewriteSession(finalSession);
 				}
 			};
-			// strongly assumes synchronous call, to "wait" for
-			// results
-			// basically just routes to Display.synchExec(runnable),
-			// if not already running on display thread.
-			getExecutionDelegate().execute(runnable);
-
-			// this remembering and re-throwing of exception is just to
-			// get an
-			// exception that occurred on one thread, to be thrown on
-			// callers
-			// thread.
-			if (resultSlot[0] instanceof Throwable) {
-				throw new RuntimeException((Throwable) resultSlot[0]);
-			}
+			executionDelegate.execute(runnable);
 		}
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java
index 0d4675e..de3ff23 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java
@@ -141,7 +141,7 @@
 		try {
 			result = data.get(offset, length);
 		} catch (StringIndexOutOfBoundsException e) {
-			throw new BadLocationException();
+			throw new BadLocationException("offset: " + offset + " length: " + length + "\ndocument length: " + data.getLength());
 		}
 		return result;
 	}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java
index ead5dad..f846682 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300427 - Comparison of String Objects using == or !=
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.text;
 
@@ -50,6 +50,7 @@
 	protected final CoreNodeList EMPTY_LIST = new CoreNodeList();
 	protected String fChanges;
 	protected String fDeletedText;
+	protected boolean fIsEntireDocument;
 
 	private FindReplaceDocumentAdapter fFindReplaceDocumentAdapter = null;
 	protected int fLengthDifference;
@@ -339,7 +340,7 @@
 			// is
 			// no adjustments
 			// to downstream stuff necessary.
-			result = new StructuredDocumentRegionsReplacedEvent(fStructuredDocument, fRequester, oldNodes, newNodes, fChanges, fStart, fLengthToReplace);
+			result = new StructuredDocumentRegionsReplacedEvent(fStructuredDocument, fRequester, oldNodes, newNodes, fChanges, fStart, fLengthToReplace, fIsEntireDocument);
 		} else {
 			// note: integrates changes into model as a side effect
 			result = minimumEvent(oldNodes, newNodes);
@@ -424,7 +425,7 @@
 		//		if (isContainerRegion(oldRegion) != isContainerRegion(oldRegion))
 		if (isCollectionRegion(oldRegion) != isCollectionRegion(newRegion))
 			result = false;
-		else if (oldRegion.getType() == newRegion.getType())
+		else if (oldRegion.getType().equals(newRegion.getType()))
 			result = true;
 		return result;
 	}
@@ -582,6 +583,7 @@
 		// doesn't do this.)
 		if ((fChanges != null) && (fDeletedText != null) && (fChanges.length() == fDeletedText.length()) && (fChanges.equals(fDeletedText))) {
 			result = new NoChangeEvent(fStructuredDocument, fRequester, fChanges, fStart, fLengthToReplace);
+			((NoChangeEvent)result).reason = NoChangeEvent.NO_CONTENT_CHANGE;
 		}
 		return result;
 	}
@@ -717,6 +719,9 @@
 		isParsing = false;
 		dirtyStart = null;
 		dirtyEnd = null;
+		fChanges = null;
+		fDeletedText = null;
+		fIsEntireDocument = false;
 	}
 
 	protected IStructuredDocumentRegion findDirtyEnd(int end) {
@@ -835,6 +840,8 @@
 		// notice this one is derived
 		fLengthDifference = Utilities.calculateLengthDifference(fChanges, fLengthToReplace);
 		fDeletedText = fStructuredDocument.get(fStart, fLengthToReplace);
+		int docLength = fStructuredDocument.getLength();
+		fIsEntireDocument = lengthToReplace >= docLength && docLength > 0;
 	}
 
 	protected void insertNodes(IStructuredDocumentRegion previousOldNode, IStructuredDocumentRegion nextOldNode, CoreNodeList newNodes) {
@@ -1058,7 +1065,7 @@
 	protected StructuredDocumentEvent nodesReplacedCheck(CoreNodeList oldNodes, CoreNodeList newNodes) {
 		// actually, nothing to check here, since (and assuming) we've already
 		// minimized the number of nodes, and ruled out mere region changes
-		StructuredDocumentEvent result = new StructuredDocumentRegionsReplacedEvent(fStructuredDocument, fRequester, oldNodes, newNodes, fChanges, fStart, fLengthToReplace);
+		StructuredDocumentEvent result = new StructuredDocumentRegionsReplacedEvent(fStructuredDocument, fRequester, oldNodes, newNodes, fChanges, fStart, fLengthToReplace, fIsEntireDocument);
 		return result;
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java
index ca92300..9f62b78 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300434 - Make inner classes static where possible
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.text;
 
@@ -21,7 +21,7 @@
 
 public class TextRegionListImpl implements ITextRegionList {
 
-	private class NullIterator implements Iterator {
+	static private class NullIterator implements Iterator {
 		public NullIterator() {
 		}
 
@@ -40,13 +40,13 @@
 
 	}
 
-	private class RegionIterator implements Iterator {
+	private static class RegionIterator implements Iterator {
 		private ITextRegion[] fIteratorRegions;
 		private int index = -1;
 		private int maxindex = -1;
 
-		public RegionIterator() {
-			fIteratorRegions = toArray();
+		public RegionIterator(ITextRegion[] regions) {
+			fIteratorRegions = regions;
 			maxindex = fIteratorRegions.length - 1;
 		}
 
@@ -61,8 +61,11 @@
 		}
 
 		public void remove() {
+			if (index < 0) {
+				// next() has never been called
+				throw new IllegalStateException("can not remove regions without prior invocation of next()"); //$NON-NLS-1$
+			}
 			throw new UnsupportedOperationException("can not remove regions via iterator"); //$NON-NLS-1$
-
 		}
 
 	}
@@ -83,7 +86,6 @@
 	}
 
 	public boolean add(ITextRegion region) {
-
 		if (region == null)
 			return false;
 		ensureCapacity(fRegionsCount + 1);
@@ -91,7 +93,7 @@
 		return true;
 	}
 
-	public boolean addAll(int insertPos, ITextRegionList newRegions) {
+	public boolean addAll(int insertPos, ITextRegionList newRegionList) {
 		// beginning of list is 0 to insertPos-1
 		// remainder of list is insertPos to fRegionsCount
 		// resulting total will be be fRegionsCount + newRegions.size()
@@ -99,20 +101,24 @@
 			throw new ArrayIndexOutOfBoundsException(insertPos);
 		}
 
-		int newRegionsSize = newRegions.size();
+		int newRegionListSize = newRegionList.size();
 
-		ensureCapacity(fRegionsCount + newRegionsSize);
+		ensureCapacity(fRegionsCount + newRegionListSize);
 
 		int numMoved = fRegionsCount - insertPos;
 		if (numMoved > 0)
-			System.arraycopy(fRegions, insertPos, fRegions, insertPos + newRegionsSize, numMoved);
+			System.arraycopy(fRegions, insertPos, fRegions, insertPos + newRegionListSize, numMoved);
 
-		for (int i = 0; i < newRegionsSize; i++)
-			fRegions[insertPos++] = newRegions.get(i);
-
-		fRegionsCount += newRegionsSize;
-		return newRegionsSize != 0;
-
+		if (newRegionList instanceof TextRegionListImpl && ((TextRegionListImpl) newRegionList).fRegions != null) {
+			System.arraycopy(((TextRegionListImpl) newRegionList).fRegions, 0, fRegions, insertPos, newRegionListSize);
+		}
+		else {
+			for (int i = 0; i < newRegionListSize; i++) {
+				fRegions[insertPos++] = newRegionList.get(i);
+			}
+		}
+		fRegionsCount += newRegionListSize;
+		return newRegionListSize != 0;
 	}
 
 	public void clear() {
@@ -136,15 +142,14 @@
 	}
 
 	public ITextRegion get(int index) {
-		if (index < 0 || index > fRegionsCount) {
+		// fRegionCount may not equal fRegions.length
+		if (index < 0 || index >= fRegionsCount) {
 			throw new ArrayIndexOutOfBoundsException(index);
 		}
-		ITextRegion result = fRegions[index];
-		return result;
+		return fRegions[index];
 	}
 
 	public int indexOf(ITextRegion region) {
-
 		int result = -1;
 		if (region != null) {
 			if (fRegions != null) {
@@ -167,7 +172,7 @@
 		if (size() == 0) {
 			return new NullIterator();
 		} else {
-			return new RegionIterator();
+			return new RegionIterator(toArray());
 		}
 	}
 
@@ -219,5 +224,13 @@
 		System.arraycopy(fRegions, 0, newArray, 0, fRegionsCount);
 		return newArray;
 	}
+	
+	public void trimToSize() {
+		if (fRegions.length > fRegionsCount) {
+			ITextRegion[] newRegions = new ITextRegion[fRegionsCount];
+			System.arraycopy(fRegions, 0, newRegions, 0, fRegionsCount);
+			fRegions = newRegions;
+		}
+	}
 
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java
index 5f078c7..14e9b15 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,6 +29,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextPartitioner;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.text.IStructuredPartitions;
@@ -38,6 +39,9 @@
  * Base Document partitioner for StructuredDocuments. BLOCK_TEXT ITextRegions
  * have a partition type of BLOCK or BLOCK:TAGNAME if a surrounding tagname
  * was recorded.
+ * 
+ * Subclasses should synchronize access to <code>internalReusedTempInstance</code> using the lock
+ * <code>PARTITION_LOCK</code>.
  */
 public class StructuredTextPartitioner implements IDocumentPartitioner, IStructuredTextPartitioner {
 
@@ -60,6 +64,8 @@
 	protected IStructuredTypedRegion internalReusedTempInstance = new SimpleStructuredTypedRegion(0, 0, IStructuredPartitions.DEFAULT_PARTITION);
 	protected IStructuredDocument fStructuredDocument;
 
+	protected final Object PARTITION_LOCK = new Object();
+
 	/**
 	 * StructuredTextPartitioner constructor comment.
 	 */
@@ -71,7 +77,7 @@
 	 * Returns the partitioning of the given range of the connected document.
 	 * There must be a document connected to this partitioner.
 	 * 
-	 * Note: this shouldn't be called dirctly by clients, unless they control
+	 * Note: this shouldn't be called directly by clients, unless they control
 	 * the threading that includes modifications to the document. Otherwise
 	 * the document could be modified while partitions are being computed. We
 	 * advise that clients use the computePartitions API directly from the
@@ -89,12 +95,12 @@
 		}
 		ITypedRegion[] results = null;
 
+		synchronized (cachedPartitions) {
+			if ((!cachedPartitions.isInValid) && (offset == cachedPartitions.fOffset) && (length == cachedPartitions.fLength))
+				results = cachedPartitions.fPartitions;
+		}
 
-
-		if ((!cachedPartitions.isInValid) && (offset == cachedPartitions.fOffset) && (length == cachedPartitions.fLength)) {
-			results = cachedPartitions.fPartitions;
-		} else {
-
+		if (results == null) {
 			if (length == 0) {
 				results = new ITypedRegion[]{getPartition(offset)};
 			} else {
@@ -109,19 +115,26 @@
 				int currentPos = offset;
 				IStructuredTypedRegion previousPartition = null;
 				while (currentPos < endPos) {
-					internalGetPartition(currentPos, false);
-					currentPos += internalReusedTempInstance.getLength();
-					// check if this partition just continues last one
-					// (type is the same),
-					// if so, just extend length of last one, not need to
-					// create new
-					// instance.
-					if (previousPartition != null && internalReusedTempInstance.getType().equals(previousPartition.getType())) {
-						// same partition type
-						previousPartition.setLength(previousPartition.getLength() + internalReusedTempInstance.getLength());
-					} else {
-						// not the same, so add to list
-						IStructuredTypedRegion partition = createNewPartitionInstance();
+					IStructuredTypedRegion partition = null;
+					synchronized (PARTITION_LOCK) {
+						internalGetPartition(currentPos, false);
+						currentPos += internalReusedTempInstance.getLength();
+						
+						// check if this partition just continues last one
+						// (type is the same),
+						// if so, just extend length of last one, not need to
+						// create new
+						// instance.
+						if (previousPartition != null && internalReusedTempInstance.getType().equals(previousPartition.getType())) {
+							// same partition type
+							previousPartition.setLength(previousPartition.getLength() + internalReusedTempInstance.getLength());
+						}
+						else {
+							// not the same, so add to list
+							partition = createNewPartitionInstance();
+						}
+					}
+					if (partition != null) {
 						list.add(partition);
 						// and make current, previous
 						previousPartition = partition;
@@ -140,15 +153,21 @@
 					((IStructuredRegion) results[results.length - 1]).setLength(offset + length - results[results.length - 1].getOffset());
 				}
 			}
-			cachedPartitions.fLength = length;
-			cachedPartitions.fOffset = offset;
-			cachedPartitions.fPartitions = results;
-			cachedPartitions.isInValid = false;
+			synchronized (cachedPartitions) {
+				cachedPartitions.fLength = length;
+				cachedPartitions.fOffset = offset;
+				cachedPartitions.fPartitions = results;
+				cachedPartitions.isInValid = false;
+			}
 		}
 		return results;
 	}
 
-
+	private void invalidatePartitionCache() {
+		synchronized (cachedPartitions) {
+			cachedPartitions.isInValid = true;
+		}
+	}
 
 	/**
 	 * Connects the document to the partitioner, i.e. indicates the begin of
@@ -156,7 +175,7 @@
 	 */
 	public synchronized void connect(IDocument document) {
 		if (document instanceof IStructuredDocument) {
-			cachedPartitions.isInValid = true;
+			invalidatePartitionCache();
 			this.fStructuredDocument = (IStructuredDocument) document;
 		} else {
 			throw new IllegalArgumentException("This class and API are for Structured Documents only"); //$NON-NLS-1$
@@ -185,7 +204,9 @@
 	}
 
 	private IStructuredTypedRegion createNewPartitionInstance() {
-		return new SimpleStructuredTypedRegion(internalReusedTempInstance.getOffset(), internalReusedTempInstance.getLength(), internalReusedTempInstance.getType());
+		synchronized (PARTITION_LOCK) {
+			return new SimpleStructuredTypedRegion(internalReusedTempInstance.getOffset(), internalReusedTempInstance.getLength(), internalReusedTempInstance.getType());
+		}
 	}
 
 	/**
@@ -212,7 +233,7 @@
 	 * @see org.eclipse.jface.text.IDocumentPartitioner#disconnect()
 	 */
 	public synchronized void disconnect() {
-		cachedPartitions.isInValid = true;
+		invalidatePartitionCache();
 		this.fStructuredDocument = null;
 	}
 
@@ -222,7 +243,7 @@
 	 * @see org.eclipse.jface.text.IDocumentPartitioner#documentAboutToBeChanged(DocumentEvent)
 	 */
 	public void documentAboutToBeChanged(DocumentEvent event) {
-		cachedPartitions.isInValid = true;
+		invalidatePartitionCache();
 	}
 
 	/**
@@ -270,7 +291,7 @@
 	}
 
 	/**
-	 * Returns the set of all possible content types the partitoner supports.
+	 * Returns the set of all possible content types the partitioner supports.
 	 * I.e. Any result delivered by this partitioner may not contain a content
 	 * type which would not be included in this method's result.
 	 * 
@@ -288,7 +309,7 @@
 	 * given document. The document has previously been connected to the
 	 * partitioner.
 	 * 
-	 * Note: this shouldn't be called dirctly by clients, unless they control
+	 * Note: this shouldn't be called directly by clients, unless they control
 	 * the threading that includes modifications to the document. Otherwise
 	 * the document could be modified while partitions are being computed. We
 	 * advise that clients use the getPartition API directly from the
@@ -545,34 +566,58 @@
 		}
 
 		if (!partitionFound && structuredDocumentRegion != null) {
-			ITextRegion resultRegion = structuredDocumentRegion.getRegionAtCharacterOffset(offset);
-			partitionFound = isDocumentRegionBasedPartition(structuredDocumentRegion, resultRegion, offset);
+			/* We want the actual ITextRegion and not a possible ITextRegionCollection that
+			 * could be returned by IStructuredDocumentRegion#getRegionAtCharacterOffset
+			 * This allows for correct syntax highlighting and content assist.
+			 */
+			DeepRegion resultRegion = getDeepRegionAtCharacterOffset(structuredDocumentRegion, offset);
+			partitionFound = isDocumentRegionBasedPartition(structuredDocumentRegion, resultRegion.region, offset);
 			if (!partitionFound) {
-				// Note: this new logic doesn't handle container regions
-				// inside of
-				// container regions ... may need to make this first clause
-				// a recursive method
-				if (resultRegion != null && resultRegion instanceof ITextRegionContainer) {
-					ITextRegionContainer containerRegion = (ITextRegionContainer) resultRegion;
-					// then need to "drill down" for relevent region and
-					// relevent offset
-					ITextRegion deepRegion = containerRegion.getRegionAtCharacterOffset(offset);
-					int endOffset = containerRegion.getEndOffset(deepRegion);
-					String type = getPartitionType(deepRegion, endOffset);
-					setInternalPartition(offset, endOffset - offset, type);
+				if (resultRegion.region != null) {
+					String type = getPartitionType(resultRegion.region, offset);
+					setInternalPartition(offset, resultRegion.end - offset, type);
 				} else {
-					if (resultRegion != null) {
-						String type = getPartitionType(resultRegion, offset);
-						setInternalPartition(offset, structuredDocumentRegion.getEndOffset(resultRegion) - offset, type);
-					} else {
-						// can happen at EOF
-						setInternalPartition(offset, 1, getUnknown());
-					}
+					// can happen at EOF
+					// https://bugs.eclipse.org/bugs/show_bug.cgi?id=224886
+					// The unknown type was causing problems with content assist in JSP documents
+					setInternalPartition(offset, 1, getDefaultPartitionType());
 				}
 			}
 		}
 	}
 
+	private static class DeepRegion {
+		int end;
+		ITextRegion region;
+		DeepRegion(ITextRegion r, int e) {
+			region = r;
+			end = e;
+		}
+	}
+
+	/**
+	 * <p>Unlike {@link IStructuredDocumentRegion#getRegionAtCharacterOffset(int)} this will dig
+	 * into <code>ITextRegionCollection</code> to find the region containing the given offset</p>
+	 * 
+	 * @param region the containing region of the given <code>offset</code>
+	 * @param offset to the overall offset in the document.
+	 * @return the <code>ITextRegion</code> containing the given <code>offset</code>, will never be
+	 * a <code>ITextRegionCollextion</code>
+	 */
+	private DeepRegion getDeepRegionAtCharacterOffset(IStructuredDocumentRegion region, int offset) {
+		ITextRegion text = region.getRegionAtCharacterOffset(offset);
+		int end = region.getStartOffset();
+		if (text != null)
+			end += text.getStart();
+		while (text instanceof ITextRegionCollection) {
+			text = ((ITextRegionCollection) text).getRegionAtCharacterOffset(offset);
+			end += text.getStart();
+		}
+		if (text != null)
+			end += text.getLength();
+		return new DeepRegion(text, end);
+	}
+
 	/**
 	 * Provides for a per-StructuredDocumentRegion override selecting the
 	 * partition type using more than just a single ITextRegion.
@@ -596,9 +641,11 @@
 	}
 
 	protected void setInternalPartition(int offset, int length, String type) {
-		internalReusedTempInstance.setOffset(offset);
-		internalReusedTempInstance.setLength(length);
-		internalReusedTempInstance.setType(type);
+		synchronized (PARTITION_LOCK) {
+			internalReusedTempInstance.setOffset(offset);
+			internalReusedTempInstance.setLength(length);
+			internalReusedTempInstance.setType(type);
+		}
 	}
 
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
index 3a2ff35..93a9b91 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -72,19 +72,11 @@
 				fTextCommand.setTextInserted(fTextCommand.getTextInserted().concat(textInserted));
 				fTextCommand.setTextEnd(textEnd);
 			}
-			else if (fTextCommand != null && textStart == fTextCommand.getTextStart() - (textEnd - textStart + 1) && textEnd <= fTextCommand.getTextEnd() - (textEnd - textStart + 1) && textDeleted.length() == 1 && textInserted.length() == 0) {
+			else if (fTextCommand != null && textStart == fTextCommand.getTextStart() - 1 && textEnd <= fTextCommand.getTextEnd() - 1 && textDeleted.length() == 1 && textInserted.length() == 0 && fTextCommand.getTextDeleted().length() > 0) {
 				// backspace pressed
-
-				// erase a character just inserted
-				if (fTextCommand.getTextInserted().length() > 0) {
-					fTextCommand.setTextInserted(fTextCommand.getTextInserted().substring(0, fTextCommand.getTextEnd() - fTextCommand.getTextStart() - 1));
-					fTextCommand.setTextEnd(textEnd);
-				}
 				// erase a character in the file
-				else {
-					fTextCommand.setTextDeleted(textDeleted.concat(fTextCommand.getTextDeleted()));
-					fTextCommand.setTextStart(textStart);
-				}
+				fTextCommand.setTextDeleted(textDeleted.concat(fTextCommand.getTextDeleted()));
+				fTextCommand.setTextStart(textStart);
 			}
 			else {
 				createNewTextCommand(textDeleted, textInserted, textStart, textEnd);
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/AbstractMemoryListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/AbstractMemoryListener.java
new file mode 100644
index 0000000..46c60a8
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/AbstractMemoryListener.java
@@ -0,0 +1,205 @@
+/*******************************************************************************

+ * Copyright (c) 2009 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *     

+ *******************************************************************************/

+package org.eclipse.wst.sse.core.internal.util;

+

+import java.util.ArrayList;

+import java.util.Arrays;

+import java.util.Hashtable;

+import java.util.List;

+

+import org.eclipse.core.runtime.Assert;

+import org.eclipse.core.runtime.Platform;

+import org.eclipse.wst.sse.core.internal.Logger;

+import org.eclipse.wst.sse.core.internal.SSECorePlugin;

+import org.osgi.framework.Bundle;

+import org.osgi.framework.BundleContext;

+import org.osgi.framework.BundleException;

+import org.osgi.framework.ServiceRegistration;

+import org.osgi.service.event.Event;

+import org.osgi.service.event.EventAdmin;

+import org.osgi.service.event.EventConstants;

+import org.osgi.service.event.EventHandler;

+

+/**

+ * This responds to memory events.

+ * 

+ * Create an instance of a child of this class with the events you are interested in.

+ * Then call connect() to start listening. To stop listening call disconnect();

+ */

+public abstract class AbstractMemoryListener implements EventHandler {

+	/**

+	 * The event that indicates that memory is running low at the lowest severity.

+	 * Listeners are requested to release caches that can easily be recomputed.

+	 * The Java VM is not seriously in trouble, but process size is getting higher than 

+	 * is deemed acceptable.

+	 */

+	public static final String SEV_NORMAL = "org/eclipse/equinox/events/MemoryEvent/NORMAL"; //$NON-NLS-1$

+	

+	/**

+	 * The event that indicates that memory is running low at medium severity. 

+	 * Listeners are requested to release intermediate build results, complex models, etc.

+	 * Memory is getting low and may cause operating system level stress, such as swapping.

+	 */

+	public static final String SEV_SERIOUS = "org/eclipse/equinox/events/MemoryEvent/SERIOUS"; //$NON-NLS-1$

+	

+	/**

+	 * The event that indicates that memory is running low at highest severity.

+	 * Listeners are requested to do things like close editors and perspectives, close database connections, etc.

+	 * Restoring these resources and caches constitutes lots of work, but memory is so low that

+	 * drastic measures are required.

+	 */

+	public static final String SEV_CRITICAL = "org/eclipse/equinox/events/MemoryEvent/CRITICAL"; //$NON-NLS-1$

+	

+	/**

+	 * All of the valid memory severities

+	 */

+	public static final String[] SEV_ALL = { SEV_NORMAL, SEV_SERIOUS, SEV_CRITICAL };

+

+	/**

+	 * Used to register the {@link EventAdmin} listener

+	 */

+	private static BundleContext CONTEXT =

+		(SSECorePlugin.getDefault() != null) ?

+				SSECorePlugin.getDefault().getBundle().getBundleContext() : null;

+

+	/**

+	 * the severities that will be reacted to

+	 */

+	private final List fSeverities;

+	

+	/**

+	 * service used to register this listener

+	 */

+	private ServiceRegistration fRegisterService;

+

+	/**

+	 * Will listen to all memory events

+	 */

+	public AbstractMemoryListener() {

+		this(AbstractMemoryListener.SEV_ALL);

+	}

+

+	/**

+	 * Will listen to memory events of the given <code>severity</code>

+	 * 

+	 * @param severity listen for memory events of this severity

+	 */

+	public AbstractMemoryListener(String severity) {

+		Assert.isNotNull(severity, "Severity can not be null"); //$NON-NLS-1$

+		

+		List severities = new ArrayList(1);

+		severities.add(severity);

+		fSeverities = severities;

+	}

+	

+	/**

+	 * Will listen to memory events of the given <code>severities</code>

+	 * 

+	 * @param severities listen for memory events for any of these severities

+	 */

+	public AbstractMemoryListener(String[] severities) {

+		Assert.isNotNull(severities, "Severities can not be null"); //$NON-NLS-1$

+		Assert.isLegal(severities.length > 0, "Severities must specify at least one severity"); //$NON-NLS-1$

+		

+		fSeverities = Arrays.asList(severities);

+	}

+

+	/**

+	 * Will listen to memory events of the given <code>severities</code>

+	 * 

+	 * @param severities listen for memory events for any of these severities

+	 */

+	public AbstractMemoryListener(List severities) {

+		Assert.isNotNull(severities, "Severities can not be null"); //$NON-NLS-1$

+		Assert.isLegal(!severities.isEmpty(), "Severities must specify at least one severity"); //$NON-NLS-1$

+		fSeverities = severities;

+	}

+

+	/**

+	 * Connect this listener to the {@link EventAdmin}

+	 */

+	public final void connect() {

+		if (CONTEXT != null) {

+			// NOTE: This is TEMPORARY CODE needed to load the plugin

+			// until its done automatically by the product

+			// TODO: Remove me

+			Bundle b = Platform.getBundle("org.eclipse.equinox.event"); //$NON-NLS-1$

+			if (b != null && b.getState() == Bundle.RESOLVED) {

+				try {

+					b.start(Bundle.START_TRANSIENT);

+				}

+				catch (BundleException e) {

+					e.printStackTrace();

+				}

+			}

+			// end remove me

+			

+			//register this handler

+			String[] severities = (String[])fSeverities.toArray(new String[fSeverities.size()]);

+			Hashtable prop = new Hashtable(1);

+			prop.put(EventConstants.EVENT_TOPIC, severities);

+			fRegisterService = CONTEXT.registerService(EventHandler.class.getName(), this, prop);

+			

+			//call any implementer specific connect code

+			doConnect();

+		} else {

+			Logger.log(Logger.WARNING, "Error accessing bundle context. Is Platform running? Not tracking memory events. "); //$NON-NLS-1$

+		}

+	}

+

+	/**

+	 * Disconnect this listener to the {@link EventAdmin}

+	 */

+	public final void disconnect() {

+		if (fRegisterService != null) {

+			fRegisterService.unregister();

+			fRegisterService = null;

+		}

+		

+		//call any implementer specific disconnect code

+		doDisconnect();

+	}

+

+	/**

+	 * <p>Filter out any events that are not of the type that this listener handles</p>

+	 * 

+	 * @see org.osgi.service.event.EventHandler#handleEvent(org.osgi.service.event.Event)

+	 */

+	public final void handleEvent(Event event) {

+		if (fSeverities.contains(event.getTopic())) {

+			handleMemoryEvent(event);

+		}

+	}

+

+	/**

+	 * Implementing child classes may assume that only {@link Event}s of the types

+	 * given to the constructor will be given to this method.

+	 * 

+	 * @param event the {@link Event} with a topic equal to one of the memory

+	 * severities that this listener is listening for

+	 */

+	protected abstract void handleMemoryEvent(Event event);

+	

+	/**

+	 * Implementers may overrun this method to do setup after connection of this listener

+	 */

+	protected void doConnect() {

+		//do nothing by default

+	}

+	

+	/**

+	 * Implementers may overrun this method to do tear down after disconnection of this listener

+	 */

+	protected void doDisconnect() {

+		//do nothing by default

+	}

+}

diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java
index d6126c3..3df8954 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300430 - String concatenation
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.util;
 
@@ -169,9 +169,11 @@
 	 */
 	private static String space(int depth) {
 		String result = "  "; //$NON-NLS-1$
+		StringBuffer sb = new StringBuffer(result);
 		for (int i = 0; i < depth; i++) {
-			result += "  "; //$NON-NLS-1$
+			sb.append("  "); //$NON-NLS-1$
 		}
+		result = sb.toString();
 		return result;
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/JarUtilities.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/JarUtilities.java
index 5582df1..bf621e0 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/JarUtilities.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/JarUtilities.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,9 +17,13 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.JarURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.List;
+import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipException;
 import java.util.zip.ZipFile;
@@ -27,8 +31,10 @@
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.wst.sse.core.internal.Logger;
 
 
@@ -38,11 +44,11 @@
 	 * @see http://java.sun.com/products/jsp/errata_1_1_a_042800.html, Issues
 	 *      8 & 9
 	 * 
-	 * "There are two cases. In both cases the TLD_URI is to be interpreted
-	 * relative to the root of the Web Application. In the first case the
-	 * TLD_URI refers to a TLD file directly. In the second case, the TLD_URI
-	 * refers to a JAR file. If so, that JAR file should have a TLD at
-	 * location META-INF/taglib.tld."
+	 *      "There are two cases. In both cases the TLD_URI is to be
+	 *      interpreted relative to the root of the Web Application. In the
+	 *      first case the TLD_URI refers to a TLD file directly. In the
+	 *      second case, the TLD_URI refers to a JAR file. If so, that JAR
+	 *      file should have a TLD at location META-INF/taglib.tld."
 	 */
 	public static final String JSP11_TAGLIB = "META-INF/taglib.tld"; //$NON-NLS-1$
 
@@ -54,7 +60,6 @@
 		}
 		catch (IOException ioe) {
 			// no cleanup can be done
-			Logger.logException("JarUtilities: Could not close file " + file.getName(), ioe); //$NON-NLS-1$
 		}
 	}
 
@@ -64,7 +69,7 @@
 	protected static InputStream getCachedInputStream(String jarFilename, String entryName) {
 		File testFile = new File(jarFilename);
 		if (!testFile.exists())
-			return null;
+			return getInputStream(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(jarFilename)), entryName);
 
 		InputStream cache = null;
 		ZipFile jarfile = null;
@@ -72,7 +77,6 @@
 			jarfile = new ZipFile(jarFilename);
 		}
 		catch (IOException ioExc) {
-			Logger.logException("JarUtilities: " + jarFilename, ioExc); //$NON-NLS-1$
 			closeJarFile(jarfile);
 		}
 
@@ -85,7 +89,7 @@
 						entryInputStream = jarfile.getInputStream(zentry);
 					}
 					catch (IOException ioExc) {
-						Logger.logException("JarUtilities: " + jarFilename, ioExc); //$NON-NLS-1$
+						// no cleanup can be done
 					}
 
 					if (entryInputStream != null) {
@@ -114,6 +118,7 @@
 								entryInputStream.close();
 							}
 							catch (IOException e) {
+								// no cleanup can be done
 							}
 						}
 					}
@@ -125,11 +130,11 @@
 		}
 		return cache;
 	}
-	
+
 	private static InputStream copyAndCloseStream(InputStream original) {
 		ByteArrayOutputStream buffer = new ByteArrayOutputStream();
 		InputStream cachedCopy = null;
-		
+
 		if (original != null) {
 			int c;
 			// array dim restriction?
@@ -148,25 +153,40 @@
 		return cachedCopy;
 	}
 
+	/**
+	 * @param jarResource
+	 *            the zip file
+	 * @return a string array containing the entry paths to every file in this
+	 *         zip resource, excluding directories
+	 */
 	public static String[] getEntryNames(IResource jarResource) {
-		if (jarResource == null || jarResource.getType() != IResource.FILE)
+		if (jarResource == null || jarResource.getType() != IResource.FILE || !jarResource.isAccessible())
 			return new String[0];
-		if(jarResource.getLocation() == null) {
-			try {
-				return getEntryNames(new ZipInputStream(((IFile)jarResource).getContents()), true);
-			}
-			catch (CoreException e) {
-				Logger.logException("Problem reading contents of " + jarResource.getFullPath(), e);  //$NON-NLS-1$
-			}
+
+		try {
+			return getEntryNames(jarResource.getFullPath().toString(), new ZipInputStream(((IFile) jarResource).getContents()), true);
 		}
-		return getEntryNames(jarResource.getLocation().toString());
+		catch (CoreException e) {
+			// no cleanup can be done
+		}
+
+		IPath location = jarResource.getLocation();
+		if (location != null)
+			return getEntryNames(location.toString());
+		return new String[0];
 	}
 
+	/**
+	 * @param jarFilename
+	 *            the location of the zip file
+	 * @return a string array containing the entry paths to every file in the
+	 *         zip file at this location, excluding directories
+	 */
 	public static String[] getEntryNames(String jarFilename) {
 		return getEntryNames(jarFilename, true);
 	}
 
-	private static String[] getEntryNames(ZipInputStream jarInputStream, boolean excludeDirectories) {
+	private static String[] getEntryNames(String filename, ZipInputStream jarInputStream, boolean excludeDirectories) {
 		List entryNames = new ArrayList();
 		try {
 			ZipEntry z = jarInputStream.getNextEntry();
@@ -177,10 +197,10 @@
 			}
 		}
 		catch (ZipException zExc) {
-			Logger.log(Logger.WARNING, "JarUtilities ZipException: (stream) " + zExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+			Logger.log(Logger.WARNING_DEBUG, "JarUtilities ZipException: (stream) " + filename, zExc); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 		catch (IOException ioExc) {
-			Logger.log(Logger.WARNING, "JarUtilities IOException: (stream) " + ioExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+			// no cleanup can be done
 		}
 		finally {
 			closeStream(jarInputStream);
@@ -194,68 +214,89 @@
 			inputStream.close();
 		}
 		catch (IOException e) {
-			// nothing to do
+			// no cleanup can be done
 		}
 	}
 
+	/**
+	 * @param jarFilename
+	 *            the location of the zip file
+	 * @param excludeDirectories
+	 *            whether to not include directories in the results
+	 * @return a string array containing the entry paths to every file in the
+	 *         zip file at this location, excluding directories if indicated
+	 */
 	public static String[] getEntryNames(String jarFilename, boolean excludeDirectories) {
 		ZipFile jarfile = null;
 		List entryNames = new ArrayList();
-		try {
-			jarfile = new ZipFile(jarFilename);
-			Enumeration entries = jarfile.entries();
-			while (entries.hasMoreElements()) {
-				ZipEntry z = (ZipEntry) entries.nextElement();
-				if (!(z.isDirectory() && excludeDirectories))
-					entryNames.add(z.getName());
+		File f = new File(jarFilename);
+		if (f.exists() && f.canRead()) {
+			try {
+				jarfile = new ZipFile(f);
+				Enumeration entries = jarfile.entries();
+				while (entries.hasMoreElements()) {
+					ZipEntry z = (ZipEntry) entries.nextElement();
+					if (!(z.isDirectory() && excludeDirectories))
+						entryNames.add(z.getName());
+				}
 			}
-		}
-		catch (ZipException zExc) {
-			Logger.log(Logger.WARNING, "JarUtilities ZipException: " + jarFilename + " " + zExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		catch (IOException ioExc) {
-			Logger.log(Logger.WARNING, "JarUtilities IOException: " + jarFilename + " " + ioExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		finally {
-			closeJarFile(jarfile);
+			catch (ZipException zExc) {
+				Logger.log(Logger.WARNING_DEBUG, "JarUtilities ZipException: " + jarFilename + " " + zExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+			}
+			catch (IOException ioExc) {
+				// no cleanup can be done
+			}
+			finally {
+				closeJarFile(jarfile);
+			}
 		}
 		String[] names = (String[]) entryNames.toArray(new String[0]);
 		return names;
 	}
 
+	/**
+	 * @param jarResource
+	 *            the zip file
+	 * @param entryName
+	 *            the entry's path in the zip file
+	 * @return an InputStream to the contents of the given entry or null if
+	 *         not possible
+	 */
 	public static InputStream getInputStream(IResource jarResource, String entryName) {
-		if (jarResource == null || jarResource.getType() != IResource.FILE)
+		if (jarResource == null || jarResource.getType() != IResource.FILE || !jarResource.isAccessible())
 			return null;
-		IPath location = jarResource.getLocation();
-		if(location == null) {
-			try {
-				InputStream zipStream = ((IFile)jarResource).getContents();
-				return getInputStream(new ZipInputStream(zipStream), entryName);
-			}
-			catch (CoreException e) {
-				Logger.logException("Problem reading contents of " + jarResource.getFullPath(), e);  //$NON-NLS-1$
-				return null;
-			}
+
+		try {
+			InputStream zipStream = ((IFile) jarResource).getContents();
+			return getInputStream(jarResource.getFullPath().toString(), new ZipInputStream(zipStream), entryName);
 		}
-		return getInputStream(location.toString(), entryName);
+		catch (CoreException e) {
+			// no cleanup can be done, probably out of sync
+		}
+
+		IPath location = jarResource.getLocation();
+		if (location != null) {
+			return getInputStream(location.toString(), entryName);
+		}
+		return null;
 	}
-	
-	private static InputStream getInputStream(ZipInputStream zip, String entryName) {
+
+	private static InputStream getInputStream(String filename, ZipInputStream zip, String entryName) {
 		InputStream result = null;
 		try {
 			ZipEntry z = zip.getNextEntry();
 			while (z != null && !z.getName().equals(entryName)) {
 				z = zip.getNextEntry();
 			}
-			if(z != null) {				
+			if (z != null) {
 				result = copyAndCloseStream(zip);
 			}
 		}
 		catch (ZipException zExc) {
-			Logger.log(Logger.WARNING, "JarUtilities ZipException: (stream) " + zExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+			Logger.log(Logger.WARNING_DEBUG, "JarUtilities ZipException: (stream) " + filename, zExc); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 		catch (IOException ioExc) {
-			Logger.log(Logger.WARNING, "JarUtilities IOException: (stream) " + ioExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+			// no cleanup can be done
 		}
 		finally {
 			closeStream(zip);
@@ -263,6 +304,14 @@
 		return result;
 	}
 
+	/**
+	 * @param jarFilename
+	 *            the location of the zip file
+	 * @param entryName
+	 *            the entry's path in the zip file
+	 * @return an InputStream to the contents of the given entry or null if
+	 *         not possible
+	 */
 	public static InputStream getInputStream(String jarFilename, String entryName) {
 		// check sanity
 		if (jarFilename == null || jarFilename.length() < 1 || entryName == null || entryName.length() < 1)
@@ -277,4 +326,65 @@
 
 		return getCachedInputStream(jarFilename, internalName);
 	}
+
+	/**
+	 * @param url
+	 *            a URL pointint to a zip file
+	 * @return a cached copy of the contents at this URL, opening it as a file
+	 *         if it is a jar:file: URL, and using a URLConnection otherwise,
+	 *         or null if it could not be read. All sockets and file handles
+	 *         are closed as quickly as possible.
+	 */
+	public static InputStream getInputStream(URL url) {
+		String urlString = url.toString();
+		if (urlString.length() > 12 && urlString.startsWith("jar:file:") && urlString.indexOf("!/") > 9) { //$NON-NLS-1$ //$NON-NLS-2$
+			int fileIndex = urlString.indexOf("!/"); //$NON-NLS-1$ 
+			String jarFileName = urlString.substring(9, fileIndex);
+			if (fileIndex < urlString.length()) {
+				String jarPath = urlString.substring(fileIndex + 1);
+				return getInputStream(jarFileName, jarPath);
+			}
+		}
+
+		InputStream input = null;
+		JarURLConnection jarUrlConnection = null;
+		try {
+			URLConnection openConnection = url.openConnection();
+			openConnection.setDefaultUseCaches(false);
+			openConnection.setUseCaches(false);
+			if (openConnection instanceof JarURLConnection) {
+				jarUrlConnection = (JarURLConnection) openConnection;
+				JarFile jarFile = jarUrlConnection.getJarFile();
+				input = jarFile.getInputStream(jarUrlConnection.getJarEntry());
+			}
+			else {
+				input = openConnection.getInputStream();
+			}
+			if (input != null) {
+				return copyAndCloseStream(input);
+			}
+		}
+		catch (IOException e) {
+			Logger.logException(e);
+		}
+		finally {
+			if (jarUrlConnection != null) {
+				try {
+					jarUrlConnection.getJarFile().close();
+				}
+				catch (IOException e) {
+					// ignore
+				}
+				catch (IllegalStateException e) {
+					/*
+					 * ignore. Can happen in case the stream.close() did close
+					 * the jar file see
+					 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=140750
+					 */
+				}
+
+			}
+		}
+		return null;
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java
index 768f361..b835085 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,8 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300430 - String concatenation
+ *          
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.util;
 
@@ -80,15 +81,18 @@
 		}
 		// now generate the backs
 		String output = "";//$NON-NLS-1$
+		StringBuffer sb = new StringBuffer(output);
 		while (baseTokenizer.hasMoreTokens()) {
 			baseTokenizer.nextToken();
-			output += "../"; //$NON-NLS-1$
+			sb.append("../"); //$NON-NLS-1$
 		}
-		output += token2;
+		sb.append(token2);
 		// generate the rest
 		while (inputTokenizer.hasMoreTokens()) {
-			output = output + FORWARD_SLASH + inputTokenizer.nextToken();
+			sb.append(FORWARD_SLASH);
+			sb.append(inputTokenizer.nextToken());
 		}
+		output = sb.toString();
 		return output;
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Sorter.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Sorter.java
index e3ff42b..41cdf33 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Sorter.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Sorter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,46 +22,48 @@
 public abstract class Sorter {
 
 	/**
-	 * Returns true if elementTwo is 'greater than' elementOne This is the
-	 * 'ordering' method of the sort operation. Each subclass overides this
+	 * Returns true iff elementTwo is 'greater than' elementOne. This is the
+	 * 'ordering' method of the sort operation. Each subclass overrides this
 	 * method with the particular implementation of the 'greater than' concept
-	 * for the objects being sorted.
+	 * for the objects being sorted. If elementOne and elementTwo are
+	 * equivalent in terms of their sorting order, this method must return
+	 * 'false'.
 	 */
 	public abstract boolean compare(Object elementOne, Object elementTwo);
 
 	/**
-	 * Sort the objects in sorted collection and return that collection.
+	 * Sort the objects in the array and return the array.
 	 */
-	private Object[] quickSort(Object[] sortedCollection, int left, int right) {
+	private Object[] quickSort(Object[] array, int left, int right) {
 		int originalLeft = left;
 		int originalRight = right;
-		Object mid = sortedCollection[(left + right) / 2];
+		Object mid = array[(left + right) / 2];
 
 		do {
-			while (compare(sortedCollection[left], mid))
+			while (compare(array[left], mid))
 				left++;
-			while (compare(mid, sortedCollection[right]))
+			while (compare(mid, array[right]))
 				right--;
 			if (left <= right) {
-				Object tmp = sortedCollection[left];
-				sortedCollection[left] = sortedCollection[right];
-				sortedCollection[right] = tmp;
+				Object tmp = array[left];
+				array[left] = array[right];
+				array[right] = tmp;
 				left++;
 				right--;
 			}
 		} while (left <= right);
 
 		if (originalLeft < right)
-			sortedCollection = quickSort(sortedCollection, originalLeft, right);
+			array = quickSort(array, originalLeft, right);
 		if (left < originalRight)
-			sortedCollection = quickSort(sortedCollection, left, originalRight);
+			array = quickSort(array, left, originalRight);
 
-		return sortedCollection;
+		return array;
 	}
 
 	/**
-	 * Return a new sorted collection from this unsorted collection. Sort
-	 * using quick sort.
+	 * Return a new (quick)sorted array from this unsorted array. The original
+	 * array is not modified.
 	 */
 	public Object[] sort(Object[] unSortedCollection) {
 		int size = unSortedCollection.length;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidatorGroupListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidatorGroupListener.java
index d8c6f83..c34c271 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidatorGroupListener.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidatorGroupListener.java
@@ -22,6 +22,7 @@
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.Logger;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.validation.IValidatorGroupListener;
 import org.eclipse.wst.validation.ValidationState;
@@ -65,9 +66,13 @@
 				if (resource.getType() != IResource.FILE)
 					return;
 
-				IStructuredModel model = StructuredModelManager.getModelManager().getModelForRead((IFile) resource);
-				if (model != null) {
-					fDiagnosticMap.put(resource.getFullPath(), model);
+				IModelManager modelManager = StructuredModelManager.getModelManager();
+				// possible when shutting down
+				if (modelManager != null) {
+					IStructuredModel model = modelManager.getModelForRead((IFile) resource);
+					if (model != null) {
+						fDiagnosticMap.put(resource.getFullPath(), model);
+					}
 				}
 			}
 		}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java
index 894fde2..72dca7d 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     David Carver (Intalio) - bug 300430 - String concatenation
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.utils;
@@ -221,22 +222,25 @@
 
 		String newText = ""; //$NON-NLS-1$
 		int lineCount = tempDoc.getNumberOfLines();
+		StringBuffer sb = new StringBuffer(newText);
 		for (int i = 0; i < lineCount; i++) {
 			try {
 				org.eclipse.jface.text.IRegion lineInfo = tempDoc.getLineInformation(i);
 				int lineStartOffset = lineInfo.getOffset();
 				int lineLength = lineInfo.getLength();
 				int lineEndOffset = lineStartOffset + lineLength;
-				newText += allText.substring(lineStartOffset, lineEndOffset);
+				sb.append(allText.substring(lineStartOffset, lineEndOffset));
 
-				if ((i < lineCount - 1) && (tempDoc.getLineDelimiter(i) != null))
-					newText += lineDelimiterToUse;
+				if ((i < lineCount - 1) && (tempDoc.getLineDelimiter(i) != null)) {
+					sb.append(lineDelimiterToUse);
+				}
 			}
 			catch (BadLocationException e) {
 				// log for now, unless we find reason not to
 				Logger.log(Logger.INFO, e.getMessage());
 			}
 		}
+		newText = sb.toString();
 
 		return newText;
 	}
@@ -546,13 +550,17 @@
 		int position = 0;
 		int previous = 0;
 		int spacer = source.length();
+		StringBuffer sb = new StringBuffer(normalString);
 		while (position + spacer - 1 < length && aString.indexOf(source, position) > -1) {
 			position = aString.indexOf(source, previous);
-			normalString = normalString + aString.substring(previous, position) + target;
+			sb.append(normalString);
+			sb.append(aString.substring(previous, position));
+			sb.append(target);
 			position += spacer;
 			previous = position;
 		}
-		normalString = normalString + aString.substring(position, aString.length());
+		sb.append(aString.substring(position, aString.length()));
+		normalString = sb.toString();
 
 		return normalString;
 	}
diff --git a/bundles/org.eclipse.wst.xml.core/.classpath b/bundles/org.eclipse.wst.xml.core/.classpath
deleted file mode 100644
index 0f97d08..0000000
--- a/bundles/org.eclipse.wst.xml.core/.classpath
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src-contentmodel"/>
-	<classpathentry kind="src" path="src-search"/>
-	<classpathentry kind="src" path="src-validation"/>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="src-catalog"/>
-	<classpathentry kind="src" path="src-emfModelSynch"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		<accessrules>
-			<accessrule kind="accessible" pattern="org/eclipse/wst/validation/**"/>
-			<accessrule kind="accessible" pattern="org/eclipse/wst/common/internal/emf/resource/**"/>
-			<accessrule kind="accessible" pattern="org/eclipse/wst/common/internal/emf/utilities/**"/>
-			<accessrule kind="accessible" pattern="org/eclipse/wst/common/internal/emfworkbench/**"/>
-		</accessrules>
-	</classpathentry>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4">
-		<accessrules>
-			<accessrule kind="accessible" pattern="org/apache/xerces/dom/TreeWalkerImpl"/>
-			<accessrule kind="accessible" pattern="org/w3c/dom/ranges/DocumentRange"/>
-			<accessrule kind="accessible" pattern="org/w3c/dom/ranges/Range"/>
-			<accessrule kind="accessible" pattern="org/w3c/dom/traversal/DocumentTraversal"/>
-			<accessrule kind="accessible" pattern="org/w3c/dom/traversal/NodeFilter"/>
-			<accessrule kind="accessible" pattern="org/w3c/dom/traversal/NodeIterator"/>
-			<accessrule kind="accessible" pattern="org/w3c/dom/traversal/TreeWalker"/>
-			<accessrule kind="accessible" pattern="org/w3c/dom/ranges/RangeException"/>
-			<accessrule kind="accessible" pattern="org/apache/xerces/impl/XMLErrorReporter"/>
-			<accessrule kind="accessible" pattern="org/apache/xerces/parsers/StandardParserConfiguration"/>
-			<accessrule kind="accessible" pattern="org/apache/xerces/xni/Augmentations"/>
-			<accessrule kind="accessible" pattern="org/apache/xerces/xni/NamespaceContext"/>
-			<accessrule kind="accessible" pattern="org/apache/xerces/xni/QName"/>
-			<accessrule kind="accessible" pattern="org/apache/xerces/xni/XMLAttributes"/>
-			<accessrule kind="accessible" pattern="org/apache/xerces/xni/XMLLocator"/>
-			<accessrule kind="accessible" pattern="org/apache/xerces/xni/XMLResourceIdentifier"/>
-			<accessrule kind="accessible" pattern="org/apache/xerces/xni/XNIException"/>
-			<accessrule kind="accessible" pattern="org/apache/xerces/xni/parser/XMLEntityResolver"/>
-			<accessrule kind="accessible" pattern="org/apache/xerces/xni/parser/XMLInputSource"/>
-			<accessrule kind="accessible" pattern="org/apache/xerces/parsers/SAXParser"/>
-			<accessrule kind="accessible" pattern="org/apache/xerces/parsers/AbstractSAXParser"/>
-		</accessrules>
-	</classpathentry>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xml.core/.cvsignore b/bundles/org.eclipse.wst.xml.core/.cvsignore
deleted file mode 100644
index 273f8bc..0000000
--- a/bundles/org.eclipse.wst.xml.core/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-temp.folder
-build.xml
-xmlmodel.jar
-org.eclipse.wst.xml.core_1.0.0.jar
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.xml.core/.options b/bundles/org.eclipse.wst.xml.core/.options
deleted file mode 100644
index 046e4f6..0000000
--- a/bundles/org.eclipse.wst.xml.core/.options
+++ /dev/null
@@ -1,4 +0,0 @@
-org.eclipse.wst.xml.core/debug=true
-org.eclipse.wst.xml.core/debug/tracefilter=
-org.eclipse.wst.xml.core/debug/cmdocumentmanager=false
-org.eclipse.wst.xml.core/debug/cmdocumentcache=false
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/.project b/bundles/org.eclipse.wst.xml.core/.project
deleted file mode 100644
index c417514..0000000
--- a/bundles/org.eclipse.wst.xml.core/.project
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.xml.core</name>
-	<comment></comment>
-	<projects></projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 3405307..0000000
--- a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,79 +0,0 @@
-#Sat Mar 24 02:18:23 EDT 2007

-eclipse.preferences.version=1

-org.eclipse.jdt.core.builder.cleanOutputFolder=clean

-org.eclipse.jdt.core.builder.duplicateResourceTask=warning

-org.eclipse.jdt.core.builder.invalidClasspath=ignore

-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch

-org.eclipse.jdt.core.circularClasspath=error

-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled

-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled

-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled

-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2

-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve

-org.eclipse.jdt.core.compiler.compliance=1.4

-org.eclipse.jdt.core.compiler.debug.lineNumber=generate

-org.eclipse.jdt.core.compiler.debug.localVariable=generate

-org.eclipse.jdt.core.compiler.debug.sourceFile=generate

-org.eclipse.jdt.core.compiler.doc.comment.support=enabled

-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100

-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning

-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning

-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore

-org.eclipse.jdt.core.compiler.problem.deprecation=ignore

-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled

-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled

-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning

-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning

-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning

-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore

-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore

-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error

-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error

-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning

-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning

-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore

-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error

-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore

-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled

-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled

-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private

-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore

-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error

-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore

-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore

-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled

-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public

-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore

-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled

-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private

-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore

-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error

-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error

-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning

-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore

-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning

-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error

-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled

-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error

-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled

-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore

-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore

-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning

-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore

-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning

-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore

-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error

-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore

-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore

-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

-org.eclipse.jdt.core.compiler.problem.unusedImport=error

-org.eclipse.jdt.core.compiler.problem.unusedLabel=error

-org.eclipse.jdt.core.compiler.problem.unusedLocal=error

-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore

-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled

-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled

-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error

-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning

-org.eclipse.jdt.core.compiler.source=1.3

-org.eclipse.jdt.core.incompatibleJDKLevel=ignore

-org.eclipse.jdt.core.incompleteClasspath=error

diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 1ca5c5e..0000000
--- a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Wed Nov 15 02:26:10 EST 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<templates/>
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 86ca5a7..0000000
--- a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,16 +0,0 @@
-#Wed Nov 15 02:13:31 EST 2006
-compilers.incompatible-environment=0
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=1
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XML10Names.jFlex b/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XML10Names.jFlex
deleted file mode 100644
index c33e65b..0000000
--- a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XML10Names.jFlex
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-%%
-
-%table
-%public
-%final
-%class XML10Names
-%function isValidXML10Name
-%type boolean
-%unicode
-%ignorecase
-%buffer 2048
-%apiprivate
-
-S = (\x20 | \x09 | \x0D | \x0A)
-
-BaseChar = [\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3]
-
-Ideographic = [\u4E00-\u9FA5\u3007\u3021-\u3029]
-
-CombiningChar = [\u0300-\u0345\u0360-\u0361\u0483-\u0486\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD\u05BF\u05C1-\u05C2\u05C4\u064B-\u0652\u0670\u06D6-\u06DC\u06DD-\u06DF\u06E0-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0901-\u0903\u093C\u093E-\u094C\u094D\u0951-\u0954\u0962-\u0963\u0981-\u0983\u09BC\u09BE\u09BF\u09C0-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09E2-\u09E3\u0A02\u0A3C\u0A3E\u0A3F\u0A40-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0B01-\u0B03\u0B3C\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B82-\u0B83\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C82-\u0C83\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86-\u0F8B\u0F90-\u0F95\u0F97\u0F99-\u0FAD\u0FB1-\u0FB7\u0FB9\u20D0-\u20DC\u20E1\u302A-\u302F\u3099\u309A]
-
-Digit =  [\u0030-\u0039\u0660-\u0669\u06F0-\u06F9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE7-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29]
-
-Extender = [\u00B7\u02D0\u02D1\u0387\u0640\u0E46\u0EC6\u3005\u3031-\u3035\u309D-\u309E\u30FC-\u30FE]
-
-Letter = ({BaseChar} | {Ideographic})
-
-NameChar = ({Letter} | {Digit} | . | - | _ | : | {CombiningChar} | {Extender})
-
-Name = ({Letter} | _ | : ) ({NameChar})*
-
-
-
-%{
-
-	/**
-	 * Creates a new scanner
-	 */
-	public XML10Names() {
-		this.zzReader = null;
-	}
-
-	public boolean isValidXML10Name(String stringToCheck) {
-		boolean result = false;
-		yyreset(new java.io.StringReader(stringToCheck));
-		try {
-			result = isValidXML10Name();
-		}
-		catch (java.io.IOException e) {
-			// should be impossible with strings, but if occurs, just means
-			// "not"
-			result = false;
-		}
-		return result;
-	}
-
-%}
-
-
-
-
-%%
-
-<YYINITIAL>
-{
-
-	// don't match if contains trailing or embedded space
-	{Name} {S}+         {return false;}
-	{Name} {S}+ {Name}  {return false;}
-
-	{Name}              {return true;}
-
-	// match anything should come last
-	.                   {return false;}
-
-}
-
-
-// this rule always in effect
-<<EOF>>
-{
-	{return false;}
-}
-
-
diff --git a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex b/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex
deleted file mode 100644
index 15d5b0a..0000000
--- a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************

- * Copyright (c) 2005, 2008 IBM Corporation and others.

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- * 

- * Contributors:

- *     IBM Corporation - initial API and implementation

- *******************************************************************************/

-/*nlsXXX*/

-package org.eclipse.wst.xml.core.internal.contenttype;

-import java.io.IOException;

-import java.io.Reader;

-

-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;

-import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;

-

-

-%%

-

-%{

-

-

-	private boolean hasMore = true;

-	private final static int MAX_TO_SCAN = 8000;

-	StringBuffer string = new StringBuffer();

-	// state stack for easier state handling

-	private IntStack fStateStack = new IntStack();

-	private String valueText = null;

-

-

-	public XMLHeadTokenizer() {

-		super();

-	}

-

-	  public void reset (Reader in) {

-                /* the input device */

-                zzReader = in;

-

-                /* the current state of the DFA */

-                zzState = 0;

-

-                /* the current lexical state */

-                zzLexicalState = YYINITIAL;

-

-                /* this buffer contains the current text to be matched and is

-                 the source of the yytext() string */

-                java.util.Arrays.fill(zzBuffer, (char)0);

-

-                /* the textposition at the last accepting state */

-                zzMarkedPos = 0;

-

-                /* the textposition at the last state to be included in yytext */

-                zzPushbackPos = 0;

-

-                /* the current text position in the buffer */

-                zzCurrentPos = 0;

-

-                /* startRead marks the beginning of the yytext() string in the buffer */

-                zzStartRead = 0;

-

-                /**

-                 * endRead marks the last character in the buffer, that has been read

-                 * from input

-                 */

-                zzEndRead = 0;

-

-                /* number of newlines encountered up to the start of the matched text */

-                yyline = 0;

-

-                /* the number of characters up to the start of the matched text */

-                yychar = 0;

-

-                /**

-                 * the number of characters from the last newline up to the start

-                 * of the matched text

-                 */

-                yycolumn = 0;

-

-                /**

-                 * yy_atBOL == true <=> the scanner is currently at the beginning

-                 * of a line

-                 */

-                zzAtBOL = true;

-

-                /* yy_atEOF == true <=> the scanner has returned a value for EOF */

-                zzAtEOF = false;

-

-                /* denotes if the user-EOF-code has already been executed */

-                zzEOFDone = false;

-

-

-                fStateStack.clear();

-

-                hasMore = true;

-  		

-  	}

-

-

-	public final HeadParserToken getNextToken() throws IOException {

-		String context = null;

-		context = primGetNextToken();

-		HeadParserToken result = null;

-		if (valueText != null) {

-			result = createToken(context, yychar, valueText);

-			valueText = null;

-		} else {

-			result = createToken(context, yychar, yytext());

-		}

-		return result;

-	}

-

-	public final boolean hasMoreTokens() {

-		return hasMore && yychar < MAX_TO_SCAN;

-	}

-	private void pushCurrentState() {

-		fStateStack.push(yystate());

-

-	}

-

-	private void popState() {

-		yybegin(fStateStack.pop());

-	}

-	

-	private HeadParserToken createToken(String context, int start, String text) {

-		return new HeadParserToken(context, start, text);

-	}	

-

-%}

-

-%eof{

-	hasMore=false;

-%eof}

-

-%public

-%class XMLHeadTokenizer

-%function primGetNextToken

-%type String

-%char

-%unicode

-%ignorecase 

-//%debug

-%switch

-%buffer 8192

-

-UTF16BE = \xFE\xFF

-UTF16LE = \xFF\xFE

-UTF83ByteBOM = \xEF\xBB\xBF

-

-//SpaceChar = [\x20\x09]

-

-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+

-S = [\x20\x09\x0D\x0A]

-

-//BeginAttribeValue = {S}* \= {S}*

-

-LineTerminator = \r|\n

-

-// Z is the single-byte zero character to be used in parsing double-byte files

-Z = (\x00)?

-S_UTF = {Z}{S}{Z}

-BeginAttributeValueUTF = {S_UTF}* \= {S_UTF}*

-

-%state ST_XMLDecl

-%state QuotedAttributeValue

-%state DQ_STRING

-%state SQ_STRING

-%state UnDelimitedString

-

-%%

-

-

-<YYINITIAL>  

-{

-	// force to start at beginning of line (^) and at beginning of file (yychar == 0)

-	^{UTF16BE}   		{if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;}}

-	^{UTF16LE}   		{if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;}}

-	^{UTF83ByteBOM}   	{if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}}

-	

-	// force to be started on first line, but we do allow preceeding spaces

-	^ {S_UTF}* ({Z}<{Z}\?{Z}x{Z}m{Z}l{Z}){S_UTF}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}

-	

-}	

-	

-<ST_XMLDecl> 

-{

-	({Z}v{Z}e{Z}r{Z}s{Z}i{Z}o{Z}n{Z}) {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}

-	({Z}e{Z}n{Z}c{Z}o{Z}d{Z}i{Z}n{Z}g{Z}) {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}

-	// note the "forced end" (via 'hasMore=false') once the end of XML Declaration found

-	// This is since non-ascii chars may follow and may cause IOExceptions which would not occur once stream is 

-	// read with incorrect encoding (such as if platform encoding is in effect until true encoding detected). 

-	({Z}\?{Z}>{Z})    {yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd;}

-}	

-

-	

-

-<QuotedAttributeValue>

-{

-	{Z}\"{Z}        { yybegin(DQ_STRING); string.setLength(0); }

-	{Z}\'{Z}			{ yybegin(SQ_STRING); string.setLength(0); }

-	// in this state, anything other than a space character can start an undelimited string

-	{S_UTF}*.           { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}

-

-}	

-

-

-<DQ_STRING>

-{

-

-	{Z}\"{Z}                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }

-  	{Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

-	{Z}\?{Z}>{Z}			{ yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

-	{Z}<{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

-	[^\x00]			{ string.append( yytext() ); }

-

-}

-

-<SQ_STRING>

-{

-

-	{Z}\'{Z}                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}

-  	{Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

-	{Z}%{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

-	{Z}<{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

-	[^\x00]			{ string.append( yytext() ); }

-

-}

-

-<UnDelimitedString>

-{

-

-	{S_UTF}                     { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }

-  	{Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

-	{Z}\?{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

-	{Z}<{Z}	

-	{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

-	// these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote

-	{Z}\'{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}

-	

-	{Z}\"{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}

-	

-	[^\x00]			{ string.append( yytext() ); }

-

-}

-

-// The "match anything" rule should always be in effect except for when looking for end of string

-// (That is, remember to update state list if/when new states added)

-.|\n	{if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}

-

-// this rule always in effect

-<<EOF>>         {hasMore = false; return EncodingParserConstants.EOF;}

-

-	
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildNames.xml b/bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildNames.xml
deleted file mode 100644
index 6d97563..0000000
--- a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildNames.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="tokenizer" default="XML10Names">
-	
-	<!-- Note: for Eclipse env., the JFlex 1.4 jar should be added 
-	to the ant global entries  -->
-	<taskdef classname="JFlex.anttask.JFlexTask" name="jflex" />
-		
-	<target name="init">
-		<property name="src.file" value="XML10Names.jFlex"/>			
-		<property name="src.dir" value="HeadParsers"/>
-		<property name="dest.dir" value="../src"/>
-		<!-- touch causes to always build, remove for real 'make' behavior -->
-		<touch file="${src.dir}/${src.file}"/>
-					
-	</target>
-
-	<target name="XML10Names" depends="init">
-		<antcall target="run-jflex"/>
-	</target>
-
-	<target name="run-jflex" depends="init">
-		<jflex
-	    	file="${src.dir}/${src.file}"
-	    	destdir="${dest.dir}"
-			verbose="true"
-			nobak="true"
-			time="on"
-	    />
-	</target>
-	
-
-</project>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildParser.xml b/bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildParser.xml
deleted file mode 100644
index 49619df..0000000
--- a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildParser.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="tokenizer" default="HeadTokenizer">
-	
-	<!-- Note: for Eclipse env., the JFlex 1.4 jar should be added 
-	to the ant global entries  -->
-	<taskdef classname="JFlex.anttask.JFlexTask" name="jflex" />
-		
-	<target name="init">
-		<property name="src.file" value="XMLHeadTokenizer.jFlex"/>			
-		<property name="src.dir" value="HeadParsers"/>
-		<property name="dest.dir" value="../src"/>
-		<!-- touch causes to always build, remove for real 'make' behavior -->
-		<touch file="${src.dir}/${src.file}"/>
-					
-	</target>
-
-	<target name="HeadTokenizer" depends="init">
-		<antcall target="run-jflex"/>
-	</target>
-
-	<target name="run-jflex" depends="init">
-		<jflex
-	    	file="${src.dir}/${src.file}"
-	    	destdir="${dest.dir}"
-			verbose="true"
-			nobak="true"
-			time="on"
-	    />
-	</target>
-	
-
-</project>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
deleted file mode 100644
index af632b8..0000000
--- a/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,74 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.xml.core; singleton:=true
-Bundle-Version: 1.1.301.qualifier
-Bundle-Activator: org.eclipse.wst.xml.core.internal.XMLCorePlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.xml.core.internal;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.catalog;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.catalog.provisional;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.cleanup;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.commentelement;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.commentelement.impl;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.commentelement.util;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.annotation;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.basic;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.factory;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.internal.util;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.modelquery;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.util;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contenttype;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.document;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.emf2xml;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.encoding;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.formatter;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.modelhandler;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.modelquery;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.parser;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.parser.regions;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.preferences;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.propagate;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.contentmodel;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.contenttype;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.document;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.format;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.text;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.regions;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.search;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.search.impl;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.search.matching;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.search.quickscan;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.ssemodelquery;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.tasks;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.text;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.text.rules;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.validate;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.validation;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.validation.core;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.validation.core.logging;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.validation.eclipse;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.validation.errorcustomization;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.text
-Require-Bundle: org.apache.xerces;bundle-version="[2.9.0,3.0.0)";visibility:=reexport,
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.jem.util;bundle-version="[2.0.100,3.0.0)";resolution:=optional,
- org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)";resolution:=optional,
- org.eclipse.emf.ecore.edit;bundle-version="[2.4.0,3.0.0)";resolution:=optional,
- org.eclipse.wst.common.emf;bundle-version="[1.1.104,1.2.0)";resolution:=optional,
- org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)";resolution:=optional,
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.200,1.2.0)";resolution:=optional,
- org.eclipse.wst.common.core;bundle-version="[1.1.101,1.2.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)"
-Bundle-ActivationPolicy: lazy; exclude:="org.eclipse.wst.xml.core.internal.contenttype"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.xml.core/README.txt b/bundles/org.eclipse.wst.xml.core/README.txt
deleted file mode 100644
index ffa6466..0000000
--- a/bundles/org.eclipse.wst.xml.core/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-THe XML specific model implementation.
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/build.properties b/bundles/org.eclipse.wst.xml.core/build.properties
deleted file mode 100644
index e49a2dc..0000000
--- a/bundles/org.eclipse.wst.xml.core/build.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-#     IBM Corporation - initial API and implementation
-#     Jens Lukowski/Innoopract - initial renaming/restructuring
-#     
-###############################################################################
-bin.includes = plugin.xml,\
-               .options,\
-               plugin.properties,\
-               META-INF/,\
-               .,\
-               about.html,\
-               schema/
-bin.excludes = bin/**,\
-               @dot/**,\
-               temp.folder/**
-src.includes = component.xml,\
-               build.properties,\
-               schema/,\
-               DevTimeSupport/
-source.. = src-catalog,\
-           src-contentmodel/,\
-           src-validation/,\
-           src/,\
-           src-emfModelSynch/,\
-           src-search/
-
-output.. = bin/
diff --git a/bundles/org.eclipse.wst.xml.core/component.xml b/bundles/org.eclipse.wst.xml.core/component.xml
deleted file mode 100644
index e061eb3..0000000
--- a/bundles/org.eclipse.wst.xml.core/component.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.wst.xml">
-	<component-depends unrestricted="true"></component-depends>
-	<plugin id="org.eclipse.wst.xmleditor.doc.user" fragment="false" />
-	<plugin id="org.eclipse.wst.xml.core" fragment="false" />
-	<plugin id="org.eclipse.wst.xml.ui" fragment="false" />
-	<description url="http://eclipse.org/webtools/wst/components/xml/overview.html" />
-	<package name="org.eclipse.wst.xml.ui" api="false">
-		<type name="StructuredTextViewerConfigurationXML" subclass="true" instantiate="true" />
-	</package>
-	<package name="org.eclipse.wst.xml.ui.views.contentoutline" api="false">
-		<type name="XMLContentOutlineConfiguration" subclass="true" instantiate="true" />
-	</package>
-	<package name="org.eclipse.wst.xml.ui.views.properties" api="false">
-		<type name="XMLPropertySheetConfiguration" subclass="true" instantiate="true" />
-	</package>
-	<plugin id="org.eclipse.wst.xml.ui.infopop" fragment="false" />
-	<plugin id="org.eclipse.wst.xml_core.feature.source" fragment="false" />
-	<plugin id="org.eclipse.wst.xml_ui.feature.source" fragment="false" />
-	<plugin id="org.apache.xerces" fragment="false" />
-</component>
diff --git a/bundles/org.eclipse.wst.xml.core/plugin.properties b/bundles/org.eclipse.wst.xml.core/plugin.properties
deleted file mode 100644
index b954490..0000000
--- a/bundles/org.eclipse.wst.xml.core/plugin.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2008 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-#     IBM Corporation - initial API and implementation
-#     Jens Lukowski/Innoopract - initial renaming/restructuring
-#     
-###############################################################################
-providerName=Eclipse.org
-pluginName=Structured Source XML Model
-Structured_XML_Document_Factory_Extension.name=Structured XML Document Factory Extension
-XML_Content_Type_Extension_Element.name=XML (Illformed)
-# contentmodel strings
-Content_Model_Document_Factories_Extension.name=Content Model Document Factories
-Content_Model_Annotation_Files_Extension.name=Content Model Annotation Files
-Model_Query_Extension.name=Model Query Extension
-XML_Catalog_Contributions_Extension_Point.name=XML Catalog Contributions Extension Point
-XSL_Content_Type_Extension_Element.name=XSL
-XMI_Content_Type=XMI
-XML_Validator.name=XML Validator
-XML_Validation_Error_Customizer.name=XML Validator Error Customizer Extension Point
-_validationMarker.name=XML Problem
-_taskMarker.name=XML Task
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/plugin.xml b/bundles/org.eclipse.wst.xml.core/plugin.xml
deleted file mode 100644
index 8ebaa6f..0000000
--- a/bundles/org.eclipse.wst.xml.core/plugin.xml
+++ /dev/null
@@ -1,216 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-   <!-- An extension for contributing a XML validation error customizer. -->
-   <extension-point id="errorCustomizer" name="%XML_Validation_Error_Customizer.name" schema="schema/errorCustomizer.exsd"/>
-
-	<extension point="org.eclipse.wst.sse.core.modelHandler">
-		<modelHandler
-			default="true"
-			class="org.eclipse.wst.xml.core.internal.modelhandler.ModelHandlerForXML"
-			associatedContentTypeId="org.eclipse.core.runtime.xml"
-			id="org.eclipse.wst.xml.core.internal.modelhandler">
-		</modelHandler>
-	</extension>
-	<extension point="org.eclipse.wst.sse.core.modelHandler">
-		<modelHandler
-			default="true"
-			class="org.eclipse.wst.xml.core.internal.modelhandler.ModelHandlerForXML"
-			associatedContentTypeId="org.eclipse.wst.xml.core.xmlsource"
-			id="org.eclipse.wst.xml.core.internal.modelhandler2">
-		</modelHandler>
-	</extension>
-	
-	<extension point="org.eclipse.wst.sse.core.embeddedTypeHandler">
-		<embeddedTypeHandler
-			class="org.eclipse.wst.xml.core.internal.modelhandler.EmbeddedXML">
-		</embeddedTypeHandler>
-	</extension>
-
-	<extension point="org.eclipse.wst.sse.core.taskscanner">
-		<scanner
-			id="org.eclipse.wst.xml.core.internal.tasks.XMLFileTaskScanner"
-			class="org.eclipse.wst.xml.core.internal.tasks.XMLFileTaskScanner:org.eclipse.wst.xml.core.taskMarker"
-			contentTypeIds="org.eclipse.core.runtime.xml" />
-	</extension>
-	<extension
-		id="taskMarker"
-		name="%_taskMarker.name"
-		point="org.eclipse.core.resources.markers">
-		<super type="org.eclipse.core.resources.taskmarker"/>
-		<persistent value="true"/>
-	</extension>
-	 
-   <!-- Here we define a new extension point.  This extension point is used
-        to programmatically contribute catalog entries to the XML Catalog. -->
-   <extension-point id="catalogContributions" name="%XML_Catalog_Contributions_Extension_Point.name" schema="schema/catalogContributions.exsd"/>
-
-   <!-- This extension point extends the Common Extensbile URI Resolver so that
-        the XML Catalog can participare in resolving processes. -->
-   <extension point="org.eclipse.wst.common.uriresolver.resolverExtensions">
-      <resolverExtension
-            stage="postnormalization"
-            class="org.eclipse.wst.xml.core.internal.catalog.XMLCatalogURIResolverExtension">
-      </resolverExtension>
-   </extension>
-
-	<extension
-		point="org.eclipse.core.filebuffers.documentCreation"
-		id="org.eclipse.wst.xml.core.documentfactories"
-		name="%Structured_XML_Document_Factory_Extension.name">
-		<factory
-			contentTypeId="org.eclipse.core.runtime.xml"
-			class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
-	</extension>
-	<extension
-		point="org.eclipse.core.filebuffers.documentCreation"
-		id="org.eclipse.wst.xml.core.documentfactories2"
-		name="%Structured_XML_Document_Factory_Extension.name">
-		<factory
-			contentTypeId="org.eclipse.wst.xml.core.xmlsource"
-			class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
-	</extension>
-	<extension point="org.eclipse.team.core.fileTypes">
-		<fileTypes
-			type="text"
-			extension="xsl">
-		</fileTypes>
-		<fileTypes
-			type="text"
-			extension="xslt">
-		</fileTypes>
-		<fileTypes
-			type="text"
-			extension="dadx">
-		</fileTypes>
-		<fileTypes
-			type="text"
-			extension="wsdl">
-		</fileTypes>
-		<fileTypes
-			type="text"
-			extension="nst">
-		</fileTypes>
-		<fileTypes
-			type="text"
-			extension="xmi">
-		</fileTypes>
-		<fileTypes
-			type="text"
-			extension="xsd">
-		</fileTypes>
-	</extension>
-	
-	<extension point="org.eclipse.wst.sse.core.formatProcessors">
-		<processor
-			class="org.eclipse.wst.xml.core.internal.formatter.XMLFormatterFormatProcessor"
-			contentTypeId="org.eclipse.core.runtime.xml">
-		</processor>
-	</extension>
-
-	<!--  https://bugs.eclipse.org/bugs/show_bug.cgi?id=103083 -->\
-	<!--  FYI: this xmi type *should* be defined in EMF, but, since isn't
-			we will here. In future versions is could be removed -->
-	<extension point="org.eclipse.core.runtime.contentTypes">
-		<content-type
-			file-extensions="xmi"
-			priority="low"
-			name="%XMI_Content_Type"
-			id="xmisource"
-			base-type="org.eclipse.core.runtime.xml">
-		</content-type>
-
-		<content-type
-			file-extensions="xml,xsl,xslt,wsdl,xsd,exsd,xmi"
-			priority="low"
-			name="%XML_Content_Type_Extension_Element.name"
-			id="xmlsource"
-			base-type="org.eclipse.core.runtime.text"
-			default-charset="UTF-8">
-			<describer class="org.eclipse.wst.xml.core.internal.contenttype.ContentDescriberForXML" />
-		</content-type>
-
-		<content-type
-			file-extensions="xsl,xslt"
-			priority="high"
-			name="%XSL_Content_Type_Extension_Element.name"
-			id="xslsource"
-			base-type="org.eclipse.core.runtime.xml"
-			default-charset="UTF-8">
-		</content-type>
-	</extension>
-
-
-	<!-- initialize xml core preferences -->
-	<extension point="org.eclipse.core.runtime.preferences">
-		<initializer class="org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceInitializer" />
-	</extension>
-
-	<extension-point id="documentFactories" name="%Content_Model_Document_Factories_Extension.name" schema="schema/documentFactories.exsd"/>
-
-	<extension-point id="modelQueryExtensions" name="%Model_Query_Extension.name" schema="schema/modelQueryExtensions.exsd"/>
-
-	<extension-point id="annotationFiles" name="%Content_Model_Annotation_Files_Extension.name" schema="schema/annotationFiles.exsd"/>	
-		
-	<extension 
-       point="org.eclipse.jem.util.uiContextSensitiveClass">
-       <uiContextSensitiveClass
-            context="UI"
-            key="rendererFactory"
-            className="org.eclipse.wst.xml.core.internal.emf2xml.EMF2DOMSSERendererFactory">
-       </uiContextSensitiveClass>
-  </extension>
-  <!-- ====================================================== -->
-	<!-- Register the XML validator with the validation 		-->
-	<!-- framework. 										    -->
-	<!-- ====================================================== -->
-
- <extension
-         id="validationMarker"
-         name="%_validationMarker.name"
-         point="org.eclipse.core.resources.markers">
-      <super type="org.eclipse.wst.validation.problemmarker"/>
-      <persistent value="true"/>
- </extension>
-
-   <extension id="xml" name="%XML_Validator.name" point="org.eclipse.wst.validation.validatorV2">
-      <validator
-            build="true"
-            class="org.eclipse.wst.xml.core.internal.validation.eclipse.Validator"
-            manual="true"
-            sourceid="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML"
-            version="3"
-            markerId="org.eclipse.wst.xml.core.validationMarker">
-         <include>
-            <rules>
-               <contentType id="org.eclipse.core.runtime.xml"></contentType>
-               <contentType id="org.eclipse.wst.xml.core.xmlsource"></contentType>
-               <contentType id="org.eclipse.wst.xml.core.xslsource"></contentType>
-               <contentType id="org.eclipse.jst.jsp.core.tldsource"></contentType>
-               <fileext
-                     caseSensitive="false"
-                     ext="xml">
-               </fileext>
-               <fileext
-                     caseSensitive="false"
-                     ext="gph">
-               </fileext>
-               <fileext
-                     caseSensitive="false"
-                     ext="wdo-connections">
-               </fileext>
-            </rules>
-         </include>
-         <exclude>
-            <rules>
-				<projectNature id="org.eclipse.jst.j2ee.ejb.EJBNature"/>
-				<projectNature id="org.eclipse.jst.j2ee.EARNature"/>
-    			<file caseSensitive="true" name=".project" type="file"/>
-    			<file caseSensitive="true" name=".classpath" type="file"/>
-    			<file caseSensitive="true" name=".settings"  type="folder"/>
-            </rules>
-         </exclude>
-      </validator>
-   </extension>
-</plugin>
diff --git a/bundles/org.eclipse.wst.xml.core/schema/annotationFiles.exsd b/bundles/org.eclipse.wst.xml.core/schema/annotationFiles.exsd
deleted file mode 100644
index d417f55..0000000
--- a/bundles/org.eclipse.wst.xml.core/schema/annotationFiles.exsd
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.xml.core" id="annotationFiles" name="Content Model Annotation Files"/>
-      </appInfo>
-      <documentation>
-         &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
-      </documentation>
-   </annotation>
-
-   <element name="extension">
-      <complexType>
-         <sequence>
-            <element ref="annotationFile" minOccurs="1" maxOccurs="unbounded"/>
-         </sequence>
-         <attribute name="point" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="name" type="string">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-               <appInfo>
-                  <meta.attribute translatable="true"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="annotationFile">
-      <complexType>
-         <attribute name="location" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="publicId" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="since"/>
-      </appInfo>
-      <documentation>
-         &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="copyright"/>
-      </appInfo>
-      <documentation>
-         Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made 
-available under the terms of the Eclipse Public License v1.0 which accompanies 
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
-      </documentation>
-   </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xml.core/schema/catalogContributions.exsd b/bundles/org.eclipse.wst.xml.core/schema/catalogContributions.exsd
deleted file mode 100644
index b7bad1b..0000000
--- a/bundles/org.eclipse.wst.xml.core/schema/catalogContributions.exsd
+++ /dev/null
@@ -1,283 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.xml.core" id="catalogContributions" name="XML Catalog Contributions Extension Point"/>
-      </appInfo>
-      <documentation>
-         This extension point allows to specify entries for XML Catalog.  Catalog entries have format specified in &lt;a href=&quot;http://www.oasis-open.org/committees/download.php/14041/xml-catalogs.html&quot;&gt;http://www.oasis-open.org/committees/entity/spec.html&lt;/a&gt;.  
-Each catalog extension consists of a single catalogContribution element.
-      </documentation>
-   </annotation>
-
-   <element name="extension">
-      <complexType>
-         <choice>
-            <element ref="catalogContribution"/>
-         </choice>
-         <attribute name="point" type="string" use="required">
-            <annotation>
-               <documentation>
-                  a fully qualified identifier of the target extension point
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  an optional identifier of the extension instance
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="name" type="string">
-            <annotation>
-               <documentation>
-                  an optional name of the extension instance
-               </documentation>
-               <appInfo>
-                  <meta.attribute translatable="true"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="catalogContribution">
-      <annotation>
-         <documentation>
-            The catalogContribution element may have id, and it is just a container for the contributed catalog entries.
-         </documentation>
-      </annotation>
-      <complexType>
-         <sequence>
-            <element ref="public" minOccurs="0" maxOccurs="unbounded"/>
-            <element ref="system" minOccurs="0" maxOccurs="unbounded"/>
-            <element ref="uri" minOccurs="0" maxOccurs="unbounded"/>
-            <element ref="nextCatalog" minOccurs="0" maxOccurs="unbounded"/>
-         </sequence>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  Id of the catalog to which entries will be added. Could be &quot;default&quot;, and if ommited, entries are added to the default workspace catalog.
-               </documentation>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="public">
-      <annotation>
-         <documentation>
-            The public element associates a URI reference with the public identitier portion of an external identifier.
-         </documentation>
-      </annotation>
-      <complexType>
-         <sequence>
-         </sequence>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  Id of the element, optional.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="publicId" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The public identifier portion of an external identifier.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="uri" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The value of the uri attribute could be relative to the plugin.xml file, use platform:/ or file:/ protocols.
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="resource"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-         <attribute name="webURL" type="string">
-            <annotation>
-               <documentation>
-                  Alternative Web address for the public ID
-               </documentation>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="system">
-      <annotation>
-         <documentation>
-            The system elements associates a URI reference with the system identifier of an external identifier
-         </documentation>
-      </annotation>
-      <complexType>
-         <sequence>
-         </sequence>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  Id of the element, optional.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="systemId" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The system identifier portion of an external identifier.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="uri" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The value of the uri attribute could be relative to the plugin.xml file, use platform:/ or file:/ protocols.
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="resource"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="uri">
-      <annotation>
-         <documentation>
-            The uri element associates a URI reference with the a URI reference that is not part of an external identifier.
-         </documentation>
-      </annotation>
-      <complexType>
-         <sequence>
-         </sequence>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  Id of the element, optional.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="uri" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The value of the uri attribute could be relative to the plugin.xml file, use platform:/ or file:/ protocols.
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="resource"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-         <attribute name="name" type="string" use="required">
-            <annotation>
-               <documentation>
-                  A URI reference that is not part of an external identitier.
-               </documentation>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="nextCatalog">
-      <annotation>
-         <documentation>
-            The nextCatalog elements indicate additional catalog entry file(s) to be considered during the process of resolution.
-         </documentation>
-      </annotation>
-      <complexType>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  Id of the element, optional.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="catalog" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The value of the uri attribute could be relative to the plugin.xml file, use platform:/ or file:/ protocols.
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="resource"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="since"/>
-      </appInfo>
-      <documentation>
-         1.0
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         &lt;pre&gt;
-   &lt;extension 
-         point=&quot;org.eclipse.wst.xml.core.catalogContributions&quot;&gt;
-      &lt;catalogContribution&gt; 
-         &lt;system 
-               systemId=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
-               uri=&quot;data/xsd/wsdl.xml&quot; &gt; 
-            &lt;property 
-                  name=&quot;webURL&quot;
-                  value=&quot;http://schemas.xmlsoap.org/wsdl/&quot;/&gt;
-         &lt;/system&gt;
-         &lt;uri
-               name=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; 
-               uri=&quot;data/xsd/soap.xsd&quot;/&gt; 
-         &lt;public
-               publicId=&quot;http://www.w3.org/1999/XSL/Transform&quot;
-               uri=&quot;data/xsd/XSLSchema.xsd&quot;&gt;
-         &lt;/public&gt;
-         &lt;nextCatalog
-               id=&quot;nestedCatalog&quot; 
-               catalog=&quot;data/catalog1.xml&quot;/&gt; 
-      &lt;/catalogContribution&gt; 
-   &lt;/extension&gt;
-&lt;/pre&gt;
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="copyright"/>
-      </appInfo>
-      <documentation>
-         Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made 
-available under the terms of the Eclipse Public License v1.0 which accompanies 
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
-      </documentation>
-   </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xml.core/schema/documentFactories.exsd b/bundles/org.eclipse.wst.xml.core/schema/documentFactories.exsd
deleted file mode 100644
index dd0d906..0000000
--- a/bundles/org.eclipse.wst.xml.core/schema/documentFactories.exsd
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.xml.core" id="documentFactories" name="Content Model Document Factories"/>
-      </appInfo>
-      <documentation>
-         &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
-      </documentation>
-   </annotation>
-
-   <element name="extension">
-      <complexType>
-         <sequence>
-            <element ref="factory"/>
-         </sequence>
-         <attribute name="point" type="string" use="required">
-            <annotation>
-               <documentation>
-                  a fully qualified identifier of the target extension point
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  an optional identifier of the extension instance
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="name" type="string">
-            <annotation>
-               <documentation>
-                  an optional name of the extension instance
-               </documentation>
-               <appInfo>
-                  <meta.attribute translatable="true"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="factory">
-      <complexType>
-         <attribute name="type" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="class" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="java"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="since"/>
-      </appInfo>
-      <documentation>
-         &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="copyright"/>
-      </appInfo>
-      <documentation>
-         Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made 
-available under the terms of the Eclipse Public License v1.0 which accompanies 
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
-      </documentation>
-   </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xml.core/schema/errorCustomizer.exsd b/bundles/org.eclipse.wst.xml.core/schema/errorCustomizer.exsd
deleted file mode 100644
index 608f190..0000000
--- a/bundles/org.eclipse.wst.xml.core/schema/errorCustomizer.exsd
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.xml.core" id="errorCustomizer" name="XML Validation Error Customizer"/>
-      </appInfo>
-      <documentation>
-         The error customizer extension point allows a client to contribute an error customizer for a specific namespace. The error customizer can provide error messages that are more domain specific than the generic error messages provided by the underlying generic XML validator.
-      </documentation>
-   </annotation>
-
-   <element name="extension">
-      <complexType>
-         <sequence>
-            <element ref="errorCustomizer" minOccurs="1" maxOccurs="unbounded"/>
-         </sequence>
-         <attribute name="point" type="string" use="required">
-            <annotation>
-               <documentation>
-                  a fully qualified identifier of the target extension point
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  an optional identifier of the extension instance
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="name" type="string">
-            <annotation>
-               <documentation>
-                  an optional name of the extension instance
-               </documentation>
-               <appInfo>
-                  <meta.attribute translatable="true"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="errorCustomizer">
-      <complexType>
-         <attribute name="namespace" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The namespace for which this error customizer will consider error customizations.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="class" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The class that implements &lt;code&gt;org.eclipse.wst.xml.core.internal.validation.errorcustomization.IErrorMessageCustomizer&lt;/code&gt;.
-               </documentation>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="since"/>
-      </appInfo>
-      <documentation>
-         &lt;b&gt;This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.&lt;/b&gt;
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         The following is an example of an Error Customizer contribution:
-&lt;pre&gt;
-   &lt;extension
-         id=&quot;sampleErrorCustomizer&quot;
-         name=&quot;Sample Error Customizer&quot;
-         point=&quot;org.eclipse.wst.xml.core.errorCustomizer&quot;&gt;
-      &lt;errorCustomizer
-            namespace=&quot;http://sample.namespace&quot;
-            class=&quot;org.eclipse.wst.xml.core.SampleErrorCustomizer&quot;/&gt;
-   &lt;/extension&gt;
-&lt;/pre&gt;
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         The supplied class must implement &lt;code&gt;org.eclipse.wst.xml.core.internal.validation.errorcustomization.IErrorMessageCustomizer&lt;/code&gt;.
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="copyright"/>
-      </appInfo>
-      <documentation>
-         Copyright (c) 2006 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made 
-available under the terms of the Eclipse Public License v1.0 which accompanies 
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
-      </documentation>
-   </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xml.core/schema/modelQueryExtensions.exsd b/bundles/org.eclipse.wst.xml.core/schema/modelQueryExtensions.exsd
deleted file mode 100644
index ecddf01..0000000
--- a/bundles/org.eclipse.wst.xml.core/schema/modelQueryExtensions.exsd
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.xml.core" id="modelQueryExtensions" name="Model Query Extension"/>
-      </appInfo>
-      <documentation>
-         &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
-      </documentation>
-   </annotation>
-
-   <element name="extension">
-      <complexType>
-         <sequence>
-            <element ref="modelQueryExtension"/>
-         </sequence>
-         <attribute name="point" type="string" use="required">
-            <annotation>
-               <documentation>
-                  a fully qualified identifier of the target extension point
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  an optional identifier of the extension instance
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="name" type="string">
-            <annotation>
-               <documentation>
-                  an optional name of the extension instance
-               </documentation>
-               <appInfo>
-                  <meta.attribute translatable="true"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="modelQueryExtension">
-      <complexType>
-         <attribute name="class" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="java"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-         <attribute name="contentType" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="since"/>
-      </appInfo>
-      <documentation>
-         &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="copyright"/>
-      </appInfo>
-      <documentation>
-         Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made 
-available under the terms of the Eclipse Public License v1.0 which accompanies 
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
-      </documentation>
-   </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java
deleted file mode 100644
index d071382..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java
+++ /dev/null
@@ -1,556 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEvent;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogListener;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-public class Catalog implements ICatalog
-{
-
-	class CatalogLS
-	{
-		public void load()
-		{
-		}
-
-		public synchronized void save()
-		{
-			try
-			{
-				new CatalogWriter().write(Catalog.this, location);
-			} catch (Exception e)
-			{
-				Logger.logException(e);
-			}
-		}
-	}
-
-	class DefaultCatalogLS extends CatalogLS
-	{
-		public void load()
-		{
-			NextCatalog userCatalogReference = new NextCatalog();
-			userCatalogReference.setId(XMLCorePlugin.USER_CATALOG_ID);
-			userCatalogReference.setCatalogLocation(USER_CATALOG_FILE);
-			addCatalogElement(userCatalogReference);
-
-			NextCatalog systemCatalogReference = new NextCatalog();
-			systemCatalogReference.setId(XMLCorePlugin.SYSTEM_CATALOG_ID);
-			systemCatalogReference.setCatalogLocation(SYSTEM_CATALOG_FILE);
-			addCatalogElement(systemCatalogReference);
-
-			/*
-			 * Here we save the file in order to 'reflect' the catalog that
-			 * we've created from plug-in extensions to disk. The 'default'
-			 * catalog is only ever written to disk and never read from disk.
-			 */
-			save();
-		}
-	}
-
-	class InternalResolver
-	{
-		protected Map publicMap = new HashMap();
-
-		protected Map systemMap = new HashMap();
-
-		protected Map uriMap = new HashMap();
-
-		InternalResolver()
-		{
-			for (Iterator i = catalogElements.iterator(); i.hasNext();)
-			{
-				ICatalogElement catalogElement = (ICatalogElement) i.next();
-				if (catalogElement.getType() == ICatalogElement.TYPE_ENTRY)
-				{
-					ICatalogEntry entry = (ICatalogEntry) catalogElement;
-					Map map = getEntryMap(entry.getEntryType());
-					map.put(entry.getKey(), entry);
-				}
-			}
-		}
-
-		private Map getEntryMap(int entryType)
-		{
-			Map map = systemMap;
-			switch (entryType)
-			{
-			case ICatalogEntry.ENTRY_TYPE_PUBLIC:
-				map = publicMap;
-				break;
-			case ICatalogEntry.ENTRY_TYPE_URI:
-				map = uriMap;
-				break;
-			default:
-				break;
-			}
-			return map;
-		}
-
-		protected String getMappedURI(Map map, String key)
-		{
-			CatalogEntry entry = (CatalogEntry) map.get(key);
-			if(entry == null) return null;
-			String uri = entry.getURI();
-			try
-			{
-                // TODO CS : do we really want to resolve these here?
-                // I'm guessing we should return the 'platform:' form of the URI
-                // to the caller.
-                if (uri.startsWith("platform:")) //$NON-NLS-1$
-                {  
-				  URL entryURL = new URL(entry.getAbsolutePath(uri));                
-				  uri = Platform.resolve(entryURL).toString();
-                  
-                  // we need to ensure URI's are of form "file:///D:/XXX" and NOT  
-                  // "file:D:/XXX".  Otherwise the EMF URI class gets confused
-                  // (see bug 103607) 
-                  String FILE_SCHEME = "file:"; //$NON-NLS-1$
-                  if (uri.startsWith(FILE_SCHEME) && !uri.startsWith(FILE_SCHEME + "/")) //$NON-NLS-1$
-                  {
-                    uri = FILE_SCHEME + "///" + uri.substring(FILE_SCHEME.length()); //$NON-NLS-1$
-                  }  
-                }  
-                return uri; 
-			} catch (IOException e)
-			{
-				return null;
-			}
-		}
-
-		public String resolvePublic(String publicId, String systemId)
-				throws MalformedURLException, IOException
-		{
-			String result = getMappedURI(publicMap, publicId);
-			if (result == null)
-			{
-				result = getMappedURI(systemMap, systemId);
-			}
-			// our clients used to pass namespace in place of public id, so we need to check uri map for those
-			if (result == null)
-			{
-				result = getMappedURI(uriMap, publicId);
-			}
-			if (result == null)
-			{
-				result = resolveSubordinateCatalogs(
-						ICatalogEntry.ENTRY_TYPE_PUBLIC, publicId, systemId);
-			}
-			return result;
-		}
-
-		public String resolveSystem(String systemId)
-				throws MalformedURLException, IOException
-		{
-			String result = getMappedURI(systemMap, systemId);
-			if (result == null)
-			{
-				result = resolveSubordinateCatalogs(
-						ICatalogEntry.ENTRY_TYPE_SYSTEM, null, systemId);
-			}
-			return result;
-		}
-
-		public String resolveURI(String uri) throws MalformedURLException,
-				IOException
-		{
-			String result = getMappedURI(uriMap, uri);
-			if (result == null)
-			{
-				result = resolveSubordinateCatalogs(
-						ICatalogEntry.ENTRY_TYPE_URI, null, uri);
-			}
-			return result;
-		}
-	}
-
-	class SystemCatalogLS extends CatalogLS
-	{
-		public void load()
-		{
-			new CatalogContributorRegistryReader(Catalog.this).readRegistry();
-
-			/*
-			 * Here we save the file in order to 'reflect' the catalog that
-			 * we've created from plugin extensions to disk. 
-			 * The 'system' catalog is only ever written to disk and never read from disk.
-			 */
-			save();
-		}
-	}
-
-	class UserCatalogLS extends CatalogLS
-	{
-		public void load()
-		{
-			InputStream inputStream = null;
-			try
-			{
-				URL url = new URL(location);
-				inputStream = url.openStream();
-				boolean oldNotificationEnabled = isNotificationEnabled();
-				setNotificationEnabled(false);
-				clear();
-				try
-				{
-					CatalogReader.read(Catalog.this, inputStream);
-				} finally
-				{
-					setNotificationEnabled(oldNotificationEnabled);
-				}
-				notifyChanged();
-			} catch (Exception e)
-			{
-			} finally
-			{
-				if (inputStream != null)
-				{
-					try
-					{
-						inputStream.close();
-					} catch (Exception e)
-					{
-					}
-				}
-			}
-		}
-	}
-
-	public static final String DEFAULT_CATALOG_FILE = "default_catalog.xml"; //$NON-NLS-1$
-
-	public static final String SYSTEM_CATALOG_FILE = "system_catalog.xml"; //$NON-NLS-1$
-
-	public static final String USER_CATALOG_FILE = "user_catalog.xml"; //$NON-NLS-1$
-
-	protected String base;
-
-	protected List catalogElements = new ArrayList();
-
-	protected CatalogLS catalogLS;
-
-	protected String id;
-
-	protected InternalResolver internalResolver;
-
-	protected boolean isNotificationEnabled;
-
-	protected List listenerList = new ArrayList();
-
-	protected String location;
-
-	protected CatalogSet resourceSet;
-
-	public Catalog(CatalogSet catalogResourceSet, String id, String location)
-	{
-		this.resourceSet = catalogResourceSet;
-		this.id = id;
-		this.location = location;
-
-		if (XMLCorePlugin.DEFAULT_CATALOG_ID.equals(id))
-		{
-			catalogLS = new DefaultCatalogLS();
-		} else if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(id))
-		{
-			catalogLS = new SystemCatalogLS();
-		} else
-		{
-			catalogLS = new UserCatalogLS();
-		}
-	}
-
-	public void addCatalogElement(ICatalogElement element)
-	{
-		catalogElements.add(element);
-		element.setOwnerCatalog(this);
-		internalResolver = null;
-		notifyAddElement(element);
-	}
-
-	public void addEntriesFromCatalog(ICatalog catalog)
-	{
-		try
-		{
-			setNotificationEnabled(false);
-			if (catalog != null)
-			{
-				ICatalogElement[] entries = ((Catalog)catalog).getCatalogElements();
-				for (int i = 0; i < entries.length; i++)
-				{
-					CatalogElement clone = (CatalogElement)((CatalogElement)entries[i]).clone();
-					addCatalogElement(clone);
-				}
-			} else
-			{
-				Logger.log(Logger.ERROR, "argument was null in Catalog.addEntriesFromCatalog"); //$NON-NLS-1$
-			}
-		} finally
-		{
-			setNotificationEnabled(true);
-		}
-		internalResolver = null;
-		notifyChanged();
-	}
-
-	public void addListener(ICatalogListener listener)
-	{
-		listenerList.add(listener);
-	}
-
-	public void clear()
-	{
-		catalogElements.clear();
-		internalResolver = null;
-		notifyChanged();
-	}
-
-	public ICatalogElement createCatalogElement(int type)
-	{
-		switch (type)
-		{
-		case ICatalogElement.TYPE_ENTRY:
-			return new CatalogEntry();
-		case ICatalogElement.TYPE_NEXT_CATALOG:
-			return new NextCatalog();
-		case ICatalogEntry.ENTRY_TYPE_PUBLIC:
-			return new CatalogEntry(ICatalogEntry.ENTRY_TYPE_PUBLIC);
-		case ICatalogEntry.ENTRY_TYPE_SYSTEM:
-			return new CatalogEntry(ICatalogEntry.ENTRY_TYPE_SYSTEM);
-		case ICatalogEntry.ENTRY_TYPE_URI:
-			return new CatalogEntry(ICatalogEntry.ENTRY_TYPE_URI);
-		default:
-			return new CatalogElement(type);
-		}
-	}
-
-	public String getBase()
-	{
-		return base;
-	}
-
-	private List getCatalogElements(int type)
-	{
-		List result = new ArrayList();
-		ICatalogElement[] elements = (ICatalogElement[]) catalogElements
-				.toArray(new ICatalogElement[catalogElements.size()]);
-		for (int i = 0; i < elements.length; i++)
-		{
-			ICatalogElement element = elements[i];
-			if (element.getType() == type)
-			{
-				result.add(element);
-			}
-		}
-		return result;
-	}
-
-	public ICatalogEntry[] getCatalogEntries()
-	{
-		List result = getCatalogElements(ICatalogElement.TYPE_ENTRY);
-		return (ICatalogEntry[]) result
-				.toArray(new ICatalogEntry[result.size()]);
-	}
-
-	protected CatalogSet getCatalogSet()
-	{
-		return resourceSet;
-	}
-
-	public String getId()
-	{
-		return id;
-	}
-
-	public String getLocation()
-	{
-		return location;
-	}
-
-	public INextCatalog[] getNextCatalogs()
-	{
-		List result = getCatalogElements(ICatalogElement.TYPE_NEXT_CATALOG);
-		return (INextCatalog[]) result.toArray(new INextCatalog[result.size()]);
-	}
-
-	protected InternalResolver getOrCreateInternalResolver()
-	{
-		if (internalResolver == null)
-		{
-			internalResolver = new InternalResolver();
-		}
-		return internalResolver;
-	}
-
-	protected boolean isNotificationEnabled()
-	{
-		return isNotificationEnabled;
-	}
-
-	public void load() throws IOException
-	{
-		catalogLS.load();
-	}
-
-	protected void notifyAddElement(ICatalogElement entry)
-	{
-		if (isNotificationEnabled)
-		{
-			ICatalogEvent event = new CatalogEvent(this, entry,
-					ICatalogEvent.ELEMENT_ADDED);
-			notifyListeners(event);
-		}
-	}
-
-	protected void notifyChanged()
-	{
-		ICatalogEvent event = new CatalogEvent(this, null,
-				ICatalogEvent.CHANGED);
-		notifyListeners(event);
-	}
-
-	protected void notifyListeners(ICatalogEvent event)
-	{
-		List list = new ArrayList();
-		list.addAll(listenerList);
-		for (Iterator i = list.iterator(); i.hasNext();)
-		{
-			ICatalogListener listener = (ICatalogListener) i.next();
-			listener.catalogChanged(event);
-		}
-	}
-
-	protected void notifyRemoveElement(ICatalogElement element)
-	{
-		if (isNotificationEnabled)
-		{
-			ICatalogEvent event = new CatalogEvent(this, element,
-					ICatalogEvent.ELEMENT_REMOVED);
-			notifyListeners(event);
-		}
-	}
-
-	public void removeCatalogElement(ICatalogElement element)
-	{
-		catalogElements.remove(element);
-		internalResolver = null;
-		notifyRemoveElement(element);
-		
-	}
-
-	public void removeListener(ICatalogListener listener)
-	{
-		listenerList.remove(listener);
-	}
-
-	public String resolvePublic(String publicId, String systemId)
-			throws MalformedURLException, IOException
-	{
-		return getOrCreateInternalResolver().resolvePublic(publicId, systemId);
-	}
-
-	protected String resolveSubordinateCatalogs(int entryType, String publicId,
-			String systemId) throws MalformedURLException, IOException
-	{
-		String result = null;
-		INextCatalog[] nextCatalogs = getNextCatalogs();
-		for (int i = 0; i < nextCatalogs.length; i++)
-		{
-			INextCatalog nextCatalog = nextCatalogs[i];
-			ICatalog catalog = nextCatalog.getReferencedCatalog();
-			if (catalog != null)
-			{
-				switch (entryType)
-				{
-				case ICatalogEntry.ENTRY_TYPE_PUBLIC:
-					result = catalog.resolvePublic(publicId, systemId);
-					break;
-				case ICatalogEntry.ENTRY_TYPE_SYSTEM:
-					result = catalog.resolveSystem(systemId);
-					break;
-				case ICatalogEntry.ENTRY_TYPE_URI:
-					result = catalog.resolveURI(systemId);
-					break;
-				default:
-					break;
-				}
-				if (result != null)
-				{
-					return result;
-				}
-			}
-		}
-		return null;
-	}
-
-	public String resolveSystem(String systemId) throws MalformedURLException,
-			IOException
-	{
-		return getOrCreateInternalResolver().resolveSystem(systemId);
-	}
-
-	public String resolveURI(String uri) throws MalformedURLException,
-			IOException
-	{
-		return getOrCreateInternalResolver().resolveURI(uri);
-	}
-
-	public void save() throws IOException
-	{
-		catalogLS.save();
-	}
-
-	public void setBase(String base)
-	{
-		this.base = base;
-	}
-
-	public void setId(String id)
-	{
-		this.id = id;
-	}
-
-	public void setLocation(String location)
-	{
-		this.location = location;
-	}
-
-	protected void setNotificationEnabled(boolean b)
-	{
-		isNotificationEnabled = b;
-	}
-
-	public ICatalogElement[] getCatalogElements()
-	{
-		return (ICatalogElement[]) catalogElements.toArray(new ICatalogElement[catalogElements.size()]);
-	}
-	
-
-	
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java
deleted file mode 100644
index 2f01c5f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.osgi.framework.Bundle;
-
-public class CatalogContributorRegistryReader
-{
-  protected static final String EXTENSION_POINT_ID = "catalogContributions"; //$NON-NLS-1$
-  protected static final String TAG_CONTRIBUTION = "catalogContribution"; //$NON-NLS-1$
-  /*
-   * this is a sample exptension 
-   * <extension point="org.eclipse.wst.xml.core.catalogContributions"> 
-   * <catalogContribution>
-   *    <uri
-   *             name="http://schemas.xmlsoap.org/wsdl/soap/" 
-   *             uri="xsd/soap.xsd"/> 
-   *   	<public
-   *          publicId="-//W3C//DTD XHTML 1.1//EN"
-   *          uri="dtds/xhtml11-flat.dtd"/> 
-   *  	<nextCatalog id="nestedCatalog" catalog="data/catalog1.xml"/> 
-   *  </catalogContribution> 
-   *  </extension>
-   *  
-   */
-  protected ICatalog catalog;
-
-  protected String declaringExtensionId;
-  
-  protected CatalogContributorRegistryReader(ICatalog aCatalog)
-  {
-    catalog = aCatalog;
-  }
-
-  /**
-   * read from plugin registry and parse it.
-   */
-  protected void readRegistry()
-  {
-    IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry();
-    IExtensionPoint point = pluginRegistry.getExtensionPoint(XMLCorePlugin.getDefault().getBundle().getSymbolicName(), EXTENSION_POINT_ID);
-    if (point != null)
-    {
-      IConfigurationElement[] elements = point.getConfigurationElements();
-      for (int i = 0; i < elements.length; i++)
-      {
-        readElement(elements[i]);
-      }
-    }
-    
-  }
-  
-  public static String resolvePath(URL platformURL, String path) 
-  {      
-	String fileLocation = path;
-	int jarPathStart = path.indexOf("jar:"); //$NON-NLS-1$
-	jarPathStart = jarPathStart < 0 ? 0 : jarPathStart + "jar:".length(); //$NON-NLS-1$
-	int jarPathEnd = path.indexOf("!"); //$NON-NLS-1$
-	jarPathEnd = jarPathEnd < 0 ? path.length() : jarPathEnd;
-	fileLocation = path.substring(jarPathStart, jarPathEnd);
-	
-	String result = path;
-	String resolvedLocation = fileLocation;
-	URL resolvedURL = null;
-    if (fileLocation.startsWith("platform:/plugin")) //$NON-NLS-1$
-    {
-      // this is the speclial case, where the resource is located relative 
-      // to another plugin (not the one that declares the extension point)
-      //
-		try
-		{
-			resolvedURL = Platform.resolve(new URL(fileLocation));
-		} catch (IOException e)
-		{
-			// do nothing
-		} 
-    }
-    else{
-    	 // this is the typical case, where the resource is located relative
-        // to the plugin that declares the extension point
-    	 try {
-    	     	resolvedURL = new URL(Platform.resolve(platformURL), fileLocation);
-    	 } catch (IOException e) {
-    	    	// do nothing
-    	 }
-    }
-   
-   if(resolvedURL != null){
-    	resolvedLocation = resolvedURL.toExternalForm().replace('\\', '/');
-    	result = result.replaceFirst(fileLocation, resolvedLocation);
-    }
-    return result;
-  }
-  
-  public static URL getPlatformURL(String pluginId){
-	  Bundle bundle = Platform.getBundle(pluginId);
-		if (bundle != null)
-		{
-			URL bundleEntry = bundle.getEntry("/"); //$NON-NLS-1$
-			
-			if(bundleEntry != null){
-				try
-				{
-					return Platform.resolve(bundleEntry);
-				} catch (IOException e)
-				{
-					Logger.logException(e);
-				}
-			}
-		}
-		return null;
-  }
-
-  private String resolvePath(String path)
-  {
-	  return resolvePath(getPlatformURL(declaringExtensionId), path);
-  }
-
-  protected void readElement(IConfigurationElement element)
-  {
-    try
-    {
-	  declaringExtensionId = element.getDeclaringExtension().getNamespace();
-    }
-    catch (InvalidRegistryObjectException e)
-    {
-      Logger.logException(e);
-    }
-    
-    if (TAG_CONTRIBUTION.equals(element.getName())){
-    	IConfigurationElement[] mappingInfoElementList = element.getChildren(OASISCatalogConstants.TAG_PUBLIC);
-    	processMappingInfoElements(mappingInfoElementList);
-    	mappingInfoElementList = element.getChildren(OASISCatalogConstants.TAG_SYSTEM);
-    	processMappingInfoElements(mappingInfoElementList);
-    	mappingInfoElementList = element.getChildren(OASISCatalogConstants.TAG_URI);
-    	processMappingInfoElements(mappingInfoElementList);
-    	IConfigurationElement[] nextCatalogElementList = element.getChildren(OASISCatalogConstants.TAG_NEXT_CATALOG);
-    	processNextCatalogElements(nextCatalogElementList);
-    	
-    }
-    
-  }
-
-  private void processMappingInfoElements(IConfigurationElement[] childElementList)
-  {
-    if (catalog == null)
-      return;
-    for (int i = 0; i < childElementList.length; i++)
-    {
-      IConfigurationElement childElement = childElementList[i];
-      String name = childElement.getName();
-      String key = null;
-	
-      int type = ICatalogEntry.ENTRY_TYPE_PUBLIC;
-      if (OASISCatalogConstants.TAG_PUBLIC.equals(name))
-      {
-        key = childElement.getAttribute(OASISCatalogConstants.ATTR_PUBLIC_ID);
-      }
-      else if (OASISCatalogConstants.TAG_SYSTEM.equals(name))
-      {
-        key = childElement.getAttribute(OASISCatalogConstants.ATTR_SYSTEM_ID);
-        type = ICatalogEntry.ENTRY_TYPE_SYSTEM;
-      }
-      else if (OASISCatalogConstants.TAG_URI.equals(name))
-      {
-        key = childElement.getAttribute(OASISCatalogConstants.ATTR_NAME);
-        type = ICatalogEntry.ENTRY_TYPE_URI;
-      }
-      else if (OASISCatalogConstants.TAG_NEXT_CATALOG.equals(name))
-      {
-        processNextCatalogElements(new IConfigurationElement[]{childElement});
-        continue;
-      }
-      if (key == null || key.equals("")) //$NON-NLS-1$
-      {
-         Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_key_not_set);
-        continue;
-      }
-      String entryURI = childElement.getAttribute(OASISCatalogConstants.ATTR_URI); // mandatory
-      if (entryURI == null || entryURI.equals("")) //$NON-NLS-1$
-      {
-       Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_uri_not_set);
-        continue;
-      }
-      ICatalogElement catalogElement = catalog.createCatalogElement(type);
-      if (catalogElement instanceof ICatalogEntry)
-      {
-        ICatalogEntry entry = (ICatalogEntry) catalogElement;
-        entry.setKey(key);
-		String resolvedPath = resolvePath(entryURI);
-		entry.setURI(resolvedPath);
-        String id = childElement.getAttribute(OASISCatalogConstants.ATTR_ID); // optional
-        if (id != null && !id.equals("")) //$NON-NLS-1$
-        {
-          entry.setId(id);
-        }
-      }
-      // process any other attributes
-      for (int j = 0; j < childElement.getAttributeNames().length; j++)
-      {
-        String attrName = childElement.getAttributeNames()[j];
-        if (!attrName.equals(OASISCatalogConstants.ATTR_URI) && !attrName.equals(OASISCatalogConstants.ATTR_NAME) && !attrName.equals(OASISCatalogConstants.ATTR_PUBLIC_ID)
-            && !attrName.equals(OASISCatalogConstants.ATTR_SYSTEM_ID) && !attrName.equals(OASISCatalogConstants.ATTR_CATALOG) && !attrName.equals(OASISCatalogConstants.ATTR_ID)
-            && !attrName.equals(OASISCatalogConstants.ATTR_BASE))
-        {
-          String attrValue = childElement.getAttribute(attrName);
-          if (attrValue != null && !attrValue.equals("")) //$NON-NLS-1$
-          {
-            catalogElement.setAttributeValue(attrName, attrValue);
-          }
-        }
-      }
-      catalog.addCatalogElement(catalogElement);
-    }
-  }
-
-  private void processNextCatalogElements(IConfigurationElement[] childElementList)
-  {
-    if (catalog == null)
-      return;
-    for (int i = 0; i < childElementList.length; i++)
-    {
-      IConfigurationElement childElement = childElementList[i];
-      String location = childElement.getAttribute(OASISCatalogConstants.ATTR_CATALOG); // mandatory
-      if (location == null || location.equals("")) //$NON-NLS-1$
-      {
-        Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_next_catalog_location_uri_not_set);
-        continue;
-      }
-      INextCatalog nextCatalog = new NextCatalog();
-	  String resolvedPath = resolvePath(location);
-      nextCatalog.setCatalogLocation(resolvedPath);
-	  String id = childElement.getAttribute(OASISCatalogConstants.ATTR_ID);
-	  if (id != null && !id.equals("")) //$NON-NLS-1$
-      { 
-		  nextCatalog.setId(id);
-      }
-      catalog.addCatalogElement(nextCatalog);
-    }
-  }
-  
- 
- 
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java
deleted file mode 100644
index 1e51a04..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-
-
-public class CatalogElement implements ICatalogElement
-{
-	int type;
-
-	String id;
-
-	Map attributes = new HashMap();
-
-	ICatalog ownerCatalog;
-
-	public CatalogElement(int aType)
-	{
-		super();
-		type = aType;
-	}
-
-	public int getType()
-	{
-		return type;
-	}
-
-	public String getAttributeValue(String name)
-	{
-		return (String) attributes.get(name);
-	}
-
-	public void setAttributeValue(String name, String value)
-	{
-		attributes.put(name, value);
-	}
-
-	public String[] getAttributes()
-	{
-		Collection c = attributes.values();
-		String[] result = new String[c.size()];
-		attributes.keySet().toArray(result);
-		return result;
-	}
-
-	public String getId()
-	{
-		return id;
-	}
-
-	public void setId(String id)
-	{
-		this.id = id;
-	}
-
-	public ICatalog getOwnerCatalog()
-	{
-		return ownerCatalog;
-	}
-
-	public void setOwnerCatalog(ICatalog catalog)
-	{
-		this.ownerCatalog = catalog;
-	}
-
-	protected static String makeAbsolute(String baseLocation, String location)
-	{
-		URL local = null;
-		location = location.replace('\\', '/');
-		try
-		{
-			URL baseURL = new URL(baseLocation);
-			local = new URL(baseURL, location);
-		} catch (MalformedURLException e)
-		{
-		}
-
-		if (local != null)
-		{
-			return local.toString();
-		} else
-		{
-			return location;
-		}
-	}
-
-	public String getAbsolutePath(String path)
-	{
-		try
-		{
-			URI uri = new URI(path);
-			if (uri.isAbsolute())
-			{
-				return path;
-			}
-		} catch (URISyntaxException e)
-		{
-		}
-
-		String result = path;
-		Catalog catalog = (Catalog) getOwnerCatalog();
-		if (catalog != null)
-		{
-			String base = catalog.getBase();
-			if (base == null || base.equals("")) //$NON-NLS-1$
-			{
-				base = catalog.getLocation();
-			}
-			result = makeAbsolute(base, path);
-		}
-		return result;
-	}
-	
-	  /*
-	   * Since we don't have events notifications for entry properties, clone()
-	   * could allow to copy and edit entry and then replace it in catalog. Entry
-	   * replacement will signal ICatalogEvent @return
-	   */
-	  public Object clone()
-	  {
-		ICatalogElement element = ownerCatalog.createCatalogElement(type);
-	    String[] attributes = getAttributes();   
-	    for (int i = 0; i < attributes.length; i++)
-	    {
-	      String attrName = attributes[i];
-	      String attrValue = getAttributeValue(attrName);
-	      element.setAttributeValue(attrName, attrValue);
-	    }
-		element.setOwnerCatalog(ownerCatalog);
-		element.setId(id);
-	    return element;
-	  }
-
-	
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEntry.java
deleted file mode 100644
index 550a8e4..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEntry.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-
-public class CatalogEntry extends CatalogElement implements ICatalogEntry, Cloneable
-{
-  int entryType = ICatalogEntry.ENTRY_TYPE_PUBLIC;
-  String key;
-  String uri;
-
-  protected CatalogEntry(int anEntryType)
-  {
-    super(ICatalogElement.TYPE_ENTRY);
-    entryType = anEntryType;
-  }
-
-  protected CatalogEntry()
-  {
-    super(ICatalogElement.TYPE_ENTRY);
-  }
-
-  public void setEntryType(int value)
-  {
-    entryType = value;
-  }
-
-  public int getEntryType()
-  {
-    return entryType;
-  }
-
-  public void setKey(String value)
-  {
-    key = value;
-  }
-
-  public String getKey()
-  {
-    return key;
-  }
-
-  public String getURI()
-  {
-    return uri;
-  }
-  
-  public void setURI(String value)
-  {
-    uri = value;
-  }
-
-  public Object clone()
-  {
-    CatalogEntry entry = (CatalogEntry)super.clone();
-	entry.setEntryType(entryType);
-    entry.setKey(key);
-    entry.setURI(uri);
-    return entry;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEvent.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEvent.java
deleted file mode 100644
index 8fba64d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEvent.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEvent;
-
-
-public class CatalogEvent implements ICatalogEvent
-{
-  protected ICatalog catalog;
-  protected ICatalogElement catalogElement;
-  protected int eventType;
-
-  public CatalogEvent(Catalog catalog, ICatalogElement element, int eventType)
-  {
-    this.catalog = catalog;
-    this.catalogElement = element;
-    this.eventType = eventType;
-  }
-
-  public ICatalog getCatalog()
-  {
-    return catalog;
-  }
-
-  public ICatalogElement getCatalogElement()
-  {
-    return catalogElement;
-  }
-
-  public int getEventType()
-  {
-    return eventType;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java
deleted file mode 100644
index bdb88d3..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Stack;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.wst.common.uriresolver.internal.URI;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * 
- * 
- */
-public final class CatalogReader
-{
-  public static void read(Catalog xmlCatalog, InputStream input) throws IOException
-  {
-    try
-    {
-      SAXParserFactory factory = SAXParserFactory.newInstance();
-      factory.setNamespaceAware(true);
-      SAXParser parser = factory.newSAXParser();
-      parser.parse(new InputSource(input), new CatalogContentHandler(xmlCatalog));
-    }
-    catch (ParserConfigurationException e)
-    {
-      Logger.logException(e);
-    }
-    catch (SAXException e)
-    {
-      Logger.logException(e);
-    }
-  }
-  protected static class CatalogContentHandler extends DefaultHandler
-  {
-    protected Catalog catalog;
-    protected Stack baseURIStack = new Stack();
-
-    public CatalogContentHandler(Catalog xmlCatalog)
-    {
-      this.catalog = xmlCatalog;
-      String base = xmlCatalog.getBase();
-      if(base == null || base == "") {  //$NON-NLS-1$
-    	  base = xmlCatalog.getLocation();
-      }
-      baseURIStack.push(base);
-    }
-
-    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
-    {
-      // set base
-      String base = attributes.getValue(OASISCatalogConstants.ATTR_BASE); //$NON-NLS-1$
-      if (base != null && !base.equals("")) //$NON-NLS-1$
-      {
-          baseURIStack.push(base);
-      } else {
-    	  baseURIStack.push(baseURIStack.peek());
-      }
-
-	  // processing for backward compatability start
-	  if (localName.equals(CompatabilityConstants.TAG_USER_ENTRY))
-      {
-		int type = ICatalogEntry.ENTRY_TYPE_PUBLIC;
-        String typeName = attributes.getValue("", CompatabilityConstants.ATT_TYPE); //$NON-NLS-1$
-        if (typeName != null)
-        {
-          if (typeName.compareToIgnoreCase("SYSTEM") == 0) //$NON-NLS-1$
-          {
-            type = ICatalogEntry.ENTRY_TYPE_SYSTEM;
-          }
-        }
-		  ICatalogElement catalogElement = catalog.createCatalogElement(type);
-	      if (catalogElement instanceof CatalogEntry)
-	      {
-	        CatalogEntry catalogEntry = (CatalogEntry) catalogElement;
-		    String key = attributes.getValue("", CompatabilityConstants.ATT_ID);   		     //$NON-NLS-1$
-	        catalogEntry.setKey(key);
-	        String entryUri = attributes.getValue("", CompatabilityConstants.ATT_URI);    //$NON-NLS-1$
-	        
-	        // For relative URIs, try to resolve them using the corresponding base URI.
-	        if(URI.createURI(entryUri).isRelative()) {
-	        	entryUri = URI.resolveRelativeURI(entryUri, baseURIStack.peek().toString());
-	        }
-
-	        catalogEntry.setURI(URIHelper.ensureURIProtocolFormat(entryUri));  
-	        String webURL = attributes.getValue("", CompatabilityConstants.ATT_WEB_URL); //$NON-NLS-1$
-			if (webURL != null)
-			{
-				catalogEntry.setAttributeValue(
-						ICatalogEntry.ATTR_WEB_URL, webURL);
-			}
-	      }
-		  catalog.addCatalogElement(catalogElement);
-		  return;
-      }
-	  //  processing for backward compatability start
-      
-	  int type = ICatalogEntry.ENTRY_TYPE_PUBLIC;
-	  String key = null;
-	 //dw String catalogId = attributes.getValue("", OASISCatalogConstants.ATTR_ID);
-      if (OASISCatalogConstants.TAG_PUBLIC.equals(localName))
-      {
-        key = attributes.getValue("", OASISCatalogConstants.ATTR_PUBLIC_ID); //$NON-NLS-1$
-      }
-      else if (OASISCatalogConstants.TAG_SYSTEM.equals(localName))
-      {
-        key = attributes.getValue("", OASISCatalogConstants.ATTR_SYSTEM_ID); //$NON-NLS-1$
-        type = ICatalogEntry.ENTRY_TYPE_SYSTEM;
-      }
-      else if (OASISCatalogConstants.TAG_URI.equals(localName))
-      {
-        key = attributes.getValue("", OASISCatalogConstants.ATTR_NAME); //$NON-NLS-1$
-        type = ICatalogEntry.ENTRY_TYPE_URI;
-      }
-      else if (OASISCatalogConstants.TAG_NEXT_CATALOG.equals(localName))
-      {
-        String nextCatalogId = attributes.getValue("", OASISCatalogConstants.ATTR_ID); //$NON-NLS-1$
-
-        String location = attributes.getValue("", OASISCatalogConstants.ATTR_CATALOG);    //$NON-NLS-1$
-        NextCatalog delegate = new NextCatalog();
-        delegate.setCatalogLocation(location);  
-        delegate.setId(nextCatalogId);
-        catalog.addCatalogElement(delegate);
-        return;
-      }
-      else{
-    	  // do not handle other entries
-    	  return;
-      }
-      if (key == null || key.equals("")) //$NON-NLS-1$
-      {
-        Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_key_not_set);
-        return;
-      }
-      String entryURI = attributes.getValue("", OASISCatalogConstants.ATTR_URI); // mandatory //$NON-NLS-1$
-      if (entryURI == null || entryURI.equals("")) //$NON-NLS-1$
-      {
-        Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_uri_not_set);
-        return;
-      }
- 
-      ICatalogElement catalogElement = catalog.createCatalogElement(type);
-      if (catalogElement instanceof CatalogEntry)
-      {
-        CatalogEntry catalogEntry = (CatalogEntry) catalogElement;
-        catalogEntry.setKey(key); 
-
-        //      For relative URIs, try to resolve them using the corresponding base URI.
-        if(URI.createURI(entryURI).isRelative()) {
-        	entryURI = URI.resolveRelativeURI(entryURI, baseURIStack.peek().toString());
-        } 
-
-        catalogEntry.setURI(URIHelper.ensureURIProtocolFormat(entryURI));     
-
-      }
-      // process any other attributes
-      for (int j = 0; j < attributes.getLength(); j++)
-      {
-        String attrName = attributes.getLocalName(j);
-        if (!attrName.equals(OASISCatalogConstants.ATTR_URI) && !attrName.equals(OASISCatalogConstants.ATTR_NAME) && !attrName.equals(OASISCatalogConstants.ATTR_PUBLIC_ID)
-            && !attrName.equals(OASISCatalogConstants.ATTR_SYSTEM_ID) && !attrName.equals(OASISCatalogConstants.ATTR_CATALOG) && !attrName.equals(OASISCatalogConstants.ATTR_ID)
-            && !attrName.equals(OASISCatalogConstants.ATTR_BASE))
-        {
-          String attrValue = attributes.getValue(attrName);
-          if (attrValue != null && !attrValue.equals("")) //$NON-NLS-1$
-          {
-            catalogElement.setAttributeValue(attrName, attrValue);
-          }
-        }
-      }
-      catalog.addCatalogElement(catalogElement);
-
-    }
-
-    public void endElement(String uri, String localName, String qName) throws SAXException
-    {
-      if (baseURIStack.size() > 0)
-      {
-        baseURIStack.pop();
-      }
-    }
-    
-  }  
-  
-  // for backward compatability
-  interface CompatabilityConstants{
-	  
-	  public static final String TAG_ID_XML_CATALOG_SETTINGS = "XMLCatalogSettings"; //$NON-NLS-1$
-	  public static final String TAG_ID_USER_ENTRIES = "UserEntries"; //$NON-NLS-1$
-	  public static final String TAG_USER_ENTRY = "UserEntry"; //$NON-NLS-1$
-	  public static final String ATT_TYPE = "TYPE"; //$NON-NLS-1$
-	  public static final String ATT_ID = "ID"; //$NON-NLS-1$
-	  public static final String ATT_URI = "URI"; //$NON-NLS-1$
-	  public static final String ATT_WEB_URL = "WEB_URL"; //$NON-NLS-1$
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java
deleted file mode 100644
index acfbd16..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.xml.core.internal.Logger;
-
-
-
-public class CatalogSet {
-	protected Map uriResourceMap = new HashMap();
-	protected Map catalogPersistenceLocations = new HashMap();
-	public CatalogSet() {
-		super();
-	}
-
-	/**
-	 * Find a Catalog with the given ID.  If one is not found, create one at the given URI.
-	 * 
-	 * @param id
-	 * @param uri - the URI, the parent of this file path must already exist
-	 * @return
-	 */
-	public Catalog lookupOrCreateCatalog(String id, String uri) {
-		Catalog catalog = getCatalog(id, uri);
-		if (catalog == null) {
-			catalog = new Catalog(this, id, uri);
-			try {
-				catalog.load();
-				uriResourceMap.put(uri, catalog);
-			}
-			catch (Exception e) {
-				// we catch and log all exceptions, to disallow
-				// one bad extension interfering with others
-				Logger.logException("error loading catalog: " + id + " " + uri, e); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-		}
-		return catalog;
-	}
-
-	private Catalog getCatalog(String id, String uri) {
-		return (Catalog) uriResourceMap.get(uri);
-	}
-
-	public void putCatalogPersistenceLocation(String logicalURI, String actualURI) {
-		catalogPersistenceLocations.put(logicalURI, actualURI);
-	}
-
-	// Never used?
-	public String getCatalogPersistenceLocation(String id) {
-		return (String) catalogPersistenceLocations.get(id);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java
deleted file mode 100644
index 5900e1f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * Write OASIS XML Catalog format
- * 
- */
-public final class CatalogWriter
-{
-  private Document doc;
-
-  public void write(ICatalog xmlCatalog, String uri) throws FileNotFoundException, IOException
-  {
-	OutputStream outputStream = null;
-	try {
-      visitCatalog(xmlCatalog);
-      outputStream = getOutputStream(uri);
-      serialize(outputStream);
-	}
-	finally {
-	  if(outputStream != null) {
-		outputStream.close();
-	  }
-	}
-  }
-
-  public void write(ICatalog catalog, OutputStream os) throws FileNotFoundException, IOException
-  {
-    if (catalog != null)
-    {
-      visitCatalog(catalog);
-      serialize(os);
-    }
-  }
-
-  private void visitCatalog(ICatalog xmlCatalog)
-  {
-    try
-    {
-      doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
-    }
-    catch (ParserConfigurationException e)
-    {
-      Logger.logException(e);
-    }
-    if (doc == null)
-      return;
-    Element catalogElement = doc.createElementNS(OASISCatalogConstants.namespaceName, OASISCatalogConstants.TAG_CATALOG);
-    doc.appendChild(catalogElement);
-    processCatalogEntries(xmlCatalog, catalogElement);
-    processNextCatalogs(xmlCatalog, catalogElement);
-  }
-
-  private void processCatalogEntries(ICatalog catalog, Element parent)
-  {
-    ICatalogEntry[] catalogEntries = catalog.getCatalogEntries();
-  
-    for (int i = 0; i < catalogEntries.length; i++)
-    {
-      ICatalogEntry entry = catalogEntries[i];
-      String key = entry.getKey();
-      String uri = entry.getURI();
-	  String id = entry.getId();
-	  Element childElement = null;
-	 
-     switch (entry.getEntryType())
-      {
-        case ICatalogEntry.ENTRY_TYPE_PUBLIC :
-          childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_PUBLIC);
-          if (childElement != null)
-          {
-            childElement.setAttribute(OASISCatalogConstants.ATTR_PUBLIC_ID, key);
-            childElement.setAttribute(OASISCatalogConstants.ATTR_URI, uri);
-          }
-          break;
-        case ICatalogEntry.ENTRY_TYPE_SYSTEM :
-          childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_SYSTEM);
-          if (childElement != null)
-          {
-            childElement.setAttribute(OASISCatalogConstants.ATTR_SYSTEM_ID, key);
-            childElement.setAttribute(OASISCatalogConstants.ATTR_URI, uri);
-          }
-          break;
-        case ICatalogEntry.ENTRY_TYPE_URI :
-          childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_URI);
-          if (childElement != null)
-          {
-            childElement.setAttribute(OASISCatalogConstants.ATTR_NAME, key);
-            childElement.setAttribute(OASISCatalogConstants.ATTR_URI, uri);
-          }
-          break;
-        default :
-          break;
-      }
-	  if(childElement != null && id != null && !id.equals("")){ //$NON-NLS-1$
-		  childElement.setAttribute(OASISCatalogConstants.ATTR_ID, id);
-	  }
-      
-      String[] attributes = entry.getAttributes();   
-      for (int j = 0; j < attributes.length; j++)
-      {
-        String attrName = attributes[j];
-        if (attrName != null && !attrName.equals("")) //$NON-NLS-1$
-        {
-		  String attrValue = entry.getAttributeValue(attrName);
-          if (childElement != null && attrValue != null)
-          {
-            childElement.setAttribute(attrName, attrValue);
-          }
-        }
-      }
-      if (childElement != null)
-      {
-        parent.appendChild(childElement);
-      }
-    }
-  }
-
-  private void processNextCatalogs(ICatalog catalog, Element parent)
-  {
-    // handle catalog entries
-    INextCatalog[] nextCatalogs = catalog.getNextCatalogs();
-    Element childElement = null;
-   //dw String attrValue = null;
-    for (int i = 0; i < nextCatalogs.length; i++)
-    {
-      INextCatalog delegate = nextCatalogs[i];
-      childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_NEXT_CATALOG);
-      if (childElement != null)
-      {
-        parent.appendChild(childElement);
-        String location = delegate.getCatalogLocation();
-        if (location != null)
-        {
-          childElement.setAttribute(OASISCatalogConstants.ATTR_CATALOG, location);
-        }
-		 String id = delegate.getId();
-		 if (id != null)
-		 {
-			 childElement.setAttribute(OASISCatalogConstants.ATTR_ID, id);
-		 }
-      }
-    }
-  }
-
-  private void serialize(OutputStream outputStream) throws FileNotFoundException, IOException
-  {
-    if (doc == null)
-      return;
-    try
-    {
-      TransformerFactory transformerFactory = TransformerFactory.newInstance();
-      Transformer transformer = transformerFactory.newTransformer();
-      transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
-      transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
-      // Unless a width is set, there will be only line breaks but no
-      // indentation.
-      // The IBM JDK and the Sun JDK don't agree on the property name,
-      // so we set them both.
-      //
-      transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$
-      transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$
-      String encoding = "UTF-8"; // TBD //$NON-NLS-1$
-      if (encoding != null)
-      {
-        transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
-      }
-      transformer.transform(new DOMSource(doc), new StreamResult(outputStream));
-    }
-    catch (TransformerException e)
-    {
-      Logger.logException(e);
-    }
-  }
-
-  private OutputStream getOutputStream(String uri) throws FileNotFoundException, IOException
-  {
-    String filePath = removeProtocol(uri);
-    File file = new File(filePath);
-    OutputStream stream = new FileOutputStream(file);
-    return stream;
-  }
-  
-  protected static String removeProtocol(String uri)
-  {
-    String result = uri;  
-    String protocol_pattern = ":"; //$NON-NLS-1$
-    if (uri != null)
-    {
-      int index = uri.indexOf(protocol_pattern);
-      if (index > 2)
-      {
-        result = result.substring(index + protocol_pattern.length());                 
-      }
-    }
-    return result;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/NextCatalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/NextCatalog.java
deleted file mode 100644
index 16f755a..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/NextCatalog.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     Raj Mandayam, IBM
- *           136400 NextCatalog.getReferencedCatalog() takes a lot of time computing constant information
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-
-
-
-public class NextCatalog extends CatalogElement implements INextCatalog
-{
-  private String location;
-  private ICatalog referencedCatalog;
-
-  public NextCatalog()
-  {
-    super(ICatalogElement.TYPE_NEXT_CATALOG);
-  }
-    
-  public String getCatalogLocation()
-  {
-    return location;
-  }
-
-  public ICatalog getReferencedCatalog()
-  {
-    if (referencedCatalog == null)
-    {
-      referencedCatalog = ((Catalog)ownerCatalog).getCatalogSet().lookupOrCreateCatalog(getId(), getAbsolutePath(location));
-    }
-    return referencedCatalog;
-  }
-
-  public void setCatalogLocation(String uri)
-  {
-    location = uri;
-    referencedCatalog = null;
-  }
-  
-  public Object clone()
-  {
-	NextCatalog nextCatalog = (NextCatalog)super.clone();
-	nextCatalog.setCatalogLocation(location);
-    return nextCatalog;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java
deleted file mode 100644
index a3c578a..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-public interface OASISCatalogConstants
-{
-  public static final String namespaceName = "urn:oasis:names:tc:entity:xmlns:xml:catalog"; //$NON-NLS-1$
-  /** Types of the catalog entries */
-  /** The CATALOG element name. */
-  public static final String TAG_CATALOG = "catalog"; //$NON-NLS-1$
-  /** The GROUP catalog entry. */
-  public static final String TAG_GROUP = "group"; //$NON-NLS-1$
-  /** The PUBLIC catalog entry. */
-  public static final String TAG_PUBLIC = "public"; //$NON-NLS-1$
-  /** The SYSTEM catalog etnry. */
-  public static final String TAG_SYSTEM = "system"; //$NON-NLS-1$
-  /** The URI catalog entry. */
-  public static final String TAG_URI = "uri"; //$NON-NLS-1$
-  /** The REWRITE_SYSTEM catalog entry. */
-  public static final String TAG_REWRITE_SYSTEM = "rewriteSystem"; //$NON-NLS-1$
-  /** The REWRITE_URI catalog entry. */
-  public static final String TAG_REWRITE_URI = "rewritePublic"; //$NON-NLS-1$
-  /** The DELEGATE_PUBLIC catalog entry. */
-  public static final String TAG_DELEGATE_PUBLIC = "delegatePublic"; //$NON-NLS-1$
-  /** The DELEGATE_SYSTEM catalog entry. */
-  public static final String TAG_DELEGATE_SYSTEM = "delegateSystem"; //$NON-NLS-1$
-  /** The DELEGATE_URI catalog entry. */
-  public static final String TAG_DELEGATE_URI = "delegateUri"; //$NON-NLS-1$
-  /** The NEXT_CATALOG catalog entry. */
-  public static final String TAG_NEXT_CATALOG = "nextCatalog"; //$NON-NLS-1$
-  /** Attributes */
-  /** Attribute id used in all catalog entries */
-  public static final String ATTR_ID = "id"; //$NON-NLS-1$
-  /** Attribute id base in all catalog entries */
-  public static final String ATTR_BASE = "xml:base"; //$NON-NLS-1$
-  /** Attribute id prefere in catalog entries: CATALOG, GROUP */
-  public static final String ATTR_PREFERE = "prefere"; //$NON-NLS-1$
-  /** Attribute used in catalog entries of type: PUBLIC */
-  public static final String ATTR_PUBLIC_ID = "publicId"; //$NON-NLS-1$
-  /**
-   * Attribute used in catalog entries of type: SYSTEM
-   */
-  public static final String ATTR_SYSTEM_ID = "systemId"; //$NON-NLS-1$
-  /**
-   * Attribute used in catalog entries of type: URI
-   */
-  public static final String ATTR_NAME = "name"; //$NON-NLS-1$
-  /**
-   * Attribute used in catalog entries of type: PUBLIC, URI
-   */
-  public static final String ATTR_URI = "uri"; //$NON-NLS-1$
-  /**
-   * Attribute used in catalog entries of type: REWRITE_SYSTEM, DELEGATE_SYSTEM
-   */
-  public static final String ATTR_SYSTEM_ID_START_STRING = "systemIdStartString"; //$NON-NLS-1$
-  /**
-   * Attribute used in catalog entries of type: REWRITE_SYSTEM, REWRITE_URI
-   */
-  public static final String ATTR_REWRITE_PREFIX = "rewritePrefix"; //$NON-NLS-1$
-  /**
-   * Attribute used in catalog entries of type: DELEGATE_PUBLIC
-   */
-  public static final String ATTR_PUBLIC_ID_START_STRING = "publicIdStartString"; //$NON-NLS-1$
-  /**
-   * Attribute used in catalog entries of type: DELEGATE_PUBLIC,
-   * DELEGATE_SYSTEM, DELEGATE_URI, NEXT_CATALOG
-   */
-  public static final String ATTR_CATALOG = "catalog"; //$NON-NLS-1$
-  /**
-   * Attribute used in catalog entries of type: REWRITE_URI, DELEGATE_URI
-   */
-  public static final String ATTR_URI_START_STRING = "uriStartString"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/XMLCatalogURIResolverExtension.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/XMLCatalogURIResolverExtension.java
deleted file mode 100644
index 0b4af07..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/XMLCatalogURIResolverExtension.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverExtension;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-
-/**
- * This class is used to inject the XMLCatalog resolution behaviour into the
- * Common Extensible URI Resolver. This class is referenced in the XML Catalog
- * plugin's plugin.xml file.
- */
-public class XMLCatalogURIResolverExtension implements URIResolverExtension
-{
-  public String resolve(IFile file, String baseLocation, String publicId, String systemId)
-  {
-    // if we have catalog in a project we may add it
-    // to the catalog manager first
-    ICatalog catalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
-    if (catalog == null)
-    {
-      Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_null_catalog);
-      return null;
-    }
-    String resolved = null;
-    if (systemId != null)
-    {
-      try
-      {
-        resolved = catalog.resolveSystem(systemId);
-        if (resolved == null)
-        {
-          resolved = catalog.resolveURI(systemId);
-        }
-      }
-      catch (MalformedURLException me)
-      {
-        Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_malformed_url);
-        resolved = null;
-      }
-      catch (IOException ie)
-      {
-        Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_io_exception);
-        resolved = null;
-      }
-    }
-    if (resolved == null)
-    {
-      if (publicId != null)
-      {
-        // CS : this is a temporary workaround for bug 96772
-        //
-        // For schemas we always use locations where available and only use
-        // namespace when no location is specified.  For XML entities (such as DOCTYPE) 
-        // default always utilize the public catalog entry.
-        //
-        // This lame test below roughly discriminate between schema and XML entities.
-        // TODO (bug 103243) remove this lame test once we move to the new URIResolver API
-        // since the new API is explicit about namespace and publicId
-        // 
-        if (!(systemId != null && systemId.endsWith(".xsd"))) //$NON-NLS-1$
-        {
-          try
-          {
-            resolved = catalog.resolvePublic(publicId, systemId);
-            if (resolved == null)
-            {
-              resolved = catalog.resolveURI(publicId);
-            }
-          }
-          catch (MalformedURLException me)
-          {
-            Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_malformed_url);
-            resolved = null;
-          }
-          catch (IOException ie)
-          {
-            Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_io_exception);
-            resolved = null;
-          }
-        }
-      }
-    }
-    return resolved;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalog.java
deleted file mode 100644
index 0637a3c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalog.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog.provisional;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-
-
-
-/**
- * A representation of the model object '<em><b>Catalog</b></em>'.
- * 
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * 
- */
-public interface ICatalog
-{
-    /**
-     * Returns catalog id string
-     * 
-     * @return catalog id string
-     */
-    public String getId();
-    
-    /**
-     * Sets catalog id string
-     * 
-     */
-    public void setId(String id);
-    
-    
-    public void setLocation(String location);
-    public String getLocation();
-    
-    /**
-     * Return the applicable PUBLIC or SYSTEM identifier.
-     * 
-     * <p>
-     * This method searches the Catalog and returns the system identifier
-     * specified for the given system or public identifiers. If no appropriate
-     * PUBLIC or SYSTEM entry is found in the Catalog, null is returned.
-     * </p>
-     * 
-     * @param publicId
-     *            The public identifier to locate in the catalog. Public
-     *            identifiers are normalized before comparison.
-     * @param systemId
-     *            The nominal system identifier for the entity in question (as
-     *            provided in the source document).
-     * 
-     * @throws MalformedURLException
-     *             The formal system identifier of a subordinate catalog cannot
-     *             be turned into a valid URL.
-     * @throws IOException
-     *             Error reading subordinate catalog file.
-     * 
-     * @return The system identifier to use. Note that the nominal system
-     *         identifier is not returned if a match is not found in the
-     *         catalog, instead null is returned to indicate that no match was
-     *         found.
-     */
-    public String resolvePublic(String publicId, String systemId)
-            throws MalformedURLException, IOException;
-
-    /**
-     * Return the applicable SYSTEM system identifier.
-     * 
-     * <p>
-     * If a SYSTEM entry exists in the Catalog for the system ID specified,
-     * return the mapped value.
-     * </p>
-     * 
-     * <p>
-     * On Windows-based operating systems, the comparison between the system
-     * identifier provided and the SYSTEM entries in the Catalog is
-     * case-insensitive.
-     * </p>
-     * 
-     * @param systemId
-     *            The system ID to locate in the catalog.
-     * 
-     * @return The resolved system identifier.
-     * 
-     * @throws MalformedURLException
-     *             The formal system identifier of a subordinate catalog cannot
-     *             be turned into a valid URL.
-     * @throws IOException
-     *             Error reading subordinate catalog file.
-     */
-    public String resolveSystem(String systemId) throws MalformedURLException,
-            IOException;
-
-    /**
-     * Return the applicable URI.
-     * 
-     * <p>
-     * If a URI entry exists in the Catalog for the URI specified, return the
-     * mapped value.
-     * </p>
-     * 
-     * <p>
-     * URI comparison is case sensitive.
-     * </p>
-     * 
-     * @param uri
-     *            The URI to locate in the catalog.
-     * 
-     * @return The resolved URI.
-     * 
-     * @throws MalformedURLException
-     *             The system identifier of a subordinate catalog cannot be
-     *             turned into a valid URL.
-     * @throws IOException
-     *             Error reading subordinate catalog file.
-     */
-    public String resolveURI(String uri) throws MalformedURLException,
-            IOException;
-
-    /**
-     * Adds catalog element to the collection of the catalog elements.
-     * 
-     * @param element -
-     *            catalog element
-     */
-    public void addCatalogElement(ICatalogElement element);
-
-    /**
-     * Removes catalog element from the collection of the catalog elements.
-     * 
-     * @param element -
-     *            catalog element
-     */
-    public void removeCatalogElement(ICatalogElement element);
-
-    /**
-     * Returns an array of catalog elements of type ICatalogElement.TYPE_ENTRY
-     * 
-     * @return an array of catalog elements
-     */
-    public ICatalogEntry[] getCatalogEntries();
-
-    /**
-     * Returns an array of catalog elements of type
-     * ICatalogElement.TYPE_DELEGATE
-     * 
-     * @return an array of catalog elements
-     */
-    public INextCatalog[] getNextCatalogs();
-
-    /**
-     * Returns new catalog element with the specified type. If the type is one
-     * of ELEMENT_TYPE, the result entry will have corresponding interface.
-     * 
-     * @return
-     */
-    public ICatalogElement createCatalogElement(int type);
-
-    /**
-     * Removes all the elements from this catalog.
-     * 
-     */
-    public void clear();
-    
-    //public void load() throws IOException;
-    
-    public void save() throws IOException;
-
-    /*
-     * Loads catalog from the specified location. Expecting OASIS XML Catalog
-     * format
-     * 
-     * @param location -
-     *            uri of the file where catalog will be saved
-
-     * @throws IOException -
-     *             problem loading file
-     * 
-     */
-    //public void load(InputStream inputStream) throws IOException;
-
-    /*
-     * Saves catalog to the specified location in OASIS XML Catalog format
-     * 
-     * @param location -
-     *            uri of the file where catalog will be saved
-
-     * @throws IOException -
-     *             problem saving file
-     * 
-     */
-    //public void save(OutputStream outputStream) throws IOException;
-
-    /**
-     * This method copies all catalog entries from source catalog to this one.
-     * 
-     * @param catalog -
-     *            source catalog
-     * @param includeNested -
-     *            a boolean flag indicating wether to include entries of the
-     *            same type from the nested catalogs
-     */
-    public void addEntriesFromCatalog(ICatalog catalog);
-
-    /**
-     * Adds a listener of the catalog events
-     * 
-     * @param listener -
-     *            listener of the catalog events
-     * @see ICatalogEvent
-     */
-    public void addListener(ICatalogListener listener);
-
-    /**
-     * Removes a listener of the catalog events
-     * 
-     * @param listener -
-     *            listener of the catalog events
-     * @see ICatalogEvent
-     */
-    public void removeListener(ICatalogListener listener);      
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogElement.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogElement.java
deleted file mode 100644
index 15055c3..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogElement.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog.provisional;
-
-
-/**
- * 
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * 
- */
-public interface ICatalogElement
-{
-    /** Types of the catalog entries */
-    /** The PUBLIC, URI or SYSTEM Catalog Entry. */
-    public static final int TYPE_ENTRY = 1;
-
-    /** The NEXT_CATALOG Catalog Entry type. */
-    public static final int TYPE_NEXT_CATALOG = 10;
-
-    /**
-     * Returns the value of the '<em><b>Type</b></em>' attribute.
-     * 
-     * @return the value of the '<em>Type</em>' attribute.
-     */
-    int getType();
-
-    /**
-     * Returns the value of the attribute with specified name.
-     * 
-     * @return the value of the attribute with specified name.
-     * @see #setAttributeValue(String)
-     */
-    String getAttributeValue(String name);
-
-    /**
-     * Sets the value of the named attribute.
-     * 
-     * @param name
-     *            the name of the attribute that will be set
-     * @param value
-     *            the new value of the named attribute.
-     * @see #getAttributeValue()
-     */
-    void setAttributeValue(String name, String value);
-
-    /**
-     * Returns an array of attribute names for any dynamic attributes that may exist
-     * 
-     * @return array of attribute names
-     * @see #getAttributeValue()
-     * @see #setAttributeValue(String)
-     */
-    String[] getAttributes();
-    
-    /**
-     * Returns element's id string
-     * 
-     * @return element's id string
-     */
-    public String getId();
-    
-    /**
-     * Sets element's id string
-     * 
-     */
-    public void setId(String id);
-    
-    public void setOwnerCatalog(ICatalog catalog);
-    
-    public ICatalog getOwnerCatalog();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java
deleted file mode 100644
index 271cbe2..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog.provisional;
-
-/**
- * 
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * 
- */
-public interface ICatalogEntry extends ICatalogElement
-{
-    /** The SYSTEM Catalog Entry type. */
-    public static final int ENTRY_TYPE_PUBLIC = 2;
-
-    /** The SYSTEM Catalog Entry type. */
-    public static final int ENTRY_TYPE_SYSTEM = 3;
-
-    /** The URI Catalog Entry type. */
-    public static final int ENTRY_TYPE_URI = 4;
-
-    /** Attribute name for Web address of catalog entry */
-    public static final String ATTR_WEB_URL = "webURL"; //$NON-NLS-1$
-
-    /**
-     * 
-     * @param entryType
-     */
-    public void setEntryType(int entryType);
-
-    /**
-     * 
-     * @return
-     */
-    public int getEntryType();
-
-    /**
-     * 
-     * @param key
-     */
-    public void setKey(String key);
-
-    /**
-     * 
-     * @return
-     */
-    public String getKey();
-
-    /**
-     * 
-     * @return
-     */
-    public String getURI();
-
-    /**
-     * 
-     * @param uri
-     */
-    public void setURI(String uri);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEvent.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEvent.java
deleted file mode 100644
index 7825768..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEvent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog.provisional;
-
-
-
-/**
- * 
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * 
- */
-public interface ICatalogEvent
-{
-    /** */
-    public static final int CHANGED = 0;
-
-    public static final int ELEMENT_ADDED = 1;
-
-    /** */
-    public static final int ELEMENT_REMOVED = 2;
-
-    /** */
-    public static final int ELEMENT_CHANGED = 3;
-
-    /**
-     * 
-     * @return
-     */
-    public int getEventType();
-
-    /**
-     * 
-     * @return
-     */
-    public ICatalog getCatalog();
-
-    /**
-     * 
-     * @return
-     */
-    public ICatalogElement getCatalogElement();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogListener.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogListener.java
deleted file mode 100644
index 7c3dc0d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog.provisional;
-
-import java.util.EventListener;
-
-
-/**
- * The clients of the catalog that want to listen to catalog changes should
- * implement this interface.
- * 
- * @see ICatalog, ICatalogEvent,
- * 
- */
-public interface ICatalogListener extends EventListener
-{
-    /**
-     * This method allows to react to catalog events
-     * 
-     * @param event -
-     *            an event that client should react to
-     */
-    public void catalogChanged(ICatalogEvent event);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/INextCatalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/INextCatalog.java
deleted file mode 100644
index 47c939c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/INextCatalog.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog.provisional;
-
-
-
-/**
- * 
- * A representation of the nextCatalog OASIS XML catalog element. Object of the
- * class that implements this interface would serve as a reference to the
- * catalog object.
- * 
- * @see ICatalog, ICatalogElement
- * 
- * This interface currently is used only by the catalog itself. Need to find if
- * there are any clients that need it.
- * 
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * 
- */
-public interface INextCatalog extends ICatalogElement
-{
-    /**
-     * Set location of the referenced catalog.
-     * 
-     * @param uri -
-     *            location uri of the referenced catalog
-     */
-    public void setCatalogLocation(String uri);
-
-    /**
-     * Get location uri of the referenced catalog.
-     * 
-     * @return location uri of the referenced catalog
-     */
-    public String getCatalogLocation();
-    
-    public ICatalog getReferencedCatalog();
-
-   
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAnyElement.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAnyElement.java
deleted file mode 100644
index 72a4702..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAnyElement.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-/**
- * CMAnyElement interface
- */
-public interface CMAnyElement extends CMContent {
-/**
- * getNamespaceURI method
- * @return java.lang.String
- */
-String getNamespaceURI();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAttributeDeclaration.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAttributeDeclaration.java
deleted file mode 100644
index c5f718f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAttributeDeclaration.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-import java.util.Enumeration;
-
-/**
- * AttributeDeclaration interface
- */
-public interface CMAttributeDeclaration extends CMNode {
-  public static final int OPTIONAL   = 1;
-  public static final int REQUIRED   = 2;
-  public static final int FIXED      = 3;
-  public static final int PROHIBITED = 4;
-/**
- * getAttrName method
- * @return java.lang.String
- */
-String getAttrName();
-/**
- * getAttrType method
- * @return CMDataType
- */
-CMDataType getAttrType();
-/**
- * getDefaultValue method
- * @return java.lang.String
- * @deprecated -- to be replaced in future with additional CMDataType methods (currently found on CMDataTypeHelper)
- */
-String getDefaultValue();
-/**
- * getEnumAttr method
- * @return java.util.Enumeration
- * @deprecated -- to be replaced in future with additional CMDataType methods (currently found on CMDataTypeHelper)
- */
-Enumeration getEnumAttr();
-/**
- * getUsage method
- * @return int
- */
-int getUsage();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMContent.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMContent.java
deleted file mode 100644
index 218b297..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMContent.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-public interface CMContent extends CMNode
-{
-/**
- * getMaxOccur method
- * @return int
- *
- * If -1, it's UNBOUNDED.
- */
-int getMaxOccur();
-/**
- * getMinOccur method
- * @return int
- *
- * If 0, it's OPTIONAL.
- * If 1, it's REQUIRED.
- */
-int getMinOccur();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDataType.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDataType.java
deleted file mode 100644
index 79d9f5f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDataType.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-/**
- * CMDataType
- */
-public interface CMDataType extends CMNode {
-    
-  // todo... at some point we should remove these names to
-  // avoid exposing implementation details via the interfaces
-  //
-	static final String CDATA = "CDATA"; //$NON-NLS-1$
-	static final String ID = "ID"; //$NON-NLS-1$
-	static final String IDREF = "IDREF"; //$NON-NLS-1$
-	static final String ENTITY = "ENTITY"; //$NON-NLS-1$
-	static final String ENTITIES = "ENTITIES"; //$NON-NLS-1$
-	static final String NOTATION = "NOTATION"; //$NON-NLS-1$
-	static final String NMTOKEN = "NMTOKEN"; //$NON-NLS-1$
-	static final String NMTOKENS = "NMTOKENS"; //$NON-NLS-1$
-	static final String NUMBER = "NUMBER"; //$NON-NLS-1$
-	static final String URI = "URI"; //$NON-NLS-1$
-	static final String ENUM = "ENUM"; //$NON-NLS-1$
-
-  static final int IMPLIED_VALUE_NONE             = 1;
-  static final int IMPLIED_VALUE_FIXED            = 2;
-  static final int IMPLIED_VALUE_DEFAULT          = 3;
-
-/**
- * getTypeName method
- * @return java.lang.String
- */
-String getDataTypeName();    
-
-/**
- * getImpliedValueKind method
- * @return int
- *
- * Returns one of :
- * IMPLIED_VALUE_NONE, IMPLIED_VALUE_FIXED, IMPLIED_VALUE_DEFAULT.
- */      
-
-int getImpliedValueKind();  
-
-/**
- * getTypeName method
- * @return java.lang.String  
- *
- * Returns the implied value or null if none exists.
- */
-String getImpliedValue();
-
-/**
- * getTypeName method
- * @return java.lang.String[]
- *
- */
-String[] getEnumeratedValues();
-
-/**
- * getTypeName method
- * @return java.lang.String
- *
- * This method returns a suitable default value that can be used when an instance of the data type is created.
- * This returns null of a suitable default is not available.
- */
-String generateInstanceValue();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocument.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocument.java
deleted file mode 100644
index 58d7a43..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocument.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-/**
- * CMDocument interface
- */
-public interface CMDocument extends CMNode {
-/**
- * getElements method
- * @return CMNamedNodeMap
- *
- * Returns CMNamedNodeMap of ElementDeclaration
- */
-CMNamedNodeMap getElements();
-/**
- * getEntities method
- * @return CMNamedNodeMap
- *
- * Returns CMNamedNodeMap of EntityDeclaration
- */
-CMNamedNodeMap getEntities();
-/**
- * getNamespace method
- * @return CMNamespace
- */
-CMNamespace getNamespace();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocumentation.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocumentation.java
deleted file mode 100644
index 88e4d8d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocumentation.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-/**
- * CMDocumentation interface
- */
-public interface CMDocumentation extends CMNode {        
-  public String getValue();
-  public String getLanguage();
-  public String getSource();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMElementDeclaration.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMElementDeclaration.java
deleted file mode 100644
index 2c48077..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMElementDeclaration.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-/**
- * CMElementDeclaration interface
- */
-public interface CMElementDeclaration extends CMContent {
-  
-	public static final int ANY = 0;
-	public static final int EMPTY = 1;
-	public static final int ELEMENT = 2;
-	public static final int MIXED = 3;
-	public static final int PCDATA = 4;
-	public static final int CDATA = 5; // todo... clarify this one
-/**
- * getAttributes method
- * @return CMNamedNodeMap
- *
- * Returns CMNamedNodeMap of AttributeDeclaration
- */
-CMNamedNodeMap getAttributes();
-/**
- * getCMContent method
- * @return CMContent
- *
- * Returns the root node of this element's content model.
- * This can be an CMElementDeclaration or a CMGroup
- */
-CMContent getContent();
-/**
- * getContentType method
- * @return int
- *
- * Returns one of :
- * ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA.
- */
-public int getContentType();
-/**
- * getElementName method
- * @return java.lang.String
- */
-String getElementName();
-
-/**
- * getDataType method
- * @return java.lang.String
- */
-CMDataType getDataType();
-
-/**
- * getLocalElements method
- * @return CMNamedNodeMap
- *
- * Returns a list of locally defined elements.
- */
-CMNamedNodeMap getLocalElements();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMEntityDeclaration.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMEntityDeclaration.java
deleted file mode 100644
index 99b5434..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMEntityDeclaration.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-/**
- * CMEntityDeclaration interface
- */
-public interface CMEntityDeclaration extends CMNode {
-  
-/**
- * getName method
- * @return java.lang.String
- */
-String getName();
-/**
- * getValue method
- * @return java.lang.String
- */
-String getValue();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMGroup.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMGroup.java
deleted file mode 100644
index ce01ca7..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMGroup.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-/**
- * CMGroup interface
- */
-public interface CMGroup extends CMContent {
-  
-	static final int ALL = 3;
-	static final int CHOICE = 2;
-	static final int SEQUENCE = 1;
-/**
- * getChildNodes method
- * @return CMNodeList
- *
- * Returns child CMNodeList, which includes ElementDefinition or CMElement.
- */
-CMNodeList getChildNodes();
-
-/**
- * getOperation method
- * @return int
- *
- * Returns one of :
- * ALONE (a), SEQUENCE (a,b), CHOICE (a|b), ALL (a&b).
- */
-int getOperator();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamedNodeMap.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamedNodeMap.java
deleted file mode 100644
index 2c79b81..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamedNodeMap.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-import java.util.Iterator;
-/**
- * NamedCMNodeMap
- */
-public interface CMNamedNodeMap {
-/**
- * getLength method
- * @return int
- */
-int getLength();
-/**
- * getNamedItem method
- * @return CMNode
- * @param name java.lang.String
- */
-CMNode getNamedItem(String name);
-/**
- * item method
- * @return CMNode
- * @param index int
- */
-CMNode item(int index);
-
-/**
- *
- */
-Iterator iterator();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamespace.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamespace.java
deleted file mode 100644
index 100bcbc..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamespace.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-/**
- * CMNamespace interface
- */
-public interface CMNamespace extends CMNode {
-  
-/**
- * getPrefix method
- * @return java.lang.String
- */
-String getPrefix();
-/**
- * getURI method
- * @return java.lang.String
- */
-String getURI();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNode.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNode.java
deleted file mode 100644
index 8bd95e8..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNode.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-/**
- * CMNode interface
- */
-public interface CMNode {        
-  
-  static final int ANY_ELEMENT           = 1;
-	static final int ATTRIBUTE_DECLARATION = 2;
-	static final int DATA_TYPE             = 3;
-	static final int DOCUMENT              = 4;
-	static final int ELEMENT_DECLARATION   = 5;
-	static final int ENTITY_DECLARATION    = 6;
-	static final int GROUP                 = 7;
-  static final int NAME_SPACE            = 8;
-  static final int DOCUMENTATION         = 9;
-/**
- * getNodeName method
- * @return java.lang.String
- */
-String getNodeName();
-/**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- *
- */
-int getNodeType();
-
-/**
- * supports method
- * @return boolean
- *
- * Returns true if the CMNode supports a specified property
- *
- */
-boolean supports(String propertyName);
-
-/**
- * getProperty method
- * @return java.lang.Object
- *
- * Returns the object property desciped by the propertyName
- *
- */
-Object getProperty(String propertyName); //todo throw unsupported property exception
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNodeList.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNodeList.java
deleted file mode 100644
index 94adbf8..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNodeList.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-/**
- * CMNodeList interface
- */
-public interface CMNodeList {
-  
-/**
- * getLength method
- * @return int
- */
-int getLength();
-/**
- * item method
- * @return CMNode
- * @param index int
- */
-CMNode item(int index);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/ContentModelManager.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/ContentModelManager.java
deleted file mode 100644
index 602b160..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/ContentModelManager.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.xml.core.internal.contentmodel.factory.CMDocumentFactory;
-import org.eclipse.wst.xml.core.internal.contentmodel.factory.CMDocumentFactoryRegistry;
-import org.eclipse.wst.xml.core.internal.contentmodel.factory.CMDocumentFactoryRegistryReader;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation.AnnotationFileRegistry;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation.AnnotationFileRegistryReader;
-
-
-/**
- * ContentModelManager class
- */
-public class ContentModelManager extends Plugin {
-	// private static InferredGrammarFactory inferredGrammarFactory;
-	private CMDocumentFactoryRegistry cmDocumentFactoryRegistry;
-	private AnnotationFileRegistry annotationFileRegistry;
-
-	private static ContentModelManager instance;
-
-	public ContentModelManager() {
-		super();
-	}
-
-	public static ContentModelManager getInstance() {
-		if (instance == null) {
-			instance = new ContentModelManager();
-		}
-		return instance;
-	}
-
-	public CMDocument createCMDocument(String uri, String resourceType) {
-		if (resourceType == null && uri != null) {
-			int index = uri.lastIndexOf("."); //$NON-NLS-1$
-			resourceType = uri.substring(index + 1);
-		}
-
-		if (resourceType != null) {
-			resourceType = resourceType.toLowerCase();
-		}
-		CMDocumentFactory factory = getCMDocumentFactoryRegistry().getFactory(resourceType);
-		return factory != null ? factory.createCMDocument(uri) : null;
-	}
-
-
-	private CMDocumentFactoryRegistry getCMDocumentFactoryRegistry() {
-		if (cmDocumentFactoryRegistry == null) {
-			cmDocumentFactoryRegistry = new CMDocumentFactoryRegistry();
-			new CMDocumentFactoryRegistryReader(cmDocumentFactoryRegistry).readRegistry();
-		}
-		return cmDocumentFactoryRegistry;
-	}
-
-
-	public List getAnnotationFilesInfos(String publicId) {
-		return getAnnotationFileRegistry().getAnnotationFilesInfos(publicId);
-	}
-
-	private AnnotationFileRegistry getAnnotationFileRegistry() {
-		if (annotationFileRegistry == null) {
-			annotationFileRegistry = new AnnotationFileRegistry();
-			new AnnotationFileRegistryReader(annotationFileRegistry).readRegistry();
-		}
-		return annotationFileRegistry;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/Annotation.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/Annotation.java
deleted file mode 100644
index e0a3b39..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/Annotation.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.annotation;
-
-import java.util.Hashtable;
-import java.util.List;
-         
-/**
- * 
- */
-public class Annotation
-{       
-  protected Hashtable hashtable = new Hashtable();                     
-
-  public Annotation()
-  {
-  }
-
-  public void setSpec(String spec)
-  {
-    hashtable.put("spec", spec); //$NON-NLS-1$
-  }     
-
-  public String getSpec()
-  {
-    return (String)hashtable.get("spec"); //$NON-NLS-1$
-  }
-      
-  public void setProperty(String name, String value)
-  {                             
-    hashtable.put(name, value);
-  }
-
-  public String getProperty(String propertyName)
-  {     
-    return (String)hashtable.get(propertyName);
-  }    
-
-  public List getAttributeList()
-  {
-    return null; // todo
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/AnnotationMap.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/AnnotationMap.java
deleted file mode 100644
index 4b93035..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/AnnotationMap.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.annotation;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation.AnnotationFileInfo;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation.AnnotationFileParser;
-
-
-/**
- * AnnotationMap
- */
-public class AnnotationMap {
-	protected List list = new Vector();
-	protected Hashtable hashtable = new Hashtable();
-	protected boolean isCaseSensitive = true;
-
-	public AnnotationMap() {
-	}
-
-	public void setCaseSensitive(boolean isCaseSensitive) {
-		this.isCaseSensitive = isCaseSensitive;
-	}
-
-	public void addAnnotation(Annotation annotation) {
-		String spec = annotation.getSpec();
-		if (spec != null) {
-			list.add(annotation);
-			StringTokenizer st = new StringTokenizer(spec, "[]|\t\n\r\f "); //$NON-NLS-1$
-			while (st.hasMoreTokens()) {
-				String cmNodeSpec = st.nextToken();
-				addAnnotationForCMNodeSpec(cmNodeSpec, annotation);
-			}
-		}
-	}
-
-	protected void addAnnotationForCMNodeSpec(String cmNodeSpec, Annotation annotation) {
-		String key = isCaseSensitive ? cmNodeSpec : cmNodeSpec.toLowerCase();
-		List list = (List) hashtable.get(key);
-		if (list == null) {
-			list = new Vector();
-
-			hashtable.put(key, list);
-		}
-		list.add(annotation);
-	}
-
-	public String getProperty(String cmNodeSpec, String propertyName) {
-		String result = null;
-		String key = isCaseSensitive ? cmNodeSpec : cmNodeSpec.toLowerCase();
-		List annotationList = (List) hashtable.get(key);
-		if (annotationList != null) {
-			for (Iterator i = annotationList.iterator(); i.hasNext();) {
-				Annotation annotation = (Annotation) i.next();
-				result = annotation.getProperty(propertyName);
-				if (result != null) {
-					break;
-				}
-			}
-		}
-		return result;
-	}
-
-	public String getProperty(CMNode cmNode, String propertyName) {
-		String result = null;
-		String cmNodeSpec = (String) cmNode.getProperty("spec"); //$NON-NLS-1$
-		if (cmNodeSpec == null) {
-			cmNodeSpec = cmNode.getNodeName();
-		}
-		if (cmNodeSpec != null) {
-			result = getProperty(cmNodeSpec, propertyName);
-		}
-		return result;
-	}
-
-	public List getAnnotations() {
-		return list;
-	}
-
-	public void load(String uri, String bundleId) throws Exception {
-		AnnotationFileParser parser = new AnnotationFileParser();
-		AnnotationFileInfo fileInfo = new AnnotationFileInfo(uri, bundleId);
-		parser.parse(this, fileInfo);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAnyElementImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAnyElementImpl.java
deleted file mode 100644
index 8300a90..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAnyElementImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-
-
-public class CMAnyElementImpl extends CMContentImpl implements CMAnyElement
-{
-  protected String namespaceURI;  
-
-  public CMAnyElementImpl(String namespaceURI)
-  {
-    this.namespaceURI = namespaceURI;
-    minOccur = -1;
-  }             
-
-  public static String computeNodeName(String uri)
-  {
-    return uri != null ? ("any#" + uri) : "any"; //$NON-NLS-1$ //$NON-NLS-2$
-  }
-
-  // implements CMNode
-  //
-  public String getNodeName()
-  {
-    return computeNodeName(namespaceURI);
-  }
- 
-  public int getNodeType()
-  {
-    return ANY_ELEMENT;
-  } 
-
-  // implements CMAnyElement
-  //
-  public String getNamespaceURI()
-  {
-    return namespaceURI;
-  }                     
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAttributeDeclarationImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAttributeDeclarationImpl.java
deleted file mode 100644
index f0df4fa..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAttributeDeclarationImpl.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.basic;
-
-import java.util.Enumeration;
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-public class CMAttributeDeclarationImpl extends CMNodeImpl implements CMAttributeDeclaration
-{
-  protected CMDataType dataType;
-  protected String nodeName;    
-  protected int usage;  
-  protected CMDocument cmDocument;
-  protected boolean prefixQualification;
-  protected List xsiTypes;
-                
-  public CMAttributeDeclarationImpl(String nodeName, int usage)
-  {
-    this(nodeName, usage, null);
-  }     
-
-  public CMAttributeDeclarationImpl(String nodeName, int usage, CMDataType dataType)
-  {        
-    this.nodeName = nodeName;
-    this.usage = usage;
-    this.dataType = dataType; 
-  }    
-
-  public int getNodeType()
-  {
-    return CMNode.ATTRIBUTE_DECLARATION;
-  }
-
-  public Object getProperty(String propertyName)
-  {
-    Object result = null;   
-    if (propertyName.equals("CMDocument")) //$NON-NLS-1$
-    {
-      result = cmDocument;
-    } 
-    else if (propertyName.equals("XSITypes")) //$NON-NLS-1$
-    {                                      
-      result = xsiTypes;
-    }
-    else if (propertyName.equals("http://org.eclipse.wst/cm/properties/nsPrefixQualification")) //$NON-NLS-1$
-    {
-      result = prefixQualification ? "qualified" : "unqualified"; //$NON-NLS-1$ //$NON-NLS-2$
-    }  
-    else
-    {
-      result = super.getProperty(propertyName);
-    }
-    return result;
-  }
-
-  public void setPrefixQualification(boolean qualified)
-  {
-    prefixQualification = qualified;
-  }              
-
-  public void setXSITypes(List list)
-  {
-    xsiTypes = list;
-  }
-     
-  public void setCMDocument(CMDocument cmDocument)
-  {
-    this.cmDocument = cmDocument;
-  }
-
-  public String getNodeName()
-  {
-    return nodeName;
-  }
-
-  public String getAttrName()
-  {
-    return nodeName;
-  }
-
-  public void setAttrType(CMDataType dataType)
-  {
-    this.dataType = dataType;
-  }
-
-  public CMDataType getAttrType()
-  {
-    return dataType;
-  }
-
-  public int getUsage()
-  {
-    return usage;
-  }
-           
-  /** @deprecated */
-  public String getDefaultValue()
-  {
-    return ""; //$NON-NLS-1$
-  }                 
-
-  /** @deprecated */
-  public Enumeration getEnumAttr()
-  {
-    return null;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMContentImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMContentImpl.java
deleted file mode 100644
index 2357eec..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMContentImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-
-
-public abstract class CMContentImpl extends CMNodeImpl implements CMContent
-{
-  protected int minOccur = 0;
-  protected int maxOccur = -1;       
-                
-  // implements CMContent
-  //
-  public int getMaxOccur()
-  {
-    return maxOccur;
-  }          
- 
-  public int getMinOccur()
-  {
-    return minOccur;
-  }  
-     
-  // implementation specific
-  //
-  public void setMaxOccur(int n)
-  {
-    maxOccur = n;
-  }          
- 
-  public void setMinOccur(int n)
-  {
-    minOccur = n;
-  }                      
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDataTypeImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDataTypeImpl.java
deleted file mode 100644
index a004626..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDataTypeImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public class CMDataTypeImpl extends CMNodeImpl implements CMDataType
-{
-  protected String dataTypeName;
-  protected String[] enumeratedValues;     
-  protected String instanceValue;
-
-  public CMDataTypeImpl(String dataTypeName, String instanceValue)
-  {
-    this.dataTypeName = dataTypeName;
-    this.instanceValue = instanceValue;
-    this.enumeratedValues = new String[0];
-  }
-
-  public CMDataTypeImpl(String dataTypeName, String[] enumeratedValues)
-  {
-    this.dataTypeName = dataTypeName;
-    this.enumeratedValues = enumeratedValues;   
-    this.instanceValue = enumeratedValues[0];
-  }
-
-
-  public int getNodeType()
-  {
-    return CMNode.DATA_TYPE;
-  }
-
-  public String getNodeName()
-  {
-    return getDataTypeName();
-  }
-
-  public String getDataTypeName()
-  {
-    return dataTypeName;
-  }
-
-  public int getImpliedValueKind()
-  {
-    return IMPLIED_VALUE_NONE;
-  }
-
-  public String getImpliedValue()
-  {
-    return null;
-  }
-
-  public String[] getEnumeratedValues()
-  {
-    return enumeratedValues;
-  }
-
-  public String generateInstanceValue()
-  {
-    return instanceValue;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDocumentImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDocumentImpl.java
deleted file mode 100644
index 7c76a8e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDocumentImpl.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-
-
-public class CMDocumentImpl extends CMNodeImpl implements CMDocument
-{
-  protected String targetNamespace;
-  protected CMNamedNodeMapImpl elements = new CMNamedNodeMapImpl();
-  protected CMNamedNodeMapImpl localElementPool;
-  protected CMNamedNodeMapImpl anyElements;
-
-  public CMDocumentImpl(String targetNamespace)
-  {
-    this.targetNamespace = targetNamespace;
-  }
-
-  public int getNodeType()
-  {
-    return DOCUMENT;
-  }
-
-  public String getNodeName()
-  {
-    return ""; //$NON-NLS-1$
-  }
- 
-  public Object getProperty(String propertyName)
-  {
-    Object result = null;
-    if (propertyName.equals("http://org.eclipse.wst/cm/properties/targetNamespaceURI")) //$NON-NLS-1$
-    {
-      result = targetNamespace;
-    }                
-    else
-    {
-      result = super.getProperty(propertyName);
-    }
-    return result;
-  }    
-
-  public CMNamedNodeMap getElements()
-  {
-    return elements;
-  }
-
-  public CMNamedNodeMapImpl getAnyElements()
-  { 
-    if (anyElements == null)
-    {
-      anyElements = new CMNamedNodeMapImpl();
-    }
-    return anyElements;
-  }
-  
-  public CMNamedNodeMapImpl getLocalElementPool()
-  { 
-    if (localElementPool == null)
-    {
-      localElementPool = new CMNamedNodeMapImpl();
-    }                 
-    return localElementPool;
-  }
-
-  public CMNamedNodeMap getEntities()
-  {
-    return new CMNamedNodeMapImpl();
-  }
-
-  public CMNamespace getNamespace()
-  {
-    return null;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMElementDeclarationImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMElementDeclarationImpl.java
deleted file mode 100644
index 1879b9f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMElementDeclarationImpl.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-
-public class CMElementDeclarationImpl extends CMContentImpl implements CMElementDeclaration
-{
-  protected String name;          
-  protected CMDocument cmDocument;
-  protected CMNamedNodeMapImpl attributeMap = new CMNamedNodeMapImpl();
-  protected CMNamedNodeMapImpl localElementMap = new CMNamedNodeMapImpl();
-  protected CMContent content;
-  protected CMDataType dataType;
-  protected boolean isLocal;
-
-  public CMElementDeclarationImpl(CMDocument cmDocument, String name)
-  {                              
-    this.cmDocument = cmDocument;
-    this.name = name;
-  }     
-
-  // implements CMNode
-  //
-  public String getNodeName()
-  {
-    return name;
-  }
- 
-  public int getNodeType()
-  {
-    return ELEMENT_DECLARATION;
-  }
-
-  public Object getProperty(String propertyName)
-  { 
-    Object result = null;               
-    if (propertyName.equals("http://org.eclipse.wst/cm/properties/nsPrefixQualification")) //$NON-NLS-1$
-    {
-      result = isLocal ? "unqualified" : "qualified"; //$NON-NLS-1$ //$NON-NLS-2$
-    }    
-    else if (propertyName.equals("CMDocument")) //$NON-NLS-1$
-    {
-      result = cmDocument;       
-    }    
-    else
-    {
-      result = super.getProperty(propertyName);
-    }
-    return result;
-  }
-                
-  // implements CMElementDeclaration
-  //
-  public CMNamedNodeMap getAttributes()
-  {
-    return attributeMap;
-  }                     
-
-  public CMContent getContent()
-  {
-    return content;
-  }
-
-  public int getContentType()
-  {
-    return MIXED;
-  }            
-
-  public String getElementName()
-  {
-    return name;
-  }
-
-  public CMDataType getDataType()
-  { 
-    return dataType;
-  }
-
-  public CMNamedNodeMap getLocalElements()
-  { 
-    return localElementMap;
-  } 
-    
-  //
-  //
-  public void setContent(CMContent cmContent)
-  {
-    content = cmContent;
-  }                 
-
-  public void setDataType(CMDataType cmDataType)
-  {
-    dataType = cmDataType;
-  }
-
-  public CMNamedNodeMapImpl getAttributeMap()
-  {
-    return attributeMap;
-  }
-
-  public void setLocal(boolean isLocal)
-  {
-    this.isLocal = isLocal;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMEntityDeclarationImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMEntityDeclarationImpl.java
deleted file mode 100644
index a5d97fa..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMEntityDeclarationImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMEntityDeclaration;
-
-public class CMEntityDeclarationImpl extends CMNodeImpl implements CMEntityDeclaration
-{
-  protected String name;                         
-  protected String value;
-
-  public CMEntityDeclarationImpl(String name, String value)
-  {
-    this.name = name;
-    this.value = value;
-  }
-
-  public int getNodeType()
-  {
-    return ENTITY_DECLARATION;
-  }
-
-  public String getNodeName()
-  {
-    return name;
-  }
- 
-  public String getName()
-  {
-    return name;
-  }
-
-  public String getValue()
-  {
-    return value;
-  }
-}   
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMGroupImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMGroupImpl.java
deleted file mode 100644
index 59c4ece..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMGroupImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-public class CMGroupImpl extends CMContentImpl implements CMGroup
-{
-  protected CMNodeList nodeList;                         
-  protected int operator;  
-
-  public CMGroupImpl(CMNodeList nodeList, int operator)
-  {
-    this.nodeList = nodeList;
-    this.operator = operator;
-  }
-
-  public int getNodeType()
-  {
-    return GROUP;
-  }
- 
-  public CMNodeList getChildNodes()
-  {
-    return nodeList;
-  }
-
-  public int getOperator()
-  {
-    return operator;
-  } 
-}   
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNamedNodeMapImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNamedNodeMapImpl.java
deleted file mode 100644
index fee63d2..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNamedNodeMapImpl.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.basic;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-public class CMNamedNodeMapImpl implements CMNamedNodeMap 
-{
-  public static CMNamedNodeMapImpl EMPTY_NAMED_NODE_MAP = new CMNamedNodeMapImpl();
-  protected Hashtable table = new Hashtable();
-
-  /**
-   * CMNamedNodeMapImpl constructor comment.
-   */
-  public CMNamedNodeMapImpl()
-  {
-  	super();
-  }
-
-  public CMNamedNodeMapImpl(CMNamedNodeMap initialContentsMap) {
-		super();
-		if (initialContentsMap != null) {
-			int length = initialContentsMap.getLength();
-			for (int j = 0; j < length; j++) {
-				put(initialContentsMap.item(j));
-			}
-		}
-	}
-  /**
-   * getLength method
-   * @return int
-   */
-  public int getLength()
-  {
-  	return table.size();
-  }
-
-  /**
-   * getNamedItem method
-   * @return CMNode
-   * @param name java.lang.String
-   */
-  public CMNode getNamedItem(String name)
-  {
-  	return (CMNode)table.get(name);
-  }
-
-  /**
-   * item method
-   * @return CMNode
-   * @param index int
-   */
-  public CMNode item(int index)
-  {
-    CMNode result = null;
-    int size = table.size();
-    if (index < size)
-    {
-      Enumeration values = table.elements();
-      for(int i = 0; i <= index; i++)
-      {
-        result = (CMNode)values.nextElement();
-      }
-    }
-    return result;
-  }
-  
-  public Hashtable getHashtable()
-  {
-          return table;
-  }
-  
-  public Iterator iterator()
-  {
-          return table.values().iterator();
-  }        
-  
-  public void put(CMNode cmNode)
-  {
-    table.put(cmNode.getNodeName(), cmNode);
-  }
-}
-  
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeImpl.java
deleted file mode 100644
index a12e2ac..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-public abstract class CMNodeImpl implements CMNode
-{            
-  protected boolean isInferred = false;
-   
-  public String getNodeName()
-  {
-    return ""; //$NON-NLS-1$
-  }
- 
-  public boolean supports(String propertyName)
-  {
-    return false;
-  } 
-
-  public Object getProperty(String propertyName)
-  {              
-    Object result = null;
-    if ("isInferred".equals(propertyName)) //$NON-NLS-1$
-    {
-      result = isInferred ? Boolean.TRUE : Boolean.FALSE;
-    }
-    return result;
-  }    
-
-  public void setInferred(boolean isInferred)
-  {
-    this.isInferred = isInferred;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeListImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeListImpl.java
deleted file mode 100644
index 6bcba38..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeListImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.basic;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-
-public class CMNodeListImpl implements CMNodeList 
-{
-  public static CMNodeListImpl EMPTY_NODE_LIST = new CMNodeListImpl(Collections.EMPTY_LIST);
-  protected List list;
-
-  public CMNodeListImpl()
-  {
-    this(new Vector());
-  }
-
-  public CMNodeListImpl(List list)
-  {
-    this.list = list;
-  }
-
-  /**
-   * getLength method
-   * @return int
-   */
-  public int getLength()
-  {
-    return list.size();
-  }
-  /**
-   * item method
-   * @return CMNode
-   * @param index int
-   */
-  public CMNode item(int index)
-  {
-    return (CMNode)list.get(index);
-  }
-  
-  public List getList()
-  {
-    return list;
-  }
-  
-  public Iterator iterator()
-  {
-    return list.iterator();
-  }
-  
-  public boolean contains(CMNode cmNode)
-  {
-    return list.contains(cmNode);
-  } 
-  
-  public void add(CMNode cmNode)
-  {
-    list.add(cmNode);
-  }  
-}
-
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactory.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactory.java
deleted file mode 100644
index a84be95..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.factory;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-// this interface is used to build a grammar document given a local file name
-//
-public interface CMDocumentFactory
-{   
-  public CMDocument createCMDocument(String uri);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryDescriptor.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryDescriptor.java
deleted file mode 100644
index c737b92..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryDescriptor.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.factory;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.xml.core.internal.Logger;
-
-
-public class CMDocumentFactoryDescriptor
-{
-  private IConfigurationElement fElement;
-  private CMDocumentFactory factory;
-
-  public CMDocumentFactoryDescriptor(IConfigurationElement element)
-  {
-    this.fElement = element;
-  }
-
-  public CMDocumentFactory getFactory()
-  {
-    if (factory == null)
-    {
-      try
-      {
-        factory = (CMDocumentFactory) fElement.createExecutableExtension("class"); //$NON-NLS-1$
-      }
-      catch (Exception e)
-      {
-        Logger.logException("Exception loading CMDocumentFactory",e); //$NON-NLS-1$
-      }
-    }
-    return factory;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistry.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistry.java
deleted file mode 100644
index 9f403b9..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistry.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.factory;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-
-/**
- * 
- * 
- */
-public class CMDocumentFactoryRegistry 
-{
-	protected static CMDocumentFactoryRegistry instance;
-
-  private static String DEFAULT_RESOURCE_TYPE = "*"; //$NON-NLS-1$
-
-	protected Map resourceTypeMap = new HashMap();
-
-	protected Vector documentBuilderList = new Vector();
-
-	public CMDocumentFactoryRegistry() {
-	}
-
-	public void putFactory(String resourceType, CMDocumentFactoryDescriptor factoryDescriptor) {
-		resourceTypeMap.put(resourceType, factoryDescriptor);
-	}
-
-	public CMDocumentFactory getFactory(String resourceType) {
-		CMDocumentFactoryDescriptor factoryDescriptor = null;
-		if (resourceType != null) {
-			factoryDescriptor = (CMDocumentFactoryDescriptor) resourceTypeMap.get(resourceType);
-		}
-		if (factoryDescriptor == null) {
-			// (dmw) issue: a default type of '*' means what? registered as
-			// '*' is the way this works now. is that the intent? Or should it
-			// mean registered as any other type?
-			factoryDescriptor = (CMDocumentFactoryDescriptor) resourceTypeMap.get(DEFAULT_RESOURCE_TYPE);
-		}
-		return factoryDescriptor != null ? factoryDescriptor.getFactory() : null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistryReader.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistryReader.java
deleted file mode 100644
index 6c8b193..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistryReader.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.factory;
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.Logger;
-
-
-
-
-public class CMDocumentFactoryRegistryReader
-{
-  protected static final String EXTENSION_POINT_ID = "documentFactories"; //$NON-NLS-1$
-  protected static final String TAG_NAME = "factory"; //$NON-NLS-1$
-  protected static final String ATT_CLASS = "class"; //$NON-NLS-1$
-  protected static final String ATT_TYPE = "type";   //$NON-NLS-1$
-  protected String pluginId, extensionPointId;
-  
-  protected CMDocumentFactoryRegistry registry;
-  
-  public CMDocumentFactoryRegistryReader(CMDocumentFactoryRegistry registry)
-  {
-  	this.registry = registry;
-  }
-
-  public void readRegistry()
-  {
-    String bundleid = "org.eclipse.wst.xml.core"; //$NON-NLS-1$
-    IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(bundleid, EXTENSION_POINT_ID);
-    if (point != null)
-    {
-      IConfigurationElement[] elements = point.getConfigurationElements();
-      for (int i = 0; i < elements.length; i++)
-      {
-        readElement(elements[i]);
-      }
-    }
-  }
-
-  protected void readElement(IConfigurationElement element)
-  {
-    if (element.getName().equals(TAG_NAME))
-    {
-      String factoryClass = element.getAttribute(ATT_CLASS);
-      String filenameExtensions = element.getAttribute(ATT_TYPE);
-      if (factoryClass != null && filenameExtensions != null)
-      {
-        try
-        {
-          CMDocumentFactoryDescriptor descriptor = new CMDocumentFactoryDescriptor(element);
-          for (StringTokenizer st = new StringTokenizer(filenameExtensions, ","); st.hasMoreTokens(); ) //$NON-NLS-1$
-          {
-          	String token = st.nextToken().trim();
-			registry.putFactory(token, descriptor);	
-          }         
-        }
-        catch (Exception e)
-        {
-			Logger.logException(e);
-        }
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileInfo.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileInfo.java
deleted file mode 100644
index a9a372f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileInfo.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation;
-
-/**
- * Contains information about annotation files
- */
-public class AnnotationFileInfo {
-	private String fAnnotationFileLocation;
-	private String fBundleId;
-
-	public AnnotationFileInfo(String annotationFileLocation, String bundleId) {
-		fAnnotationFileLocation = annotationFileLocation;
-		fBundleId = bundleId;
-	}
-
-	/**
-	 * Get the location of the annotation file as originally specified.
-	 * 
-	 * @return String
-	 */
-	public String getAnnotationFileLocation() {
-		return fAnnotationFileLocation;
-	}
-
-	/**
-	 * Get the bundle id where the annotation file is located.
-	 * 
-	 * @return String
-	 */
-	public String getBundleId() {
-		return fBundleId;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileParser.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileParser.java
deleted file mode 100644
index 641915d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileParser.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.Annotation;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.AnnotationMap;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-
-/**
- * 
- */
-public class AnnotationFileParser {
-	public static final String TAG_ID_ANNOTATIONS = "abstractGrammarAnnotations"; //$NON-NLS-1$
-	public static final String TAG_ID_ANNOTATION = "annotation"; //$NON-NLS-1$
-	public static final String TAG_ID_PROPERTY = "property"; //$NON-NLS-1$
-
-	/**
-	 * This method is called to parse an annotation file and store the
-	 * contents into an annotationMap
-	 */
-	private void parse(AnnotationMap annotationMap, InputStream input, AnnotationFileInfo fileInfo) throws Exception {
-		// move to Xerces-2.... add 'contextClassLoader' stuff
-		ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader();
-		try {
-			SAXParserFactory factory = SAXParserFactory.newInstance();
-			factory.setNamespaceAware(true);
-			SAXParser parser = factory.newSAXParser();
-			parser.parse(new InputSource(input), new AnnotationMapContentHandler(annotationMap, fileInfo));
-		}
-		finally {
-			Thread.currentThread().setContextClassLoader(prevClassLoader);
-		}
-	}
-
-	/**
-	 * This method is called to parse an annotation file and store the
-	 * contents into an annotationMap
-	 */
-	public void parse(AnnotationMap map, AnnotationFileInfo fileInfo) throws Exception {
-		InputStream inputStream = null;
-		try {
-			URL url = Platform.find(Platform.getBundle(fileInfo.getBundleId()), Path.fromOSString(fileInfo.getAnnotationFileLocation()));
-			if (url != null) {
-				inputStream = url.openStream();
-				parse(map, inputStream, fileInfo);
-			}
-		}
-		catch (Exception e) {
-			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-			throw (e);
-		}
-		finally {
-			try {
-				if (inputStream != null) {
-					inputStream.close();
-				}
-			}
-			catch (IOException e) {
-			}
-		}
-	}
-
-	protected class AnnotationMapContentHandler extends DefaultHandler {
-		private AnnotationMap annotationMap;
-		private Annotation currentAnnotation;
-		private String currentPropertyName;
-		private StringBuffer propertyValueBuffer;
-		private ResourceBundle resourceBundle;
-		private AnnotationFileInfo fFileInfo;
-
-		public AnnotationMapContentHandler(AnnotationMap annotationMap, AnnotationFileInfo fileInfo) {
-			this.annotationMap = annotationMap;
-			this.fFileInfo = fileInfo;
-		}
-
-		private URL generatePropertiesFileURL(AnnotationFileInfo fileInfo, String propertiesLocation) {
-			URL propertiesURL = null;
-
-			// prepend $nl$ variable to location
-			IPath annotationPath = Path.fromOSString("$nl$/" + fileInfo.getAnnotationFileLocation()); //$NON-NLS-1$
-			// remove the annotation.xml file
-			IPath annotationFolder = annotationPath.removeLastSegments(1);
-			// append location of propertiles file
-			IPath propertiesFile = annotationFolder.append(propertiesLocation);
-			// append .properties extension if needed
-			if (propertiesFile.getFileExtension() == null)
-				propertiesFile = propertiesFile.addFileExtension("properties"); //$NON-NLS-1$
-			// create a URL out of the properties file location
-			propertiesURL = Platform.find(Platform.getBundle(fileInfo.getBundleId()), propertiesFile);
-			return propertiesURL;
-		}
-
-		public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
-			propertyValueBuffer = new StringBuffer();
-			if (localName.equals(TAG_ID_ANNOTATIONS)) {
-				int attributesLength = attributes.getLength();
-				for (int i = 0; i < attributesLength; i++) {
-					String attributeName = attributes.getLocalName(i);
-					String attributeValue = attributes.getValue(i);
-					if (attributeName.equals("propertiesLocation")) //$NON-NLS-1$
-					{
-						URL bundleURL = generatePropertiesFileURL(fFileInfo, attributeValue);
-						if (bundleURL != null) {
-							InputStream bundleStream = null;
-							try {
-								bundleStream = bundleURL.openStream();
-								resourceBundle = new PropertyResourceBundle(bundleStream);
-							}
-							catch (IOException e) {
-								Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-							}
-							finally {
-								try {
-									if (bundleStream != null)
-										bundleStream.close();
-								}
-								catch (IOException x) {
-									Logger.log(Logger.WARNING_DEBUG, x.getMessage(), x);
-								}
-							}
-						}
-					}
-					else if (attributeName.equals("caseSensitive")) //$NON-NLS-1$
-					{
-						if (attributeValue.trim().equals("false")) //$NON-NLS-1$
-						{
-							annotationMap.setCaseSensitive(false);
-						}
-					}
-				}
-			}
-			else if (localName.equals(TAG_ID_ANNOTATION)) {
-				currentAnnotation = null;
-				String specValue = attributes.getValue("spec"); //$NON-NLS-1$
-				if (specValue != null) {
-					currentAnnotation = new Annotation();
-					currentAnnotation.setSpec(specValue);
-				}
-				annotationMap.addAnnotation(currentAnnotation);
-			}
-			else if (localName.equals(TAG_ID_PROPERTY)) {
-				if (currentAnnotation != null) {
-					currentPropertyName = attributes.getValue("name"); //$NON-NLS-1$
-				}
-			}
-		}
-
-		public void endElement(String uri, String localName, String qName) throws SAXException {
-			if (currentPropertyName != null && currentAnnotation != null) {
-				String propertyValue = propertyValueBuffer.toString();
-				if (propertyValue != null) {
-					if (propertyValue.startsWith("%") && resourceBundle != null) //$NON-NLS-1$
-					{
-						try {
-							propertyValue = resourceBundle.getString(propertyValue.substring(1));
-						}
-						catch (Exception e) {
-							// ignore any exception that occurs while trying
-							// to fetch a resource
-						}
-					}
-					currentAnnotation.setProperty(currentPropertyName, propertyValue);
-				}
-			}
-
-			if (localName.equals(TAG_ID_ANNOTATION)) {
-				currentAnnotation = null;
-			}
-			else if (localName.equals(TAG_ID_PROPERTY)) {
-				currentPropertyName = null;
-			}
-		}
-
-		public void characters(char[] ch, int start, int length) {
-			if (currentPropertyName != null && currentAnnotation != null) {
-				propertyValueBuffer.append(ch, start, length);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistry.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistry.java
deleted file mode 100644
index c8991fb..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistry.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * This class is used to associate one or more annotation files with a grammar
- * file.
- * 
- */
-public class AnnotationFileRegistry {
-	private Map map = new HashMap();
-
-	public AnnotationFileRegistry() {
-		new AnnotationFileRegistryReader(this).readRegistry();
-	}
-	
-	public synchronized List getAnnotationFilesInfos(String publicId) {
-		List theList = (List) map.get(publicId);
-		return theList != null ? theList : new ArrayList();
-	}
-		
-	public synchronized void addAnnotationFile(String publicId, AnnotationFileInfo fileInfo) {
-		List fileInfos = (List) map.get(publicId);
-		if (fileInfos == null) {
-			fileInfos = new ArrayList();
-			map.put(publicId, fileInfos);
-		}
-		fileInfos.add(fileInfo);
-	}
-
-	public synchronized void removeAnnotationFile(String publicId, AnnotationFileInfo fileInfo) {
-		List fileInfos = (List) map.get(publicId);
-		if (fileInfos != null) {
-			fileInfos.remove(fileInfo);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistryReader.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistryReader.java
deleted file mode 100644
index 3c7c423..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistryReader.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.Logger;
-
-
-/**
- * This class reads the plugin manifests and adds each specified gramamr
- * annotation file with the AnnotationProvider
- */
-public class AnnotationFileRegistryReader {
-	protected static final String EXTENSION_POINT_ID = "annotationFiles"; //$NON-NLS-1$
-	protected static final String TAG_NAME = "annotationFile"; //$NON-NLS-1$
-	protected static final String ATT_PUBLIC_ID = "publicId"; //$NON-NLS-1$
-	protected static final String ATT_LOCATION = "location"; //$NON-NLS-1$
-
-	private AnnotationFileRegistry annotationFileRegistry;
-
-	public AnnotationFileRegistryReader(AnnotationFileRegistry annotationFileRegistry) {
-		this.annotationFileRegistry = annotationFileRegistry;
-	}
-
-	/**
-	 * read from plugin registry and parse it.
-	 */
-	public void readRegistry() {
-		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
-		String pluginId = "org.eclipse.wst.xml.core"; //$NON-NLS-1$
-		IExtensionPoint point = extensionRegistry.getExtensionPoint(pluginId, EXTENSION_POINT_ID);
-		if (point != null) {
-			IConfigurationElement[] elements = point.getConfigurationElements();
-			for (int i = 0; i < elements.length; i++) {
-				readElement(elements[i]);
-			}
-		}
-	}
-
-	/**
-	 * readElement() - parse and deal with an extension like:
-	 * 
-	 * <extension
-	 * point="org.eclipse.wst.xml.core.internal.contentmodel.util_implementation">
-	 * <util_implementation class =
-	 * corg.eclipse.wst.baseutil.CMUtilImplementationImpl /> </extension>
-	 */
-	protected void readElement(IConfigurationElement element) {
-		if (element.getName().equals(TAG_NAME)) {
-			String publicId = element.getAttribute(ATT_PUBLIC_ID);
-			String location = element.getAttribute(ATT_LOCATION);
-			if (publicId != null && location != null) {
-				try {
-					String bundleId = element.getNamespace();
-					AnnotationFileInfo fileInfo = new AnnotationFileInfo(location, bundleId);
-					annotationFileRegistry.addAnnotationFile(publicId, fileInfo);
-				}
-				catch (Exception e) {
-					Logger.logException("problem adding annotation file " + location, e); //$NON-NLS-1$
-				}
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationUtility.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationUtility.java
deleted file mode 100644
index 061088a..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationUtility.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.ContentModelManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.AnnotationMap;
-
-
-/**
- * 
- */
-public class AnnotationUtility {
-	public static void loadAnnotationsForGrammar(String publicId, CMDocument cmDocument) {
-		List annotationFiles = ContentModelManager.getInstance().getAnnotationFilesInfos(publicId);
-		AnnotationMap map = (AnnotationMap) cmDocument.getProperty("annotationMap"); //$NON-NLS-1$
-		if (map != null) {
-			for (Iterator i = annotationFiles.iterator(); i.hasNext();) {
-				try {
-					AnnotationFileInfo annotationFileInfo = (AnnotationFileInfo) i.next();
-					AnnotationFileParser parser = new AnnotationFileParser();
-					parser.parse(map, annotationFileInfo);
-				}
-				catch (Exception e) {
-					Logger.logException(e);
-				}
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/ResourceBundleHelper.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/ResourceBundleHelper.java
deleted file mode 100644
index 98eeba4..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/ResourceBundleHelper.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation;
-                     
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.Platform;
-
-
-public class ResourceBundleHelper
-{
-  public static ResourceBundle getResourceBundle(String resourceURI, Locale targetLocale) throws Exception
-  {
-	  // try to load bundle from the location specified in the resourceURI
-    // we make the assumption that the resourceURI points to the local file system
-         
-    int index = resourceURI.lastIndexOf("/"); //$NON-NLS-1$
-    if (index == -1)
-    {
-      throw new Exception("Invalid resourceURI"); //$NON-NLS-1$
-    }                               
-
-    // Below we set 'resourceDirectory' so that it ends with a '/'.
-    // Here's an excerpt from the ClassLoader Javadoc ...
-    // Any URL that ends with a '/' is assumed to refer to a directory. Otherwise, the URL is assumed
-    // to refer to a JAR file which will be opened as needed. 
-    //
-    String resourceDirectory = resourceURI.substring(0, index + 1);
-    String resourceBundleName = resourceURI.substring(index + 1);
-    
-    // create a class loader with a class path that points to the resource bundle's location
-    //         
-    URL[] classpath = new URL[1];
-    classpath[0] = Platform.resolve(new URL(resourceDirectory));
-	  ClassLoader resourceLoader = new URLClassLoader(classpath, null); 
-       
-  	return ResourceBundle.getBundle(resourceBundleName, targetLocale, resourceLoader);
-	}  
-
-  public static ResourceBundle getResourceBundle(String resourceURI) throws Exception 
-  {
-	  return getResourceBundle(resourceURI, Locale.getDefault());
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/InferredGrammarFactory.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/InferredGrammarFactory.java
deleted file mode 100644
index 19d8131..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/InferredGrammarFactory.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMAnyElementImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMAttributeDeclarationImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMDocumentImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMElementDeclarationImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMGroupImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNodeListImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDescriptionBuilder;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
- 
-
-public class InferredGrammarFactory
-{                                      
-  public InferredGrammarFactory()
-  {
-  }
-
-  public CMDocument createCMDocument(String uri)
-  {                      
-    CMDocumentImpl cmdocument =new CMDocumentImpl(uri);
-    cmdocument.setInferred(true);
-    return cmdocument;
-  }    
- 
-  public CMElementDeclaration createCMElementDeclaration(CMDocument cmDocument, Element element, boolean isLocal)
-  {
-    String localName = element.getLocalName();                                   
-    CMDocumentImpl cmDocumentImpl = (CMDocumentImpl)cmDocument;
-
-    CMNamedNodeMapImpl elementMap = isLocal ?
-                                    (CMNamedNodeMapImpl)cmDocumentImpl.getLocalElementPool() :
-                                    (CMNamedNodeMapImpl)cmDocumentImpl.getElements();
-
-    CMElementDeclarationImpl ed = (CMElementDeclarationImpl)elementMap.getNamedItem(localName);
-    if (ed == null)
-    {                                                                                          
-      //System.out.println("create ed " + localName);
-      ed = new CMElementDeclarationImpl(cmDocument, localName);
-      ed.setInferred(true);
-      ed.setLocal(isLocal);
-      ed.setMaxOccur(1);
-      CMGroupImpl group = new CMGroupImpl(new CMNodeListImpl(), CMGroup.CHOICE);
-      group.setInferred(true);
-      group.setMinOccur(0);
-      group.setMaxOccur(-1);
-      ed.setContent(group);            
-      elementMap.put(ed);
-    } 
-
-    // lookup or create the attributes
-    //
-    NamedNodeMap attributeMap = element.getAttributes();
-    int attributeMapLength = attributeMap.getLength();
-    for (int i = 0; i < attributeMapLength; i++)
-    {
-      Attr attr = (Attr)attributeMap.item(i);
-      CMAttributeDeclarationImpl ad = (CMAttributeDeclarationImpl)ed.getAttributeMap().getNamedItem(attr.getNodeName());
-      if (ad == null)
-      {     
-        // todo... use an attribute pool to be more efficient?
-        ad = new CMAttributeDeclarationImpl(attr.getNodeName(), CMAttributeDeclaration.OPTIONAL);
-        ad.setInferred(true);
-        ed.getAttributeMap().put(ad);
-      }
-    }
-    return ed;
-  }         
-
-  public void createCMContent(CMDocument parentCMDocument, CMElementDeclaration parentEd, CMDocument childCMDocument, CMElementDeclaration childEd, boolean isLocal, String uri)
-  {
-    // add element to the parent's content
-    // consider all content to be of the form (A | B | C)*    
-    //
-    CMGroupImpl group = (CMGroupImpl)parentEd.getContent();
-    CMNodeListImpl groupChildNodeList = (CMNodeListImpl)group.getChildNodes();
-
-    if (parentCMDocument == childCMDocument)
-    {
-      if (!groupChildNodeList.contains(childEd))
-      {
-        groupChildNodeList.add(childEd);
-      }
-      if (isLocal)
-      {
-        CMNamedNodeMapImpl localElementMap = (CMNamedNodeMapImpl)parentEd.getLocalElements();
-        localElementMap.put(childEd);
-      }
-    }     
-    else
-    {                                                    
-      CMAnyElement cmAnyElement = lookupOrCreateCMAnyElement((CMDocumentImpl)parentCMDocument, uri);
-      if (!groupChildNodeList.contains(cmAnyElement))
-      {
-        groupChildNodeList.add(cmAnyElement);
-      }
-    }      
-  }   
-
-  protected CMAnyElement lookupOrCreateCMAnyElement(CMDocumentImpl parentCMDocument, String uri)
-  {
-    CMNamedNodeMapImpl anyElementMap = parentCMDocument.getAnyElements();
-    CMAnyElementImpl anyElement = (CMAnyElementImpl)anyElementMap.getNamedItem(CMAnyElementImpl.computeNodeName(uri));
-    if (anyElement == null)
-    {                                                                                     
-      //System.out.println("create anyElement " + uri);
-      anyElement = new CMAnyElementImpl(uri);
-      anyElement.setInferred(true);
-      anyElementMap.put(anyElement);
-    }
-    return anyElement;
-  } 
-      
-
-  public void debugPrint(Collection collection)
-  {                
-    for (Iterator iter = collection.iterator(); iter.hasNext(); )
-    {
-      CMDocument cmDocument = (CMDocument)iter.next(); 
-      System.out.println("-----------------------------------------------"); //$NON-NLS-1$
-      System.out.println("cmDocument (" + cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI") +")");  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-      CMNamedNodeMapImpl elementMap = (CMNamedNodeMapImpl)cmDocument.getElements();
-      int size = elementMap.getLength();
-      for (int i = 0; i < size; i++)
-      {
-        CMElementDeclaration ed = (CMElementDeclaration)elementMap.item(i);
-        CMDescriptionBuilder builder = new CMDescriptionBuilder();
-        System.out.println("  ELEMENT " + ed.getNodeName() + " = " + builder.buildDescription(ed)); //$NON-NLS-1$ //$NON-NLS-2$
-      }
-    }
-  }        
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionDescriptor.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionDescriptor.java
deleted file mode 100644
index c6d9490..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionDescriptor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension;
-
-/**
- * Describes an extension to the <code>modelQueryExtension</code> extension
- * point.
- * 
- */
-public class ModelQueryExtensionDescriptor
-{
-  private static final String CONTENT_TYPE_ATTRIBUTE = "contentType"; //$NON-NLS-1$
-  private static final String NAMESPACE_ATTRIBUTE = "namespace"; //$NON-NLS-1$
-  private static final String CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$
-  private IConfigurationElement configuration;
-  private String contentTypeId;
-  private String namespace;
-  private ModelQueryExtension extension;
-
-  public ModelQueryExtensionDescriptor(IConfigurationElement element)
-  {
-    configuration = element;
-  }
-
-  public ModelQueryExtension createModelQueryExtension() throws CoreException
-  {
-    if (extension == null)
-    {  
-      extension = (ModelQueryExtension) configuration.createExecutableExtension(CLASS_ATTRIBUTE);
-    }  
-    return extension;
-  }
-
-  public String getContentTypeId()
-  {
-    if (contentTypeId == null)
-    {
-      contentTypeId = configuration.getAttribute(CONTENT_TYPE_ATTRIBUTE);
-    }
-    return contentTypeId;
-  }
-
-  public String getNamespace()
-  {
-    if (namespace == null)
-    {
-      namespace = configuration.getAttribute(NAMESPACE_ATTRIBUTE);
-    }
-    return namespace;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionManagerImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionManagerImpl.java
deleted file mode 100644
index 72c28fd..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionManagerImpl.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl;
-        
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtensionManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-
-public class ModelQueryExtensionManagerImpl implements ModelQueryExtensionManager
-{           
-  protected ModelQueryExtensionRegistry modelQueryExtensionRegistry = new ModelQueryExtensionRegistry();
-
-  public List getDataTypeValues(Element element, CMNode cmNode)
-  {    
-    List list = new ArrayList();      
-    String contentTypeId = getContentTypeId(element);
-    String namespace = getNamespace(cmNode);
-    String name = cmNode.getNodeName();
-    
-    for (Iterator i = modelQueryExtensionRegistry.getApplicableExtensions(contentTypeId, namespace).iterator(); i.hasNext();)
-    {
-      ModelQueryExtension extension = (ModelQueryExtension)i.next();
-      String[] values = null;
-      if (cmNode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION)
-      {  
-        values = extension.getAttributeValues(element, namespace, name);
-      }
-      else
-      {
-        values = extension.getElementValues(element, namespace, name);        
-      }
-      if (values != null)
-      {
-        list.addAll(Arrays.asList(values));
-      }  
-    }  
-    return list;  
-  }                               
-
-  public void filterAvailableElementContent(List cmnodes, Element element, CMElementDeclaration ed)
-  {
-	  filterAvailableElementContent(cmnodes, element, ed, ModelQuery.INCLUDE_CHILD_NODES);
-  }
-
-  public void filterAvailableElementContent(List cmnodes, Element element, CMElementDeclaration ed, int includeOptions)
-  {
-    String contentTypeId = getContentTypeId(element);
-    String parentNamespace = element.getNamespaceURI();
-
-	List modelQueryExtensions = modelQueryExtensionRegistry.getApplicableExtensions(contentTypeId, parentNamespace);
-	if((includeOptions & ModelQuery.INCLUDE_CHILD_NODES) > 0)
-	{
-      for (Iterator j = cmnodes.iterator(); j.hasNext(); )
-      {
-        CMNode cmNode = (CMNode)j.next();  
-        String namespace = getNamespace(cmNode);
-        String name = cmNode.getNodeName();
-      
-        boolean include = true;
-        for(int k = 0; k < modelQueryExtensions.size() && include; k++) {
-        {
-            ModelQueryExtension extension = (ModelQueryExtension)modelQueryExtensions.get(k);
-            include = extension.isApplicableChildElement(element, namespace, name);
-            if (!include)
-            {
-              // remove the cmNode from the list
-              j.remove();
-            }
-          }
-        }
-      }
-    }
-    // add MQE-provided content
-    for(int k = 0; k < modelQueryExtensions.size(); k++)
-    {
-        ModelQueryExtension extension = (ModelQueryExtension)modelQueryExtensions.get(k);
-        cmnodes.addAll(Arrays.asList(extension.getAvailableElementContent(element, parentNamespace, includeOptions)));
-    }
-  }
-  
-  private String getNamespace(CMNode cmNode)
-  {
-    String namespace = null;
-    CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$
-    if (cmDocument != null)          
-    {     
-      namespace = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI");    //$NON-NLS-1$
-    }
-    return namespace;
-  }
-  
-  private String getContentTypeId(Node node)
-  {
-    String contentTypeId = "org.eclipse.core.runtime.xml"; //$NON-NLS-1$
-    if (node instanceof IDOMNode)
-    {
-      IDOMNode domNode = (IDOMNode) node;
-      contentTypeId = domNode.getModel().getContentTypeIdentifier();
-    }   
-    return contentTypeId;
-  } 
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionRegistry.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionRegistry.java
deleted file mode 100644
index 5366f41..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionRegistry.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension;
-
-public class ModelQueryExtensionRegistry
-{
-  protected static final String EXTENSION_POINT_ID = "modelQueryExtensions"; //$NON-NLS-1$
-  protected static final String TAG_NAME = "modelQueryExtension"; //$NON-NLS-1$
-  private List descriptors;
-
-  public List getApplicableExtensions(String contentTypeId, String namespace)
-  {
-    List list = new ArrayList();
-    if (contentTypeId != null)
-    {
-      ensureExtensionsLoaded();
-      for (Iterator i = descriptors.iterator(); i.hasNext();)
-      {
-        ModelQueryExtensionDescriptor descriptor = (ModelQueryExtensionDescriptor) i.next();
-        if (contentTypeId.equals(descriptor.getContentTypeId()))
-        {
-          if (descriptor.getNamespace() == null ||  descriptor.getNamespace().equals(namespace))
-          {  
-            try
-            {
-              ModelQueryExtension extension = descriptor.createModelQueryExtension();
-              list.add(extension);
-            }
-            catch (CoreException e) {
-            	Logger.logException("problem creating model query extension", e); //$NON-NLS-1$
-            }
-          }  
-        }
-      }
-    }
-    return list;
-  }
-  
-  /*
-   *  TODO : consider providing a non-plugin means add/remove extensions
-   *   
-  public void addExtension(ModelQueryExtension extension)
-  {     
-  }
-
-  public void removeExtension(ModelQueryExtensionDeprecated extension)
-  {
-  }*/
-
-  /**
-   * Reads all extensions.
-   * <p>
-   * This method can be called more than once in order to reload from a changed
-   * extension registry.
-   * </p>
-   */
-  private synchronized void reloadExtensions()
-  {
-    descriptors = new ArrayList();
-    String bundleid = "org.eclipse.wst.xml.core"; //$NON-NLS-1$      
-    IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(bundleid, EXTENSION_POINT_ID);
-    for (int i = 0; i < elements.length; i++)
-    {
-      ModelQueryExtensionDescriptor descriptor = new ModelQueryExtensionDescriptor(elements[i]);
-      descriptors.add(descriptor);
-    }
-  }
-
-  /**
-   * Ensures the extensions have been loaded at least once.
-   */
-  private void ensureExtensionsLoaded()
-  {
-    if (descriptors == null)
-    {
-      reloadExtensions();
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMDataTypeValueHelper.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMDataTypeValueHelper.java
deleted file mode 100644
index e09fa6c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMDataTypeValueHelper.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.util;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
-
-
-public class CMDataTypeValueHelper
-{
-  protected int idCount = 0;
-
-
-  public String getValue(CMAttributeDeclaration ad, NamespaceTable namespaceTable)
-  {
-    String value = null;
-       
-    if (isXSIType(ad))         
-    {       
-      List list = getQualifiedXSITypes(ad, namespaceTable);
-      value = list.size() > 0 ? (String)list.get(0) : null;
-    } 
-
-    // shameless hack
-    //
-    if (value == null)
-    {
-      if (ad.getAttrName().equals("xml:lang"))     //$NON-NLS-1$
-      {
-        value = "EN"; //$NON-NLS-1$
-      }
-    }
-
-    if (value == null)
-    {
-      CMDataType dataType = ad.getAttrType();
-      if (dataType != null)
-      {
-        value = getValue(dataType);
-      }
-    }
-    return value;
-  }
-
-
-  public String getValue(CMDataType dataType)
-  {
-    String value = null;
-    value = dataType.getImpliedValue();
-
-    if (value == null)
-    {
-      String[] values = dataType.getEnumeratedValues();
-      if (values != null && values.length > 0)
-      {
-        value = values[0];
-      }
-    }
-
-    if (value == null)
-    {
-      value = dataType.generateInstanceValue();
-    }               
-
-    // Here is a special case where we handle DTD's ID related datatypes.
-    // These values must be generated/validate by considering the entire xml file
-    // so we can't rely on the 'generateInstanceValue' method.
-    //
-    // todo... find a nicer way to handle this    
-    if (value == null)
-    {
-      String dataTypeName = dataType.getDataTypeName();
-      if (dataTypeName != null)
-      {
-        if (dataTypeName.equals("ID")) //$NON-NLS-1$
-        {
-          value = "idvalue" + idCount++; //$NON-NLS-1$
-        }
-        else if (dataTypeName.equals("IDREF") || dataTypeName.equals("IDREFS")) //$NON-NLS-1$ //$NON-NLS-2$
-        {
-          value = "idvalue0"; //$NON-NLS-1$
-        }
-      }
-    }     
-    return value;
-  } 
-      
-
-  public boolean isValidEmptyValue(CMAttributeDeclaration ad)
-  {    
-    boolean result = true;
-    CMDataType dataType = ad.getAttrType();
-    if (dataType != null)
-    {                                                          
-      String propertyValue = (String)dataType.getProperty("isValidEmptyValue"); //$NON-NLS-1$
-      if (propertyValue != null && propertyValue.equals("false")) //$NON-NLS-1$
-      {
-        result = false;
-      }
-    }   
-    return result;
-  }
-
-
-  public boolean isXSIType(CMAttributeDeclaration ad)
-  {         
-    boolean result = false;
-    if (ad.getNodeName().equals("type"))  //$NON-NLS-1$
-    {
-      CMDocument cmDocument = (CMDocument)ad.getProperty("CMDocument"); //$NON-NLS-1$
-      if (cmDocument != null)
-      {
-        String namespaceName = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
-        if (namespaceName != null && namespaceName.equals("http://www.w3.org/2001/XMLSchema-instance")) //$NON-NLS-1$
-        {           
-          result = true;
-        }
-      }
-    }                   
-    return result;
-  }
-   
-
-  public List getQualifiedXSITypes(CMAttributeDeclaration ad, NamespaceTable table)
-  {          
-    List list = new Vector();                                                 
-                                       
-    List xsiTypes = (List)ad.getProperty("XSITypes"); //$NON-NLS-1$
-    if (xsiTypes != null && xsiTypes.size() > 0)
-    {
-      for (Iterator i = xsiTypes.iterator(); i.hasNext(); )
-      { 
-        String uriQualifiedName = (String)i.next();
-        String[] components = DOMNamespaceHelper.getURIQualifiedNameComponents(uriQualifiedName);  
-        String prefix = table.getPrefixForURI(components[0] != null ? components[0] : ""); //$NON-NLS-1$
-        String typeName = (prefix != null && prefix.length() > 0) ? 
-                           prefix + ":" + components[1] :  //$NON-NLS-1$
-                           components[1];
-        list.add(typeName);
-      }
-    }           
-    return list;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMValidator.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMValidator.java
deleted file mode 100644
index 3ee535f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMValidator.java
+++ /dev/null
@@ -1,1244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.util;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMVisitor;
-
-
-
-public class CMValidator
-{
-  protected static StringElementContentComparator stringContentComparitor = new StringElementContentComparator();
-  protected Hashtable graphNodeTable = new Hashtable();
-
-  /**
-   * GraphNode
-   */
-  protected static class GraphNode
-  {
-    public String name;
-    public boolean isTerminal;
-    public Vector arcList = new Vector();
-
-    public GraphNode(String name)
-    {
-      this.name = name;
-    }
-
-    public void addArc(Arc arc)
-    {
-      arcList.addElement(arc);
-    }
-
-    public String toString()
-    {
-      return "[GraphNode " + name + "]"; //$NON-NLS-1$ //$NON-NLS-2$
-    }
-  }
-
-
-  /**
-   * Arc
-   */
-  protected static class Arc
-  {
-    public static final int ELEMENT  = 1;
-    public static final int REPEAT   = 2;
-    public static final int OPTIONAL = 3;
-    public static final int PREV_IN  = 4;
-    public static final int OUT_NEXT = 5;
-    public static final int LINK     = 6;
-
-    public int kind;
-    public String name;
-    public GraphNode node;
-    public CMNode cmNode;
-
-    public Arc(int kind, GraphNode node, CMNode cmNode)
-    {
-      this(kind, "", node, cmNode); //$NON-NLS-1$
-    }
-
-    protected Arc(int kind, String name, GraphNode node, CMNode cmNode)
-    {
-      this.name = name;
-      this.kind = kind;
-      this.node = node;
-      this.cmNode = cmNode;
-    }
-  }
-
-
-  /**
-   * GraphGenerator
-   */
-  protected static class GraphGenerator extends CMVisitor
-  {
-    public int indent;
-    public int count;
-    public GraphNode startGraphNode;
-    public Context context;
-
-    protected static class Context
-    {
-      GraphNode from;
-      GraphNode to;
-
-      Context(GraphNode from, GraphNode to)
-      {
-        this.from = from;
-        this.to = to;
-      }
-
-      GraphNode getLastGraphNode()
-      {
-        return (to != null) ? to : from;
-      }
-    }
-
-
-    protected GraphGenerator()
-    {
-      startGraphNode = new GraphNode(getGraphNodeName());
-      context = new Context(startGraphNode, null);
-    }
-
-
-    protected void generateGraph(CMElementDeclaration ed)
-    {
-      int contentType = ed.getContentType();
-
-      if (contentType == CMElementDeclaration.MIXED ||
-          contentType == CMElementDeclaration.ELEMENT)
-      {
-        visitCMNode(ed.getContent());
-      }
-      // CMElementDeclaration.PCDATA... no graph required
-      // CMElementDeclaration.ANY... no graph required
-      context.getLastGraphNode().isTerminal = true;
-    }
-
-
-    protected String getGraphNodeName()
-    {
-      return "n" + count++; //$NON-NLS-1$
-    }
-
-
-    protected GraphNode getStartGraphNode()
-    {
-      return startGraphNode;
-    }
-
-
-    /**
-     *                repeat
-     *             +----#-----+
-     *             |          |
-     *             v          |
-     *  prev --#-> in --'x'-> out --#-> next
-     *  |                               ^
-     *  |                               |
-     *  +----------------#--------------+
-     *                optional
-     *
-     */
-    protected void createArcs(GraphNode in, GraphNode out, CMContent cmContent)
-    {
-      createArcs(in, out, cmContent, false);
-    }
-
-    protected void createArcs(GraphNode in, GraphNode out, CMContent cmContent, boolean isAllGroup)
-    {
-      //println("+createArcs() " + ed.getDescription() + " " + ed.getMinOccur());
-      GraphNode prev = context.from;
-      GraphNode next = new GraphNode(getGraphNodeName());
-
-      prev.addArc(new Arc(Arc.PREV_IN, in, cmContent));
-      out.addArc(new Arc(Arc.OUT_NEXT, next, cmContent));
-
-      if (context.to != null)
-      {
-        next.addArc(new Arc(Arc.LINK, context.to, cmContent));
-      }
-      else
-      {
-        context.from = next;
-      }
-
-      if (cmContent.getMinOccur() == 0)
-      {
-        // todo... should we see if an optional arc has already been added?
-        prev.addArc(new Arc(Arc.OPTIONAL, next, cmContent));
-      }
-
-      if (cmContent.getMaxOccur() == -1 || cmContent.getMaxOccur() > 1 || isAllGroup)
-      {
-        out.addArc(new Arc(Arc.REPEAT, in, cmContent));
-      }
-    }
-
-
-    public void visitCMGroup(CMGroup group)
-    {
-      Context prevContext = context;
-      GraphNode in = new GraphNode("(" + getGraphNodeName()); //$NON-NLS-1$
-      GraphNode out = new GraphNode(")" + getGraphNodeName()); //$NON-NLS-1$
-
-      int groupOperator = group.getOperator();
-      if (groupOperator == CMGroup.SEQUENCE)
-      {
-        context = new Context(in, null);
-        super.visitCMGroup(group);
-        context.from.addArc(new Arc(Arc.LINK, out, group));
-      }
-      else if (groupOperator == CMGroup.CHOICE ||
-               groupOperator == CMGroup.ALL)
-      {
-        context = new Context(in, out);
-        super.visitCMGroup(group);
-      }
-
-      context = prevContext;
-      createArcs(in, out, group, groupOperator == CMGroup.ALL);
-    }
-
-
-    public void visitCMElementDeclaration(CMElementDeclaration ed)
-    {
-      GraphNode in = new GraphNode(getGraphNodeName());
-      GraphNode out = new GraphNode(getGraphNodeName());
-      createArcs(in, out, ed);
-      in.addArc(new Arc(Arc.ELEMENT, ed.getElementName(), out, ed));
-    }
-                            
-
-    public void visitCMAnyElement(CMAnyElement anyElement)
-    {
-      GraphNode in = new GraphNode(getGraphNodeName());
-      GraphNode out = new GraphNode(getGraphNodeName());
-      createArcs(in, out, anyElement);
-      in.addArc(new Arc(Arc.ELEMENT, "any", out, anyElement)); //$NON-NLS-1$
-    }
-  }
-
-  // todo.. implement cache strategy hook, handle name spaces, locals etc.
-  //
-  public GraphNode lookupOrCreateGraph(CMElementDeclaration element)
-  {
-    Object key = element;
-    GraphNode node = (GraphNode)graphNodeTable.get(key);
-    if (node == null)
-    {
-      node = createGraph(element);
-      graphNodeTable.put(key, node);
-    }
-    return node;
-  }
-
-  public GraphNode createGraph(CMElementDeclaration element)
-  {
-    GraphGenerator generator = new GraphGenerator();
-    generator.generateGraph(element);
-    return generator.getStartGraphNode();
-  }
-
-
-  public void printGraph(GraphNode node, Vector namedArcList, Vector unamedArcList, int indent)
-  {
-    //String decoration = node.isTerminal ? " *" : "";
-    //printlnIndented(indent, "GraphNode:" + node.name + decoration);
-
-    indent += 2;
-    for (Enumeration e = node.arcList.elements() ; e.hasMoreElements() ;)
-    {
-      Arc arc = (Arc)e.nextElement();
-      //boolean visit = false;
-      //printlnIndented(indent, "Arc:" + arc.name + " (" + arc.kind + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-      if (arc.kind == Arc.ELEMENT)
-      {
-        //table.add(currentGrammarObject, arc.grammarObject);
-        if (!namedArcList.contains(arc))
-        {
-          namedArcList.add(arc);
-          unamedArcList = new Vector();
-          printGraph(arc.node, namedArcList, unamedArcList, indent + 2);
-        }
-      }
-      else
-      {
-        if (!unamedArcList.contains(arc))
-        {
-          unamedArcList.add(arc);
-          printGraph(arc.node, namedArcList, unamedArcList, indent + 2);
-        }
-      }
-    }
-  }
-
-  public void printGraph(GraphNode node)
-  {
-    printGraph(node, new Vector(), new Vector(), 0);
-  }
-
-
-  public void validateElementList(ElementList list, GraphNode node, ElementContentComparator comparator, Result result, boolean loopFlag)
-  {
-    //println("+validateElementList " + node + " " + list);
-    if (list == null && node.isTerminal)
-    {
-      result.isValid = true;
-    }
-    else
-    {
-      for (Iterator i = node.arcList.iterator(); i.hasNext();)
-      {
-        Arc arc = (Arc)i.next();
-        boolean traverseArc = false;
-        if (arc.kind == Arc.ELEMENT)
-        {
-          if (list != null && comparator.matches(list.head, arc.cmNode))
-          {
-            loopFlag = false;
-            traverseArc = true;
-            list = list.tail; // increment our position in the list
-          }
-        }
-        else if (arc.kind == Arc.REPEAT)
-        {
-          if (!loopFlag)
-          {
-            traverseArc = true;
-          }
-          loopFlag = true;
-        }
-        else
-        {
-          traverseArc = true;
-        }
-
-        if (traverseArc)
-        {
-          // test to see if we can push this arc due to facet constraints
-          //
-          if (result.canPush(arc))
-          {          
-            // see if this arc leads to a correct solution          
-            result.push(arc);
-            validateElementList(list, arc.node, comparator, result, loopFlag);
-            if (result.isValid)
-            {
-              break;
-            }
-            result.pop(arc);
-          }
-        }
-      }
-    }
-  }
-
-
-  /**
-   *
-   */
-  protected static ElementList createElementList(int contentType, List v, ElementContentComparator comparator, Result result)
-  {
-    ElementList first = null;
-    ElementList prev = null;
-
-    int size = v.size();
-    for (int i = 0; i < size; i++)
-    {
-      Object o = v.get(i);
-      if (o != null && !comparator.isIgnorable(o))
-      {
-        if (comparator.isElement(o))
-        {
-          ElementList list = new ElementList();
-          list.head = o;
-
-          if (prev != null)
-          {
-            prev.tail = list;
-          }
-          else
-          {
-            first = list;
-          }
-          prev = list;
-        }
-        else if (contentType == CMElementDeclaration.ELEMENT)
-        {
-          result.isValid = false;
-          result.errorIndex = i;
-          result.errorMessage = "Element can not include PCDATA content"; //$NON-NLS-1$
-        }
-      }
-    }
-    return first;
-  }
-
-  /**
-   *
-   */
-  public void validate(CMElementDeclaration ed, List elementContent, ElementContentComparator comparator, Result result)
-  {
-    int contentType = ed.getContentType();
-
-    if (contentType == CMElementDeclaration.MIXED ||
-        contentType == CMElementDeclaration.ELEMENT)
-    {
-      ElementList elementList = createElementList(contentType, elementContent, comparator, result);
-      if (result.isValid == true)
-      {  
-        // defect 226213 ... elements with a large number of children will cause the recursion based validation
-        // algorithm to stack overflow ... as a quick fix assume any element with a large number of children is valid        
-        if (elementContent.size() < 500)
-        {
-          boolean isGraphValidationNeeded = !(elementList == null && contentType == CMElementDeclaration.MIXED);
-                      
-          // exlicity handle 'All' groups
-          //
-          CMContent content = ed.getContent();
-          if (content.getNodeType() == CMNode.GROUP)
-          {
-            CMGroup group = (CMGroup)content;
-            if (group.getOperator() == CMGroup.ALL)
-            {
-              isGraphValidationNeeded = false;
-              validatAllGroupContent(elementContent, comparator, group, result);                               
-            }              
-          }  
-          
-          if (isGraphValidationNeeded)
-          {
-            // validate the elementList using a graph
-            //
-            result.isValid = false;
-            GraphNode node = lookupOrCreateGraph(ed);
-            validateElementList(elementList, node, comparator, result, false);
-          }
-        }
-      }
-    }
-    else if (contentType == CMElementDeclaration.PCDATA)
-    {
-      int size = elementContent.size();
-      for (int i = 0; i < size; i++)
-      {
-        Object o = elementContent.get(i);
-        if (comparator.isElement(o))
-        {
-          result.isValid = false;
-          result.errorIndex = i;
-          result.errorMessage = "Element may only include PCDATA content"; //$NON-NLS-1$
-          break;
-        }
-      }
-    }
-    else if (contentType == CMElementDeclaration.EMPTY)
-    {
-      int size = elementContent.size();
-      for (int i = 0; i < size; i++)
-      {
-        Object o = elementContent.get(i);
-        if (!comparator.isIgnorable(o))
-        {
-          result.isValid = false;
-          result.errorIndex = i;
-          result.errorMessage = "Element may not contain PCDATA or Element content"; //$NON-NLS-1$
-          break;
-        }
-      }
-    }
-    //else if (contentType == CMElementDeclaration.ANY)
-    // {
-    //   assume elementContent will always be valid for this content type
-    // }
-  }
-    
-  static class ItemCount
-  {
-    int count = 0;    
-  }
-  
-  private void validatAllGroupContent(List elementContent, ElementContentComparator comparator, CMGroup allGroup, Result result) 
-  {
-    boolean isValid = true;
-    boolean isPartiallyValid = true;
-    HashMap map = new HashMap();
-    CMNodeList list = allGroup.getChildNodes();
-    for (int j = list.getLength() - 1; j >= 0; j--)
-    {
-      CMNode node = list.item(j);      
-      if (map.get(node) == null)
-      {  
-        map.put(node, new ItemCount());
-      }  
-    }    
-    int validitionCount = 0;
-    for (Iterator i = elementContent.iterator(); i.hasNext(); validitionCount++)
-    {
-      Object o = i.next();        
-      if (comparator.isElement(o))
-      {              
-        // test to see if the element is listed in the all group
-        //
-        CMNode matchingCMNode = null;
-        for (int j = list.getLength() - 1; j >= 0; j--)
-        {
-          CMNode node = list.item(j);
-          if (comparator.matches(o, node))
-          {
-            matchingCMNode = node;
-            break;
-          }             
-        }                              
-        if (matchingCMNode == null)
-        {     
-          isPartiallyValid = false;
-          isValid = false;
-          break;
-        }
-        else
-        {  
-          // test to see that the element occurs only once
-          //
-          ItemCount itemCount = (ItemCount)map.get(matchingCMNode);
-          if (itemCount != null)
-          {  
-            if (itemCount.count > 0)
-            {
-              // we don't want to allow too many elements!
-              // we consider 'not enough' to be partially valid... but not 'too many'
-              isPartiallyValid = false;
-              break;
-            }  
-            else
-            {
-              itemCount.count++;
-            }  
-          }
-        }  
-      }  
-    }
-    if (isValid)
-    {  
-      for (int j = list.getLength() - 1; j >= 0; j--)
-      {
-        CMNode node = list.item(j);      
-        if (node.getNodeType() == CMNode.ELEMENT_DECLARATION)
-        {  
-          CMContent content = (CMContent)node;
-          ItemCount itemCount = (ItemCount)map.get(node);
-//          System.out.print("content " + content.getNodeName() + " " + content.getMinOccur());
-          if (itemCount.count < content.getMinOccur())
-          {  
-            isValid = false;
-            break;
-          }  
-        }  
-      }
-    }
-    if (result instanceof ElementPathRecordingResult && isPartiallyValid)
-    {
-      ((ElementPathRecordingResult)result).setPartialValidationCount(validitionCount);
-    }  
-    result.isValid = isValid;
-  }  
-  
-  
-  public void getOriginArray(CMElementDeclaration ed, List elementContent, ElementContentComparator comparator, ElementPathRecordingResult result)
-  {
-    CMNode[] cmNodeArray = null;
-    validate(ed, elementContent, comparator, result);
-    if (result.isValid)
-    {
-      CMDataType dataType = ed.getDataType();
-      int size = elementContent.size();
-      cmNodeArray = new CMNode[size];
-      Vector originList = result.getElementOriginList();
-      int originListSize = originList.size(); 
-      int originListIndex = 0;
-      for (int i = 0; i < size; i++)
-      {
-        Object o = elementContent.get(i);
-        if (comparator.isElement(o))
-        {     
-          if (originListIndex < originListSize)
-          {
-            cmNodeArray[i] = (CMNode)originList.get(originListIndex);
-            originListIndex++;
-          }
-        }
-        else if (comparator.isPCData(o))
-        {
-          cmNodeArray[i] = dataType;
-        }
-        // else the CMNode at this index is null
-      }
-      result.setOriginArray(cmNodeArray);
-    }
-  }
-  
-  private void collectNamedArcs(GraphNode node, List namedArcList, int indent)
-  {
-    //printlnIndented(indent, "GraphNode:" + node.name + decoration);
-    indent += 2;
-    for (Iterator i = node.arcList.iterator(); i.hasNext() ;)
-    {
-      Arc arc = (Arc)i.next();
-      //printlnIndented(indent, "Arc:" + arc.name + " (" + arc.kind + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-      if (arc.kind == Arc.ELEMENT)
-      { 
-        if (!namedArcList.contains(arc))
-        {
-          namedArcList.add(arc);
-          collectNamedArcs(arc.node, namedArcList, indent + 2);
-        }
-      }
-      else if (arc.kind != Arc.REPEAT && arc.kind != Arc.OPTIONAL)
-      {
-        collectNamedArcs(arc.node, namedArcList, indent + 2);
-      }
-    }
-  }
-  
-  
-  private List getMatchingArcs(CMElementDeclaration ed, String elementName)
-  {
-    List arcList = new ArrayList();
-    GraphNode graphNode = lookupOrCreateGraph(ed);
-    if (elementName == null)
-    {
-      // here we add the 'root' arc
-      for (Iterator i = graphNode.arcList.iterator(); i.hasNext() ;)
-      {
-        Arc arc = (Arc)i.next();
-        if (arc.kind == Arc.PREV_IN)
-        {
-          arcList.add(arc);
-          break;
-        }  
-      }
-    }
-    else
-    { 
-      List namedArcs = new ArrayList();
-      collectNamedArcs(graphNode, namedArcs, 0);
-      for (Iterator i = namedArcs.iterator(); i.hasNext(); )
-      {
-        Arc arc = (Arc)i.next();
-        if (arc.cmNode != null && elementName.equals(arc.cmNode.getNodeName()))
-        {  
-          arcList.add(arc);
-        }  
-      }  
-    }      
-    return arcList;
-  }
-
-  
-  private void collectNextSiblings(GraphNode node, List nextSiblingList, List namedArcList, List unamedArcList, int indent)
-  {
-    //printlnIndented(indent, "GraphNode:" + node.name + decoration);
-    indent += 2;
-    for (Iterator i = node.arcList.iterator(); i.hasNext(); )
-    {
-      Arc arc = (Arc)i.next();
-      if (arc.kind == Arc.ELEMENT)
-      {       
-        if (!namedArcList.contains(arc))
-        {
-          if (arc.cmNode != null)
-          {  
-            nextSiblingList.add(arc.cmNode);
-            if (arc.cmNode.getNodeType() == CMNode.ELEMENT_DECLARATION ||
-                arc.cmNode.getNodeType() == CMNode.ANY_ELEMENT)
-            {              
-              namedArcList.add(arc);
-              CMContent cmNode = (CMContent)arc.cmNode; 
-              if (cmNode.getMinOccur() == 0)
-              {
-                unamedArcList = new ArrayList();
-                collectNextSiblings(arc.node, nextSiblingList, namedArcList, unamedArcList, indent + 2);
-              }
-            }            
-          }
-        }
-      }  
-      else
-      {
-        if (!unamedArcList.contains(arc))
-        {
-          unamedArcList.add(arc);
-          collectNextSiblings(arc.node, nextSiblingList, namedArcList, unamedArcList, indent + 2);
-        }
-      }
-    }  
-  }
-    
-  public CMNode[] getNextSiblings(CMElementDeclaration ed, String elementName)
-  {
-    List arcList = getMatchingArcs(ed, elementName);
-    List nextSiblingList = new ArrayList();
-    for (Iterator i = arcList.iterator(); i.hasNext(); )
-    {
-      Arc arc = (Arc)i.next();
-      collectNextSiblings(arc.node, nextSiblingList, new ArrayList(), new ArrayList(), 0);      
-    }  
-    CMNode[] result = new CMNode[nextSiblingList.size()];
-    nextSiblingList.toArray(result);    
-    //System.out.print("getNextSibling(" +elementName + ")");
-    //for (int i = 0; i < result.length; i++)
-    //{
-    //  System.out.print("[" + result[i].getNodeName() + "]");
-    //}  
-    //System.out.println();
-    return result;
-  }
-
-  /**
-   *
-   */
-  public static class Result
-  {
-    public boolean isValid = true;
-    public int errorIndex = -1;
-    public String errorMessage;
-    public boolean isRepeatTraversed; // detects if a repeat has been traversed
-
-    public boolean canPush(Arc arc)
-    {
-      return true;
-    }
-    
-    public void push(Arc arc)
-    {
-      // overide this method to record traversed nodes
-    }
-    public void pop(Arc arc)
-    {
-      // overide this method to record traversed nodes
-    }
-    public CMNode[] getOriginArray()
-    {
-      return null;
-    }
-  }
-
-  /**
-   *
-   */
-  public static class ElementPathRecordingResult extends Result
-  {  
-    protected List activeItemCountList = new ArrayList();
-    protected List inactiveItemCountList = new ArrayList();    
-    protected Vector elementOriginStack = new Vector();
-    protected CMNode[] originArray = null;
-    protected int partialValidationCount = 0;
-
-    
-    // this method is used to support facet counts
-    //
-    public boolean canPush(Arc arc)
-    {     
-      boolean result = true;        
-      try
-      {        
-        if (arc.kind == Arc.REPEAT)
-        {          
-          if (arc.cmNode instanceof CMContent)
-          {
-            CMContent content = (CMContent)arc.cmNode;
-            
-            // we only need to do 'special' facet checking if the maxOccurs is > 1
-            // values of '0' and '-1' (unbounded) work 'for free' without any special checking
-            //
-            if (content.getMaxOccur() > 1)
-            {  
-              ItemCount itemCount = (ItemCount)activeItemCountList.get(activeItemCountList.size() - 1);
-              
-              // here we need to compute if we can do another repeat
-              // if we increase the repeat count by '1' will this violate the maxOccurs
-              //
-              if (itemCount.count + 1 >= content.getMaxOccur())
-              {
-                result = false;
-              }
-            }
-            //System.out.println("canPush REPEAT (" + itemCount.count + ")" + content.getNodeName() + " result= " + result);            
-          } 
-        }       
-      }
-      catch (Exception e)
-      {
-        e.printStackTrace();
-      }
-      //System.out.flush();
-      return result;
-    }
-    
-    public void push(Arc arc)
-    {
-      if (arc.kind == Arc.ELEMENT)
-      {
-        //System.out.println("[X]push(" + arc.kind + ")" + arc.cmNode.getNodeName());
-        elementOriginStack.add(arc.cmNode);
-        partialValidationCount = Math.max(elementOriginStack.size(), partialValidationCount);
-      }
-      else if (arc.kind == Arc.PREV_IN)
-      {
-        //System.out.println("[X]push(" + arc.kind + ")" + arc.cmNode.getNodeName());
-        activeItemCountList.add(new ItemCount());   
-      }
-      else if (arc.kind == Arc.OUT_NEXT)
-      {        
-        //System.out.println("[X]push(" + arc.kind + ")" + arc.cmNode.getNodeName() + "[" + arc + "]");
-        int size = activeItemCountList.size();
-        ItemCount itemCount = (ItemCount)activeItemCountList.get(size - 1);
-        activeItemCountList.remove(size - 1);
-        inactiveItemCountList.add(itemCount); 
-      }      
-      else if (arc.kind == Arc.REPEAT)
-      {
-        //System.out.println("[X]push(" + arc.kind + ")" + arc.cmNode.getNodeName());
-        ItemCount itemCount = (ItemCount)activeItemCountList.get(activeItemCountList.size() - 1);
-        itemCount.count++;
-        //System.out.println("repeat(" + itemCount.count + ")" + arc.cmNode.getNodeName());
-      }        
-    }
-
-    public void pop(Arc arc)
-    {
-      if (arc.kind == Arc.ELEMENT)
-      {
-        //System.out.println("[X]pop(" + arc.kind + ")" + arc.cmNode.getNodeName());
-        int size = elementOriginStack.size();
-        elementOriginStack.remove(size - 1);
-      }
-      else if (arc.kind == Arc.PREV_IN)
-      {
-        //System.out.println("[X]pop(" + arc.kind + ")" + arc.cmNode.getNodeName());
-        activeItemCountList.remove(activeItemCountList.size() - 1);        
-      }
-      else if (arc.kind == Arc.OUT_NEXT)
-      {
-        //System.out.println("[X]pop(" + arc.kind + ")" + arc.cmNode.getNodeName());
-        int size = inactiveItemCountList.size();
-        ItemCount itemCount = (ItemCount)inactiveItemCountList.get(size - 1);
-        inactiveItemCountList.remove(size - 1);
-        activeItemCountList.add(itemCount);     
-      }  
-      else if (arc.kind == Arc.REPEAT)
-      {
-        //System.out.println("[X]pop(" + arc.kind + ")" + arc.cmNode.getNodeName());
-        ItemCount itemCount = (ItemCount)activeItemCountList.get(activeItemCountList.size() - 1);
-        itemCount.count--;
-      }     
-    }
-
-    public Vector getElementOriginList()
-    {
-      return elementOriginStack;
-    }
-
-    public CMNode[] getOriginArray()
-    {
-      return originArray;
-    }
-
-    public void setOriginArray(CMNode[] originArray)
-    {
-      this.originArray = originArray;
-    }
-    
-    public int getPartialValidationCount()
-    {
-      return partialValidationCount;
-    }
-
-    public void setPartialValidationCount(int partialValidationCount)
-    {
-      this.partialValidationCount = partialValidationCount;
-    }
-  }  
-
-  /**
-   *
-   */
-  public static class PathRecordingResult extends Result
-  {
-    protected Vector arcList = new Vector();
-
-    public void push(Arc arc)
-    {
-      arcList.add(arc);
-    }
-
-    public void pop(Arc arc)
-    {
-      int size = arcList.size();
-      arcList.remove(size - 1);
-    }
-
-    public List getArcList()
-    {
-      List list = new Vector();
-      for (Iterator iterator = arcList.iterator(); iterator.hasNext(); )
-      {
-        Arc arc = (Arc)iterator.next();
-        if (arc.kind == Arc.ELEMENT)
-        {
-          list.add(arc);
-        }
-      }
-      return list;
-    }
-
-    public MatchModelNode getMatchModel()
-    {
-      MatchModelNodeBuilder builder = new MatchModelNodeBuilder(arcList);
-      builder.buildMatchModel();
-      return builder.getRoot();
-    }
-  }
-
-  /**
-   *
-   */
-  public static class MatchModelNode
-  {
-    public CMNode cmNode;
-    public List children = new Vector();
-    public Object data;
-
-    public MatchModelNode(MatchModelNode parent, CMNode cmNode)
-    {
-      this.cmNode = cmNode;
-    }
-
-    public void printModel(int indent)
-    {
-      //String cmNodeName = cmNode != null ? cmNode.getNodeName() : "null";
-      //printlnIndented(indent, "MatchModelNode : " + cmNodeName);
-      for (Iterator iterator = children.iterator(); iterator.hasNext(); )
-      {
-        MatchModelNode child = (MatchModelNode)iterator.next();
-        child.printModel(indent + 2);
-      }
-    }
-  }
-
-  public static class MatchModelNodeBuilder
-  {
-    protected List arcList;
-    protected List stack = new Vector();
-    protected MatchModelNode root;
-    protected MatchModelNode current;
-
-    public MatchModelNodeBuilder(List arcList)
-    {
-      this.arcList = arcList;
-      root = new MatchModelNode(null, null);
-      push(root);
-    }
-
-    protected void push(MatchModelNode node)
-    {
-      current = node;
-      stack.add(node);
-    }
-
-    protected void pop()
-    {
-      int size = stack.size();
-      stack.remove(size - 1);
-      current = (MatchModelNode)stack.get(size - 2);
-    }
-
-    public boolean isCMGroup(CMNode cmNode)
-    {
-      return cmNode != null && cmNode.getNodeType() == CMNode.GROUP;
-    }
-
-    public void buildMatchModel()
-    {
-      for (Iterator iterator = arcList.iterator(); iterator.hasNext(); )
-      {
-        Arc arc = (Arc)iterator.next();
-
-        if (arc.kind == Arc.ELEMENT)
-        {
-          current.children.add(new MatchModelNode(current, arc.cmNode));
-        }
-        else if (arc.kind == Arc.PREV_IN)
-        {
-          if (isCMGroup(arc.cmNode))
-          {
-            MatchModelNode newModelNode = new MatchModelNode(current, arc.cmNode);
-            current.children.add(newModelNode);
-            push(newModelNode);
-          }
-        }
-        else if (arc.kind == Arc.OUT_NEXT)
-        {
-          if (isCMGroup(arc.cmNode))
-          {
-            pop();
-          }
-        }
-        else if (arc.kind == Arc.REPEAT)
-        {
-          if (isCMGroup(arc.cmNode))
-          {
-            pop();
-            MatchModelNode newModelNode = new MatchModelNode(current, arc.cmNode);
-            current.children.add(newModelNode);
-            push(newModelNode);
-          }
-        }
-      }
-    }
-
-    public MatchModelNode getRoot()
-    {
-      return root;
-    }
-  }
-
-
-  /**
-   *
-   */
-  public interface ElementContentComparator
-  {
-    public boolean isIgnorable(Object o);
-    public boolean isPCData(Object o);
-    public boolean isElement(Object o);
-    public boolean matches(Object o, CMNode cmNode);
-  }
-
-  /**
-   * A linked list
-   */
-  public static class ElementList
-  {
-    protected Object head;
-    protected ElementList tail;
-
-    public static ElementList create(List v)
-    {
-      ElementList first = null;
-      ElementList prev = null;
-
-      for (Iterator iterator = v.iterator(); iterator.hasNext(); )
-      {
-        Object o = iterator.next();
-        if (o != null)
-        {
-          ElementList list = new ElementList();
-          list.head = o;
-
-          if (prev != null)
-          {
-            prev.tail = list;
-          }
-          else
-          {
-            first = list;
-          }
-          prev = list;
-        }
-      }
-      return first;
-    }
-
-
-    public String toString()
-    {
-      String string = "[" + head + "],"; //$NON-NLS-1$ //$NON-NLS-2$
-
-      if (tail != null)
-      {
-        string += tail.toString();
-      }
-
-      return string;
-    }
-  }
-
-  /**
-   * StringElementContentComparator
-   */
-  public static class StringElementContentComparator implements ElementContentComparator
-  {
-    public boolean isIgnorable(Object o)
-    {
-      String string = o.toString();
-      return string.startsWith("!") || string.startsWith("?"); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    public boolean isPCData(Object o)
-    {
-      String string = o.toString();
-      return string.startsWith("'") || string.startsWith("\""); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    public boolean isElement(Object o)
-    {
-      return !isIgnorable(o) && !isPCData(o);
-    }
-
-    public boolean matches(Object o, CMNode cmNode)
-    {
-      boolean result = false;
-      if (cmNode.getNodeType() == CMNode.ELEMENT_DECLARATION)
-      { 
-        CMElementDeclaration element = (CMElementDeclaration)cmNode;
-        String name = o.toString();                              
-        int index = name.indexOf("]"); //$NON-NLS-1$
-        if (index != -1)
-        {
-          name = name.substring(index + 1);
-        }
-        result = name.equalsIgnoreCase(element.getElementName());        
-
-        // TODO... here's we consider substitution groups... revisit to see if this should be moved into validator code
-        if (!result)
-        {
-          CMNodeList cmNodeList = (CMNodeList)element.getProperty("SubstitutionGroup");   //$NON-NLS-1$
-          if (cmNodeList != null)
-          {
-            int cmNodeListLength = cmNodeList.getLength();
-            if (cmNodeListLength > 1)
-            {                        
-              for (int i = 0; i < cmNodeListLength; i++)
-              {                                                               
-                CMElementDeclaration alternativeCMElementDeclaration = (CMElementDeclaration)cmNodeList.item(i);
-                String altName = alternativeCMElementDeclaration.getElementName();
-                result = name.equalsIgnoreCase(altName);
-                if (result)
-                {
-                  break;
-                }
-              }
-            }
-          }
-        }         
-      }   
-      else if (cmNode.getNodeType() == CMNode.ANY_ELEMENT)
-      {                                   
-        String string = o.toString();
-        if (string.equals("*")) //$NON-NLS-1$
-        {
-          result = true;
-        }
-        else
-        {
-          CMAnyElement anyElement = (CMAnyElement)cmNode;
-          String anyElementURI = anyElement.getNamespaceURI();    
-          if (anyElementURI != null)
-          {           
-            if (anyElementURI.equals("##any")) //$NON-NLS-1$
-            {                               
-              result = true;
-            }
-            else if (anyElementURI.equals("##other")) //$NON-NLS-1$
-            {     
-              result = true;    
-              CMDocument cmDocument = (CMDocument)anyElement.getProperty("CMDocument");   //$NON-NLS-1$
-              if (cmDocument != null)
-              {
-                String excludedURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
-                if (excludedURI != null)
-                { 
-                  String specifiedURI = getURIForContentSpecification(string);
-                  if (specifiedURI != null && excludedURI.equals(specifiedURI))
-                  { 
-                    result = false;
-                  } 
-                }
-              }
-            } 
-            else if (anyElementURI.equals("##targetNamespace")) //$NON-NLS-1$
-            {
-              result = true;
-              CMDocument cmDocument = (CMDocument)anyElement.getProperty("CMDocument");   //$NON-NLS-1$
-              if (cmDocument != null)
-              {     
-                String targetNamespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
-                String specifiedURI = getURIForContentSpecification(string);
-                if (specifiedURI != null && !targetNamespaceURI.equals(specifiedURI))
-                { 
-                  result = false;
-                } 
-              }
-            }
-            else  
-            {        
-              result = true;
-              String specifiedURI = getURIForContentSpecification(string);
-              if (specifiedURI != null && !anyElementURI.equals(specifiedURI))
-              { 
-                result = false;
-              }      
-            }
-          }  
-          else 
-          {          
-            result = true;
-          }        
-        }
-      }
-      return result;
-    }     
-    
-
-    protected String getURIForContentSpecification(String specification)
-    {           
-      String result = null;
-      int index = specification.indexOf("]"); //$NON-NLS-1$
-      if (index != -1)
-      {                
-        result = specification.substring(1, index);
-      } 
-      return result;  
-    }
-  }      
-
-  public static List createStringList(String arg[], int startIndex)
-  {
-    Vector v = new Vector();
-    for (int i = startIndex; i < arg.length; i++)
-    {
-      v.add(arg[i]);
-    }
-    return v;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/DOMValidator.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/DOMValidator.java
deleted file mode 100644
index 4a11a27..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/DOMValidator.java
+++ /dev/null
@@ -1,424 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.util;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMVisitor;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-/**
- * A special CMValidator that knows about DOMs
- */
-public class DOMValidator extends CMValidator
-{               
-  protected String getNamespaceURI(Node node)
-  {   
-    return DOMNamespaceHelper.getNamespaceURI(node);
-    //return node.getNamespaceURI();
-  }
-          
-
-  //
-  // This is a temporary hack!!
-  //
-  protected String getFallbackNamepaceURI(CMElementDeclaration ed)
-  {   
-    String fallbackNamepaceURI = null;
-    CMDocument cmDocument = (CMDocument)ed.getProperty("CMDocument"); //$NON-NLS-1$
-    if (cmDocument != null)
-    {
-      fallbackNamepaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI");   //$NON-NLS-1$
-    }  
-    return fallbackNamepaceURI;
-  }
-
-  /**
-   * Encode the Element's NodeList as a List of strings that the validator recognizes
-   */
-  public List createContentSpecificationList(Element element, CMElementDeclaration ed)
-  {                                                                    
-    boolean isNamespaceAware = isNamespaceAware(ed);
-    Vector v = new Vector();         
-    for (Node childNode = element.getFirstChild(); childNode != null; childNode = childNode.getNextSibling())
-    { 
-      v.add(createContentSpecification(childNode, isNamespaceAware, isNamespaceAware ? getFallbackNamepaceURI(ed) : null));
-    }
-    return v;
-  }
-
-
-  public List createContentSpecificationList(List nodeList, CMElementDeclaration ed)
-  {             
-    boolean isNamespaceAware = isNamespaceAware(ed);
-    Vector v = new Vector();            
- 
-    for (Iterator i = nodeList.iterator(); i.hasNext(); )
-    {
-      Node node = (Node)i.next();
-      v.add(createContentSpecification(node, isNamespaceAware, getFallbackNamepaceURI(ed)));
-    }
-    return v;
-  }
-
-
-  /**
-   * Encode the Node as a string that the validator recognizes
-   */
-  public String createContentSpecification(Node node, boolean isNamespaceAware, String fallbackNamepaceURI)
-  {
-    String result = "!"; //$NON-NLS-1$
-    switch (node.getNodeType())
-    {
-      case Node.ELEMENT_NODE :
-      {  
-        String nodeName = node.getNodeName();  
-        if (nodeName.startsWith("jsp:")) //$NON-NLS-1$
-        {  
-          result = "!"; // treat it as a comment so that it's ignored by the validator //$NON-NLS-1$
-        }
-        else
-        {
-          if (isNamespaceAware)
-          {
-            result = DOMNamespaceHelper.getUnprefixedName(nodeName);
-            String uri = getNamespaceURI(node);
-            if (uri != null)
-            {
-              result = "[" + uri + "]" + result;    //$NON-NLS-1$ //$NON-NLS-2$
-            } 
-            else if (fallbackNamepaceURI != null)
-            {
-              result = "[" + fallbackNamepaceURI + "]" + result;   //$NON-NLS-1$ //$NON-NLS-2$
-            }
-          }  
-          else
-          {
-            result = nodeName;
-          }
-        }        
-        //ContentModelManager.println("result " + result);
-        break;
-      }
-      case Node.PROCESSING_INSTRUCTION_NODE :
-      {
-        result = "?"; //$NON-NLS-1$
-        break;
-      }
-      case Node.COMMENT_NODE :
-      {
-        result = "!"; //$NON-NLS-1$
-        break;
-      }
-      case Node.CDATA_SECTION_NODE :
-      {
-        result = "\"" + node.getNodeName() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-        break;
-      }
-      case Node.TEXT_NODE :
-      {
-        String data = ((Text)node).getData();
-        // here we test to see if the test node is 'ignorable'
-        if (data != null && data.trim().length() > 0)
-        {
-          result = "\"" + node.getNodeName() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-        }
-        else
-        {
-          result = "!"; // todo... use another symbol? //$NON-NLS-1$
-        }
-        break;
-      }
-    }
-    return result;
-  }
-
-
-  /**
-   *
-   */
-  public List createContentSpecificationList(CMNode cmNode)
-  {
-    List list = new Vector();
-    switch (cmNode.getNodeType())
-    {
-      case CMNode.ELEMENT_DECLARATION :
-      {         
-        list.add(createContentSpecificationForCMElementDeclaration((CMElementDeclaration)cmNode));   
-        break;
-      }
-      case CMNode.DATA_TYPE :
-      {
-        list.add("\"" + cmNode.getNodeName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
-        break;
-      }
-      case CMNode.GROUP :
-      {
-        createContentSpecificationListForCMGroup((CMGroup)cmNode, list);
-        break;
-      }
-      case CMNode.ANY_ELEMENT :
-      {
-        list.add("*"); //$NON-NLS-1$
-        break;
-      }
-      default :
-      {
-        list.add("!"); //$NON-NLS-1$
-      }
-    }
-    return list;
-  }
-     
-
-  /**
-   * 
-   */              
-  protected String createContentSpecificationForCMElementDeclaration(CMElementDeclaration ed)
-  {  
-    CMDocument document = (CMDocument)ed.getProperty("CMDocument"); //$NON-NLS-1$
-    String uri = document != null ? (String)document.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI") : null; //$NON-NLS-1$
-    String string = ed.getNodeName();
-    if (uri != null)
-    {            
-      string = "[" + uri + "]" + string; //$NON-NLS-1$ //$NON-NLS-2$
-    }
-    return string;
-  }
-  
-  /**
-   *
-   */
-  protected void createContentSpecificationListForCMGroup(CMGroup group, List list)
-  {         
-    CMGroupContentVisitor visitor = new CMGroupContentVisitor(group, list);
-    visitor.visitCMNode(group);
-  } 
-     
-  protected class CMGroupContentVisitor extends CMVisitor
-  {  
-    protected CMGroup root;                             
-    protected List list;
-
-    public CMGroupContentVisitor(CMGroup root, List list)
-    {                                        
-      this.root = root;        
-      this.list = list;
-    }
-
-    public void visitCMElementDeclaration(CMElementDeclaration ed)
-    {           
-      if (ed.getMinOccur() > 0)
-      {
-        list.add(createContentSpecificationForCMElementDeclaration(ed));
-      }
-    }       
-
-    public void visitCMAnyElement(CMAnyElement anyElement)
-    {   
-      list.add("*"); //$NON-NLS-1$
-    }
-
-    public void visitCMGroup(CMGroup group)
-    {                              
-      if (group == root || group.getMinOccur() > 0)
-      {
-        int op = group.getOperator();
-        if (op == CMGroup.SEQUENCE)
-        {
-          super.visitCMGroup(group);
-        }
-        else if (op == CMGroup.CHOICE)
-        {
-          CMNodeList nodeList = group.getChildNodes();
-          if (nodeList.getLength() > 0)
-          {
-            visitCMNode(nodeList.item(0));
-          }      
-        }
-      }
-    }
-  }
-
-  public boolean isNamespaceAware(CMElementDeclaration ed)
-  { 
-    return ed != null ? ed.getProperty("http://org.eclipse.wst/cm/properties/isNameSpaceAware") != null : false; //$NON-NLS-1$
-  }
-     
-  /**
-   *
-   */
-  public CMNode[] getOriginArray(CMElementDeclaration ed, Element element)
-  {
-    ElementPathRecordingResult result = new ElementPathRecordingResult();
-    getOriginArray(ed, createContentSpecificationList(element, ed), stringContentComparitor, result);
-    return result.getOriginArray();
-  }
-                   
-  /**
-   *
-   */
-  public MatchModelNode getMatchModel(CMElementDeclaration ed, Element element)
-  {
-    MatchModelNode matchModelNode = null;
-    PathRecordingResult result = new PathRecordingResult();
-    validate(ed, createContentSpecificationList(element, ed), stringContentComparitor, result);
-    if (result.isValid)
-    {
-      matchModelNode = result.getMatchModel();
-    }
-    return matchModelNode;
-  }
-                           
-
-  public List clone(List list)
-  {   
-    List result = new Vector(list.size());
-    result.addAll(list);
-    return result;
-  }
- 
-  /**
-   *
-   */
-  public boolean canInsert(CMElementDeclaration ed, List contentSpecificationList, int insertIndex, CMNode cmNode)
-  {           
-    List clonedList = clone(contentSpecificationList);
-    insert(clonedList, insertIndex, cmNode);
-    boolean result = isPartiallyValid(ed, clonedList);   
-    return result;
-  }  
-
-  /**
-   *
-   */
-  public boolean canInsert(CMElementDeclaration ed, List contentSpecificationList, int insertIndex, List cmNodeList)
-  {              
-    List clonedList = clone(contentSpecificationList);
-    insert(clonedList, insertIndex, cmNodeList);
-    return isValid(ed, clonedList);
-  }  
-
-  /**
-   *
-   */
-  public boolean canRemove(CMElementDeclaration ed, List contentSpecificationList, int startRemoveIndex)
-  {
-    return canRemove(ed, contentSpecificationList, startRemoveIndex, startRemoveIndex);
-  }
-
-  /**
-   *
-   */
-  public boolean canRemove(CMElementDeclaration ed, List contentSpecificationList, int startRemoveIndex, int endRemoveIndex)
-  {
-    List clonedList = clone(contentSpecificationList);
-    remove(clonedList, startRemoveIndex, endRemoveIndex);
-    return isValid(ed, clonedList);
-  }
-                        
-  /**
-   *
-   */
-  public boolean canReplace(CMElementDeclaration ed, List contentSpecificationList, int startRemoveIndex, int endRemoveIndex, CMNode cmNode)
-  {
-    List clonedList = clone(contentSpecificationList);
-    remove(clonedList, startRemoveIndex, endRemoveIndex); 
-    insert(clonedList, startRemoveIndex, cmNode);
-    return isValid(ed, clonedList);
-  }
-
-  /**
-   *
-   */                      
-  public boolean isValid(CMElementDeclaration ed, List contentSpecificationList)
-  {
-    Result result = new Result();
-    validate(ed, contentSpecificationList, stringContentComparitor, result);
-    return result.isValid;
-  }
-
-  public boolean isPartiallyValid(CMElementDeclaration ed, List contentSpecificationList)
-  {
-    CMValidator.ElementPathRecordingResult result = new CMValidator.ElementPathRecordingResult();
-    validate(ed, contentSpecificationList, stringContentComparitor, result);
-    int count = getElementCount(contentSpecificationList);
-    //System.out.println("elementOriginList " + result.getPartialValidationCount() + "vs" + count);
-    return result.getPartialValidationCount() >= count;
-  }  
-  
-  public int getElementCount(List contentSpecificationList)
-  {
-    int count = 0;
-    for (Iterator i = contentSpecificationList.iterator(); i.hasNext(); )
-    {
-      if (stringContentComparitor.isElement(i.next()))
-      {
-        count++;
-      }  
-    }  
-    return count;
-  }
-
-  protected Result validate(CMElementDeclaration ed, Element element)
-  {
-    Result result = new Result();
-    validate(ed, createContentSpecificationList(element, ed), stringContentComparitor, result);
-    return result;
-  }
-
-
-  protected void remove(List stringList, int startRemoveIndex, int endRemoveIndex)
-  {
-    if (startRemoveIndex != -1)
-    {
-      for (int i = startRemoveIndex; i <= endRemoveIndex; i++)
-      {
-        stringList.remove(i);
-      }
-    }
-  }
-
-  protected void insert(List stringList, int insertIndex, CMNode cmNode)
-  {
-    if (insertIndex != -1)
-    {
-      stringList.addAll(insertIndex, createContentSpecificationList(cmNode));
-    }
-  }
-
-  protected void insert(List stringList, int insertIndex, List cmNodeList)
-  {
-    if (insertIndex != -1)
-    {
-      int insertListSize = cmNodeList.size();
-      for (int i = insertListSize - 1; i >= 0; i--)
-      {
-        CMNode cmNode = (CMNode)cmNodeList.get(i);
-        stringList.addAll(insertIndex, createContentSpecificationList(cmNode));
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManager.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManager.java
deleted file mode 100644
index 6fbee2a..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManager.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-
-
-/**
- * The CMDocumentManager can be visualized as a table of CMDocument
- * references, each with a corresponding entry in a CMDocument cache. The
- * CMDocumentManager also performs the task of loading CMDocuments providing
- * support for synchronous and asynchronous loading.
- * 
- * publicIdTable CMDocumentCache ---------------------------
- * --------------------------------------- | publicId | resolvedURI | -> |
- * resolvedURI | status | CMDocument | ---------------------------
- * --------------------------------------- | (null) | file:/x.dtd | |
- * file:/x.dtd | loading | (null) | ---------------------------
- * --------------------------------------- | http:/... | file:/y.xsd | |
- * file:/y.xsd | loaded | | ---------------------------
- * ---------------------------------------
- * 
- */
-public interface CMDocumentManager {
-	/**
-	 * This property specifies WHEN CMDocuments are loaded. Setting this
-	 * property to true allows the CMDocumentManager to load CMDocuments on
-	 * demand. Settings this property a false puts the onus on the client to
-	 * call addCMDocumentReference() to explicity trigger a load. This allows
-	 * the client to control exactly when loading should take place. )
-	 */
-	public static final String PROPERTY_AUTO_LOAD = "autoLoad"; //$NON-NLS-1$
-
-	/**
-	 * This property specifies HOW CMDocuments are loaded. When set to false,
-	 * the getCMDocument() method will load the CMDocument synchronously and
-	 * return a CMDocument object when loading is successful. When set to
-	 * true, the getCMDocument() will load the CMDocument asynchronously and
-	 * will immediately return null. When loading is complete, the
-	 * CMDocumentManager will inform its listeners that the CMDocument has
-	 * been loaded.
-	 */
-	public static final String PROPERTY_ASYNC_LOAD = "asyncLoad"; //$NON-NLS-1$
-
-	/**
-	 * 
-	 */
-	public static final String PROPERTY_USE_CACHED_RESOLVED_URI = "useCachedResovledURI"; //$NON-NLS-1$
-
-	/**
-	 * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=136399
-	 * Allows a client to control whether the document manager attempts to resolve a
-	 * CM document's URI. When set to false, the CM systemID will be assumed to point
-	 * to an already resolved URI. By default this property is set to true.
-	 */
-	public static final String PROPERTY_PERFORM_URI_RESOLUTION = "performURIResolution"; //$NON-NLS-1$
-	
-	/**
-	 * Set the enabled state of a property.
-	 */
-	public void setPropertyEnabled(String propertyName, boolean enabled);
-
-	/**
-	 * Get the enabled state of the property.
-	 */
-	public boolean getPropertyEnabled(String propertyName);
-
-	/**
-	 * Adds a listener. Listeners should expect to receive call backs on a
-	 * secondary thread when asynchronously loading is used.
-	 */
-	public void addListener(CMDocumentManagerListener listener);
-
-	/**
-	 * Removes a listener.
-	 */
-	public void removeListener(CMDocumentManagerListener listener);
-
-	/**
-	 * Lookup or create a CMDocument (depending on PROPERTY_AUTO_LOAD).
-	 * 
-	 * @param publicId
-	 * @param systemId
-	 * @param type -
-	 *            'dtd', 'xsd', 'tld', etc. if null is given as the type, then
-	 *            the type is calculated as last segment (e.g. file extension)
-	 *            of the resolved URI
-	 * @return
-	 */
-	public CMDocument getCMDocument(String publicId, String systemId, String type);
-
-	/**
-	 * Lookup a CMDocument.
-	 */
-	public CMDocument getCMDocument(String publicId);
-
-	/**
-	 * Get the status of a CMDocument.
-	 */
-	public int getCMDocumentStatus(String publicId);
-
-	/**
-	 * Creates a CMDocument and adds the associated CMDocument reference
-	 * information to the table. Calling this method always triggers a
-	 * CMDocument load.
-	 */
-	public void addCMDocumentReference(String publicId, String systemId, String type);
-
-	/**
-	 * Add an existingCMDocument and the reference information to the table.
-	 */
-	public void addCMDocument(String publicId, String systemId, String resolvedURI, String type, CMDocument cmDocument);
-
-	/**
-	 * Remove all entries from the table.
-	 */
-	public void removeAllReferences();
-
-	/**
-	 * Get the CMDocumentCache that is used to store loaded CMDocuments and
-	 * associated status.
-	 */
-	public CMDocumentCache getCMDocumentCache();
-
-	/**
-	 * Builds a CMDocument given a resoulvedURI. Note that no entries are
-	 * added to the table.
-	 */
-	public CMDocument buildCMDocument(String publicId, String resolvedURI, String type);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManagerListener.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManagerListener.java
deleted file mode 100644
index bd607dc..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManagerListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCacheListener;
-
-/**
- *
- */
-public interface CMDocumentManagerListener extends CMDocumentCacheListener
-{                    
-  public void propertyChanged(CMDocumentManager cmDocumentManager, String propertyName);
-}       
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReference.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReference.java
deleted file mode 100644
index 1d57f46..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReference.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery;
-
-
-public interface CMDocumentReference
-{
-  public String getPublicId();
-  public String getSystemId();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReferenceProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReferenceProvider.java
deleted file mode 100644
index d7dc8bf..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReferenceProvider.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery;
-
-import java.util.List;
-
-import org.w3c.dom.Node;
- 
-/**
- * The interface is used to abstract the task of computing the document references associated with a DOM
- * or a particular node within the DOM.  
- */
-public interface CMDocumentReferenceProvider
-{
-  List getCMDocumentReferences(Node node, boolean deep);
-  String resolveGrammarURI(String publicId, String systemId);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQuery.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQuery.java
deleted file mode 100644
index 5d300e8..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQuery.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery;
-
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtensionManager;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- * This class provides an interface for performing higher level queries based on
- * a xml model (DOM) and one or more associated content models (CMDocument).
- *
- * The queries provided can be organized into three groups:
- *
- * 1) DOM Node to CMNode mapping
- *      Given a grammatically valid DOM Node the corresponding CMNode can be determined.
- *      (i.e. Element -> CMElementDeclaration, Attr -> CMAttributeDeclaration, CharacterData -> CMDataType)
- *
- * 2) DOM editing tests ("Can I do this?")
- *      Questions such as canInsert, canRemove, canReplace can assist in the editing of a DOM.
- *
- *      The validityChecking argument determines the strictness of the validity testing that occurs.
- *
- *      - VALIDITY_NONE    : The current content of the Element is ignored.
- *                           Only the content model is considered.
- *                           This is most useful for codeassist related queries.
- *
- *      - VALIDITY_STRICT  : The current content of the Element is considered.
- *                           Returns true only if the operation preserves content validity.
- *                           This is useful when DOM editing needs to be constrained to maintain validity.
- *
- *      - VALIDITY_PARTIAL : Some optimized compromise between the two options above.
- *
- * 3) DOM editing actions ("What can I do here?")
- *      These methods return ModelQueryActions that are relevant at some specified DOM Node.
- *      The actions indicate what kinds of DOM Node can be inserted where (at what index).
- */
-public interface ModelQuery
-{
-  public static final int VALIDITY_NONE = 0;
-  public static final int VALIDITY_PARTIAL = 1;
-  public static final int VALIDITY_STRICT = 2;
-
-  public static final int INCLUDE_ALL = 0xFF;
-  public static final int INCLUDE_ATTRIBUTES = 0x01;
-  public static final int INCLUDE_CHILD_NODES = 0x02;
-  public static final int INCLUDE_SEQUENCE_GROUPS = 0x04;
-  public static final int INCLUDE_TEXT_NODES = 0x08;
-  public static final int INCLUDE_ENCLOSING_REPLACE_ACTIONS = 0x10;
-
-  public static final int EDIT_MODE_UNCONSTRAINED = 0;
-  public static final int EDIT_MODE_CONSTRAINED_LENIENT= 1;
-  public static final int EDIT_MODE_CONSTRAINED_STRICT = 2;
-
-
-  void setEditMode(int editMode);
-
-  int  getEditMode();
-
-  /**
-   * Returns the CMDocument that corresponds to the DOM Node.
-   * or null if no CMDocument is appropriate for the DOM Node.
-   */
-  CMDocument getCorrespondingCMDocument(Node node);
-
-  /**
-   * Returns the corresponding CMNode for the DOM Node
-   * or null if no CMNode is appropriate for the DOM Node.
-   */
-  CMNode getCMNode(Node node);
-
-  /**
-   * Returns the corresponding CMAttribute for the DOM Node
-   * or null if no CMNode is appropriate for the DOM Node.
-   */
-  CMAttributeDeclaration getCMAttributeDeclaration(Attr attr);
-
-  /**
-   * Returns the corresponding CMAttribute for the DOM Node
-   * or null if no CMNode is appropriate for the DOM Node.
-   */
-  CMElementDeclaration getCMElementDeclaration(Element element);
-
-  /**
-   * Returns true if the content of the element is valid
-   */
-  boolean isContentValid(Element element);
-
-  /**
-   * Returns the CMNode of the parent element's content model
-   * that corresponds to the node
-   */
-  CMNode getOrigin(Node node);
-
-  /**
-   * Returns an array of CMNodes of the parent element's content model
-   * that corresponds to the node
-   */
-  CMNode[] getOriginArray(Element element);
-
-  /**
-   * Returns a list of all CMNode 'meta data' that may be potentially added to the element.
-   */
-  List getAvailableContent(Element element, CMElementDeclaration ed, int includeOptions);
-
-  /**
-   * Can a DOM Node corresponding to the CMNode 'meta data' be added to the parent
-   */
-  boolean canInsert(Element parent, CMNode cmNode, int index, int validityChecking);
-
-  /**
-   * Can multiple DOM Nodes corresponding to the list of CMNode 'meta data' be added to the parent
-   */
-  boolean canInsert(Element parent, List cmNodeList, int index, int validityChecking);
-
-  /**
-   * Can the DOM Node be removed
-   */
-  boolean canRemove(Node node, int validityChecking);
-
-  /**
-   * Can the list of DOM Nodes be removed
-   */
-  boolean canRemove(List nodeList, int validityChecking);
-
-  /**
-   * Can the children within the indicated indices be replaced with a DOM Node corresponding to the CMNode 'meta data'
-   */
-  boolean canReplace(Element parent, int startIndex, int endIndex, CMNode cmNode, int validityChecking);
-
-  /**
-   * Can the children within the indicated indices be replaced with multiple DOM Nodes corresponding to the list of CMNode 'meta data'
-   */
-  boolean canReplace(Element parent, int startIndex, int endIndex, List cmNodeList, int validityChecking);
-
-  /**
-   *
-   */
-  void getInsertActions(Element parent, CMElementDeclaration ed, int index, int includeOptions, int validityChecking, List actionList);
-
-  /**
-   *
-   */
-  void getInsertActions(Document parent, CMDocument cmDocument, int index, int includeOptions, int validityChecking, List actionList);
-
-  /**
-   * Return a list of replace actions that can be performed on the parent's content
-   */
-  void getReplaceActions(Element parent, CMElementDeclaration ed, int includeOptions, int validityChecking, List actionList);
-
-  /**
-   * Return a list of replace actions that can be performed on the selected children of that parent 
-   */
-  void getReplaceActions(Element parent, CMElementDeclaration ed, List selectedChildren, int includeOptions, int validityChecking, List actionList);
-
-                        
-  /** 
-   *  @deprecated - use getPossibleDataTypeValues()
-   */
-  List getDataTypeValues(Element element, CMNode cmNode);
-
-  /**
-   * This methods return an array of possible values corresponding to the datatype of the CMNode (either an CMAttributeDeclaration or a CMElementDeclaration)
-   */
-  String[] getPossibleDataTypeValues(Element element, CMNode cmNode);
-
-  /**
-   * This method may return null if a CMDocumentManager is not used by the ModelQuery
-   */
-  CMDocumentManager getCMDocumentManager();                                       
-
-  /**
-   * This method may return null the ModelQuery doesn't support the use of extensions
-   */
-  ModelQueryExtensionManager getExtensionManager();   
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAction.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAction.java
deleted file mode 100644
index 059c4ff..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAction.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.w3c.dom.Node;
-
-
-public interface ModelQueryAction
-{
-  public static final int INSERT  = 1;
-  public static final int REMOVE  = 2;
-  public static final int REPLACE = 4;
-
-  public int getKind();
-  /**
-   * if start index == -1 then no insert is possible
-   * if start index != -1 and endIndex == -1 then an insert at any position is possible
-   */
-  public int getStartIndex();
-  public int getEndIndex();
-  public Node getParent();
-  public CMNode getCMNode();
-  public Object getUserData();
-  public void setUserData(Object object);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAssociationProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAssociationProvider.java
deleted file mode 100644
index 7777756..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAssociationProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-/**
- * 
- *
- */
-public interface ModelQueryAssociationProvider extends ModelQueryCMProvider
-{
-  public CMNode getCMNode(Node node);
-  public CMDataType getCMDataType(Text text); 
-  public CMAttributeDeclaration getCMAttributeDeclaration(Attr attr);
-  public CMElementDeclaration getCMElementDeclaration(Element element);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryCMProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryCMProvider.java
deleted file mode 100644
index f0f9373..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryCMProvider.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.w3c.dom.Node;
-
-
-
-/**
- *
- */
-public interface ModelQueryCMProvider
-{
-  /**
-   * Returns the CMDocument that corresponds to the DOM Node.
-   * or null if no CMDocument is appropriate for the DOM Node.
-   */
-  CMDocument getCorrespondingCMDocument(Node node);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtension.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtension.java
deleted file mode 100644
index b417f56..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtension.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public abstract class ModelQueryExtension
-{  
-  protected static final String[] EMPTY_STRING_ARRAY = {};
-  protected static final CMNode[] EMPTY_CMNODE_ARRAY = {};
-  
-  /**
- * @param ownerElement - the owner element
- * @param namespace - the active namespace
- * @param name - the name of an attribute node
- * @return valid values for the given attribute
- */
-public String[] getAttributeValues(Element ownerElement, String namespace, String name)
-  {
-    return EMPTY_STRING_ARRAY;
-  }
-  
-  public String[] getElementValues(Node parentNode, String namespace, String name)
-  {
-    return EMPTY_STRING_ARRAY;
-  }
-  
-  /**
- * @param parentNode
- * @param namespace
- * @param name
- * @return whether a child element of the given parentNode is valid given the active namespace
- */
-public boolean isApplicableChildElement(Node parentNode, String namespace, String name)
-  {
-    return true;
-  }
-  
-  /**
- * @param parentElement - the parent Element when asking for children, the owner Element when asking for attributes 
- * @param namespace - the active namespace
- * @param includeOptions - ModelQuery.INCLUDE_ATTRIBUTES or ModelQuery.INCLUDE_CHILD_NODES
- * @return additional valid CMAttributeDeclarations or CMElementDeclarations 
- */
-public CMNode[] getAvailableElementContent(Element parentElement, String namespace, int includeOptions) 
-  {
-	  return EMPTY_CMNODE_ARRAY;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtensionManager.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtensionManager.java
deleted file mode 100644
index 31c440f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtensionManager.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension;
-
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.w3c.dom.Element;
-
-
-
-public interface ModelQueryExtensionManager
-{
-  List getDataTypeValues(Element element, CMNode cmNode);                             
-
-  void filterAvailableElementContent(List availableContent, Element element, CMElementDeclaration ed);
-
-  void filterAvailableElementContent(List availableContent, Element element, CMElementDeclaration ed, int includeOptions);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/BaseAssociationProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/BaseAssociationProvider.java
deleted file mode 100644
index 54242f6..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/BaseAssociationProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAssociationProvider;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-/**
- *
- */
-public abstract class BaseAssociationProvider implements ModelQueryAssociationProvider
-{                    
-  public BaseAssociationProvider()
-  {
-  }
-
-  public CMNode getCMNode(Node node)
-  {
-    CMNode result = null;
-    switch (node.getNodeType())
-    {
-      case Node.ATTRIBUTE_NODE :
-      {
-        result = getCMAttributeDeclaration((Attr)node);
-        break;
-      }
-      case Node.ELEMENT_NODE :
-      {
-        result = getCMElementDeclaration((Element)node);
-        break;
-      }
-      case Node.CDATA_SECTION_NODE :
-      case Node.TEXT_NODE :
-      {
-        result = getCMDataType((Text)node);
-        break;
-      }
-    }
-    return result;
-  }
-
-
-  public CMDataType getCMDataType(Text text)
-  {
-    CMDataType result = null;
-    Node parentNode = text.getParentNode();
-    if (parentNode != null && parentNode.getNodeType() == Node.ELEMENT_NODE)
-    {
-      CMElementDeclaration ed = getCMElementDeclaration((Element)parentNode);
-      result = ed.getDataType();
-    }
-    return result;
-  }
-
-
-  public CMAttributeDeclaration getCMAttributeDeclaration(Attr attr)
-  {
-    CMAttributeDeclaration result = null;
-    Element element = attr.getOwnerElement();
-    if (element != null)
-    {
-      CMElementDeclaration ed = getCMElementDeclaration(element);
-      if (ed != null)
-      {
-        result = (CMAttributeDeclaration)ed.getAttributes().getNamedItem(attr.getName());
-      }
-    }
-    return result;
-  }          
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentLoader.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentLoader.java
deleted file mode 100644
index 6905948..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentLoader.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
-                          
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/**
- *
- */
-public class CMDocumentLoader
-{                                           
-  protected Document document;
-  protected ModelQuery modelQuery;
-  protected CMDocumentManager cmDocumentManager;
-  protected boolean isInferredGrammarEnabled = true;  
-  protected CMDocumentLoadingNamespaceTable namespaceTable;
-  protected int count = 0;
-    
-  public CMDocumentLoader(Document document, ModelQuery modelQuery)
-  {                             
-    this(document, modelQuery.getCMDocumentManager());
-  }
-  
-  public CMDocumentLoader(Document document, CMDocumentManager cmDocumentManager)
-  {   
-    this.document = document;                     
-    this.cmDocumentManager = cmDocumentManager;  	
-  }
-  
-  public void loadCMDocuments()
-  {          
-    //System.out.println("----------loadCMDocuments ------------");          
-    //long time = System.currentTimeMillis();
-       
-    boolean walkDocument = false;
-            
-    cmDocumentManager.removeAllReferences();
-      
-    String[] doctypeInfo = XMLAssociationProvider.getDoctypeInfo(document);
-    if (doctypeInfo != null)
-    {
-      // load the doctype if required
-      walkDocument = handleGrammar(doctypeInfo[0], doctypeInfo[1], "DTD"); //$NON-NLS-1$
-    }                                   
-    else
-    {                           
-      Element element = getRootElement(document);
-      if (element != null)
-      {
-        namespaceTable = new CMDocumentLoadingNamespaceTable(document);   
-        namespaceTable.addElement(element);
-        if (namespaceTable.isNamespaceEncountered())
-        {   
-          walkDocument = true;
-          //System.out.println("isNamespaceAware");
-        }
-        else
-        {
-          namespaceTable = null;
-          walkDocument = isInferredGrammarEnabled;
-          //System.out.println("is NOT namespaceAware");
-        }        
-      }  
-    } 
-
-    if (walkDocument)
-    {
-      visitNode(document);   
-    } 
-
-    //System.out.println("--- elapsed time (" + count + ") = " + (System.currentTimeMillis() - time));
-  }
-
-
-  public boolean handleGrammar(String publicId, String systemId, String type)
-  {           
-    boolean result = false;
-    
-    int status = cmDocumentManager.getCMDocumentStatus(publicId);
-    if (status == CMDocumentCache.STATUS_NOT_LOADED)
-    {
-      cmDocumentManager.addCMDocumentReference(publicId, systemId, type);
-    }                 
-    else if (status == CMDocumentCache.STATUS_ERROR)
-    {
-      result = true;
-    }
-    return result;
-  } 
-    
-
-  public void handleElement(Element element)
-  {  
-    visitChildNodes(element);
-  }
-
-                             
-  public void handleElementNS(Element element)
-  {
-    namespaceTable.addElement(element);
-    visitChildNodes(element);
-  }
-                                                    
-
-  public void visitNode(Node node)
-  {                    
-    int nodeType = node.getNodeType();
-    if (nodeType == Node.ELEMENT_NODE)
-    {
-      count++;       
-
-      Element element = (Element)node;    
-      if (namespaceTable == null)
-      {
-        handleElement(element); 
-      }
-      else
-      {
-        handleElementNS(element);
-      }            
-    }
-    else if (nodeType == Node.DOCUMENT_NODE)
-    {
-      visitChildNodes(node);
-    }
-  }
-
-
-  protected void visitChildNodes(Node node)
-  {   
-	  for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) 
-    {
-	    visitNode(child);
-    }
-	}             
-
-
-  protected class CMDocumentLoadingNamespaceTable extends NamespaceTable
-  {                                        
-    protected List newNamespaceList;
-
-    public CMDocumentLoadingNamespaceTable(Document document)
-    {                                                          
-      super(document);     
-    }  
-                                           
-
-    public void addElement(Element element)
-    {                               
-      newNamespaceList = null;
-      super.addElement(element);  
-      if (newNamespaceList != null)
-      {
-        for (Iterator i = newNamespaceList.iterator(); i.hasNext(); )
-        {
-          NamespaceInfo info = (NamespaceInfo)i.next();
-          handleGrammar(info.uri, info.locationHint, "XSD"); //$NON-NLS-1$
-        }
-      }
-    }                 
-     
-                               
-    protected void internalAddNamespaceInfo(String key, NamespaceInfo info)
-    {
-      super.internalAddNamespaceInfo(key, info);           
-      if (newNamespaceList == null)
-      {
-        newNamespaceList = new ArrayList();
-      }
-      newNamespaceList.add(info);    
-    }                     
-  }
-
-  
-  protected Element getRootElement(Document document)
-  {
-    Element result = null;
-    NodeList nodeList = document.getChildNodes();
-    int nodeListLength = nodeList.getLength();
-    for (int i = 0 ; i < nodeListLength; i++)
-    {
-      Node node = nodeList.item(i);
-      if (node.getNodeType() == Node.ELEMENT_NODE)
-      {
-        result = (Element)node;
-        break;
-      }
-    }
-    return result;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentManagerImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentManagerImpl.java
deleted file mode 100644
index c4cbfc4..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentManagerImpl.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
-                          
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.ContentModelManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation.AnnotationUtility;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManagerListener;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentReferenceProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-
-
-/**
- *
- */
-public class CMDocumentManagerImpl implements CMDocumentManager
-{                                
-  protected CMDocumentCache cmDocumentCache;
-  protected CMDocumentReferenceProvider cmDocumentReferenceProvider;
-  protected List listenerList = new Vector(); 
-  protected Hashtable propertyTable = new Hashtable();
-  protected Hashtable publicIdTable = new Hashtable();
-
-       
-  public CMDocumentManagerImpl(CMDocumentCache cmDocumentCache, CMDocumentReferenceProvider cmDocumentReferenceProvider)
-  {                                                       
-    this.cmDocumentCache = cmDocumentCache;                                                                            
-    this.cmDocumentReferenceProvider = cmDocumentReferenceProvider;
-    setPropertyEnabled(PROPERTY_AUTO_LOAD, true);
-    setPropertyEnabled(PROPERTY_USE_CACHED_RESOLVED_URI, false);
-    setPropertyEnabled(PROPERTY_PERFORM_URI_RESOLUTION, true);
-  }         
-
-       
-  public CMDocumentCache getCMDocumentCache()
-  {
-    return cmDocumentCache;
-  }
-
- 
-  public void setPropertyEnabled(String propertyName, boolean value)
-  {
-    propertyTable.put(propertyName, value ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
-    for (Iterator i = listenerList.iterator(); i.hasNext(); )
-    {
-      CMDocumentManagerListener listener = (CMDocumentManagerListener)i.next();
-      listener.propertyChanged(this, propertyName);
-    }
-  }                                        
-
-        
-  public boolean getPropertyEnabled(String propertyName)
-  {
-    Object object = propertyTable.get(propertyName);
-    return object != null && object.equals("true"); //$NON-NLS-1$
-  }
-
-
-  public void addListener(CMDocumentManagerListener listener)
-  {
-    listenerList.add(listener);
-    cmDocumentCache.addListener(listener);
-  }
-
-
-  public void removeListener(CMDocumentManagerListener listener)
-  {
-    listenerList.remove(listener);
-    cmDocumentCache.removeListener(listener);
-  }                       
-   
-                   
-  protected String lookupResolvedURI(String publicId)
-  {
-    String key = publicId != null ? publicId : ""; //$NON-NLS-1$
-    return (String)publicIdTable.get(key);
-  }
-    
-
-  protected String lookupOrCreateResolvedURI(String publicId, String systemId)
-  {                    
-    String resolvedURI = null;                  
-
-    String key = publicId != null ? publicId : ""; //$NON-NLS-1$
-
-    if (getPropertyEnabled(PROPERTY_USE_CACHED_RESOLVED_URI))
-    {
-      resolvedURI = (String)publicIdTable.get(key);
-    }   
-
-    if (resolvedURI == null)
-    {
-      resolvedURI = cmDocumentReferenceProvider.resolveGrammarURI(publicId, systemId);
-      if (resolvedURI == null)
-      {
-        resolvedURI = ""; //$NON-NLS-1$
-      }
-      publicIdTable.put(key, resolvedURI);     
-    }                       
-  
-    return resolvedURI;
-  }
-
-
-  public int getCMDocumentStatus(String publicId)
-  {                                           
-    int status = CMDocumentCache.STATUS_NOT_LOADED; 
-    String resolvedURI = lookupResolvedURI(publicId);
-    if (resolvedURI != null)
-    {                      
-      status = cmDocumentCache.getStatus(resolvedURI);
-    }
-    return status;
-  }    
-              
-
-  public CMDocument getCMDocument(String publicId)
-  {                                           
-    CMDocument result = null;
-    String resolvedURI = lookupResolvedURI(publicId);
-    if (resolvedURI != null)
-    {                      
-      result = cmDocumentCache.getCMDocument(resolvedURI);
-    }
-    return result;
-  }    
-  
-
-  /* (non-Javadoc)
- * @see org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager#getCMDocument(java.lang.String, java.lang.String, java.lang.String)
- */
-public CMDocument getCMDocument(String publicId, String systemId, String type)
-  {                
-    CMDocument cmDocument = null;                           
-    String resolvedURI = null;
-
-    if (getPropertyEnabled(PROPERTY_AUTO_LOAD))
-    {
-      // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=136399
-      
-      if (getPropertyEnabled(PROPERTY_PERFORM_URI_RESOLUTION))
-      {
-        resolvedURI = lookupOrCreateResolvedURI(publicId, systemId);
-      }
-      else
-      {
-        resolvedURI = systemId;
-      }
-    }    
-    else
-    {
-      resolvedURI = lookupResolvedURI(publicId);
-    } 
-
-    if (resolvedURI != null)
-    {                   
-      int status = cmDocumentCache.getStatus(resolvedURI);
-      if (status == CMDocumentCache.STATUS_LOADED)
-      {                      
-        cmDocument = cmDocumentCache.getCMDocument(resolvedURI);
-      }   
-      else if (status == CMDocumentCache.STATUS_NOT_LOADED)
-      {     
-        if (getPropertyEnabled(PROPERTY_AUTO_LOAD))
-        {
-          cmDocument = loadCMDocument(publicId, resolvedURI, type, getPropertyEnabled(PROPERTY_ASYNC_LOAD));
-        }
-      }
-    }
-    return cmDocument;   
-  } 
-  
-  public void addCMDocumentReference(String publicId, String systemId, String type)
-  {
-    String resolvedURI = lookupOrCreateResolvedURI(publicId, systemId);
-    if (resolvedURI != null && resolvedURI.length() > 0)
-    {                                                                      
-      int status = cmDocumentCache.getStatus(resolvedURI);
-      if (status == CMDocumentCache.STATUS_NOT_LOADED)
-      {                      
-        loadCMDocument(publicId, resolvedURI, type, getPropertyEnabled(PROPERTY_ASYNC_LOAD));
-      }         
-    } 
-  }
-     
-
-  public void addCMDocument(String publicId, String systemId, String resolvedURI, String type, CMDocument cmDocument)
-  {
-    String key = publicId != null ? publicId : ""; //$NON-NLS-1$
-    publicIdTable.put(key, resolvedURI);
-    cmDocumentCache.putCMDocument(resolvedURI, cmDocument);
-  }
-
-
-  protected CMDocument loadCMDocument(final String publicId, final String resolvedURI, final String type, boolean async)
-  {                                                      
-    CMDocument result = null;
-                         
-    //System.out.println("about to build CMDocument(" + publicId + ", " + unresolvedURI + " = " + resolvedURI + ")");
-    if (async)
-    {     
-      cmDocumentCache.setStatus(resolvedURI, CMDocumentCache.STATUS_LOADING);
-      //Thread thread = new Thread(new AsyncBuildOperation(publicId, resolvedURI, type));
-      //thread.start();
-      Job job = new Job(XMLCoreMessages.loading + resolvedURI)
-      {
-        public boolean belongsTo(Object family)
-        {
-          boolean result = (family == CMDocumentManager.class);
-          return result;
-        }
-        
-        protected IStatus run(IProgressMonitor monitor)
-        {
-          try
-          {
-        	  buildCMDocument(publicId, resolvedURI, type);
-          }
-          catch (Exception e)
-          {
-        	  Logger.logException(e);
-          }
-          return Status.OK_STATUS;
-        }
-      };
-      job.schedule();
-    }
-    else
-    {                
-      result = buildCMDocument(publicId, resolvedURI, type);
-    }          
-    return result;
-  } 
-
-    
-
-  public synchronized CMDocument buildCMDocument(String publicId, String resolvedURI, String type)
-  {                                     
-    cmDocumentCache.setStatus(resolvedURI, CMDocumentCache.STATUS_LOADING);
-  
-    CMDocument result = null;         
-    if (resolvedURI != null && resolvedURI.length() > 0)
-    {
-      // TODO... pass the TYPE thru to the CMDocumentBuilder
-      result = ContentModelManager.getInstance().createCMDocument(resolvedURI, type);
-    }
-    if (result != null)
-    { 
-      // load the annotation files for the document 
-      if (publicId != null)
-      {    
-        AnnotationUtility.loadAnnotationsForGrammar(publicId, result);
-      }
-      cmDocumentCache.putCMDocument(resolvedURI, result);
-    }
-    else
-    {
-      cmDocumentCache.setStatus(resolvedURI, CMDocumentCache.STATUS_ERROR);
-    }
-    return result;
-  } 
-
-  public void removeAllReferences()
-  {
-    // TODO... initiate a timed release of the entries in the CMDocumentCache
-    publicIdTable = new Hashtable();
-  }
-}                                            
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentReferenceImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentReferenceImpl.java
deleted file mode 100644
index f4edabd..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentReferenceImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentReference;
-
-public class CMDocumentReferenceImpl implements CMDocumentReference
-{              
-  protected String systemId;
-  protected String publicId;
-
-  public CMDocumentReferenceImpl(String publicId, String systemId)
-  {
-    this.publicId = publicId;                                    
-    this.systemId = systemId;
-  }
-
-  public String getPublicId()
-  {                          
-    return publicId;
-  }
-
-  public String getSystemId()
-  {                          
-    return systemId;
-  }      
-  
-  public String toString()
-  {
-    return "[" + publicId + ", " + systemId + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/InferredGrammarBuildingCMDocumentLoader.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/InferredGrammarBuildingCMDocumentLoader.java
deleted file mode 100644
index c91e72c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/InferredGrammarBuildingCMDocumentLoader.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
-                          
-import java.util.Hashtable;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl.InferredGrammarFactory;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- *
- */
-public class InferredGrammarBuildingCMDocumentLoader extends CMDocumentLoader
-{     
-  protected CMElementDeclaration inferredCMElementDeclaration;
-  protected CMDocument inferredCMDocument;
-  protected InferredGrammarFactory inferredGrammarFactory;
-  protected Hashtable createdCMDocumentTable;
-
-  public InferredGrammarBuildingCMDocumentLoader(Document document, ModelQuery modelQuery)
-  {                             
-    this(document, modelQuery.getCMDocumentManager());
-  }
-  
-  public InferredGrammarBuildingCMDocumentLoader(Document document, CMDocumentManager cmDocumentManager)
-  {                             
-    super(document, cmDocumentManager);
-    createdCMDocumentTable = new Hashtable();             
-    inferredGrammarFactory = new InferredGrammarFactory();
-  }     
-
-     
-  public void loadCMDocuments()
-  {   
-    //System.out.println("----------loadCMDocuments ------------");          
-    if (inferredGrammarFactory != null)
-    {
-      //long time = System.currentTimeMillis();
-      super.loadCMDocuments();
-      //System.out.println("--- elapsed time (" + count + ") = " + (System.currentTimeMillis() - time));
-      //inferredGrammarFactory.debugPrint(createdCMDocumentTable.values());
-    }
-    
-  }
-
-  public void handleElement(Element element)
-  { 
-    CMElementDeclaration parentInferredCMElementDeclaration = inferredCMElementDeclaration;
-                
-    if (inferredCMDocument == null)
-    {     
-      String cacheKey = "inferred-document";                    //$NON-NLS-1$
-      inferredCMDocument = inferredGrammarFactory.createCMDocument("");   //$NON-NLS-1$
-      cmDocumentManager.addCMDocument("", "", cacheKey, "DTD", inferredCMDocument); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-      createdCMDocumentTable.put(cacheKey, inferredCMDocument);
-    } 
-
-    inferredCMElementDeclaration = inferredGrammarFactory.createCMElementDeclaration(inferredCMDocument, element, false);                             
-     
-    if (parentInferredCMElementDeclaration != null)
-    {
-      inferredGrammarFactory.createCMContent(inferredCMDocument, parentInferredCMElementDeclaration, inferredCMDocument, inferredCMElementDeclaration, false, null);
-    }     
-       
-
-    visitChildNodes(element);   
-           
-    // reset the 'current' state to inital values
-    inferredCMElementDeclaration = parentInferredCMElementDeclaration;
-  }
-  
-
-  public void handleElementNS(Element element)
-  {                             
-    CMDocument parentInferredCMDocument = inferredCMDocument;
-    CMElementDeclaration parentInferredCMElementDeclaration = inferredCMElementDeclaration;
-        
-    inferredCMDocument = null;                                                            
-    inferredCMElementDeclaration = null;
-
-    // by adding the element to the namespaceTable, handleGrammar() will get called for any schema references
-    if (element.getParentNode() != document)
-    {
-      namespaceTable.addElement(element);
-    }
-
-    String prefix = element.getPrefix();
-    String uri = namespaceTable.getURIForPrefix(prefix);
-
-    if (uri == null && element.getParentNode() == document)
-    {
-      // when this is the root element
-      // we need to add an implied "no namespace schema location"
-      uri = "ommitted-namespace"; //$NON-NLS-1$
-      namespaceTable.addNamespaceInfo(prefix, uri, ""); //$NON-NLS-1$
-    }  
-
-    // here's where we update the inferred grammar if required
-    // 
-    boolean createCMElementDeclaration = true;
-          
-    boolean isLocal = (uri == null && prefix == null);         
-    if (isLocal)
-    {          
-      if (parentInferredCMDocument == null)
-      {
-        // this is a local element... and the parent is not inferred (e.g) it has a known grammar
-        // so we don't need to create an element declaration for this element
-        createCMElementDeclaration = false; 
-      }                             
-      else
-      {
-        if (uri == null)
-        {
-          uri = "ommitted-namespace"; //$NON-NLS-1$
-        }
-      }
-    }
-
-    if (createCMElementDeclaration)
-    {            
-      if (isLocal)
-      {
-        inferredCMDocument = parentInferredCMDocument;
-        inferredCMElementDeclaration = inferredGrammarFactory.createCMElementDeclaration(inferredCMDocument, element, true);       
-      }          
-      else
-      {
-        boolean createCMDocument = false;
-
-        String cacheKey = "inferred-document" + uri;  //$NON-NLS-1$
-        inferredCMDocument = (CMDocument)createdCMDocumentTable.get(cacheKey);
-
-        if (inferredCMDocument == null)
-        {
-          // we don't have an inferred document for this uri yet... let's see of we need one
-          int status = cmDocumentManager.getCMDocumentStatus(uri);                                                                                           
-          if (status == CMDocumentCache.STATUS_NOT_LOADED || status == CMDocumentCache.STATUS_ERROR)
-          {                  
-            // the cache does not contain a 'proper' CMDocument for this uri
-            // so we need to create an inferred one
-            createCMDocument = true;
-          } 
-        } 
-                
-        if (createCMDocument)
-        {           
-          //System.out.println("encountered element {" + element.getNodeName() + "} ... creating inferred CMDocument for " + uri);
-          inferredCMDocument = inferredGrammarFactory.createCMDocument(uri);
-          cmDocumentManager.addCMDocument(uri, "", cacheKey, "XSD", inferredCMDocument); //$NON-NLS-1$ //$NON-NLS-2$
-          createdCMDocumentTable.put(cacheKey, inferredCMDocument);
-        }
-
-        if (inferredCMDocument != null)
-        {
-          inferredCMElementDeclaration = inferredGrammarFactory.createCMElementDeclaration(inferredCMDocument, element, false);
-        }                                                                                                                                                   
-      }
-
-      if (parentInferredCMElementDeclaration != null)
-      {
-        inferredGrammarFactory.createCMContent(parentInferredCMDocument, parentInferredCMElementDeclaration, inferredCMDocument, inferredCMElementDeclaration, isLocal, uri);
-      } 
-    }               
-          
-    visitChildNodes(element);
-      
-    // reset the 'current' state to inital values
-    inferredCMElementDeclaration = parentInferredCMElementDeclaration;
-    inferredCMDocument = parentInferredCMDocument;
-  }                                                                                                       
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryActionHelper.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryActionHelper.java
deleted file mode 100644
index b66a0d6..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryActionHelper.java
+++ /dev/null
@@ -1,574 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.util.CMValidator;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/**
- *
- */
-public class ModelQueryActionHelper
-{
-  protected ModelQueryImpl modelQuery;
-
-  protected static class Action implements ModelQueryAction
-  {
-    public int kind;
-    public int startIndex;
-    public int endIndex;
-    public Node parent;
-    public CMNode cmNode;
-    public Object userData;
-
-    public Action(int kind, Node parent, CMNode cmNode)
-    {
-      this.kind = kind;
-      this.parent = parent;
-      this.cmNode = cmNode;
-    }
-
-    public Action(int kind, Node parent, CMNode cmNode, int startIndex, int endIndex)
-    {
-      this.kind = kind;
-      this.parent = parent;
-      this.cmNode = cmNode;
-      this.startIndex = startIndex;
-      this.endIndex = endIndex;
-    }
-
-    public int getKind()
-    {
-      return kind;
-    }
-
-    public int getStartIndex()
-    {
-      return startIndex;
-    }
-
-    public int getEndIndex()
-    {
-      return endIndex;
-    }
-
-    public Node getParent()
-    {
-      return parent;
-    }
-
-    public CMNode getCMNode()
-    {
-      return cmNode;
-    }
-
-    public Object getUserData()
-    {
-      return userData;
-    }
-
-    public void setUserData(Object object)
-    {
-      userData = object;
-    }
-
-    public void performAction()
-    {
-    }
-  }
-
-
-  public ModelQueryActionHelper(ModelQueryImpl modelQuery)
-  {
-    this.modelQuery = modelQuery;
-  }
-
-
-  public void getAllActions(Element parent, CMElementDeclaration ed, int validityChecking, List actionList)
-  {
-  }
-
-
-  // insert actions
-  //
-  public void getInsertActions(Element parent, CMElementDeclaration ed, int index, int includeOptions, int validityChecking, List actionList)
-  {
-    if ((includeOptions & ModelQuery.INCLUDE_ATTRIBUTES) != 0)
-    {
-      getInsertAttributeActions(parent, ed, validityChecking, actionList);
-    }
-    includeOptions &= ~ModelQuery.INCLUDE_ATTRIBUTES;
-    if ((includeOptions & ModelQuery.INCLUDE_CHILD_NODES) != 0)
-    {
-      if (index != -1)
-      {
-        getInsertChildNodeActionsAtIndex(parent, ed, index, includeOptions, validityChecking, actionList);
-      }
-      else
-      {
-        getInsertChildNodeActions(parent, ed, includeOptions, validityChecking, actionList);
-      }
-    }
-  }
-
-
-
-  protected void getInsertAttributeActions(Element parent, CMElementDeclaration ed, int validityChecking, List actionList)
-  {
-    // get actions for each insertable attribute
-    //
-    List availableAttributeList = modelQuery.getAvailableContent(parent, ed, ModelQuery.INCLUDE_ATTRIBUTES);
-
-    for (Iterator i = availableAttributeList.iterator(); i.hasNext(); )
-    {
-      CMAttributeDeclaration ad = (CMAttributeDeclaration)i.next();
-      if (modelQuery.canInsert(parent, ed, ad, 0, validityChecking))
-      {
-        Action action = new Action(ModelQueryAction.INSERT, parent, ad);
-        actionList.add(action);
-      }
-    }
-  }
-
-
-  protected void getInsertChildNodeActionsAtIndex(Element parent, CMElementDeclaration ed, int index, int includeOptions, int validityChecking, List actionList)
-  {                       
-    // get actions for each insertable attribute
-    //
-    int size = parent.getChildNodes().getLength();
-    if (index <= size)
-    {                                                                                          
-      List contentSpecificationList = modelQuery.getValidator().createContentSpecificationList(parent, ed); 
-      List availableChildNodeList = modelQuery.getAvailableContent(parent, ed, includeOptions);
-
-      boolean isSimpleChoice = isSimpleChoiceGroupContentModel(ed);
-     
-      for (Iterator i = availableChildNodeList.iterator(); i.hasNext(); )
-      {
-        CMNode cmNode = (CMNode)i.next();      
-        if (isSimpleChoice || modelQuery.canInsert(parent, ed, cmNode, index, validityChecking, contentSpecificationList))
-        {
-          Action action = new Action(ModelQueryAction.INSERT, parent, cmNode, index, index);
-          actionList.add(action);
-        }
-      }
-    }
-  }
-                  
- 
-  protected boolean isSimpleChoiceGroupContentModel(CMElementDeclaration ed)
-  {       
-    boolean result = false;
-    CMNode cmNode = ed.getContent();
-    if (cmNode != null && cmNode.getNodeType() == CMNode.GROUP)
-    {
-      CMGroup cmGroup = (CMGroup)cmNode;
-      if (cmGroup.getOperator() == CMGroup.CHOICE && cmGroup.getMaxOccur() == -1)
-      {                   
-        result = true;
-        CMNodeList list = cmGroup.getChildNodes();
-        for (int i = list.getLength() - 1; i >= 0; i--)
-        {
-          if (list.item(i).getNodeType() != CMNode.ELEMENT_DECLARATION)
-          {
-            result = false;
-            break;
-          }
-        }
-      }
-    }
-    return result;
-  }
-
-
-  protected void getInsertChildNodeActions(Element parent, CMElementDeclaration ed, int includeOptions, int validityChecking, List actionList)
-  {
-    int size = parent.getChildNodes().getLength();
-    List contentSpecificationList = modelQuery.getValidator().createContentSpecificationList(parent, ed);
-    List availableChildNodeList = modelQuery.getAvailableContent(parent, ed, includeOptions);
-
-    boolean isSimpleChoice = isSimpleChoiceGroupContentModel(ed);
-
-    for (Iterator iterator = availableChildNodeList.iterator(); iterator.hasNext(); )
-    {
-      CMNode cmNode = (CMNode)iterator.next();
-      for (int i = size; i >= 0; i--)
-      {
-        if (isSimpleChoice || modelQuery.canInsert(parent, ed, cmNode, i, validityChecking, contentSpecificationList))
-        {
-          Action action = new Action(ModelQueryAction.INSERT, parent, cmNode, i, i);
-          actionList.add(action);
-          break;
-        }
-      }
-    }
-  }
-
-  public void getInsertActions(Document parent, CMDocument cmDocument, int index, int includeOptions, int validityChecking, List actionList)
-  {
-    // get the root element and doctype index (if any)
-    //
-    int doctypeIndex = -1;
-    DocumentType doctype = null;
-    Element rootElement = null;
-    NodeList nodeList = parent.getChildNodes();
-    int nodeListLength = nodeList.getLength();
-    for (int i = 0; i < nodeListLength; i++)
-    {
-      Node childNode = nodeList.item(i);
-      if (childNode.getNodeType() == Node.ELEMENT_NODE)
-      {
-        rootElement = (Element)childNode;
-        break;
-      }
-      else if (childNode.getNodeType() == Node.DOCUMENT_TYPE_NODE)
-      {
-        doctype = (DocumentType)childNode;
-        doctypeIndex = i;
-      }
-    }
-
-    // make sure that root elements are only added after the doctype (if any)
-    if (rootElement == null && index > doctypeIndex)
-    {
-      CMNamedNodeMap map = cmDocument.getElements();
-      int mapLength = map.getLength();
-      for (int i = 0; i < mapLength; i++)
-      {
-        CMNode cmNode = map.item(i);
-
-        boolean canAdd = true;
-        if (validityChecking == ModelQuery.VALIDITY_STRICT)
-        {
-          canAdd = doctype == null || doctype.getName().equals(cmNode.getNodeName());
-        }
-
-        if (canAdd)
-        {
-          Action action = new Action(ModelQueryAction.INSERT, parent, cmNode, index, index);
-          actionList.add(action);
-        }
-      }
-    }
-  }
-
-
-
-  public void getInsertChildNodeActionTable(Element parent, CMElementDeclaration ed, int validityChecking, Hashtable actionTable)
-  {
-  }
-
-
-  public void getReplaceActions(Element parent, CMElementDeclaration ed, int includeOptions, int validityChecking, List actionList)
-  {
-    CMValidator.MatchModelNode matchModelNode = modelQuery.getValidator().getMatchModel(ed, parent);
-    if (matchModelNode != null)
-    {
-      MatchModelVisitor visitor = new MatchModelVisitor(parent, actionList);
-      visitor.visitMatchModelNode(matchModelNode);
-    }     
-  }
-
-  public void getReplaceActions(Element parent, CMElementDeclaration ed, List selectedChildren, int includeOptions, int validityChecking, List actionList)
-  {
-    int[] range = getRange(parent, selectedChildren);
-    if (range != null)
-    {                
-      if (isContiguous(parent, range, selectedChildren))
-      {
-        List tempList = new Vector();
-        getReplaceActions(parent, ed, includeOptions, validityChecking, tempList);
-        if ((includeOptions & ModelQuery.INCLUDE_ENCLOSING_REPLACE_ACTIONS) != 0)
-        {
-          removeActionsNotContainingRange(tempList, range[0], range[1]);            
-        }
-        else
-        {
-          removeActionsNotMatchingRange(tempList, range[0], range[1]);    
-        }
-        actionList.addAll(tempList);
-      }
-    }   
-    
-    if (selectedChildren.size() == 1)
-    {
-      Node node = (Node)selectedChildren.get(0);
-      if (node.getNodeType() == Node.ELEMENT_NODE)
-      {        
-        Element childElement = (Element)node;       
-        CMNode childEd = modelQuery.getCMElementDeclaration(childElement);
-        if (childEd != null)
-        {         
-
-          CMNode childOrigin= modelQuery.getOrigin(childElement);
-
-          CMNodeList cmNodeList = childOrigin != null ? 
-                                    (CMNodeList)childOrigin.getProperty("SubstitutionGroup") : //$NON-NLS-1$
-                                    (CMNodeList)childEd.getProperty("SubstitutionGroup"); //$NON-NLS-1$
-
-          if (cmNodeList != null && cmNodeList.getLength() > 1)
-          {                                                 
-            int replaceIndex = getIndex(parent, childElement);
-            String childEdName = childEd.getNodeName();
-            for (int i = 0; i < cmNodeList.getLength(); i++)
-            {         
-              CMNode substitution = cmNodeList.item(i);
-              if (!substitution.getNodeName().equals(childEdName) && !Boolean.TRUE.equals(substitution.getProperty("Abstract"))) //$NON-NLS-1$
-              {
-                Action action = new Action(ModelQueryAction.REPLACE, parent, cmNodeList.item(i), replaceIndex, replaceIndex);
-                actionList.add(action);
-              }
-            }
-          }
-        }
-      }   
-    }
-  }     
-           
-  
-  // returns true if the selected nodes are contiguous
-  //  
-  protected boolean isContiguous(Element parent, int[] range, List selectedNodeList)
-  {         
-    boolean result = true;
-    NodeList nodeList = parent.getChildNodes();
-	// issue: nodeListLength was never read, but in theory, 
-	// nodelList.getLength() might cause some clearing of cached 
-	// data, or something, so leaving in a potential meaningless call, for now.
-    //int nodeListLength = nodeList.getLength();
-	nodeList.getLength();
-    for (int i = range[0]; i < range[1]; i++)
-    {       
-      Node node = nodeList.item(i);    
-      if (!isWhitespaceNode(node) && !selectedNodeList.contains(node))
-      {             
-        result = false;
-        break;
-      }                       
-    }         
-    return result;
-  }
- 
- 
-  protected int[] getRange(Element parent, List list)
-  {
-    int[] result = null;
-    int first = -1;
-    int last = -1;                     
-
-    NodeList nodeList = parent.getChildNodes();
-    int nodeListLength = nodeList.getLength();
-    for (int i = 0; i < nodeListLength; i++)
-    {       
-      Node node = nodeList.item(i);    
-      if (list.contains(node))
-      {             
-        first = (first == -1) ? i : Math.min(first, i);        
-        last = Math.max(last, i);
-      }    
-    }
-   
-    if (first != -1 && last!= -1)
-    {             
-      result = new int[2];
-      result[0] = first;
-      result[1] = last;
-    }   
-    return result;
-  } 
-
-
-  protected boolean isWhitespaceNode(Node node)
-  {
-    return node.getNodeType() == Node.TEXT_NODE &&
-           node.getNodeValue().trim().length() == 0;
-  } 
-
-
-  protected int getIndex(Node parentNode, Node child)
-  {
-    NodeList nodeList = parentNode.getChildNodes();
-    int index = -1;
-    int size = nodeList.getLength();
-    for (int i = 0; i < size; i++)
-    {
-      if (nodeList.item(i) == child)
-      {
-        index = i;
-        break;
-      }
-    }
-    return index;
-  }                    
-
-
-  protected boolean isActionContainingRange(ModelQueryAction action, int startIndex, int endIndex)
-  {
-    int actionStartIndex = action.getStartIndex();
-    int actionEndIndex = action.getEndIndex();
-
-    return (actionStartIndex <= startIndex &&
-            actionEndIndex >= endIndex);
-  } 
-           
-
-  protected boolean isActionMatchingRange(ModelQueryAction action, int startIndex, int endIndex)
-  {
-    int actionStartIndex = action.getStartIndex();
-    int actionEndIndex = action.getEndIndex();
-    return (actionStartIndex == startIndex &&        
-            actionEndIndex == endIndex);
-  } 
-           
-
-  protected void removeActionsNotContainingRange(List actionList, int startIndex, int endIndex)
-  {
-    for (int i = actionList.size() - 1; i >= 0; i--)
-    {
-      ModelQueryAction action = (ModelQueryAction)actionList.get(i);
-      if (!isActionContainingRange(action, startIndex, endIndex))
-      {
-        actionList.remove(i);
-      }
-    }
-  }
-
-
-  protected void removeActionsNotMatchingRange(List actionList, int startIndex, int endIndex)
-  {
-    for (int i = actionList.size() - 1; i >= 0; i--)
-    {
-      ModelQueryAction action = (ModelQueryAction)actionList.get(i);
-      if (!isActionMatchingRange(action, startIndex, endIndex))
-      {
-        actionList.remove(i);
-      }
-    }
-  }
-
-
-  public static class MatchModelVisitor
-  {
-    int indent;
-    int elementIndex;
-    Node parent;
-    List actionList;
-
-    public MatchModelVisitor(Node parent, List actionList)
-    {
-      this.parent = parent;
-      this.actionList = actionList;
-    }
-
-    public int indexOfNextElement(int start)
-    {
-      NodeList nodeList = parent.getChildNodes();
-      int length = nodeList.getLength();
-      int result = length;
-      for (int i = start; i < length; i++)
-      {
-        Node node = nodeList.item(i);
-        if (node.getNodeType() == Node.ELEMENT_NODE)
-        {
-          result = i;
-          break;
-        }
-      }
-      return result;
-    }
-
-    public void visitMatchModelNode(CMValidator.MatchModelNode matchModelNode)
-    {
-      int startIndex = indexOfNextElement(elementIndex);
-
-      //String cmNodeName = matchModelNode.cmNode != null ? matchModelNode.cmNode.getNodeName() : "null";
-      //printIndented(indent, "+MatchModelNode : " + cmNodeName +  " " + startIndex);
-
-      indent += 2;
-      for (Iterator iterator = matchModelNode.children.iterator(); iterator.hasNext(); )
-      {
-        CMValidator.MatchModelNode child = (CMValidator.MatchModelNode)iterator.next();
-        visitMatchModelNode(child);
-      }
-      indent -= 2;
-
-      if (matchModelNode.cmNode != null)
-      {
-        int nodeType = matchModelNode.cmNode.getNodeType();
-        if (nodeType == CMNode.GROUP)
-        {
-          CMGroup group = (CMGroup)matchModelNode.cmNode;
-          if (group.getOperator() == CMGroup.CHOICE)
-          {
-            addReplaceActions(matchModelNode, group, startIndex, elementIndex - 1);
-          }
-        }
-        else if (nodeType == CMNode.ELEMENT_DECLARATION)
-        {
-          elementIndex = startIndex + 1;
-        }
-        //printIndented(indent, "-MatchModelNode : " + cmNodeName +  " " + (elementIndex - 1));
-      }
-    }
-
-    public void addReplaceActions(CMValidator.MatchModelNode matchModelNode, CMGroup group, int startIndex, int endIndex)
-    {
-      CMNode excludeCMNode = null;
-      if (matchModelNode.children.size() > 0)
-      {
-        CMValidator.MatchModelNode child = (CMValidator.MatchModelNode)matchModelNode.children.get(0);
-        excludeCMNode = child.cmNode;
-      }
-
-      CMNodeList nodeList = group.getChildNodes();
-      int size = nodeList.getLength();
-      for (int i = 0; i < size; i++)
-      {
-        CMNode alternative = nodeList.item(i);
-        if (alternative != excludeCMNode)
-        {
-          Action action = new Action(ModelQueryAction.REPLACE, parent, alternative, startIndex, endIndex);
-          actionList.add(action);
-        }
-      }
-    }
-  }
-
-  //public static void printIndented(int indent, String string)
-  //{
-  //  for (int i = 0; i < indent; i++)
-  //  {
-  //    System.out.print(" ");
-  //  }
-  //  System.out.println(string);
-  //}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryImpl.java
deleted file mode 100644
index 436d8ff..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryImpl.java
+++ /dev/null
@@ -1,856 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl.ModelQueryExtensionManagerImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.util.CMDataTypeValueHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.util.DOMValidator;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAssociationProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtensionManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMVisitor;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-
-/**
- * This class implements a large portion of the ModelQuery interfaces.
- * Some work is delegated to the DOMHelper, CMDocumentManager, and DOMValidator.
- */
-public class ModelQueryImpl implements ModelQuery
-{
-  protected ModelQueryAssociationProvider modelQueryAssociationProvider;
-  protected ModelQueryActionHelper modelQueryActionHelper;
-  protected DOMValidator validator;   
-  protected ModelQueryExtensionManagerImpl extensionManager;   
-  protected CMDataTypeValueHelper valueHelper;
-  protected int editMode = EDIT_MODE_CONSTRAINED_STRICT;
-
-  public ModelQueryImpl(ModelQueryAssociationProvider modelQueryAssociationProvider)
-  {
-    this.modelQueryAssociationProvider = modelQueryAssociationProvider;
-    modelQueryActionHelper = createModelQueryActionHelper();
-    validator = new DOMValidator();                         
-    extensionManager = new ModelQueryExtensionManagerImpl();
-    valueHelper = new CMDataTypeValueHelper();
-  }
-                         
-  public int getEditMode()
-  {
-    return editMode;
-  }
-                    
-  public void setEditMode(int editMode)
-  {
-    this.editMode =editMode;
-  }
-
-
-  // factory methods
-  public ModelQueryActionHelper createModelQueryActionHelper()
-  {
-    return new ModelQueryActionHelper(this);
-  } 
-
-  public DOMValidator getValidator()
-  {
-    return validator;
-  }
-
-  public CMDocument getCorrespondingCMDocument(Node node)
-  {
-    return modelQueryAssociationProvider.getCorrespondingCMDocument(node);
-  }
-
-  public CMNode getCMNode(Node node)
-  {
-    return modelQueryAssociationProvider.getCMNode(node);
-  }
-
-  public CMDataType getCMDataType(Text text)
-  {
-    return modelQueryAssociationProvider.getCMDataType(text);
-  }
-
-  public CMAttributeDeclaration getCMAttributeDeclaration(Attr attr)
-  {
-    return modelQueryAssociationProvider.getCMAttributeDeclaration(attr);
-  }
-
-  public CMElementDeclaration getCMElementDeclaration(Element element)
-  {
-    return modelQueryAssociationProvider.getCMElementDeclaration(element);
-  }
-   
-  public CMDocumentManager getCMDocumentManager()
-  {
-    CMDocumentManager result = null;
-    if (modelQueryAssociationProvider instanceof XMLAssociationProvider)
-    {             
-      XMLAssociationProvider xmlAssociationProvider = (XMLAssociationProvider)modelQueryAssociationProvider;
-      result = xmlAssociationProvider.getCMDocumentManager();
-    }    
-    return result;
-  }
-       
-
-  /**
-   * @deprected - use 3 arg version below
-   */
-  public List getCMDocumentList(Element element, String uri)
-  {        
-    return Collections.EMPTY_LIST;
-  }
-
-  public List getCMDocumentList(Element element, CMElementDeclaration ed, String uri)
-  {                
-    List result = new Vector();
-    if (modelQueryAssociationProvider instanceof XMLAssociationProvider)
-    {              
-      XMLAssociationProvider xmlAssociationProvider = (XMLAssociationProvider)modelQueryAssociationProvider;
-     
-      // todo... revist... handle each ##thing explicitly
-      //          
-      if (uri == null)
-      {
-        uri = "##any"; //$NON-NLS-1$
-      }               
-
-      if (uri.equals("##targetNamespace")) //$NON-NLS-1$
-      {                                                      
-        CMDocument cmDocument = (CMDocument)ed.getProperty("CMDocument"); //$NON-NLS-1$
-        if (cmDocument != null)
-        {  
-          result.add(cmDocument);
-        }
-      }
-      else if (uri.equals("##any") || uri.equals("##other")) //$NON-NLS-1$ //$NON-NLS-2$
-      {                                        
-        String excludedURI = null;
-        if (uri.equals("##other")) //$NON-NLS-1$
-        {
-          CMDocument cmDocument = (CMDocument)ed.getProperty("CMDocument");        //$NON-NLS-1$
-          if (cmDocument != null)
-          {
-            excludedURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
-          }
-        }
-                               
-        // in this case we should consider all of the schema related to this document
-        //
-        NamespaceTable namespaceTable = new NamespaceTable(element.getOwnerDocument());
-        namespaceTable.addElementLineage(element);
-        List list = namespaceTable.getNamespaceInfoList();
-        for (Iterator i = list.iterator(); i.hasNext();)
-        {
-          NamespaceInfo info = (NamespaceInfo)i.next();
-          if (info.uri != null && !info.uri.equals(excludedURI))
-          {
-            CMDocument document = xmlAssociationProvider.getCMDocument(info.uri, info.locationHint, "XSD"); //$NON-NLS-1$
-            if (document != null)
-            {
-              result.add(document);
-            }
-          }
-        }
-      }   
-      else
-      {        
-        CMDocument document = xmlAssociationProvider.getCMDocument(element, uri);
-        if (document != null)
-        {
-          result.add(document);
-        }
-      }      
-    }
-    return result;
-  }
-
-
-  public CMDocument getCMDocument(Element element, String uri)
-  {                
-
-    CMDocument result = null;
-    if (modelQueryAssociationProvider instanceof XMLAssociationProvider)
-    {             
-      XMLAssociationProvider xmlAssociationProvider = (XMLAssociationProvider)modelQueryAssociationProvider;
-      result = xmlAssociationProvider.getCMDocument(element, uri);
-    }
-    //ContentModelManager.println("ModelQueryImpl.getCMDocument(" + element.getNodeName() + ", " + uri + ") = " + result);
-    return result;
-  }
-
-  public boolean isContentValid(Element element)
-  {               
-    CMElementDeclaration ed = getCMElementDeclaration(element);
-    return isContentValid(ed, element);
-  }
-
-  public boolean isContentValid(CMElementDeclaration ed, Element element)
-  {                                               
-    boolean result = true;    
-    if (ed != null)
-    { 
-      // first check to see if all the required attributes are present
-      //                                                      
-      CMNamedNodeMap map = ed.getAttributes();
-      int mapLength = map.getLength();
-      for (int i = 0; i < mapLength; i++)
-      {                                                           
-        CMAttributeDeclaration ad = (CMAttributeDeclaration)map.item(i);
-        String attributeName = DOMNamespaceHelper.computeName(ad, element, null);
-        if (ad.getUsage() == CMAttributeDeclaration.REQUIRED)
-        {               
-           Attr attr = element.getAttributeNode(attributeName);
-           if (attr == null)
-           {
-             result = false;
-             break;
-           }
-        }
-      }
-
-      // now check to see of the children validate properly
-      //
-      if (result) 
-      {
-        CMNode[] originArray = getOriginArray(element);
-        result = originArray != null && originArray.length == element.getChildNodes().getLength();
-      }
-    }
-    return result;
-  }
-
-
-  public CMNode getOrigin(Node node)
-  {
-    CMNode result = null;
-    // todo... make sure parent is right
-    //
-    Node parentNode = getParentOrOwnerNode(node);
-    if (parentNode != null && parentNode.getNodeType() == Node.ELEMENT_NODE)
-    {
-      Element parentElement = (Element)parentNode;
-      CMNode[] array = getOriginArray(parentElement);
-      if (array != null)
-      {
-        int index = getIndexOfNode(parentElement.getChildNodes(), node);
-        if (index < array.length)
-        {
-          result = array[index];
-        }
-      }
-    }
-    return result;
-  }
-
-  public CMNode[] getOriginArray(Element element)
-  {
-    CMElementDeclaration ed = getCMElementDeclaration(element);
-    return (ed != null) ? getValidator().getOriginArray(ed, element) : null;
-  }
-
-  public int getIndexOfNode(NodeList nodeList, Node node)
-  {
-    int result = -1;
-    int size = nodeList.getLength();
-    for (int i = 0; i < size; i++)
-    {
-       if (nodeList.item(i) == node)
-       {
-         result = i;
-         break;
-       }
-    }
-    return result;
-  }
-
-
-  /**
-   * Returns a list of all CMNode 'meta data' that may be potentially added to the element.
-   */
-  public List getAvailableContent(Element element, CMElementDeclaration ed, int includeOptions)
-  {
-    AvailableContentCMVisitor visitor = new AvailableContentCMVisitor(element, ed);
-    List list = visitor.computeAvailableContent(includeOptions);
-    if (extensionManager != null)
-    {                    
-      extensionManager.filterAvailableElementContent(list, element, ed, includeOptions);
-    }  
-    return list;
-  }  
-
-
-  public boolean canInsert(Element parent, CMNode cmNode, int index, int validityChecking)
-  {
-    boolean result = true;
-    CMElementDeclaration ed = getCMElementDeclaration(parent);
-    if (ed != null)
-    {
-      result = canInsert(parent, ed, cmNode, index, validityChecking);
-    }
-    return result;
-  }
-
-
-  public boolean canInsert(Element parent, CMElementDeclaration ed, CMNode cmNode, int index, int validityChecking)
-  {
-    return canInsert(parent, ed, cmNode, index, validityChecking, null);
-  }         
-
-  protected boolean canInsert(Element parent, CMElementDeclaration ed, CMNode cmNode, int index, int validityChecking, Object reuseableData)
-  {
-    boolean result = true;
-    switch (cmNode.getNodeType())
-    {
-      case CMNode.ATTRIBUTE_DECLARATION :
-      {
-        String attributeName = DOMNamespaceHelper.computeName(cmNode, parent, null);
-        result = parent.getAttributeNode(attributeName) == null;
-        break;
-      }
-      case CMNode.ELEMENT_DECLARATION :
-      case CMNode.GROUP :
-      {
-        if (validityChecking == VALIDITY_STRICT)
-        {                                  
-          // create list                       
-          List contentSpecificationList = null;
-          if (reuseableData != null)
-          {                            
-            contentSpecificationList = (List)reuseableData;
-          }    
-          else
-          {                                                                                  
-            contentSpecificationList = getValidator().createContentSpecificationList(parent, ed);
-          }
-          result = getValidator().canInsert(ed, contentSpecificationList, index, cmNode);
-        }
-        break;
-      }
-      case CMNode.DATA_TYPE :
-      {
-        int contentType = ed.getContentType();
-        result = (contentType == CMElementDeclaration.MIXED ||
-                  contentType == CMElementDeclaration.PCDATA ||
-                  contentType == CMElementDeclaration.ANY);
-        break;
-      }
-      default :
-      {
-        result = false;
-        break;
-      }
-    }
-    return result;
-  }
-
-  public boolean canInsert(Element parent, List cmNodeList, int index, int validityChecking)
-  {
-    // todo
-    return true;
-  }
-
-
-  public boolean canRemove(Node node, int validityChecking)
-  {
-    boolean result = true;      
-    if (validityChecking == VALIDITY_STRICT)
-    {
-      int nodeType = node.getNodeType();
-      switch (nodeType)
-      {
-        case Node.ATTRIBUTE_NODE:
-        {
-          CMAttributeDeclaration ad = getCMAttributeDeclaration((Attr)node);
-          if (ad != null)
-          {
-            result = (ad.getUsage() == CMAttributeDeclaration.OPTIONAL);
-          }
-          break;
-        }
-        case Node.ELEMENT_NODE:
-        {
-          Node parentNode = node.getParentNode();
-          if (parentNode.getNodeType() == Node.ELEMENT_NODE)
-          {
-            Element parentElement = (Element)parentNode;
-            CMElementDeclaration ed = getCMElementDeclaration(parentElement);
-            if (ed != null)
-            {
-              List contentSpecificationList = getValidator().createContentSpecificationList(parentElement, ed);
-              int index = getIndexOfNode(parentElement.getChildNodes(), node);
-              result = getValidator().canRemove(ed, contentSpecificationList, index);
-            }
-          }
-          break;
-        }
-      }
-    }
-    return result;
-  }
-
-
-  public boolean canRemove(List nodeList, int validityChecking)
-  {
-    boolean result = true;
-
-    if (validityChecking == VALIDITY_STRICT)
-    {
-      Element parentElement = null;
-      List childList = null;
-
-      for (Iterator i = nodeList.iterator(); i.hasNext(); )
-      {
-        Node node = (Node)i.next();
-
-        if (parentElement == null)
-        {
-          parentElement = getParentOrOwnerElement(node);
-        }
-        else if (parentElement != getParentOrOwnerElement(node))
-        {
-          // make sure the parent are the same
-          result = false;
-          break;
-        }
-
-        if (parentElement == null)
-        {
-          result = true;
-          break;
-        }
-
-        int nodeType = node.getNodeType();
-        if (nodeType == Node.ATTRIBUTE_NODE)
-        {
-          if (!canRemove(node, validityChecking))
-          {
-            result = false;
-            break;
-          }
-        }
-        else
-        {
-          if (childList == null)
-          {
-            childList = nodeListToList(parentElement.getChildNodes());
-          }
-          childList.remove(node);
-        }
-      }
-
-      if (result && childList != null)
-      {
-        CMElementDeclaration ed = getCMElementDeclaration(parentElement);
-        if (ed != null)
-        {                                
-          List contentSpecificationList = getValidator().createContentSpecificationList(childList, ed);
-          result = getValidator().isValid(ed, contentSpecificationList);
-        }
-      }
-    }
-
-    return result;
-  }
-
-  public boolean canReplace(Element parent, int startIndex, int endIndex, CMNode cmNode, int validityChecking)
-  {
-    return true;
-  }
-
-  public boolean canReplace(Element parent, int startIndex, int endIndex, List cmNodeList, int validityChecking)
-  {
-    return true;
-  }     
-   
-  /**
-   * This method is experimental... use at your own risk
-   */
-  public boolean canWrap(Element childElement, CMElementDeclaration wrapElement, int validityChecking)
-  {                        
-    boolean result = true;  
-    Node parentNode = childElement.getParentNode();                      
-    if (parentNode.getNodeType() == Node.ELEMENT_NODE)
-    {           
-      Element parentElement = (Element)parentNode;      
-      CMElementDeclaration parentEd = getCMElementDeclaration(parentElement);
-      if (parentEd != null)
-      {                                                                                         
-        if (validityChecking == VALIDITY_STRICT)
-        {
-          int index = getIndexOfNode(parentElement.getChildNodes(), childElement);
-
-          List contentSpecificationList = getValidator().createContentSpecificationList(parentElement, parentEd);
-          List subList = contentSpecificationList.subList(index, index + 1);
-          result = getValidator().canReplace(parentEd, contentSpecificationList, index, index, wrapElement);
-          if (result)
-          {
-            result = getValidator().isValid(wrapElement, subList);
-          }
-        }
-      }
-    }
-    else
-    {
-      result = false;
-    }                
-    return result;
-  }
-
-  public void getInsertActions(Element parent, CMElementDeclaration ed, int index, int includeOptions, int validityChecking, List actionList)
-  {
-    modelQueryActionHelper.getInsertActions(parent, ed, index, includeOptions, validityChecking, actionList);
-  }
-
-  public void getInsertActions(Document parent, CMDocument cmDocument, int index, int includeOptions, int validityChecking, List actionList)
-  {
-    modelQueryActionHelper.getInsertActions(parent, cmDocument, index, includeOptions, validityChecking, actionList);
-  }
-
-  public void getReplaceActions(Element parent, CMElementDeclaration ed, int includeOptions, int validityChecking, List actionList)
-  {
-    modelQueryActionHelper.getReplaceActions(parent, ed, includeOptions, validityChecking, actionList);
-  }                     
-
-  public void getReplaceActions(Element parent, CMElementDeclaration ed, List selectedChildren, int includeOptions, int validityChecking, List actionList)
-  {
-    modelQueryActionHelper.getReplaceActions(parent, ed, selectedChildren, includeOptions, validityChecking, actionList);
-  }
-
-  public void getInsertChildNodeActionTable(Element parent, CMElementDeclaration ed, int validityChecking, Hashtable actionTable)
-  {
-    modelQueryActionHelper.getInsertChildNodeActionTable(parent, ed, validityChecking, actionTable);
-  }
-
-  public void getActionTable(Element parent, CMElementDeclaration ed, int index, int validityChecking, Hashtable actionTable)
-  {
-    //modelQueryActionHelper.getAllActions(parent, ed, validityChecking, actionList);
-  }
-
-
-  // some helper methods
-  //
-  protected Node getParentOrOwnerNode(Node node)
-  {
-    return (node.getNodeType() == Node.ATTRIBUTE_NODE) ?
-           ((Attr)node).getOwnerElement() :
-           node.getParentNode();
-  }
-
-  protected Element getParentOrOwnerElement(Node node)
-  {
-    Node parent = getParentOrOwnerNode(node);
-    return (parent.getNodeType() == Node.ELEMENT_NODE) ? (Element)parent : null;
-  }
-               
-
-  protected List nodeListToList(NodeList nodeList)
-  {
-    int size = nodeList.getLength();
-    Vector v = new Vector(size);
-    for (int i = 0; i < size; i++)
-    {
-      v.add(nodeList.item(i));
-    }
-    return v;
-  }   
-   
-  /**
-  protected List getCMNodeList(NodeList nodeList)
-  {
-    int size = nodeList.getLength();
-    Vector v = new Vector(size);
-    for (int i = 0; i < size; i++)
-    {
-      v.add(getCMNode(nodeList.item(i));
-    }
-    return v;
-  }
-  */  
-
-  public class AvailableContentCMVisitor extends CMVisitor
-  {
-    public Hashtable childNodeTable = new Hashtable();
-    public Hashtable attributeTable = new Hashtable();
-    public Element rootElement;
-    public CMElementDeclaration rootElementDeclaration; 
-    public boolean isRootVisited;
-    protected boolean includeSequenceGroups;
-
-    public AvailableContentCMVisitor(Element rootElement, CMElementDeclaration rootElementDeclaration)
-    {                                     
-      this.rootElement = rootElement;
-      this.rootElementDeclaration = rootElementDeclaration;
-    }
-
-    protected String getKey(CMNode cmNode)
-    {
-      String key = cmNode.getNodeName();
-      CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$
-      if (cmDocument != null)
-      {                         
-        String namespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI");    //$NON-NLS-1$
-        if (namespaceURI != null)
-        {   
-          key = "[" + namespaceURI + "]" + key; //$NON-NLS-1$ //$NON-NLS-2$
-        }
-      }
-      return key;
-    }
-    
-    protected void addToTable(Hashtable table, CMNode cmNode)
-    {
-      String nodeName = cmNode.getNodeName();
-      if (nodeName != null && nodeName.length() > 0)
-      {  
-        table.put(getKey(cmNode), cmNode);
-      }  
-    }
-
-    public List computeAvailableContent(int includeOptions)
-    {                   
-      Vector v = new Vector();  
-
-      int contentType = rootElementDeclaration.getContentType();
-      includeSequenceGroups = ((includeOptions & INCLUDE_SEQUENCE_GROUPS) != 0);
-      visitCMNode(rootElementDeclaration);
-      
-      if ((includeOptions & INCLUDE_ATTRIBUTES) != 0)
-      {
-        v.addAll(attributeTable.values());
-        CMAttributeDeclaration nillableAttribute = (CMAttributeDeclaration)rootElementDeclaration.getProperty("http://org.eclipse.wst/cm/properties/nillable"); //$NON-NLS-1$
-        if (nillableAttribute != null)
-        {
-          v.add(nillableAttribute);
-        }
-      }  
-
-      if ((includeOptions & INCLUDE_CHILD_NODES) != 0)
-      {      
-        if (contentType == CMElementDeclaration.MIXED ||
-            contentType == CMElementDeclaration.ELEMENT)
-        {
-          v.addAll(childNodeTable.values());
-        }
-        else if (contentType == CMElementDeclaration.ANY)
-        {      
-          CMDocument cmDocument =  (CMDocument)rootElementDeclaration.getProperty("CMDocument"); //$NON-NLS-1$
-          if (cmDocument != null)
-          {
-            CMNamedNodeMap elements = cmDocument.getElements();            
-            for (Iterator i = elements.iterator(); i.hasNext(); )
-            {
-              v.add(i.next());
-            } 
-          }
-        }
-              
-        if (contentType == CMElementDeclaration.MIXED ||
-            contentType == CMElementDeclaration.PCDATA || 
-            contentType == CMElementDeclaration.ANY)
-        {
-          CMDataType dataType = rootElementDeclaration.getDataType();
-          if (dataType != null)
-          {
-            v.add(dataType);
-          }                                       
-        }
-      }
-      return v;
-    }   
-
-    public void visitCMAnyElement(CMAnyElement anyElement)
-    {            
-      String uri = anyElement.getNamespaceURI();                          
-      List list = getCMDocumentList(rootElement, rootElementDeclaration, uri);
-      for (Iterator iterator = list.iterator(); iterator.hasNext(); )
-      {
-        CMDocument cmdocument = (CMDocument)iterator.next();
-        if (cmdocument != null)
-        {                          
-          CMNamedNodeMap map = cmdocument.getElements();
-          int size = map.getLength();
-          for (int i = 0; i < size; i++)
-          {                       
-            CMNode ed = map.item(i);                  
-            addToTable(childNodeTable,ed);
-          }        
-        }                
-      }
-    }
-
-    public void visitCMAttributeDeclaration(CMAttributeDeclaration ad)
-    {
-      super.visitCMAttributeDeclaration(ad);
-      attributeTable.put(ad.getNodeName(), ad);
-    }
-
-    public void visitCMElementDeclaration(CMElementDeclaration ed)
-    {
-      if (ed == rootElementDeclaration && !isRootVisited)
-      {
-        isRootVisited = true;
-        super.visitCMElementDeclaration(ed);
-      }
-      else
-      {                                                                                  
-        if (!Boolean.TRUE.equals(ed.getProperty("Abstract"))) //$NON-NLS-1$
-        {
-          addToTable(childNodeTable,ed);
-        }
-
-        CMNodeList substitutionGroup = (CMNodeList)ed.getProperty("SubstitutionGroup"); //$NON-NLS-1$
-        if (substitutionGroup != null)
-        {
-          handleSubstitutionGroup(substitutionGroup);
-        }
-      }
-    }                                              
-
-    protected void handleSubstitutionGroup(CMNodeList substitutionGroup)
-    {
-      int substitutionGroupLength = substitutionGroup.getLength();
-      if (substitutionGroupLength > 1)
-      {
-        for (int i = 0; i < substitutionGroupLength; i++)
-        {
-          CMNode ed = substitutionGroup.item(i);
-          if (!Boolean.TRUE.equals(ed.getProperty("Abstract"))) //$NON-NLS-1$
-          {
-            addToTable(childNodeTable,ed);
-          }
-        }
-      }
-    }
-
-    public void visitCMGroup(CMGroup group)
-    {
-      if (includeSequenceGroups)
-      {
-        if (group.getOperator() == CMGroup.SEQUENCE &&
-            group.getChildNodes().getLength() > 1 &&
-            includesRequiredContent(group))
-        {                                        
-          childNodeTable.put(group, group);
-        }
-      }  
-      super.visitCMGroup(group);
-    }   
-
-    public boolean includesRequiredContent(CMGroup group)
-    {
-      List list = getValidator().createContentSpecificationList(group);
-      return list.size() > 1;
-    }
-  }    
-
- 
-  /**
-   * @deprected - use getPossibleDataTypeValues()
-   */
-  public List getDataTypeValues(Element element, CMNode cmNode)
-  {                                                                             
-    return Arrays.asList(getPossibleDataTypeValues(element, cmNode));
-  }
-  
-  /**
-   * This methods return an array of possible values corresponding to the datatype of the CMNode (either an CMAttributeDeclaration or a CMElementDeclaration)
-   */
-  public String[] getPossibleDataTypeValues(Element element, CMNode cmNode)
-  {
-    List list = new Vector();                            
-                               
-    if (cmNode != null)
-    {       
-      CMDataType dataType = null;
-      if (cmNode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION)
-      {
-        dataType = ((CMAttributeDeclaration)cmNode).getAttrType();
-      }
-      else if (cmNode.getNodeType() == CMNode.ELEMENT_DECLARATION)
-      {
-        dataType = ((CMElementDeclaration)cmNode).getDataType();
-      }         
-     
-      String[] enumeratedValues = dataType != null ? dataType.getEnumeratedValues() : null;      
-      if (enumeratedValues != null)
-      {
-        for (int i = 0; i < enumeratedValues.length; i++)
-        {
-          list.add(enumeratedValues[i]);
-        } 
-      }                              
-    }
-                         
-    addValuesForXSIType(element, cmNode, list);
-    
-    if (extensionManager != null)
-    {                    
-      list.addAll(extensionManager.getDataTypeValues(element, cmNode));
-    }          
-                        
-    int listSize = list.size();
-    String[] result = new String[listSize];
-    for (int i = 0; i < listSize; i++)
-    {
-      result[i] = (String)list.get(i);
-    }     
-    return result;
-  }    
-
-           
-  protected void addValuesForXSIType(Element element, CMNode cmNode, List list)
-  {               
-    if (cmNode != null && cmNode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) 
-    {                         
-      CMAttributeDeclaration ad = (CMAttributeDeclaration)cmNode;                              
-      if (valueHelper.isXSIType(ad))
-      {             
-        NamespaceTable table = new NamespaceTable(element.getOwnerDocument());
-        table.addElementLineage(element);
-        list.addAll(valueHelper.getQualifiedXSITypes(ad, table));     
-      }
-    }
-  }
-    
-
-  public ModelQueryExtensionManager getExtensionManager()
-  {
-    return extensionManager;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/SimpleAssociationProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/SimpleAssociationProvider.java
deleted file mode 100644
index de5242f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/SimpleAssociationProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryCMProvider;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- *
- */
-public class SimpleAssociationProvider extends BaseAssociationProvider
-{
-  protected ModelQueryCMProvider modelQueryCMProvider;
-          
-  public SimpleAssociationProvider(ModelQueryCMProvider modelQueryCMProvider)
-  {                                              
-    this.modelQueryCMProvider = modelQueryCMProvider;
-  }
-
-  public CMDocument getCorrespondingCMDocument(Node node)
-  {
-    return modelQueryCMProvider.getCorrespondingCMDocument(node);
-  }
-  
-  public CMElementDeclaration getCMElementDeclaration(Element element)
-  {
-    CMElementDeclaration result = null;
-    CMDocument cmDocument = getCorrespondingCMDocument(element);
-    if (cmDocument != null)
-    {        
-      result = (CMElementDeclaration)cmDocument.getElements().getNamedItem(element.getNodeName());    
-    }
-    return result;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/XMLAssociationProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/XMLAssociationProvider.java
deleted file mode 100644
index 9e20be6..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/XMLAssociationProvider.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentReferenceProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/**
- *
- */
-public abstract class XMLAssociationProvider extends BaseAssociationProvider implements CMDocumentReferenceProvider
-{              
-  protected CMDocumentCache cmDocumentCache; 
-  protected CMDocumentManagerImpl documentManager;
-
-  public XMLAssociationProvider(CMDocumentCache cmDocumentCache)
-  {
-    this.cmDocumentCache = cmDocumentCache; 
-    documentManager = new CMDocumentManagerImpl(cmDocumentCache, this);
-  }                              
-
-  public CMDocumentManager getCMDocumentManager()
-  {
-    return documentManager;
-  }
- 
-      
-  public static String[] getDoctypeInfo(Document document)
-  {   
-    String[] result = null;
-    DocumentType doctype = document.getDoctype();
-
-    // defect 206833 ... here we test for DTDs that are declared inline
-    // since we currently have no way of making use of inline DTDs we ingore them
-    // so that the implict DTD (if any) can be used
-    if (doctype != null && (doctype.getPublicId() != null || doctype.getSystemId() != null))
-    {
-      result = new String[2];
-      result[0] = doctype.getPublicId();
-      result[1] = doctype.getSystemId();
-    }   
-    else if (getImplictDoctype(document) != null)
-    {
-      result = getImplictDoctype(document);
-    }                  
-    return result;
-  }   
-
-
-  protected static String[] getImplictDoctype(Document document)
-  { 
-    String[] result = null;
-    /*
-    DOMExtension domExtension = DOMExtensionProviderRegistry.getInstance().getDOMExtension(document);
-    if (domExtension != null)
-    {
-      result = domExtension.getImplicitDoctype();
-    }*/
-    return result;
-  }
-
-  public CMDocument getCorrespondingCMDocument(Node node)
-  {        
-    return getCorrespondingCMDocument(node, true);
-  }
-
-  protected CMDocument getCorrespondingCMDocument(Node node, boolean getDocumentFromCMNode)
-  {            
-    CMDocument result = null;
-    try
-    {
-      Document document = node.getNodeType() == Node.DOCUMENT_NODE ? (Document)node : node.getOwnerDocument();
-   
-      String[] doctypeInfo = getDoctypeInfo(document);
-
-      if (doctypeInfo != null)
-      {
-        result = getCMDocument(doctypeInfo[0], doctypeInfo[1], "DTD"); //$NON-NLS-1$
-      }                                             
-      // defect 211236 ... in some cases calling this method can result in a cycle
-      // we use the getDocumentFromCMNode as a flag to avoid this 
-      // TODO... see if there is a way to re-organize to avoid the need for this flag
-      else if (getDocumentFromCMNode)
-      {
-        CMNode cmNode = getCMNode(node);
-        if (cmNode != null)       
-        {                
-          // todo... add a getCMDocument() methods to CMNode
-          // for now use the getProperty interface
-          result = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$
-        }
-      }
-    }
-    catch (Exception e)
-    {
-      Logger.logException("exception locating CMDocument for " + node, e); //$NON-NLS-1$
-    }
-    return result;
-  }    
-
-      
-  public CMDocument getCMDocument(Element element, String uri)
-  {
-    CMDocument result = null;
-    NamespaceTable namespaceTable = new NamespaceTable(element.getOwnerDocument());
-    namespaceTable.addElementLineage(element);
-    NamespaceInfo namespaceInfo = namespaceTable.getNamespaceInfoForURI(uri);
-    if (namespaceInfo != null)
-    {
-      result = getCMDocument(namespaceInfo.uri, namespaceInfo.locationHint, "XSD"); //$NON-NLS-1$
-    }
-    return result;
-  }         
-  
-                          
-  public CMDocument getCMDocument(String publicId, String systemId, String type)
-  {                   
-    //String resolvedGrammarURI = resolveGrammarURI(document, publicId, systemId);
-    return documentManager.getCMDocument(publicId, systemId, type);  
-  }
-
-  //public CMDocument getCMDocument(Document document, String publicId, String systemId)
-  //{                   
-  //  //String resolvedGrammarURI = resolveGrammarURI(document, publicId, systemId);
-  //  return documentManager.getCMDocument(publicId, systemId);  
-  //}
-   
-  public String resolveGrammarURI(String publicId, String systemId)
-  {
-    return resolveGrammarURI(null, publicId, systemId);
-  }
-
-
-  /**
-   * This method should be specialized in order to implement specialized uri resolution
-   */
-  protected String resolveGrammarURI(Document document, String publicId, String systemId)
-  {
-    return systemId;
-  }
-  
-
-  public CMElementDeclaration getCMElementDeclaration(Element element)
-  { 
-    CMElementDeclaration result = null; 
-    Document document = element.getOwnerDocument();
-    String[] doctypeInfo = getDoctypeInfo(document);
-    if (doctypeInfo != null)
-    {   
-      // we have detected doctype information so we assume that we can locate the CMElementDeclaration 
-      // in the CMDocument's table of global elements 
-      CMDocument cmDocument = getCorrespondingCMDocument(element, false);
-
-      // TODO... consider replacing above with 
-      // CMDocument cmDocument = getCMDocument(document, doctypeInfo[0], doctypeInfo[1]);
-
-      if (cmDocument != null)
-      {        
-        result = (CMElementDeclaration)cmDocument.getElements().getNamedItem(element.getNodeName());    
-                 
-        // this is a hack to get our xsl code assist working... we might want to handle similar
-        // grammar behaviour via some established model query setting 
-        if (result == null && getImplictDoctype(document) != null)
-        {         
-          Node parent = element.getParentNode();
-          if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE)
-          {
-            result = getCMElementDeclaration((Element)parent);
-          }
-        }
-      }
-    }    
-    else
-    {  
-      // here we use a namespaceTable to consider if the root element has any namespace information
-      //
-      NamespaceTable namespaceTable = new NamespaceTable(element.getOwnerDocument());
-      List list = NamespaceTable.getElementLineage(element);
-      Element rootElement = (Element)list.get(0);
-      namespaceTable.addElement(rootElement);
-         
-      if (namespaceTable.isNamespaceEncountered())
-      {                                         
-        // we assume that this is an XMLSchema style namespace aware document
-        result = getCMElementDeclaration(element, list, namespaceTable);
-      }
-      else
-      { 
-        // we assume that this is an inferred CMDocument for a DTD style 'namespaceless' document
-        CMDocument cmDocument = getCMDocument("", "", "DTD"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        if (cmDocument != null)
-        {
-          result = (CMElementDeclaration)cmDocument.getElements().getNamedItem(element.getNodeName()); 
-        }
-      }
-    }             
-    return result;
-  } 
-     
-
-  protected CMElementDeclaration getCMElementDeclaration(Element targetElement, List list, NamespaceTable namespaceTable)
-  {         
-    CMElementDeclaration currentED = null;
-    try
-    {    
-      int listSize = list.size();
-      for (int i = 0; i < listSize; i++)
-      {
-        Element element = (Element)list.get(i);                                     
-                    
-        if (i != 0)
-        {
-          namespaceTable.addElement(element);                        
-        }
-
-        String nodeName = element.getNodeName();
-        String unprefixedName = DOMNamespaceHelper.getUnprefixedName(nodeName);
-        String prefix = DOMNamespaceHelper.getPrefix(nodeName);
- 
-        CMElementDeclaration ed = null;
- 
-        // see if the element is a local of the currentED
-        //             
-        if (currentED != null)
-        {  
-          ed = (CMElementDeclaration)currentED.getLocalElements().getNamedItem(unprefixedName);
-        } 
-                                                                   
-        if (ed == null) 
-        {               
-          NamespaceInfo namespaceInfo = namespaceTable.getNamespaceInfoForPrefix(prefix);                   
-          if (namespaceInfo != null) 
-          {
-            CMDocument cmDocument = getCMDocument(namespaceInfo.uri, namespaceInfo.locationHint, "XSD"); //$NON-NLS-1$
-            if (cmDocument != null)
-            { 
-              ed = (CMElementDeclaration)cmDocument.getElements().getNamedItem(unprefixedName);   
-            }                                        
-          }
-        }                                                   
-        currentED = ed;     
-
-        // handle XSIType     
-        if (currentED != null)
-        {
-          CMElementDeclaration derivedED = getDerivedCMElementDeclaration(element, currentED, namespaceTable);
-          if (derivedED != null)
-          {                           
-            currentED = derivedED;
-          }    
-        }
-      }                                       
-    }
-    catch (Exception e)
-    { 
-      Logger.logException("exception locating element declaration for " + targetElement, e); //$NON-NLS-1$
-    } 
-  
-    return currentED;
-  }  
-      
-
-  protected CMElementDeclaration getDerivedCMElementDeclaration(Element element, CMElementDeclaration ed, NamespaceTable namespaceTable)
-  {                      
-    CMElementDeclaration result = null;
-    String xsiPrefix = namespaceTable.getPrefixForURI("http://www.w3.org/2001/XMLSchema-instance"); //$NON-NLS-1$
-    if (xsiPrefix != null)
-    {
-      String xsiTypeValue = element.getAttribute(xsiPrefix + ":type"); //$NON-NLS-1$
-      if (xsiTypeValue != null)
-      {  
-        String typePrefix = DOMNamespaceHelper.getPrefix(xsiTypeValue);
-        String typeName = DOMNamespaceHelper.getUnprefixedName(xsiTypeValue);
-        String typeURI = namespaceTable.getURIForPrefix(typePrefix);
-        String uriQualifiedTypeName = typeName;
-        if (typeURI != null && typeURI.length() > 0) 
-        {
-          uriQualifiedTypeName = "[" +  typeURI + "]" + typeName; //$NON-NLS-1$ //$NON-NLS-2$
-        }
-        result = (CMElementDeclaration)ed.getProperty("DerivedElementDeclaration=" + uriQualifiedTypeName);   //$NON-NLS-1$
-      }
-    }                                                                                                    
-    return result;
-  }   
-
-
-  public CMAttributeDeclaration getCMAttributeDeclaration(Attr attr)
-  {
-    CMAttributeDeclaration result = null;
-    Element element = attr.getOwnerElement();
-    if (element != null)
-    {
-      CMElementDeclaration ed = getCMElementDeclaration(element);
-      if (ed != null)
-      {                                                
-        result = (CMAttributeDeclaration)ed.getAttributes().getNamedItem(attr.getName());
-        if (result == null)
-        {                                              
-          // try to get the unprefixed name             
-          String name = DOMNamespaceHelper.getUnprefixedName(attr.getName());
-          result = (CMAttributeDeclaration)ed.getAttributes().getNamedItem(name);
-        }                                                                        
-        if (result == null)
-        {
-          // todo... perhaps this is a globally defined attribute... 
-        }
-      }
-    }
-    return result;
-  }               
-
-  /**
-   * This method returns a list of CMDocumentReferences associated with a particular node or subtree
-   */                                                                                                          
-  public List getCMDocumentReferences(Node node, boolean deep)
-  { 
-    List result = new ArrayList();  
-    Document document = (node.getNodeType() == Node.DOCUMENT_NODE) ? (Document)node : node.getOwnerDocument();
-    DocumentType doctype = document.getDoctype();
-    // defect 206833 ... here we test for DTDs that are declared inline
-    // since we currently have no way of making use of inline DTDs we ingore them
-    // so that the implict DTD (if any) can be used
-    if (doctype != null && (doctype.getPublicId() != null || doctype.getSystemId() != null))
-    {                                                                               
-      String uri = resolveGrammarURI(document, doctype.getPublicId(), doctype.getSystemId());
-      result.add(new CMDocumentReferenceImpl(doctype.getPublicId(), uri));
-    }   
-    else if (getImplictDoctype(document) != null)
-    {                  
-      String[] implicitDoctype = getImplictDoctype(document);
-      String uri = resolveGrammarURI(document, implicitDoctype[0], implicitDoctype[1]);
-      result.add(new CMDocumentReferenceImpl(implicitDoctype[0], uri));
-    }                              
-    else
-    {   
-      NamespaceTable namespaceTable = new NamespaceTable(document);
-      if (node.getNodeType() == Node.ELEMENT_NODE)
-      {
-		    namespaceTable.addElement((Element)node);
-      }                                     
-      if (deep)
-      {
-        addChildElementsToNamespaceTable(node, namespaceTable);
-      }
-	    List list = namespaceTable.getNamespaceInfoList();
-		  for (Iterator i = list.iterator(); i.hasNext();) 
-      {
-			  NamespaceInfo info = (NamespaceInfo) i.next();    
-        String uri = resolveGrammarURI(document, info.uri, info.locationHint);
-        result.add(new CMDocumentReferenceImpl(info.uri, uri));
-		  }	
-    } 
-    return result;
-  }
-
-  protected void addChildElementsToNamespaceTable(Node node, NamespaceTable namespaceTable)
-  {
-    NodeList nodeList = node.getChildNodes();
-	  if (nodeList != null) 
-    {
-		  int nodeListLength = nodeList.getLength();
-		  for (int i = 0; i < nodeListLength; i++) 
-      {
-			  Node childNode = nodeList.item(i);
-        if (childNode.getNodeType() == Node.ELEMENT_NODE)
-        {   
-          namespaceTable.addElement((Element)childNode);
-          addChildElementsToNamespaceTable(childNode, namespaceTable);
-        }
-		  }
-	  }
-  }  
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDescriptionBuilder.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDescriptionBuilder.java
deleted file mode 100644
index f1cc690..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDescriptionBuilder.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.util.Stack;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-public class CMDescriptionBuilder extends CMVisitor
-{
-  protected StringBuffer sb;
-  protected CMNode root;
-  protected boolean isRootVisited;
-  protected Stack visitedCMGroupStack = new Stack();
-
-  public String buildDescription(CMNode node)
-  {
-    sb = new StringBuffer();
-    root = node;
-    isRootVisited = false;
-    visitCMNode(node);
-    return sb.toString();
-  }       
-
-  public void visitCMAnyElement(CMAnyElement anyElement)
-  {
-    sb.append("namespace:uri=\"" + anyElement.getNamespaceURI() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
-  }
-
-  public void visitCMDataType(CMDataType dataType)
-  {
-    sb.append("#PCDATA"); //$NON-NLS-1$
-  }
-
-  public void visitCMDocument(CMDocument document)
-  {
-    CMNamedNodeMap map = document.getElements();
-    int size = map.getLength();
-    for (int i = 0; i < size; i++)
-    {
-      visitCMNode(map.item(i));
-    }
-  }
-
-  public void visitCMGroup(CMGroup group)
-  {
-    // This is to prevent recursion.
-    if (visitedCMGroupStack.contains(group))
-    {
-      return;
-    }
-    int op = group.getOperator();
-    if (op == CMGroup.ALL)
-    {
-      sb.append("all"); //$NON-NLS-1$
-    }
-
-    sb.append("("); //$NON-NLS-1$
-
-    String separator = ", "; //$NON-NLS-1$
-
-    if (op == CMGroup.CHOICE)
-    {
-      separator = " | "; //$NON-NLS-1$
-    }
-    
-    // Push the current group to check later to avoid potential recursion
-    visitedCMGroupStack.push(group);
-   
-    CMNodeList nodeList = group.getChildNodes();
-    int size = nodeList.getLength();
-    for (int i = 0; i < size; i++)
-    {
-      visitCMNode(nodeList.item(i));
-      if (i < size - 1)
-      {
-        sb.append(separator);
-      }
-    }
-    
-    // Pop the current group
-    visitedCMGroupStack.pop();
-    
-    sb.append(")"); //$NON-NLS-1$
-    addOccurenceSymbol(group);
-  }
-
-  public void visitCMElementDeclaration(CMElementDeclaration ed)
-  {
-    if (ed == root && !isRootVisited)
-    {
-      isRootVisited = true;
-      CMContent content = ed.getContent();
-      if (content != null)
-      {
-        if (content.getNodeType() != CMNode.GROUP)
-        {
-          sb.append("("); //$NON-NLS-1$
-          visitCMNode(content);
-          sb.append(")"); //$NON-NLS-1$
-        }
-        else
-        {
-          visitCMNode(content);
-        }
-      }
-    }
-    else
-    {
-      sb.append(ed.getElementName());
-      addOccurenceSymbol(ed);
-    }
-  }
-
-  public void addOccurenceSymbol(CMContent content)
-  {
-    int min = content.getMinOccur();
-    int max = content.getMaxOccur();
-    if (min == 0)
-    {
-      if (max > 1 || max == -1)
-      {
-        sb.append("*"); //$NON-NLS-1$
-      }
-      else
-      {
-        sb.append("?"); //$NON-NLS-1$
-      }
-    }
-    else if (max > 1 || max == -1)
-    {
-      sb.append("+"); //$NON-NLS-1$
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCache.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCache.java
deleted file mode 100644
index 670ff53..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCache.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-
-
-/**
- *
- */
-public class CMDocumentCache
-{                                     
-  public static final int STATUS_NOT_LOADED = 0;
-  public static final int STATUS_LOADING    = 2;
-  public static final int STATUS_LOADED     = 3;
-  public static final int STATUS_ERROR      = 4;
-
-  protected class Entry
-  {
-    public String uri;
-    public int status = STATUS_NOT_LOADED;
-    public float progress;
-    public CMDocument cmDocument;
-
-    public Entry(String uri)
-    {                      
-      this.uri = uri;         
-    }
-
-    public Entry(String uri, int status, CMDocument cmDocument)
-    {                                     
-      this.uri = uri;
-      this.status = status;      
-      this.cmDocument = cmDocument;
-    }
-  }
-
-  protected Hashtable hashtable;
-  protected List listenerList = new Vector();
-
-
-  /**
-   * temporarily public until caching problem is solved
-   */
-  public CMDocumentCache()
-  {
-    hashtable = new Hashtable();
-  }
-
-  public void addListener(CMDocumentCacheListener listener)
-  {
-    listenerList.add(listener);
-  }
-
-  public void removeListener(CMDocumentCacheListener listener)
-  {
-    listenerList.remove(listener);
-  }   
-
-  /**
-   *
-   */
-  public CMDocument getCMDocument(String grammarURI)
-  {
-    CMDocument result = null;
-    if (grammarURI != null)
-    {  
-      Entry entry = (Entry)hashtable.get(grammarURI);
-      if (entry != null)
-      {
-        result = entry.cmDocument;
-      }   
-    }
-    return result;
-  }    
-
-  /**
-   *
-   */
-  public int getStatus(String grammarURI)
-  {
-    int result = STATUS_NOT_LOADED;
-    if (grammarURI != null)
-    {  
-      Entry entry = (Entry)hashtable.get(grammarURI);
-      if (entry != null)
-      {
-        result = entry.status;
-      }      
-      
-    }
-    return result;
-  }            
-            
-  /**
-   *
-   */
-  protected Entry lookupOrCreate(String grammarURI)
-  {
-    Entry entry = (Entry)hashtable.get(grammarURI);
-    if (entry == null)
-    {
-      entry = new Entry(grammarURI);                       
-      hashtable.put(grammarURI, entry);
-    }
-    return entry;
-  }
-
-    
-  /**
-   *
-   */
-  public void putCMDocument(String grammarURI, CMDocument cmDocument)
-  {                                    
-    if (grammarURI != null && cmDocument != null)
-    {                           
-      Entry entry = lookupOrCreate(grammarURI);
-      int oldStatus = entry.status;
-      entry.status = STATUS_LOADED;
-      entry.cmDocument = cmDocument;  
-      notifyCacheUpdated(grammarURI, oldStatus, entry.status, entry.cmDocument);  
-    }
-  }
-     
-  /**
-   *
-   */
-  public void setStatus(String grammarURI, int status)
-  {
-    if (grammarURI != null)
-    {
-      Entry entry = lookupOrCreate(grammarURI);
-      int oldStatus = entry.status;
-      entry.status = status;
-      notifyCacheUpdated(grammarURI, oldStatus, entry.status, entry.cmDocument);   
-    }
-  }
-     
-  /**
-   *
-   */
-  public void clear()
-  {
-    hashtable.clear();
-    notifyCacheCleared();
-  }  
-
-  /**
-   *
-   */
-  protected void notifyCacheUpdated(String uri, int oldStatus, int newStatus, CMDocument cmDocument)
-  {      
-    List list = new Vector();
-    list.addAll(listenerList);
-    for (Iterator i = list.iterator(); i.hasNext(); )
-    {
-      CMDocumentCacheListener listener = (CMDocumentCacheListener)i.next();
-      listener.cacheUpdated(this, uri, oldStatus, newStatus, cmDocument);
-    }
-  }
-
-  /**
-   *
-   */
-  protected void notifyCacheCleared()
-  {     
-    List list = new Vector();
-    list.addAll(listenerList);
-    for (Iterator i = list.iterator(); i.hasNext(); )
-    {
-      CMDocumentCacheListener listener = (CMDocumentCacheListener)i.next();
-      listener.cacheCleared(this);
-    }
-  }
-  
-  public List getCMDocuments()
-  {
-  	List list = new ArrayList();  	
-  	for (Iterator i = hashtable.values().iterator(); i.hasNext(); )
-  	{
-  		Entry entry = (Entry)i.next();
-  		list.add(entry.cmDocument);
-  	}
-  	return list;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCacheListener.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCacheListener.java
deleted file mode 100644
index d9f6dcd..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCacheListener.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-
-/**
- * todo... add more interface methods
- */
-public interface CMDocumentCacheListener
-{
-  /** Tells the client that the cache has been cleared.
-   *  This gives clients an opportunity to flush any state that depends on the CMDocument
-   *  since this CMDocument will be recomputed on a subsequent 'lookup' request
-   */
-  public void cacheCleared(CMDocumentCache cache); 
-
-  /** 
-   *  Tells the client that the cache has been updated.  
-   */
-  public void cacheUpdated(CMDocumentCache cache, String uri, int oldStatus, int newStatus, CMDocument cmDocument);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMVisitor.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMVisitor.java
deleted file mode 100644
index fc4f35d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMVisitor.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-public class CMVisitor
-{
-  protected int indent = 0;
-
-  public void visitCMNode(CMNode node)
-  {
-    if (node != null)
-    {
-      //ContentModelManager.printlnIndented("visitCMNode : " + node.getNodeName() + " " + node);
-      indent += 2;
-      int nodeType = node.getNodeType();
-      switch (nodeType)
-      {
-        case CMNode.ANY_ELEMENT :
-        {
-          visitCMAnyElement((CMAnyElement)node);
-          break;
-        }
-        case CMNode.ATTRIBUTE_DECLARATION :
-        {
-          visitCMAttributeDeclaration((CMAttributeDeclaration)node);
-          break;
-        }
-        case CMNode.DATA_TYPE :
-        {
-          visitCMDataType((CMDataType)node);
-          break;
-        }
-        case CMNode.DOCUMENT :
-        {
-          visitCMDocument((CMDocument)node);
-          break;
-        }
-        case CMNode.ELEMENT_DECLARATION :
-        {
-          visitCMElementDeclaration((CMElementDeclaration)node);
-          break;
-        }
-        case CMNode.GROUP :
-        {
-          visitCMGroup((CMGroup)node);
-          break;
-        }
-      }
-      indent -= 2;
-    }
-  }
-      
-  public void visitCMAnyElement(CMAnyElement anyElement)
-  {
-  }
-
-  public void visitCMAttributeDeclaration(CMAttributeDeclaration ad)
-  {
-  }
-
-  public void visitCMDataType(CMDataType dataType)
-  {
-  }
-
-  public void visitCMDocument(CMDocument document)
-  {
-    CMNamedNodeMap map = document.getElements();
-    int size = map.getLength();
-    for (int i = 0; i < size; i++)
-    {
-      visitCMNode(map.item(i));
-    }
-  }
-
-  public void visitCMGroup(CMGroup group)
-  {
-    CMNodeList nodeList = group.getChildNodes();
-    int size = nodeList.getLength();
-    for (int i = 0; i < size; i++)
-    {
-      visitCMNode(nodeList.item(i));
-    }
-  }
-
-  public void visitCMElementDeclaration(CMElementDeclaration ed)
-  {
-    CMNamedNodeMap nodeMap = ed.getAttributes();
-    int size = nodeMap.getLength();
-    for (int i = 0; i < size; i++)
-    {
-      visitCMNode(nodeMap.item(i));
-    }
-
-    visitCMNode(ed.getContent());
-
-    visitCMDataType(ed.getDataType());
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/ContentBuilder.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/ContentBuilder.java
deleted file mode 100644
index 14d02b1..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/ContentBuilder.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-                   
-/**
- * This class lets you traverse a 'CM' model providing callbacks to build content.
- */
-public class ContentBuilder extends CMVisitor
-{
-  public static final int BUILD_ALL_CONTENT = 1;
-  public static final int BUILD_ONLY_REQUIRED_CONTENT = 2;
-  protected int buildPolicy = BUILD_ALL_CONTENT;
-
-  protected boolean alwaysVisit;
-  protected Vector visitedCMElementDeclarationList = new Vector();
-
-  public ContentBuilder()
-  {
-  }
-                
-  public void setBuildPolicy(int buildPolicy)
-  {
-    this.buildPolicy = buildPolicy;
-  }
-
-  public int getBuildPolicy()
-  {
-    return buildPolicy;
-  }                
-           
-  protected void createAnyElementNode(CMAnyElement anyElement)
-  {
-  }
-
-  protected void createElementNodeStart(CMElementDeclaration ed)
-  {      
-  }
-
-  protected void createElementNodeEnd(CMElementDeclaration ed)
-  {
-  }
-
-  protected void createTextNode(CMDataType dataType)
-  {
-  } 
-
-  protected void createAttributeNode(CMAttributeDeclaration attribute)
-  {
-  } 
- 
-  public void visitCMElementDeclaration(CMElementDeclaration ed)
-  {
-    int forcedMin = (buildPolicy == BUILD_ALL_CONTENT || alwaysVisit) ? 1 : 0;
-    int min = Math.max(ed.getMinOccur(), forcedMin);                          
-    alwaysVisit = false;
-
-    if (min > 0 && !visitedCMElementDeclarationList.contains(ed))
-    {
-      visitedCMElementDeclarationList.add(ed);
-      for (int i = 1; i <= min; i++)
-      {       
-        createElementNodeStart(ed);       
-        
-        // instead of calling super.visitCMElementDeclaration()
-        // we duplicate the code with some minor modifications
-        CMNamedNodeMap nodeMap = ed.getAttributes();
-        int size = nodeMap.getLength();
-        for (int j = 0; j < size; j++)
-        {
-          visitCMNode(nodeMap.item(j));
-        }
-
-        CMContent content = ed.getContent();
-        if (content != null)
-        {
-          visitCMNode(content);
-        }
-
-        if (ed.getContentType() == CMElementDeclaration.PCDATA)
-        {
-          CMDataType dataType = ed.getDataType();
-          if (dataType != null)
-          {
-            visitCMDataType(dataType);
-          }
-        }
-        // end duplication
-        createElementNodeEnd(ed);  
-      }
-      int size = visitedCMElementDeclarationList.size();
-      visitedCMElementDeclarationList.remove(size - 1);
-    }
-  }
-    
-
-  public void visitCMDataType(CMDataType dataType)
-  {
-    createTextNode(dataType);   
-  }
-
-
-  public void visitCMGroup(CMGroup e)
-  { 
-    int forcedMin = (buildPolicy == BUILD_ALL_CONTENT || alwaysVisit) ? 1 : 0;
-    int min = Math.max(e.getMinOccur(), forcedMin);                          
-    alwaysVisit = false;
-
-    for (int i = 1; i <= min; i++)
-    {   
-      if (e.getOperator() == CMGroup.CHOICE)
-      {
-        // add only 1 element from the group
-        // todo... perhaps add something other than the first one        
-        CMNodeList nodeList = e.getChildNodes();
-        if (nodeList.getLength() > 0)
-        {
-          visitCMNode(nodeList.item(0));
-        }
-      }
-      else // SEQUENCE, ALL
-      {
-        // visit all of the content
-        super.visitCMGroup(e);
-      }
-    }
-  } 
-
-  public void visitCMAttributeDeclaration(CMAttributeDeclaration ad)
-  {
-    if (alwaysVisit ||
-        buildPolicy == BUILD_ALL_CONTENT ||
-        ad.getUsage() == CMAttributeDeclaration.REQUIRED)
-    {
-      createAttributeNode(ad);      
-    }
-  }                     
-  
-
-  public void visitCMAnyElement(CMAnyElement anyElement)
-  {  
-    int forcedMin = (buildPolicy == BUILD_ALL_CONTENT || alwaysVisit) ? 1 : 0;
-    alwaysVisit = false; 
-    int min = Math.max(anyElement.getMinOccur(), forcedMin);                          
-    for (int i = 1; i <= min; i++)
-    {                                
-      createAnyElementNode(anyElement);
-    }
-  }     
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilder.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilder.java
deleted file mode 100644
index 9d23576..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilder.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.w3c.dom.Node;
-
-
-public interface DOMContentBuilder
-{
-  public static final int BUILD_OPTIONAL_ATTRIBUTES = 1;
-  public static final int BUILD_OPTIONAL_ELEMENTS = 1<<1;
-  public static final int BUILD_FIRST_CHOICE = 1<<2;
-  public static final int BUILD_TEXT_NODES = 1<<3;
-  public static final int BUILD_FIRST_SUBSTITUTION = 1<<4;
-  
-  public static final int 
-    BUILD_ONLY_REQUIRED_CONTENT =
-      BUILD_FIRST_CHOICE
-      | BUILD_TEXT_NODES;
-  public static final int 
-    BUILD_ALL_CONTENT = 
-      BUILD_OPTIONAL_ATTRIBUTES 
-      | BUILD_OPTIONAL_ELEMENTS 
-      | BUILD_FIRST_CHOICE
-      | BUILD_TEXT_NODES;
-      
-  public static final String PROPERTY_BUILD_BLANK_TEXT_NODES = "buildBlankTextNodes"; //$NON-NLS-1$
-  
-  public void setBuildPolicy(int buildPolicy);
-  public int  getBuildPolicy();
-  public void setProperty(String propertyName, Object value);
-  public Object getProperty(String propertyName);
-  public List getResult();
-  public void build(Node parent, CMNode child);
-  public void createDefaultRootContent(CMDocument cmDocument, CMElementDeclaration rootCMElementDeclaration) throws Exception;
-  public void createDefaultRootContent(CMDocument cmDocument, CMElementDeclaration rootCMElementDeclaration, List namespaceInfoList) throws Exception;
-  public void createDefaultContent(Node parent, CMElementDeclaration ed) throws Exception;
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java
deleted file mode 100644
index 532a484..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java
+++ /dev/null
@@ -1,602 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.ContentModelManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.util.CMDataTypeValueHelper;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-
-/**
- * todo... common up this code with 'ContentBuilder'
- */
-public class DOMContentBuilderImpl extends CMVisitor implements DOMContentBuilder {
-	protected int buildPolicy = BUILD_ALL_CONTENT;
-	protected Hashtable propertyTable = new Hashtable();
-
-	protected boolean alwaysVisit = false;
-	protected List resultList;
-	protected Document document;
-	protected Node currentParent;
-	protected Node topParent;
-	protected Vector visitedCMElementDeclarationList = new Vector();
-	protected boolean attachNodesToParent = true;
-	protected NamespaceTable namespaceTable;
-
-	protected List namespaceInfoList;
-	protected Element rootElement; // this is used only teporarily via
-									// createDefaultRootContent
-	protected ExternalCMDocumentSupport externalCMDocumentSupport;
-
-	public boolean supressCreationOfDoctypeAndXMLDeclaration;
-
-	protected CMDataTypeValueHelper valueHelper = new CMDataTypeValueHelper();
-
-	protected int numOfRepeatableElements = 1;
-	protected Stack cmGroupStack = new Stack();
-
-	public interface ExternalCMDocumentSupport {
-		public CMDocument getCMDocument(Element element, String uri);
-	}
-
-	public void setExternalCMDocumentSupport(ExternalCMDocumentSupport externalCMDocumentSupport) {
-		this.externalCMDocumentSupport = externalCMDocumentSupport;
-	}
-
-	public DOMContentBuilderImpl(Document document) {
-		this.document = document;
-		namespaceTable = new NamespaceTable(document);
-	}
-
-	public void setBuildPolicy(int buildPolicy) {
-		this.buildPolicy = buildPolicy;
-	}
-
-	public int getBuildPolicy() {
-		return buildPolicy;
-	}
-
-	protected boolean buildAllContent(int policy) {
-		return (policy & BUILD_ALL_CONTENT) == BUILD_ALL_CONTENT;
-	}
-
-	protected boolean buildOptionalElements(int policy) {
-		return (policy & BUILD_OPTIONAL_ELEMENTS) == BUILD_OPTIONAL_ELEMENTS;
-	}
-
-	protected boolean buildOptionalAttributes(int policy) {
-		return (policy & BUILD_OPTIONAL_ATTRIBUTES) == BUILD_OPTIONAL_ATTRIBUTES;
-	}
-
-	protected boolean buildFirstChoice(int policy) {
-		return (policy & BUILD_FIRST_CHOICE) == BUILD_FIRST_CHOICE;
-	}
-
-	protected boolean buildTextNodes(int policy) {
-		return (policy & BUILD_TEXT_NODES) == BUILD_TEXT_NODES;
-	}
-
-	protected boolean buildFirstSubstitution(int policy) {
-		return (policy & BUILD_FIRST_SUBSTITUTION) == BUILD_FIRST_SUBSTITUTION;
-	}
-
-	public List getResult() {
-		return resultList;
-	}
-
-	public void setProperty(String propertyName, Object value) {
-		propertyTable.put(propertyName, value);
-	}
-
-	public Object getProperty(String propertyName) {
-		return propertyTable.get(propertyName);
-	}
-
-	public void build(Node parent, CMNode child) {
-		resultList = new Vector();
-		topParent = parent;
-		currentParent = parent;
-		if (parent instanceof Element) {
-			namespaceTable.addElementLineage((Element) parent);
-		}
-		attachNodesToParent = false;
-		alwaysVisit = true;
-		visitCMNode(child);
-	}
-
-	public void createDefaultRootContent(CMDocument cmDocument, CMElementDeclaration rootCMElementDeclaration, List namespaceInfoList) throws Exception {
-		this.namespaceInfoList = namespaceInfoList;
-		createDefaultRootContent(cmDocument, rootCMElementDeclaration);
-	}
-
-	public void createDefaultRootContent(CMDocument cmDocument, CMElementDeclaration rootCMElementDeclaration) throws Exception {
-		String grammarFileName = cmDocument.getNodeName();
-		if (!supressCreationOfDoctypeAndXMLDeclaration) {
-			// TODO cs... investigate to see if this code path is ever used,
-			// doesn't seem to be
-			// for now I'm setting the encoding to UTF-8 just incase this code
-			// path is used somewhere
-			//
-			String piValue = "version=\"1.0\""; //$NON-NLS-1$
-			String encoding = "UTF-8"; //$NON-NLS-1$
-			piValue += " encoding=\"" + encoding + "\""; //$NON-NLS-1$ //$NON-NLS-2$      
-			ProcessingInstruction pi = document.createProcessingInstruction("xml", piValue); //$NON-NLS-1$
-			document.appendChild(pi);
-
-			// if we have a 'dtd' then add a DOCTYPE tag
-			//
-			if (grammarFileName != null && grammarFileName.endsWith("dtd")) //$NON-NLS-1$
-			{
-				DOMImplementation domImpl = document.getImplementation();
-				DocumentType documentType = domImpl.createDocumentType(rootCMElementDeclaration.getElementName(), grammarFileName, grammarFileName);
-				document.appendChild(documentType);
-			}
-		}
-
-		// if we have a schema add an xsi:schemaLocation attribute
-		//
-		if (grammarFileName != null && grammarFileName.endsWith("xsd") && namespaceInfoList != null) //$NON-NLS-1$
-		{
-			DOMNamespaceInfoManager manager = new DOMNamespaceInfoManager();
-			String name = rootCMElementDeclaration.getNodeName();
-			if (namespaceInfoList.size() > 0) {
-				NamespaceInfo info = (NamespaceInfo) namespaceInfoList.get(0);
-				if (info.prefix != null && info.prefix.length() > 0) {
-					name = info.prefix + ":" + name; //$NON-NLS-1$
-				}
-			}
-			rootElement = createElement(rootCMElementDeclaration, name, document);
-			manager.addNamespaceInfo(rootElement, namespaceInfoList, true);
-		}
-		createDefaultContent(document, rootCMElementDeclaration);
-	}
-
-	public void createDefaultContent(Node parent, CMElementDeclaration ed) {
-		currentParent = parent;
-		alwaysVisit = true;
-		visitCMElementDeclaration(ed);
-	}
-
-	public String computeName(CMNode cmNode, Node parent) {
-		String prefix = null;
-		return DOMNamespaceHelper.computeName(cmNode, parent, prefix, namespaceTable);
-	}
-
-	// overide the following 'create' methods to control how nodes are created
-	//
-	protected Element createElement(CMElementDeclaration ed, String name, Node parent) {
-		return document.createElement(name);
-	}
-
-	protected Attr createAttribute(CMAttributeDeclaration ad, String name, Node parent) {
-		return document.createAttribute(name);
-	}
-
-	protected Text createTextNode(CMDataType dataType, String value, Node parent) {
-		return document.createTextNode(value);
-	}
-
-	protected void handlePushParent(Element parent, CMElementDeclaration ed) {
-	}
-
-	protected void handlePopParent(Element element, CMElementDeclaration ed) {
-	}
-
-	// The range must be between 1 and 99.
-	public void setNumOfRepeatableElements(int i) {
-		numOfRepeatableElements = i;
-	}
-
-	protected int getNumOfRepeatableElements() {
-		return numOfRepeatableElements;
-	}
-
-	public void visitCMElementDeclaration(CMElementDeclaration ed) {
-		int forcedMin = (buildOptionalElements(buildPolicy) || alwaysVisit) ? 1 : 0;
-		int min = Math.max(ed.getMinOccur(), forcedMin);
-
-		// Correct the min value if the element is contained in
-		// a group.
-		if (!cmGroupStack.isEmpty()) {
-			CMGroup group = (CMGroup) cmGroupStack.peek();
-			int gmin = group.getMinOccur();
-			if (gmin == 0)
-				if (buildOptionalElements(buildPolicy)) { 
-					/* do nothing: min = min */
-				}
-				else {
-					min = min * gmin; // min = 0
-				}
-			else {
-				min = min * gmin;
-			}
-		}
-
-		int max = Math.min(ed.getMaxOccur(), getNumOfRepeatableElements());
-		if (max < min)
-			max = min;
-
-		alwaysVisit = false;
-
-		// Note - ed may not be abstract but has substitutionGroups
-		// involved.
-		if (buildFirstSubstitution(buildPolicy) || isAbstract(ed)) // leave
-																	// this
-																	// for
-																	// backward
-																	// compatibility
-																	// for now
-		{
-			// Note - To change so that if ed is optional, we do not
-			// generate anything here.
-			ed = getSubstitution(ed);
-
-			// Note - the returned ed may be an abstract element in
-			// which case the xml will be invalid.
-		}
-
-		if (min > 0 && !visitedCMElementDeclarationList.contains(ed)) {
-			visitedCMElementDeclarationList.add(ed);
-			for (int i = 1; i <= max; i++) {
-				// create an Element for each
-				Element element = null;
-				if (rootElement != null) {
-					element = rootElement;
-					rootElement = null;
-				}
-				else {
-					element = createElement(ed, computeName(ed, currentParent), currentParent);
-				}
-
-				// visit the children of the GrammarElement
-				Node oldParent = currentParent;
-				currentParent = element;
-				handlePushParent(element, ed);
-
-				namespaceTable.addElement(element);
-
-				boolean oldAttachNodesToParent = attachNodesToParent;
-				attachNodesToParent = true;
-
-				// instead of calling super.visitCMElementDeclaration()
-				// we duplicate the code with some minor modifications
-				CMNamedNodeMap nodeMap = ed.getAttributes();
-				int size = nodeMap.getLength();
-				for (int j = 0; j < size; j++) {
-					visitCMNode(nodeMap.item(j));
-				}
-
-				CMContent content = ed.getContent();
-				if (content != null) {
-					visitCMNode(content);
-				}
-
-				if (ed.getContentType() == CMElementDeclaration.PCDATA) {
-					CMDataType dataType = ed.getDataType();
-					if (dataType != null) {
-						visitCMDataType(dataType);
-					}
-				}
-				// end duplication
-				attachNodesToParent = oldAttachNodesToParent;
-				handlePopParent(element, ed);
-				currentParent = oldParent;
-				linkNode(element);
-			}
-			int size = visitedCMElementDeclarationList.size();
-			visitedCMElementDeclarationList.remove(size - 1);
-		}
-	}
-
-
-	public void visitCMDataType(CMDataType dataType) {
-		Text text = null;
-		String value = null;
-
-		// For backward compatibility:
-		// Previous code uses a property value but new one uses
-		// buildPolicy.
-		if (getProperty(PROPERTY_BUILD_BLANK_TEXT_NODES) != null && getProperty(PROPERTY_BUILD_BLANK_TEXT_NODES).equals("true")) //$NON-NLS-1$
-			buildPolicy = buildPolicy ^ BUILD_TEXT_NODES;
-
-		if (buildTextNodes(buildPolicy)) {
-			value = valueHelper.getValue(dataType);
-			if (value == null) {
-				if (currentParent != null && currentParent.getNodeType() == Node.ELEMENT_NODE) {
-					value = currentParent.getNodeName();
-				}
-				else {
-					value = "pcdata"; //$NON-NLS-1$
-				}
-			}
-		}
-		else {
-			value = ""; //$NON-NLS-1$
-		}
-		text = createTextNode(dataType, value, currentParent);
-		linkNode(text);
-	}
-
-
-	public void visitCMGroup(CMGroup e) {
-		cmGroupStack.push(e);
-
-		int forcedMin = (buildOptionalElements(buildPolicy) || alwaysVisit) ? 1 : 0;
-		int min = Math.max(e.getMinOccur(), forcedMin);
-
-		int max = 0;
-		if (e.getMaxOccur() == -1) // unbounded
-			max = getNumOfRepeatableElements();
-		else
-			max = Math.min(e.getMaxOccur(), getNumOfRepeatableElements());
-
-		if (max < min)
-			max = min;
-
-		alwaysVisit = false;
-
-		for (int i = 1; i <= max; i++) {
-			if (e.getOperator() == CMGroup.CHOICE && buildFirstChoice(buildPolicy)) {
-				CMNode hintNode = null;
-
-				// todo... the CMGroup should specify the hint... but it seems
-				// as though
-				// the Yamato guys are making the CMElement specify the hint.
-				// I do it that way for now until... we should fix this post
-				// GA
-				//    
-				int listSize = visitedCMElementDeclarationList.size();
-				if (listSize > 0) {
-					CMElementDeclaration ed = (CMElementDeclaration) visitedCMElementDeclarationList.get(listSize - 1);
-					Object contentHint = ed.getProperty("contentHint"); //$NON-NLS-1$
-					if (contentHint instanceof CMNode) {
-						hintNode = (CMNode) contentHint;
-					}
-				}
-
-				// see if this hint corresponds to a valid choice
-				//
-				CMNode cmNode = null;
-
-				if (hintNode != null) {
-					CMNodeList nodeList = e.getChildNodes();
-					int nodeListLength = nodeList.getLength();
-					for (int j = 0; j < nodeListLength; j++) {
-						if (hintNode == nodeList.item(j)) {
-							cmNode = hintNode;
-						}
-					}
-				}
-
-				// if no cmNode has been determined from the hint, just use
-				// the first choice
-				//
-				if (cmNode == null) {
-					CMNodeList nodeList = e.getChildNodes();
-					if (nodeList.getLength() > 0) {
-						cmNode = nodeList.item(0);
-					}
-				}
-
-				if (cmNode != null) {
-					visitCMNode(cmNode);
-				}
-			}
-			else if (e.getOperator() == CMGroup.ALL // ALL
-						|| e.getOperator() == CMGroup.SEQUENCE) // SEQUENCE
-			{
-				// visit all of the content
-				super.visitCMGroup(e);
-			}
-		}
-
-		cmGroupStack.pop();
-	}
-
-	static int count = 0;
-
-	public void visitCMAttributeDeclaration(CMAttributeDeclaration ad) {
-		if (alwaysVisit || buildOptionalAttributes(buildPolicy) || ad.getUsage() == CMAttributeDeclaration.REQUIRED) {
-			alwaysVisit = false;
-			String name = computeName(ad, currentParent);
-			String value = valueHelper.getValue(ad, namespaceTable);
-			Attr attr = createAttribute(ad, name, currentParent);
-			attr.setValue(value != null ? value : ""); //$NON-NLS-1$
-			linkNode(attr);
-		}
-	}
-
-	protected boolean isAbstract(CMNode ed) {
-		boolean result = false;
-		if (ed != null) {
-			Object value = ed.getProperty("Abstract"); //$NON-NLS-1$
-			result = (value == Boolean.TRUE);
-		}
-		return result;
-	}
-
-	protected CMElementDeclaration getSubstitution(CMElementDeclaration ed) {
-		CMElementDeclaration result = ed;
-		CMNodeList l = (CMNodeList) ed.getProperty("SubstitutionGroup"); //$NON-NLS-1$
-		if (l != null) {
-			for (int i = 0; i < l.getLength(); i++) {
-				CMNode candidate = l.item(i);
-				if (!isAbstract(candidate) && (candidate instanceof CMElementDeclaration)) {
-					result = (CMElementDeclaration) candidate;
-					break;
-				}
-			}
-		}
-		return result;
-	}
-
-	protected CMElementDeclaration getParentCMElementDeclaration() {
-		CMElementDeclaration ed = null;
-		int listSize = visitedCMElementDeclarationList.size();
-		if (listSize > 0) {
-			ed = (CMElementDeclaration) visitedCMElementDeclarationList.get(listSize - 1);
-		}
-		return ed;
-	}
-
-	public void visitCMAnyElement(CMAnyElement anyElement) {
-		// ingnore buildPolicy for ANY elements... only create elements if
-		// absolutely needed
-		//
-		int forcedMin = alwaysVisit ? 1 : 0;
-		int min = Math.max(anyElement.getMinOccur(), forcedMin);
-		alwaysVisit = false;
-
-		String uri = anyElement.getNamespaceURI();
-		String targetNSProperty = "http://org.eclipse.wst/cm/properties/targetNamespaceURI"; //$NON-NLS-1$
-		CMDocument parentCMDocument = (CMDocument) anyElement.getProperty("CMDocument"); //$NON-NLS-1$
-		CMElementDeclaration ed = null;
-
-		// System.out.println("parentCMDocument = " + parentCMDocument);
-		// //$NON-NLS-1$
-		if (parentCMDocument != null) {
-			if (uri == null || uri.startsWith("##") || uri.equals(parentCMDocument.getProperty(targetNSProperty))) //$NON-NLS-1$
-			{
-				ed = getSuitableElement(getParentCMElementDeclaration(), parentCMDocument);
-			}
-		}
-
-
-		if (ed == null && externalCMDocumentSupport != null && uri != null && !uri.startsWith("##") && currentParent instanceof Element) //$NON-NLS-1$
-		{
-			CMDocument externalCMDocument = externalCMDocumentSupport.getCMDocument((Element) currentParent, uri);
-			if (externalCMDocument != null) {
-				ed = getSuitableElement(null, externalCMDocument);
-			}
-		}
-
-		for (int i = 1; i <= min; i++) {
-			if (ed != null) {
-				visitCMElementDeclaration(ed);
-			}
-			else {
-				Element element = document.createElement("ANY-ELEMENT"); //$NON-NLS-1$
-				linkNode(element);
-			}
-		}
-	}
-
-	protected CMElementDeclaration getSuitableElement(CMNamedNodeMap nameNodeMap) {
-		CMElementDeclaration result = null;
-		int size = nameNodeMap.getLength();
-		for (int i = 0; i < size; i++) {
-			CMElementDeclaration candidate = (CMElementDeclaration) nameNodeMap.item(i);
-			if (!visitedCMElementDeclarationList.contains(candidate)) {
-				result = candidate;
-				break;
-			}
-		}
-		return result;
-	}
-
-	protected CMElementDeclaration getSuitableElement(CMElementDeclaration ed, CMDocument cmDocument) {
-		CMElementDeclaration result = null;
-
-		if (ed != null) {
-			result = getSuitableElement(ed.getLocalElements());
-		}
-
-		if (result == null && cmDocument != null) {
-			result = getSuitableElement(cmDocument.getElements());
-		}
-
-		return result;
-	}
-
-
-	public void linkNode(Node node) {
-		if (attachNodesToParent && currentParent != null) {
-			if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
-				((Element) currentParent).setAttributeNode((Attr) node);
-			}
-			else {
-				currentParent.appendChild(node);
-			}
-		}
-		else if (resultList != null) {
-			resultList.add(node);
-		}
-	}
-
-	public static void testPopulateDocumentFromGrammarFile(Document document, String grammarFileName, String rootElementName, boolean hack) {
-		try {
-			CMDocument cmDocument = ContentModelManager.getInstance().createCMDocument(grammarFileName, null);
-			CMNamedNodeMap elementMap = cmDocument.getElements();
-			CMElementDeclaration element = (CMElementDeclaration) elementMap.getNamedItem(rootElementName);
-
-			DOMContentBuilderImpl contentBuilder = new DOMContentBuilderImpl(document);
-			contentBuilder.supressCreationOfDoctypeAndXMLDeclaration = hack;
-			contentBuilder.createDefaultRootContent(cmDocument, element);
-
-			System.out.println();
-			System.out.println("-----------------------------"); //$NON-NLS-1$
-			DOMWriter writer = new DOMWriter();
-			if (hack) {
-				writer.print(document, grammarFileName);
-			}
-			else {
-				writer.print(document);
-			}
-			System.out.println("-----------------------------"); //$NON-NLS-1$
-		}
-		catch (Exception e) {
-			System.out.println("Error: " + e); //$NON-NLS-1$
-			e.printStackTrace();
-		}
-	}
-
-	// test
-	//
-	/*
-	 * public static void main(String arg[]) { if (arg.length >= 2) { try {
-	 * CMDocumentFactoryRegistry.getInstance().registerCMDocumentBuilderWithClassName("org.eclipse.wst.xml.core.internal.contentmodel.mofimpl.CMDocumentBuilderImpl");
-	 * 
-	 * String grammarFileName = arg[0]; String rootElementName = arg[1];
-	 * 
-	 * Document document =
-	 * (Document)Class.forName("org.apache.xerces.dom.DocumentImpl").newInstance();
-	 * testPopulateDocumentFromGrammarFile(document, grammarFileName,
-	 * rootElementName, true); } catch (Exception e) {
-	 * System.out.println("DOMContentBuilderImpl error"); e.printStackTrace(); } }
-	 * else { System.out.println("Usage : java
-	 * org.eclipse.wst.xml.util.DOMContentBuildingCMVisitor grammarFileName
-	 * rootElementName"); } }
-	 */
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceHelper.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceHelper.java
deleted file mode 100644
index 049d445..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceHelper.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class DOMNamespaceHelper
-{                
-  protected static String getURIForPrefix(Element element, String prefix)
-  {              
-    String result = null;
-	  String nsAttrName = null;
-	  if (prefix != null && prefix.length() > 0) 
-    {
-		  nsAttrName = "xmlns:" + prefix; //$NON-NLS-1$
-	  }
-	  else 
-    {
-		  nsAttrName = "xmlns"; //$NON-NLS-1$
-	  }
-            
-    // assume the node is qualified... look up the URI base on the prefix
-    //
-	  for (Node node = element; node != null; node = node.getParentNode()) 
-    {
-	   	if (node.getNodeType() == Node.ELEMENT_NODE)
-      {
-        Element theElement = (Element)node;
-		    Attr attr = theElement.getAttributeNode(nsAttrName);
-		    if (attr != null) 
-        {
-          result = attr.getValue();
-        }
-      }
-      else
-      {
-        break;
-      }
-    }
-         
-    // see if we can find some info from an 'implicit' namespace
-    //
-    if (result == null)
-    {                                
-      NamespaceTable table = new NamespaceTable(element.getOwnerDocument());
-      result = table.getURIForPrefix(prefix);
-    }
-    return result;
-	}
-
-  public static String getNamespaceURI(Node node)
-  {            
-    String result = null;
-    if (node.getNodeType() == Node.ELEMENT_NODE)
-    {               
-      Element element = (Element)node;
-      String prefix = element.getPrefix();
-      result = getURIForPrefix(element, prefix);
-    }
-    else if (node.getNodeType() == Node.ATTRIBUTE_NODE)
-    {      
-      Attr attr = (Attr)node;
-      String prefix = attr.getPrefix();
-      result = getURIForPrefix(attr.getOwnerElement(), prefix);
-    }
-    return result;
-  }                 
-
-  // todo... this is an ugly hack... needs to be fixed
-  //
-  public static String computePrefix(CMNode cmNode, Node parentNode)
-  {
-    String result = null;
-    for (Node node = parentNode; node != null; node = node.getParentNode())
-    {
-      if (node.getNodeType() == Node.ELEMENT_NODE)
-      {
-        result = getPrefix(node.getNodeName());
-        if (result != null)
-        {
-          break;
-        }
-      }
-    }
-    return result;
-  }        
-
-
-  public static String getPrefix(String name)
-  {
-    String prefix = null;
-    int index = name.indexOf(":"); //$NON-NLS-1$
-    if (index != -1)
-    {
-      prefix = name.substring(0, index);
-    }
-    return prefix;
-  }
-
-
-  public static String getUnprefixedName(String name)
-  {
-    int index = name.indexOf(":"); //$NON-NLS-1$
-    if (index != -1)
-    {
-      name = name.substring(index + 1);
-    }
-    return name;
-  }
-
-
-  public static String computeName(CMNode cmNode, Node parent, String prefix)
-  {     
-    return computeName(cmNode, parent, prefix, null);
-  }   
-
-
-  public static String computeName(CMNode cmNode, Node parent, String prefix, NamespaceTable namespaceTable)
-  {
-    String result = cmNode.getNodeName();
-
-    // if the cmNode has a hard coded prefix then we don't need to do anything
-    //
-    if (getPrefix(result) == null)
-    {              
-      String qualification = (String)cmNode.getProperty("http://org.eclipse.wst/cm/properties/nsPrefixQualification"); //$NON-NLS-1$
-      // see if we need a namespace prefix
-      //
-      if (qualification != null && qualification.equals("qualified")) //$NON-NLS-1$
-      {            
-        if (prefix == null)                 
-        {
-          // todo... add getCMDocument() method to CMNode
-          // for now use this getProperty() hack
-          CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$
-          if (cmDocument != null)          
-          {     
-            String namespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI");    //$NON-NLS-1$
-            if (namespaceURI != null)
-            {   
-              // use the NamespaceTable to figure out the correct prefix for this namespace uri
-              //      
-              if (namespaceTable == null)
-              {                                            
-                Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document)parent : parent.getOwnerDocument();
-                namespaceTable = new NamespaceTable(document);
-                if (parent instanceof Element)
-                {
-                  namespaceTable.addElementLineage((Element)parent);
-                }
-              }
-              prefix = namespaceTable.getPrefixForURI(namespaceURI);
-            }
-          }
-        }
-        if (prefix != null && prefix.length() > 0)
-        {
-          result = prefix + ":" + result; //$NON-NLS-1$
-        }
-      }    
-    }
-    return result;
-  }  
-  
-
-  public static String[] getURIQualifiedNameComponents(String uriQualifiedName)
-  {
-    String[] result = new String[2];
-    int firstIndex = uriQualifiedName.indexOf("["); //$NON-NLS-1$
-    int lastIndex = uriQualifiedName.indexOf("]"); //$NON-NLS-1$
-    if (firstIndex != -1 && lastIndex > firstIndex)
-    {
-      result[0] = uriQualifiedName.substring(firstIndex + 1, lastIndex);
-      result[1] = uriQualifiedName.substring(lastIndex + 1);
-    }  
-    else
-    {
-      result[1] = uriQualifiedName;
-    }                              
-    return result;
-  }   
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceInfoManager.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceInfoManager.java
deleted file mode 100644
index 747efbc..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceInfoManager.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- * DOMNamespaceInfoManager          
- *
- *
- */
-public class DOMNamespaceInfoManager
-{                               
-  public static final String XSI_URI = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
-
-  public DOMNamespaceInfoManager()
-  {
-  }                 
-
-  public List getNamespaceInfoList(Element element)
-  {
-    NamespaceInfoReader reader = new NamespaceInfoReader();
-    return reader.getNamespaceInfoList(element);
-  }            
-   
-  public void removeNamespaceInfo(Element element)
-  {     
-    NamespaceInfoRemover remover = new NamespaceInfoRemover();
-    remover.removeNamespaceInfo(element);
-  }
-
-  public void addNamespaceInfo(Element element, List namespaceInfoList, boolean needsXSI)
-  {  
-    // first we create an xmlns attribute for each namespace
-    //                   
-    Document document = element.getOwnerDocument();
-                                
-    String schemaLocationValue = "";      //$NON-NLS-1$
-
-    for (Iterator iterator = namespaceInfoList.iterator(); iterator.hasNext(); )
-    {
-      NamespaceInfo nsInfo = (NamespaceInfo)iterator.next();
-      nsInfo.normalize();
-               
-      if (nsInfo.uri != null) 
-      {            
-        String attrName = nsInfo.prefix != null ? "xmlns:" + nsInfo.prefix : "xmlns"; //$NON-NLS-1$ //$NON-NLS-2$
-        Attr namespaceAttr = document.createAttribute(attrName);  
-        namespaceAttr.setValue(nsInfo.uri);
-        element.setAttributeNode(namespaceAttr);   
-
-        // in this case we use the attribute "xsi:schemaLocation"
-        // here we build up its value
-        //
-        if (nsInfo.locationHint != null)
-        {
-          schemaLocationValue += nsInfo.uri;
-          schemaLocationValue += " "; //$NON-NLS-1$
-          schemaLocationValue += nsInfo.locationHint;
-          schemaLocationValue += " ";    //$NON-NLS-1$
-        }   
-
-        if (nsInfo.uri.equals(XSI_URI))
-        {
-          needsXSI = false;
-        }
-      }     
-      else if (nsInfo.locationHint != null)
-      {
-        // in this case we use the attribute "xsi:noNamespaceSchemaLocation"
-        //
-        Attr attr = document.createAttribute("xsi:noNamespaceSchemaLocation");   //$NON-NLS-1$
-        attr.setValue(nsInfo.locationHint);
-        element.setAttributeNode(attr);
-      } 
-    } 
-
-    if (needsXSI)
-    {
-      // we add an xmlns:xsi attribute to define 'xsi:schemaLocation' attribute
-      //   
-      Attr attr = document.createAttribute("xmlns:xsi"); //$NON-NLS-1$
-      attr.setValue(XSI_URI);
-      element.setAttributeNode(attr);
-    }
-
-    if (schemaLocationValue.length() > 0)
-    {
-      // create the "xsi:schemaLocation" attribute
-      //
-      Attr attr = document.createAttribute("xsi:schemaLocation"); //$NON-NLS-1$
-      attr.setValue(schemaLocationValue);
-      element.setAttributeNode(attr);
-    }                             
-  } 
-       
-  /**
-   *
-   */
-  protected static class NamespaceInfoReader extends NamespaceAttributeVisitor
-  {  
-    protected List namespaceInfoList = new Vector();
-
-    public List getNamespaceInfoList(Element element)
-    {
-      visitElement(element);
-      return namespaceInfoList;
-    }
-                       
-
-    public void visitXSINoNamespaceSchemaLocationAttribute(Attr attr, String value)
-    {
-      NamespaceInfo info = createNamespaceInfo();
-      info.locationHint = value;      
-    }
-    
-    public void visitXMLNamespaceAttribute(Attr attr, String prefix, String uri)
-    {           
-      NamespaceInfo info = createNamespaceInfo();
-      info.uri = uri;
-      info.prefix = prefix;      
-      super.visitXMLNamespaceAttribute(attr, prefix, uri);
-    }
-
-    public void visitXSISchemaLocationValuePair(String uri, String locationHint)
-    {    
-      NamespaceInfo info = getNamespaceInfoForURI(uri);            
-      if (info != null)
-      {
-        info.locationHint = locationHint;
-      } 
-      else
-      {
-        info = createNamespaceInfo();
-        info.uri = uri;
-        info.locationHint = locationHint;
-      }
-    }                                                                 
-
-    protected NamespaceInfo getNamespaceInfoForURI(String uri)
-    {    
-      NamespaceInfo result = null;
-      for (Iterator i = namespaceInfoList.iterator(); i.hasNext(); )
-      {
-        NamespaceInfo info = (NamespaceInfo)i.next();
-        if (info.uri != null && info.uri.equals(uri))
-        {
-          result = info;
-          break;
-        }
-      }         
-      return result;
-    }     
-
-    protected NamespaceInfo createNamespaceInfo()
-    {
-      NamespaceInfo info = new NamespaceInfo();
-      namespaceInfoList.add(info);
-      return info;
-    }
-  }
-     
-                                                
-  /**
-   *
-   */
-  protected static class NamespaceInfoRemover extends NamespaceAttributeVisitor
-  {                   
-    protected List attributesToRemove = new Vector();
-
-    public void removeNamespaceInfo(Element element)
-    {  
-      visitElement(element);
-      removeAttributes();
-    }   
-
-    public void visitXSINoNamespaceSchemaLocationAttribute(Attr attr, String value)
-    {
-      attributesToRemove.add(attr);
-    }        
-    
-    public void visitXMLNamespaceAttribute(Attr attr, String namespacePrefix, String namespaceURI)
-    {   
-      attributesToRemove.add(attr);
-      super.visitXMLNamespaceAttribute(attr, namespacePrefix, namespaceURI);
-    }
-    
-    public void visitXSISchemaLocationAttribute(Attr attr, String value)
-    {
-      attributesToRemove.add(attr);
-    }   
-
-    public void removeAttributes()
-    {
-      for (Iterator i = attributesToRemove.iterator(); i.hasNext(); )
-      {
-        Attr attr = (Attr)i.next();
-        Element element = attr.getOwnerElement();
-        if (element != null)
-        {
-          element.removeAttributeNode(attr);
-        }
-      }
-    }   
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMVisitor.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMVisitor.java
deleted file mode 100644
index 0742f7b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMVisitor.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-// todo.. move this class to another package (perhaps xmlutility)
-//
-public class DOMVisitor
-{         
-  public void visitNode(Node node)
-  {
-    switch (node.getNodeType())
-    {
-      case Node.ATTRIBUTE_NODE :
-      {
-        visitAttr((Attr)node);
-        break;
-      }
-      case Node.CDATA_SECTION_NODE :
-      {
-        visitCDATASection((CDATASection)node);
-        break;
-      }
-      case Node.COMMENT_NODE :
-      {
-        visitComment((Comment)node);
-        break;
-      }
-      case Node.DOCUMENT_NODE :
-      {
-        visitDocument((Document)node);
-        break;
-      }
-      case Node.DOCUMENT_TYPE_NODE :
-      {
-        visitDocumentType((DocumentType)node);
-        break;
-      }
-      case Node.ELEMENT_NODE :
-      {
-        visitElement((Element)node);
-        break;
-      }
-      case Node.PROCESSING_INSTRUCTION_NODE :
-      {
-        visitProcessingInstruction((ProcessingInstruction)node);
-        break;
-      }
-      case Node.TEXT_NODE :
-      {
-        visitText((Text)node);
-        break;
-      }
-    }  
-  }    
-    
-  protected void visitDocument(Document document)
-  {                   
-    visitChildNodesHelper(document);
-  }
-
-  protected void visitDocumentType(DocumentType doctype)
-  {         
-
-  }  
-
-  protected void visitElement(Element element)
-  {        
-    visitAttributesHelper(element);
-    visitChildNodesHelper(element);
-  } 
- 
-
-  public void visitAttr(Attr attr)
-  {                                  
-  }
-
-  protected void visitText(Text text)
-  {    
-  }
-
-  protected void visitCDATASection(CDATASection cdataSection)
-  {                       
-  }     
-
-  protected void visitComment(Comment comment)
-  {                   
-  }   
-
-  protected void visitProcessingInstruction(ProcessingInstruction pi)
-  {    
-  }
- 
-
-  protected void visitChildNodesHelper(Node node)
-  {
-    NodeList children = node.getChildNodes();
-    for (int i = 0; i < children.getLength(); i++)
-    {
-      visitNode(children.item(i));
-    }
-  }
-
-  protected void visitAttributesHelper(Node node)
-  {
-    NamedNodeMap map = node.getAttributes();
-    for (int i = 0; i < map.getLength(); i++ )
-    {
-      visitNode(map.item(i));
-    }
-  }         
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMWriter.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMWriter.java
deleted file mode 100644
index d5a1150..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMWriter.java
+++ /dev/null
@@ -1,411 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-
-/**
- * This is a hacked up dom writer stolen from a Xerces sample.
- * I'd like to use an exisitng 'generic DOM' writer
- * If anyone can find such a thing then please go ahead and junk this.
- *
- * @version
- */
-public class DOMWriter
-{
-  protected boolean formattingEnabled = true;
-   protected boolean outputDoctypeEnabled = true;
-   protected PrintWriter out;
-   protected int indent = 0;  
-
-   public DOMWriter() throws UnsupportedEncodingException
-   {
-     this(System.out);
-   }
-
-   public DOMWriter(OutputStream outputSteam)
-   {
-     out = new PrintWriter(outputSteam);
-   }
-
-   public DOMWriter(Writer writer)
-   {
-     out = new PrintWriter(writer);
-   }
-
-   public void setFormattingEnabled(boolean enabled)
-   {
-     formattingEnabled = enabled;
-   }
-
-   public boolean getFormattingEnabled()
-   {
-     return formattingEnabled;
-   }
-
-   public void setOutputDoctypeEnabled(boolean enabled)
-   {
-     outputDoctypeEnabled = enabled;
-   }
-
-   public class XMLVisitor
-   {
-     protected boolean currentElementHasChildElements = false;
-
-     public void visitNode(Node node)
-     {
-       switch (node.getNodeType())
-       {
-         case Node.ATTRIBUTE_NODE :
-         {
-           visitAttr((Attr)node);
-           break;
-         }
-         case Node.CDATA_SECTION_NODE :
-         {
-           visitCDATASection((CDATASection)node);
-           break;
-         }
-         case Node.COMMENT_NODE :
-         {
-           visitComment((Comment)node);
-           break;
-         }
-         case Node.DOCUMENT_NODE :
-         {
-           visitDocument((Document)node);
-           break;
-         }
-         case Node.DOCUMENT_TYPE_NODE :
-         {
-           visitDocumentType((DocumentType)node);
-           break;
-         }
-         case Node.ELEMENT_NODE :
-         {
-           visitElement((Element)node);
-           break;
-         }
-         case Node.PROCESSING_INSTRUCTION_NODE :
-         {
-           visitProcessingInstruction((ProcessingInstruction)node);
-           break;
-         }
-         case Node.TEXT_NODE :
-         {
-           visitText((Text)node);
-           break;
-         }
-       }
-     }
-
-     public void visitDocument(Document document)
-     {
-       visitChildNodesHelper(document);
-     }
-
-     public void visitDocumentType(DocumentType doctype)
-     {                       
-       if (outputDoctypeEnabled)
-       {
-         String data = getDocumentTypeData(doctype);
-         print("<!DOCTYPE " + data + ">"); //$NON-NLS-1$ //$NON-NLS-2$
-       }
-     }
-
-     public void visitElement(Element element)
-     {                                  
-       if (!doShow(element))
-         return;
-
-       boolean parentElementHasChildNodes = currentElementHasChildElements;
-       currentElementHasChildElements = hasChildElements(element);
-
-       printIndent();
-       print("<"); //$NON-NLS-1$
-       print(element.getNodeName());
-       visitAttributesHelper(element);
-
-       boolean hasChildNodes = element.getChildNodes().getLength() > 0;                
-       boolean isRootElement = element.getParentNode().getNodeType() == Node.DOCUMENT_NODE;
-       if (hasChildNodes || isRootElement)
-       {
-         if (currentElementHasChildElements || isRootElement)
-         {
-           println(">"); //$NON-NLS-1$
-         }
-         else
-         {
-           print(">"); //$NON-NLS-1$
-         }
-         indent += 2;
-         visitChildNodesHelper(element);
-         indent -= 2;
-
-         if (currentElementHasChildElements || isRootElement)
-         {
-           printIndent();
-         }
-         print("</"); //$NON-NLS-1$
-         print(element.getNodeName());
-         println(">"); //$NON-NLS-1$
-       }
-       else
-       {
-         println("/>"); //$NON-NLS-1$
-       }
-
-       currentElementHasChildElements = parentElementHasChildNodes;
-     }
-
-     public void visitAttr(Attr attr)
-     {
-       print(" "); //$NON-NLS-1$
-       print(attr.getNodeName());
-       print("=\""); //$NON-NLS-1$
-       print(createPrintableCharacterData(attr.getValue()));
-       print("\""); //$NON-NLS-1$
-     }
-
-     public void visitText(Text text)
-     {
-       if (currentElementHasChildElements)
-       {
-         printIndent();
-         print(createPrintableCharacterData(text.getNodeValue()));
-         println();
-       }
-       else
-       {
-         print(createPrintableCharacterData(text.getNodeValue()));
-       }
-     }
-
-     public void visitCDATASection(CDATASection cdataSection)
-     {
-     }
-
-     public void visitComment(Comment comment)
-     {
-       printIndent();
-       print("<!--"); //$NON-NLS-1$
-       print(comment.getNodeValue());
-       println("-->"); //$NON-NLS-1$
-     }
-
-     public void visitProcessingInstruction(ProcessingInstruction pi)
-     {
-       printIndent();
-       print("<?"); //$NON-NLS-1$
-       print(pi.getNodeName());
-       print(" "); //$NON-NLS-1$
-       print(pi.getNodeValue());
-       println("?>"); //$NON-NLS-1$
-     }
-             
-
-     public boolean hasChildElements(Node node)
-     {
-       boolean result = false;
-       NodeList children = node.getChildNodes();
-       for (int i = 0; i < children.getLength(); i++)
-       {
-         if (children.item(i).getNodeType() == Node.ELEMENT_NODE)
-         {
-           result = true;
-           break;
-         }
-       }
-       return result;
-     }
-
-     public void visitChildNodesHelper(Node node)
-     {
-       NodeList children = node.getChildNodes();
-       for (int i = 0; i < children.getLength(); i++)
-       {
-         visitNode(children.item(i));
-       }
-     }
-
-     public void visitAttributesHelper(Node node)
-     {
-       NamedNodeMap map = node.getAttributes();
-       for (int i = 0; i < map.getLength(); i++ )
-       {
-         visitNode(map.item(i));
-       }
-     }
-   }
-
-  /** an ugly hack until I restruct this code a little
-   *  
-   */  
-  protected boolean doShow(Element element)    
-  {
-    return true;
-  }
-                                               
-  /** converts DOM text values to 'printable' values 
-   *  - converts '&' to '&amp;'
-   */
-  protected String createPrintableCharacterData(String string)
-  {              
-    String result = ""; //$NON-NLS-1$
-    int index = 0;                             
-    while (true)
-    {                                                 
-      int ampersandIndex = string.indexOf("&", index); //$NON-NLS-1$
-      if (ampersandIndex != -1)
-      {
-        result += string.substring(index, ampersandIndex);
-        result += "&amp;"; //$NON-NLS-1$
-        index = ampersandIndex + 1; 
-      }
-      else
-      {
-        break;
-      }
-    } 
-    result += string.substring(index);
-    return result;
-  }
-
-
-  /** Prints the specified node, recursively. */
-  public void print(Node node)
-  {
-    // is there anything to do?
-    if (node != null)
-    {
-      XMLVisitor visitor = new XMLVisitor();
-      visitor.visitNode(node);
-    }
-    out.flush();
-  }
-
-  /** a temporary hack to workaround our inability to create a DocumentType tag*/
-  public void print(Document document, String grammarURL)
-  {
-    String systemId = null;
-    if (grammarURL.endsWith("dtd")) //$NON-NLS-1$
-    {
-      int lastSlashIndex = Math.max(grammarURL.lastIndexOf("/"), grammarURL.lastIndexOf("\\")); //$NON-NLS-1$ //$NON-NLS-2$
-      if (lastSlashIndex != -1)
-      {
-        systemId = grammarURL.substring(lastSlashIndex + 1);
-      }
-    }
-    print(document, "UTF-8", grammarURL, null, systemId); //$NON-NLS-1$
-
-  }
-
-  /** a temporary hack to workaround our inability to create a DocumentType tag*/
-  public void print(Document document, String encoding, String grammarFileName, String publicId, String systemId)
-  {
-    out.println("<?xml version=\"1.0\"" + " encoding=\"" + encoding + "\"?>");   //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-    if (grammarFileName.endsWith(".dtd")) //$NON-NLS-1$
-    {
-      String docTypeLine = "<!DOCTYPE " + document.getDocumentElement().getNodeName() + " "; //$NON-NLS-1$ //$NON-NLS-2$
-      if (publicId != null) 
-      {
-        docTypeLine += "PUBLIC \"" + publicId + "\" "; //$NON-NLS-1$ //$NON-NLS-2$
-        if (systemId != null)
-        {
-          docTypeLine += "\"" + systemId + "\" "; //$NON-NLS-1$ //$NON-NLS-2$
-        }
-        docTypeLine += ">"; //$NON-NLS-1$
-        out.println(docTypeLine);
-      }
-      else if (systemId != null)
-      {
-        docTypeLine += "SYSTEM \"" + systemId + "\" >"; //$NON-NLS-1$ //$NON-NLS-2$
-        out.println(docTypeLine);
-      }
-    }
-    print(document);
-  }  
-
-  public static String getDocumentTypeData(DocumentType doctype)
-  {
-    String data = doctype.getName();
-    if (doctype.getPublicId() != null)
-    {
-      data += " PUBLIC \"" + doctype.getPublicId() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-      String systemId = doctype.getSystemId();
-      if (systemId == null)
-      {
-        systemId = ""; //$NON-NLS-1$
-      }
-      data += " \"" + systemId + "\"";      //$NON-NLS-1$ //$NON-NLS-2$
-    }
-    else
-    {
-      data += " SYSTEM \"" + doctype.getSystemId() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-    }
-    return data;
-  }     
-
-  public void println()
-  {
-    if (formattingEnabled)
-    {
-      out.println();
-    }
-  }
-
-  public void println(String string)
-  {
-    if (formattingEnabled)
-    {
-      out.println(string);
-    }
-    else
-    {
-      out.print(string);
-    }
-  }
-
-  public void printIndent()
-  {             
-    if (formattingEnabled)
-    {
-      for (int i = 0; i < indent; i++)
-      {
-        out.print(" "); //$NON-NLS-1$
-      }
-    }
-  }       
-
-  public void print(String string)
-  {
-    out.print(string);
-  }
-}
-
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/InferredGrammarFactory.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/InferredGrammarFactory.java
deleted file mode 100644
index d4a3c40..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/InferredGrammarFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.util.Collection;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.w3c.dom.Element;
-
-
-// this interface is used to build a grammar document given a local file name
-//
-public interface InferredGrammarFactory
-{   
-  public CMDocument createCMDocument(String uri); 
-  public CMElementDeclaration createCMElementDeclaration(CMDocument cmDocument, Element element, boolean isLocal);
-  public void createCMContent(CMDocument parentCMDocument, CMElementDeclaration parentEd, CMDocument childCMDocument, CMElementDeclaration childEd, boolean isLocal, String uri);
-  public void debugPrint(Collection collection); 
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceAttributeVisitor.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceAttributeVisitor.java
deleted file mode 100644
index 58d193d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceAttributeVisitor.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     David Carver - STAR - bug 198807 - attribute order dependancy.
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-import com.ibm.icu.util.StringTokenizer;
-
-
-public class NamespaceAttributeVisitor
-{                                      
-  public static final String XML_SCHEMA_INSTANCE_URI = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
-  public String xsiPrefix = "xsi"; //$NON-NLS-1$
-
-  public void visitXMLNamespaceAttribute(Attr attr, String namespacePrefix, String namespaceURI)
-  {   
-    if (namespaceURI.equals(XML_SCHEMA_INSTANCE_URI))
-    {
-      xsiPrefix = namespacePrefix;
-    }
-  } 
-
-  public void visitXSINoNamespaceSchemaLocationAttribute(Attr attr, String value)
-  {
-  }
-
-  public void visitXSISchemaLocationAttribute(Attr attr, String value)
-  {
-    StringTokenizer st = new StringTokenizer(value);          
-    while (true)
-    {
-      String nsURI = st.hasMoreTokens() ? st.nextToken() : null;
-      String locationHint = st.hasMoreTokens() ? st.nextToken() : null;            
-      if (nsURI != null && locationHint != null)
-      {    
-        visitXSISchemaLocationValuePair(nsURI, locationHint);          
-      }
-      else
-      {
-        break;
-      }
-    }
-  }   
-
-  public void visitXSISchemaLocationValuePair(String uri, String locationHint)
-  {
-  }
-
-  public void visitElement(Element element)
-  {
-    NamedNodeMap map = element.getAttributes();
-    int mapLength = map.getLength();
-    
-    // First retrieve all the namespaces so that they are loaded before
-    // doing any special prefix handling.  This allows the attributes to be
-    // defined in any order, but the namespaces have to be retrieved first.
-    
-    for (int i = 0; i < mapLength; i++)
-    {
-      Attr attr = (Attr)map.item(i);
-      String prefix = DOMNamespaceHelper.getPrefix(attr.getName());
-      String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attr.getName());
-      if (prefix != null && unprefixedName != null)
-      {
-        if (prefix.equals("xmlns")) //$NON-NLS-1$
-        {
-          visitXMLNamespaceAttribute(attr, unprefixedName, attr.getValue());
-        }
-      }
-      else if (unprefixedName != null)
-      {
-        if (unprefixedName.equals("xmlns")) //$NON-NLS-1$
-        {
-          visitXMLNamespaceAttribute(attr, "", attr.getValue()); //$NON-NLS-1$
-        }
-      }      
-
-    }
-
-    for (int i = 0; i < mapLength; i++)
-    {
-      Attr attr = (Attr)map.item(i);
-      String prefix = DOMNamespaceHelper.getPrefix(attr.getName());
-      String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attr.getName());
-      if (prefix != null && unprefixedName != null)
-      {
-       	if (prefix.equals(xsiPrefix) && unprefixedName.equals("schemaLocation")) //$NON-NLS-1$
-        {
-          visitXSISchemaLocationAttribute(attr, attr.getValue());
-        }
-        else if (prefix.equals(xsiPrefix) && unprefixedName.equals("noNamespaceSchemaLocation")) //$NON-NLS-1$
-        {
-          visitXSINoNamespaceSchemaLocationAttribute(attr, attr.getValue());
-        }
-      }
-    }
-  }      
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceInfo.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceInfo.java
deleted file mode 100644
index 56af91b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceInfo.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-public class NamespaceInfo
-{                        
-  public String uri;
-  public String prefix;
-  public String locationHint;
-  public boolean isPrefixRequired; 
-  protected Hashtable hashtable;
-
-  public NamespaceInfo()
-  {
-  }
-
-  public NamespaceInfo(String uri, String prefix, String locationHint)
-  {                                                                  
-    this.uri = uri;                             
-    this.prefix = prefix;
-    this.locationHint = locationHint;
-  }   
-
-  public NamespaceInfo(NamespaceInfo that)
-  {                                               
-    this.uri = that.uri;                             
-    this.prefix = that.prefix;
-    this.locationHint = that.locationHint;
-    // todo... see if we need to clone the hastable 
-  }
-
-  public void normalize()
-  {
-    uri = getNormalizedValue(uri);
-    prefix  = getNormalizedValue(prefix);
-    locationHint= getNormalizedValue(locationHint);
-  }
-
-  protected String getNormalizedValue(String string)
-  {
-    return (string != null && string.trim().length() == 0) ? null : string;
-  }
-    
-  public void setProperty(String property, Object value)
-  {
-    if (hashtable == null)
-    {
-      hashtable = new Hashtable();
-    }
-    hashtable.put(property, value);
-  }
-
-  public Object getProperty(String property)
-  {
-    return (hashtable != null) ? hashtable.get(property) : null;
-  }
-
-  public static List cloneNamespaceInfoList(List oldList)
-  {  
-    List newList = new Vector(oldList.size());
-    for (Iterator i = oldList.iterator(); i.hasNext(); )
-    {
-      NamespaceInfo oldInfo = (NamespaceInfo)i.next();
-      newList.add(new NamespaceInfo(oldInfo));
-    }               
-    return newList;
-  }
-}      
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceTable.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceTable.java
deleted file mode 100644
index 18a2541..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceTable.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-                          
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class NamespaceTable extends NamespaceAttributeVisitor
-{                   
-  public Hashtable hashtable = new Hashtable();
-
-  public NamespaceTable(Document document)
-  {         
-	  this();
-    //DOMExtension domExtension = DOMExtensionProviderRegistry.getInstance().getDOMExtension(document);
-    //if (domExtension != null)
-    //{                          
-    //  addNamespaceInfoList(domExtension.getImplictNamespaceInfoList(), true);
-    // }
-  }   
-
-  private NamespaceTable()
-  {       
-	  super();
-  }  
-
-  public boolean isNamespaceEncountered()
-  {
-    return hashtable.values().size() > 0;
-  }
-
-  public String getPrefixForURI(String uri)
-  {           
-    String result = null;
-    NamespaceInfo entry = getNamespaceInfoForURI(uri, true);
-    if (entry != null) 
-    {
-      result = entry.prefix;
-    }                         
-    return result;
-  }
-      
-
-  public String getURIForPrefix(String prefix)
-  {           
-    String result = null;
-    NamespaceInfo info = getNamespaceInfoForPrefix(prefix);
-    if (info != null) 
-    {
-      result = info.uri;
-    }                         
-    return result;
-  }    
-
-          
-  protected boolean isMatchingString(String a, String b)
-  {
-    return ((a == null && b == null) || (a != null && b != null && a.equals(b)));
-  }
-   
-
-  public NamespaceInfo getNamespaceInfoForURI(String uri)
-  {                                                     
-    return getNamespaceInfoForURI(uri, false);
-  }
-
-
-  public NamespaceInfo getNamespaceInfoForURI(String uri, boolean testImplied)
-  {
-    NamespaceInfo result = null;
-    for (Iterator i = hashtable.values().iterator(); i.hasNext(); )
-    {                    
-      NamespaceInfo nsInfo = (NamespaceInfo)i.next(); 
-      if (isMatchingString(nsInfo.uri, uri))
-      {                 
-        result = nsInfo;
-        if (testImplied && nsInfo.getProperty("isImplied") != null) //$NON-NLS-1$
-        {
-          // continue
-        }            
-        else
-        {
-          break;
-        }
-      }
-    }
-    return result;
-  } 
-
-
-  public void setLocationHintForURI(String uri, String locationHint)
-  {      
-   // List list = new Vector();
-    for (Iterator i = hashtable.values().iterator(); i.hasNext(); )
-    {                    
-      NamespaceInfo nsInfo = (NamespaceInfo)i.next(); 
-      if (isMatchingString(nsInfo.uri, uri))
-      {                                               
-        nsInfo.locationHint = locationHint;
-      }
-    }
-  }
-    
-
-  public NamespaceInfo getNamespaceInfoForPrefix(String prefix)
-  {                                      
-    prefix = prefix != null ? prefix : ""; //$NON-NLS-1$
-    return (NamespaceInfo)hashtable.get(prefix);
-  }   
-
-
-  public void visitXMLNamespaceAttribute(Attr attr, String namespacePrefix, String namespaceURI)
-  {                                 
-    NamespaceInfo nsInfo = new NamespaceInfo();      
-    nsInfo.prefix = namespacePrefix;
-    nsInfo.uri = namespaceURI;      
-   
-    NamespaceInfo matchingNamespaceInfo = getNamespaceInfoForURI(namespaceURI);
-    if (matchingNamespaceInfo != null)
-    {                           
-      nsInfo.locationHint = matchingNamespaceInfo.locationHint;
-    }                                      
-
-    internalAddNamespaceInfo(namespacePrefix, nsInfo);
-
-    super.visitXMLNamespaceAttribute(attr, namespacePrefix, namespaceURI);
-  } 
-                 
-  public void visitXSISchemaLocationValuePair(String uri, String locationHint)
-  {
-    setLocationHintForURI(uri, locationHint);
-  }   
-
-  public void addNamespaceInfo(NamespaceInfo info)
-  {                           
-    String key  = (info.prefix != null) ? info.prefix : ""; //$NON-NLS-1$
-    internalAddNamespaceInfo(key, info);
-  }
-
-  protected void internalAddNamespaceInfo(String key, NamespaceInfo info)
-  {
-    hashtable.put(key, info);
-  }
-
-  protected void addNamespaceInfoList(List list, boolean isImplied)
-  {       
-    if (list != null)
-    {
-      for (Iterator i = list.iterator(); i.hasNext(); )
-      {
-        NamespaceInfo info = (NamespaceInfo)i.next();
-        NamespaceInfo clone = new NamespaceInfo(info);    
-        if (isImplied)
-        {
-          clone.setProperty("isImplied", "true"); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-        addNamespaceInfo(clone);
-      }
-    }
-  }
-
-  public void addNamespaceInfoList(List list)
-  {  
-    addNamespaceInfoList(list, false);  
-  }
-
-  public void visitXSINoNamespaceSchemaLocationAttribute(Attr attr, String locationHint)
-  {
-    addNoNamespaceSchemaLocation(locationHint);
-  } 
-
-  public void addNoNamespaceSchemaLocation(String locationHint)
-  {
-    NamespaceInfo nsInfo = new NamespaceInfo();      
-    nsInfo.prefix = null;
-    nsInfo.uri = "";       //$NON-NLS-1$
-    nsInfo.locationHint = locationHint;  
-    internalAddNamespaceInfo("", nsInfo); //$NON-NLS-1$
-  } 
-
-  public void addNamespaceInfo(String prefix, String uri, String locationHint)
-  {
-    NamespaceInfo nsInfo = new NamespaceInfo();      
-    nsInfo.prefix = prefix;
-    nsInfo.uri = uri;      
-    nsInfo.locationHint = locationHint;  
-    internalAddNamespaceInfo(prefix != null ? prefix : "", nsInfo); //$NON-NLS-1$
-  } 
-
-  public void addElement(Element element)
-  {   
-    visitElement(element);  
-  }      
-         
-  public void addElementLineage(Element targetElement)
-  {
-    List list = NamespaceTable.getElementLineage(targetElement);                 
-    for (Iterator i = list.iterator(); i.hasNext(); )
-    {
-      Element element = (Element)i.next();
-      addElement(element);
-    }            
-  }
-
-  public static List getElementLineage(Element element)
-  {          
-    List result = new ArrayList();             
-    for (Node node = element; node != null; node = node.getParentNode())
-    {                               
-      if (node.getNodeType() == Node.ELEMENT_NODE)
-      {
-        result.add(0, node);                      
-      }
-      else
-      {
-        break;
-      }
-    }  
-    return result;
-  }    
-
-  public Collection getNamespaceInfoCollection()
-  {              
-    return hashtable.values();
-  } 
-
-  public List getNamespaceInfoList()
-  {                               
-    List list = new Vector();
-    list.addAll(hashtable.values());
-    return list;
-  }
-} 
diff --git a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java b/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java
deleted file mode 100644
index 409ffa0..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java
+++ /dev/null
@@ -1,439 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.emf2xml;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapter;
-import org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterImpl;
-import org.eclipse.wst.common.internal.emf.resource.EMF2DOMRenderer;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResource;
-import org.eclipse.wst.common.internal.emf.utilities.Assert;
-import org.eclipse.wst.common.internal.emf.utilities.DOMUtilities;
-import org.eclipse.wst.common.internal.emf.utilities.FeatureValueConversionException;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-public class EMF2DOMSSEAdapter extends EMF2DOMAdapterImpl implements INodeAdapter {
-	
-	private Class resourceClass;
-	public EMF2DOMSSEAdapter(Node node, EMF2DOMRenderer renderer, Translator translator) {
-		super(node, renderer, translator);
-	}
-
-	public EMF2DOMSSEAdapter(Notifier object, Node node, EMF2DOMRenderer renderer, Translator translator) {
-		super(object, node, renderer, translator);
-	}
-
-	public EMF2DOMSSEAdapter(TranslatorResource resource, Document document, EMF2DOMRenderer renderer, Translator translator) {
-		super(resource, document, renderer, translator);
-	}
-
-	protected String calcIndentString(Node node) {
-		Assert.isNotNull(node);
-		Assert.isNotNull(node.getParentNode(), "Node must be connected into the tree"); //$NON-NLS-1$
-
-		Node parent = node.getParentNode();
-
-		String indentString = getNewlineString(node);
-
-		// Find indentation string for this node based on its sibling or
-		// parent
-		Node previousSibling = DOMUtilities.getPreviousNodeSibling(node);
-		if (previousSibling != null) {
-			indentString = primGetIndentString(previousSibling);
-		}
-		else {
-			String parentIndentString = primGetIndentString(parent);
-			indentString = parentIndentString + DOMUtilities.INDENT_STRING;
-		}
-		return indentString;
-	}
-
-	/*
-	 * Prints out a DOM notification for debugging.
-	 */
-	protected void debugDOMNotify(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue) {
-		if (fDebug) {
-			String notifType = ""; //$NON-NLS-1$
-			switch (eventType) {
-				case INodeNotifier.ADD :
-					notifType = "ADD"; //$NON-NLS-1$
-					break;
-				case INodeNotifier.REMOVE :
-					notifType = "REMOVE"; //$NON-NLS-1$
-					break;
-				case INodeNotifier.CHANGE :
-					notifType = "CHANGE"; //$NON-NLS-1$
-					break;
-				case INodeNotifier.CONTENT_CHANGED :
-					notifType = "CONTENT_CHANGED"; //$NON-NLS-1$
-					break;
-				case INodeNotifier.STRUCTURE_CHANGED :
-					notifType = "STRUCTURE_CHANGE"; //$NON-NLS-1$
-					break;
-			}
-			Logger.log(Logger.INFO_DEBUG, "DOM Change: " + notifType); //$NON-NLS-1$
-			Logger.log(Logger.INFO_DEBUG, "\tnotifier      : " + notifier); //$NON-NLS-1$
-			Logger.log(Logger.INFO_DEBUG, "\tchangedFeature: " + changedFeature); //$NON-NLS-1$
-			Logger.log(Logger.INFO_DEBUG, "\toldValue      : " + oldValue); //$NON-NLS-1$
-			Logger.log(Logger.INFO_DEBUG, "\tnewValue      : " + newValue); //$NON-NLS-1$
-		}
-	}
-
-	protected void disableUndoManagementIfNecessary() {
-		IDOMModel model = getXMLModel();
-		if (model != null && model.getUndoManager() != null)
-			model.disableUndoManagement();
-	}
-
-	protected void enableUndoManagement() {
-		IDOMModel model = getXMLModel();
-		if (model != null && model.getUndoManager() != null)
-			model.enableUndoManagement();
-	}
-
-	protected String getNewlineString(Node node) {
-		/*
-		 * We should always have IDOMNode, and IStructuredDocument, and
-		 * consquently a valid "preferred" line delimiter, but just to be
-		 * safe, we'll assign something by default.
-		 */
-		if (node instanceof IDOMNode) {
-			IDOMNode xmlNode = (IDOMNode) node;
-			IStructuredDocument document = xmlNode.getStructuredDocument();
-			if (document != null) {
-				return document.getLineDelimiter();
-			}
-		}
-		return DOMUtilities.NEWLINE_STRING;
-	}
-
-	protected IDOMModel getXMLModel() {
-		if (getNode() != null)
-			return ((IDOMNode) getNode()).getModel();
-		return null;
-	}
-
-	protected IDOMNode getXMLNode() {
-		return (IDOMNode) getNode();
-	}
-
-	/*
-	 * Do nothing for SSE, we will tolerate anything they add
-	 */
-	protected void handleFeatureValueConversionException(FeatureValueConversionException ex) {
-		// Do nothing
-	}
-
-	/*
-	 * Do nothing for SSE, we will tolerate anything they add
-	 */
-	protected void handleInvalidMultiNodes(String nodeName) {
-		// Do nothing
-	}
-
-	protected void indent(Node node, Translator map) {
-		Assert.isNotNull(node.getParentNode(), "Node must be connected into the tree"); //$NON-NLS-1$
-		Assert.isNotNull(node);
-
-		String indentString = calcIndentString(node);
-
-		// Indent before the start tag
-		indentStartTag(indentString, node, map);
-
-		// Indent before the end tag
-		indentEndTag(indentString, node, map);
-	}
-
-	/**
-	 * Indent before the end tag of the <node>passed in.
-	 */
-	protected void indentEndTag(String indentString, Node node, Translator map) {
-		if (!map.shouldIndentEndTag(node))
-			return;
-		String domPath = map.getDOMPath();
-
-		if ((!map.isManagedByParent() && !map.isDOMTextValue()) || (map.isManagedByParent() && domPath.length() != 0) && node.getNodeName().equals(domPath)) {
-			Text newWS = node.getOwnerDocument().createTextNode(getNewlineString(node) + indentString); //$NON-NLS-1$
-			DOMUtilities.insertBeforeNode(node, newWS, null);
-		}
-	}
-
-	/**
-	 * Indent before the start tag of the <node>passed in.
-	 */
-	protected void indentStartTag(String indentString, Node node, Translator map) {
-		Node parent = node.getParentNode();
-		Text newWS = node.getOwnerDocument().createTextNode(getNewlineString(node) + indentString); //$NON-NLS-1$
-		DOMUtilities.insertAfterNode(parent, newWS, DOMUtilities.getPreviousNodeSibling(node));
-	}
-
-	protected boolean isEmptyTag(Element parent) {
-		return ((IDOMElement) parent).isEmptyTag();
-	}
-
-	/*
-	 * This method is called when the DOM node changes. It attempts to update
-	 * MOF object based on the changes.
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-
-		if (!isNotificationEnabled())
-			return;
-
-		debugDOMNotify(notifier, eventType, changedFeature, oldValue, newValue);
-
-		if (notifier != getNode() && eventType != INodeNotifier.CHANGE) {
-			// This is the case where the notification was sent from a
-			// sub node. Use the notifiers name to determine which
-			// MOF feature to update. Note that is is assumed that if
-			// the eventType is CHANGE then it attribute on a path node
-			// changing. This was put in for the EGL group.
-			if (notifier instanceof Element) {
-				if (eventType == INodeNotifier.STRUCTURE_CHANGED || eventType == INodeNotifier.CONTENT_CHANGED || eventType == INodeNotifier.CHANGE) {
-					Element notifyingNode = (Element) notifier;
-					Translator map = findTranslator(notifyingNode.getNodeName(), false);
-					if (map != null)
-						updateMOFFeature(map, getNode(), getEObject());
-				}
-			}
-		}
-		else {
-			// Update everything on STRUCTURE_CHANGE or CONTENT_CHANGE.
-			// Other event types occur too often.
-			if (eventType == INodeNotifier.STRUCTURE_CHANGED || eventType == INodeNotifier.CONTENT_CHANGED) {
-				updateMOF();
-			}
-			// Update just the attribute that changed.
-			else if (eventType == INodeNotifier.CHANGE) {
-				Translator map = findTranslator(changedFeature.toString(), true);
-				if (map != null)
-					updateMOFFeature(map, getNode(), getEObject());
-			}
-		}
-	}
-
-	protected void postUpdateDOMFeature(Translator map, Node node, EObject mofObject) {
-		enableUndoManagement();
-	}
-
-	protected void preUpdateDOMFeature(Translator map, Node node, EObject mofObject) {
-		super.preUpdateDOMFeature(map, node, mofObject);
-		disableUndoManagementIfNecessary();
-	}
-
-	protected void primAddDOMAdapter(Node aNode, EMF2DOMAdapter anAdapter) {
-		((IDOMNode) aNode).addAdapter((EMF2DOMSSEAdapter) anAdapter);
-	}
-
-	/**
-	 * Create an adapter for a child DOM node
-	 * 
-	 * @param node
-	 *            org.w3c.dom.Node The node to create the adapter for.
-	 */
-	protected EMF2DOMAdapter primCreateAdapter(EObject mofObject, Translator childMap) {
-		Element newNode = createNewNode(mofObject, childMap);
-		return new EMF2DOMSSEAdapter(mofObject, newNode, fRenderer, childMap);
-	}
-
-	/**
-	 * Create an adapter for a child DOM node
-	 * 
-	 * @param node
-	 *            org.w3c.dom.Node The node to create the adapter for.
-	 */
-	protected EMF2DOMAdapter primCreateAdapter(Node node, Translator childMap) {
-		return new EMF2DOMSSEAdapter(node, fRenderer, childMap);
-	}
-	protected EMF2DOMAdapter createAdapter(Node node, Translator childMap) {
-
-		//Assert.isNotNull(childMap.getChildAdapterClass());
-		Assert.isNotNull(node);
-
-		EMF2DOMAdapter adapter = primGetExistingAdapter(node);
-
-		if (adapter != null) {
-			if (adapter.isMOFProxy() || adapter.getTarget() == null) {
-				removeDOMAdapter(node, adapter);
-				if (adapter.getTarget() != null) {
-					adapter.getTarget().eAdapters().remove(adapter);
-				}
-				adapter = null;
-			}
-		} else {
-			adapter = primCreateAdapter(node, childMap);
-		}
-		return adapter;
-	}
-	protected void addDOMAdapter(Node childNode) {
-
-		// Only add the adapter if this is an child node that will not be
-		// adapted. For instance a subtree that maps to a MOF attribute
-		// setting.
-		if (childNode.getNodeType() == Node.ELEMENT_NODE) {
-			EMF2DOMAdapter attrAdapter = primGetExistingAdapter(childNode);
-
-			if (attrAdapter == null || attrAdapter.getNode() != getNode()) {
-				// If the node is adapted, but not by this adapter then remove
-				// it. This happens to non-object children when the parent tag
-				// name is changed.
-				removeDOMAdapter(childNode, attrAdapter);
-
-				if (fDebug) {
-					org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError("\tCHILD: Adding DOM adapter: " + this); //$NON-NLS-1$
-					org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError("\t\tto: " + childNode); //$NON-NLS-1$
-				}
-				primAddDOMAdapter(childNode, this);
-			}
-		}
-	}
-	
-	protected EMF2DOMAdapter primGetExistingAdapter(Node aNode) {
-		INodeNotifier sseNode = (INodeNotifier) aNode;
-		Collection adapters = sseNode.getAdapters();
-		for (Iterator iterator = adapters.iterator(); iterator.hasNext();) {
-			INodeAdapter adapter = (INodeAdapter) iterator.next();
-			// First Check if it's an EMF2DOMAdapter
-			if (adapter != null && adapter.isAdapterForType(EMF2DOMAdapter.ADAPTER_CLASS)) {
-				// Cast to EMF2DOMAdapter
-				EMF2DOMSSEAdapter e2DAdapter = (EMF2DOMSSEAdapter) adapter;
-				Object adapterTarget = e2DAdapter.getTarget();
-				
-				//Handle the cases where either adapter's target is null 
-				if ((getTarget() == null) || (adapterTarget == null))
-					if(resourceClass.equals(e2DAdapter.getResourceClass()))
-						return e2DAdapter;
-					else
-						continue;
-				
-				
-				// Check if target is an EMF resource
-				if (getTarget() instanceof Resource) {
-					/*
-					 * Now check if it's the right one (Multiple resources
-					 * could be attached)
-					 */
-					if (adapterTarget != null && adapterTarget == getTarget()) {
-						return e2DAdapter;
-					}
-				}
-				else {
-					// Check if targets are EObjects with the same resources
-					EObject myTarget = (EObject) getTarget();
-					/*
-					 * Now check if it's the right one (Multiple resources could
-					 * be attached)
-					 */
-					if (adapterTarget != null && ((EObject)adapterTarget).eResource() == myTarget.eResource()) {
-						return e2DAdapter;
-					}
-				}
-				
-				if (adapterTarget instanceof EObject) {
-					if (((EObject) e2DAdapter.getTarget()).eResource() == null) {
-						return e2DAdapter;
-					}
-				}
-			}
-		}
-		return null;
-	}
-
-	protected String primGetIndentString(Node node) {
-		IStructuredDocument flatModel = ((IDOMNode) node).getStructuredDocument();
-		int nodeStartOff = ((IDOMNode) node).getStartOffset();
-
-		int startOff = Math.max(0, nodeStartOff - 100);
-		int endOff = nodeStartOff;
-
-		try {
-			String text = flatModel.get(startOff, endOff - startOff);
-
-			int inx = text.length() - 1;
-			if (inx >= 0) {
-				for (; inx >= 0; inx--) {
-					char ch = text.charAt(inx);
-					if (Character.isWhitespace(ch) && ch != '\n' && ch != '\r') {
-						continue;
-					}
-					inx++;
-					break;
-				}
-
-				return text.substring(inx);
-			}
-		}
-		catch (BadLocationException ex) {
-			Logger.logException(ex);
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	protected void removeDOMAdapter(Node aNode, EMF2DOMAdapter anAdapter) {
-		((IDOMNode) aNode).removeAdapter((INodeAdapter) anAdapter);
-	}
-
-
-	protected void reorderDOMChild(Node parentNode, Node childNode, Node insertBeforeNode, Translator map) {
-		super.reorderDOMChild(parentNode, childNode, insertBeforeNode, map);
-		// Since reordering deletes all the whitespace before the node, we
-		// must indent .
-		if (insertBeforeNode != null && insertBeforeNode.getNodeType() == Node.ELEMENT_NODE)
-			indentStartTag(calcIndentString(insertBeforeNode), insertBeforeNode, map);
-		else
-			indentStartTag(calcIndentString(childNode), childNode, map);
-	}
-
-	protected void setEmptyTag(Element element) {
-		((IDOMElement) element).setEmptyTag(true);
-	}
-
-	public void updateDOM() {
-		if (!isNotificationEnabled())
-			return;
-		try {
-			disableUndoManagementIfNecessary();
-			primUpdateDOM();
-		}
-		finally {
-			enableUndoManagement();
-		}
-	}
-
-	public Class getResourceClass() {
-		return resourceClass;
-	}
-
-	protected void initChildTranslators() {
-		if (fRenderer != null && fRenderer.getResource() != null)
-			resourceClass = fRenderer.getResource().getClass();
-		super.initChildTranslators();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java b/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java
deleted file mode 100644
index 8b23e11..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java
+++ /dev/null
@@ -1,644 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.emf2xml;
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.jem.util.emf.workbench.ProjectResourceSet;
-import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase;
-import org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapter;
-import org.eclipse.wst.common.internal.emf.resource.EMF2DOMRenderer;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResource;
-import org.eclipse.wst.common.internal.emf.utilities.DOMUtilities;
-import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
-import org.eclipse.wst.common.internal.emfworkbench.integration.ResourceSetWorkbenchEditSynchronizer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-
-public class EMF2DOMSSERenderer extends EMF2DOMRenderer implements IModelStateListener, IModelLifecycleListener {
-
-	protected Object aboutToChangeNode = null;
-
-	protected boolean isBatchChanges = false;
-
-	private boolean isSaving = false;
-
-	private IModelManager modelManager;
-	
-	private Class resourceClass;
-
-	/** The XML DOM model */
-	protected IDOMModel xmlModel;
-
-	/** Used internally; the unique id for the xml model */
-	protected String xmlModelId;
-
-	protected boolean xmlModelReverted = false;
-
-	public EMF2DOMSSERenderer() {
-		super();
-	}
-
-	public void accessForRead() {
-		if (!resource.isNew()) {
-			String id = getModelManagerId();
-			getModelManager().getExistingModelForRead(id);
-		}
-	}
-
-	public void accessForWrite() {
-		modelAccessForWrite();
-	}
-
-	/**
-	 * see batchModelEnd
-	 * 
-	 */
-
-	public void batchModeEnd() {
-		getXMLModel().changedModel();
-		setRootNodeAdapterNotificationEnabled(true);
-		isBatchChanges = false;
-	}
-
-	/**
-	 * batchModeStart and batchModeEnd is a pair that controls notifications,
-	 * and tread access. They should always be called in a try/finally block.
-	 * 
-	 * setBatchModel begins the processing where notifications are not sent
-	 * out on each change, but saved up until the endBatchMode called.
-	 * 
-	 * This pair of calls can also, indirectly, "lock" the DOM Model to access
-	 * from only one thread, so it should not be locked for long periods of
-	 * time. That's also why it is important to have the endBatchMode in a
-	 * finally block to be sure it is always called, or the DOM will be left
-	 * in a locked, unusable, state and only shortly away from severere
-	 * program error.
-	 * 
-	 * <pre><code>
-	 * Example
-	 * </code>
-	 *  
-	 *  try { 
-	 *  		batchModelStart();
-	 *  		...do a some work ...
-	 *  		}
-	 *  	finally {
-	 *  		endBatchMode();
-	 *  		}
-	 *  
-	 *  
-	 * </pre>
-	 */
-	public void batchModeStart() {
-		isBatchChanges = true;
-		getXMLModel().aboutToChangeModel();
-		setRootNodeAdapterNotificationEnabled(false);
-	}
-
-	private void cacheSynchronizationStamp() {
-		IFile file = WorkbenchResourceHelper.getFile(resource);
-		if (file != null) {
-			if (xmlModel != null)
-				xmlModel.resetSynchronizationStamp(file);
-		}
-	}
-
-	/**
-	 * Create a new Document given
-	 * 
-	 * @aResource.
-	 */
-	protected void createDocument() {
-		TranslatorResource res = getResource();
-		res.setDefaults();
-		IFile file = WorkbenchResourceHelper.getFile(resource);
-		InputStream is = DOMUtilities.createHeaderInputStream(res.getDoctype(), res.getPublicId(), res.getSystemId());
-		if (is == null)
-			return;
-		try {
-			try {
-				List folders = new ArrayList();
-				IContainer container = file.getParent();
-				while (null != container && !container.exists() && container instanceof IFolder) {
-					folders.add(container);
-					container = container.getParent();
-				}
-				IFolder folder = null;
-				for (int i = 0; i < folders.size(); i++) {
-					folder = (IFolder) folders.get(i);
-					folder.create(true, true, null);
-				}
-				file.create(is, true, null);
-				file.setLocal(true, 1, null);
-			}
-			catch (CoreException e1) {
-				Logger.logException(e1);
-			}
-			finally {
-				if (null != is) {
-					is.close();
-				}
-			}
-			initializeXMLModel(file, resource.getWriteCount() != 0);
-		}
-		catch (IOException ex) {
-			Logger.log(Logger.ERROR, "IWAE0017E Unexpected IO exception occurred creating xml document");//$NON-NLS-1$
-		}
-	}
-
-	protected void createDOMTreeIfNecessary() {
-		if (needsToCreateDOM)
-			createDOMTree();
-	}
-
-	protected EMF2DOMAdapter createRootDOMAdapter() {
-		return new EMF2DOMSSEAdapter(getResource(), document, this, getResource().getRootTranslator());
-	}
-
-	public void deRegisterAsModelLifecycleListener() {
-		if (xmlModel != null)
-			xmlModel.removeModelLifecycleListener(this);
-	}
-
-	public void deRegisterAsModelStateListener() {
-		if (xmlModel != null)
-			xmlModel.removeModelStateListener(this);
-	}
-
-	private void deregisterFromXMLModel() {
-		
-		deRegisterAsModelStateListener();
-		deRegisterAsModelLifecycleListener();
-		// This try/catch block is a hack to fix defect 204114. This occurs
-		// because
-		// the model manager plugin is shut down and unloaded before the j2ee
-		// plugin.
-		// Calling getModelManager() can result in a class cast exception that
-		// should
-		// be ignored.
-		// ModelManager mgr = null;
-		try {
-			getModelManager();
-		}
-		catch (ClassCastException exc) {
-			return;
-		}
-		if (xmlModel != null) {
-			int writeCount = resource.getWriteCount();
-			int readCount = resource.getReadCount();
-			for (int i = 0; i < writeCount; i++)
-				xmlModel.releaseFromEdit();
-			for (int ii = 0; ii < readCount; ii++)
-				xmlModel.releaseFromRead();
-		}
-		EMF2DOMAdapter adapter = (EMF2DOMAdapter) EcoreUtil.getAdapter(resource.eAdapters(), EMF2DOMAdapter.ADAPTER_CLASS);
-		if (adapter != null) {
-			adapter.removeAdapters(adapter.getNode());
-		}
-		xmlModel = null;
-		xmlModelId = null;
-	}
-
-	public void doSave(OutputStream outputStream, Map options) throws IOException {
-
-		try {
-			isSaving = true;
-			if (null != outputStream) {
-				throw new RuntimeException(this.getClass().getName() + " should not use an OutputStream for saving");} //$NON-NLS-1$
-			createDOMTreeIfNecessary();
-			ResourceSetWorkbenchEditSynchronizer synchronizer = (ResourceSetWorkbenchEditSynchronizer) ((ProjectResourceSet) resource.getResourceSet()).getSynchronizer();
-			IFile aFile = WorkbenchResourceHelper.getFile(resource);
-			try {
-				synchronizer.preSave(aFile, resource);
-				xmlModel.save(aFile);
-			}
-			catch (CoreException ex) {
-				synchronizer.removeFromRecentlySavedList(aFile);
-				Logger.logException(ex);
-			}
-			cacheSynchronizationStamp();
-		}
-		finally {
-			isSaving = false;
-		}
-	}
-
-	public EMF2DOMAdapter getExistingDOMAdapter(Node node) {
-		//IDOMNode xNode = (IDOMNode) node;
-		//return (EMF2DOMSSEAdapter) xNode.getAdapterFor(EMF2DOMAdapter.ADAPTER_CLASS);
-
-		INodeNotifier sseNode = (INodeNotifier) node;
-		Collection adapters = sseNode.getAdapters();
-		for (Iterator iterator = adapters.iterator(); iterator.hasNext();) {
-			INodeAdapter adapter = (INodeAdapter) iterator.next();
-			// First Check if it's an EMF2DOMAdapter
-			if (adapter != null && adapter.isAdapterForType(EMF2DOMAdapter.ADAPTER_CLASS)) {
-				// Cast to EMF2DOMSSEAdapter
-				EMF2DOMSSEAdapter e2DAdapter = (EMF2DOMSSEAdapter) adapter;
-				//Handle the cases where either adapter's target is null 
-				//Use the resourceClass to make sure the resource type is identical
-				if (getResource() == null || e2DAdapter.getTarget() == null)
-					if(resourceClass.equals(e2DAdapter.getResourceClass()))
-						return e2DAdapter;
-					else
-						continue;
-				
-				// First check if targets are resources
-				if (e2DAdapter.getTarget() instanceof Resource) {
-					/*
-					 * Now check if it's the right one (Multiple resources
-					 * could be attached)
-					 */
-					if (e2DAdapter.getTarget() == getResource()) {
-						return e2DAdapter;
-					}
-				} else {
-					// Check if targets are EObjects with the same resources
-					TranslatorResource myTarget = getResource();
-					EObject adapterTarget = (EObject) e2DAdapter.getTarget();
-					/*
-					 * Now check if it's the right one (Multiple resources could
-					 * be attached)
-					 */
-					if (adapterTarget.eResource() == myTarget || adapterTarget.eResource() == null) {
-						return e2DAdapter;
-					}
-				}
-			}
-		}
-		return null;
-	
-	}
-
-	protected IModelManager getModelManager() {
-		if (modelManager == null)
-			modelManager = StructuredModelManager.getModelManager();
-		return modelManager;
-	}
-
-	/**
-	 * Return id used to key the XML resource in the XML ModelManager.
-	 */
-	protected String getModelManagerId() {
-		if (xmlModelId == null) {
-			IFile file = WorkbenchResourceHelper.getFile(getResource());
-			if (file != null) {
-				xmlModelId = getModelManager().calculateId(file);
-			}
-			else {
-				xmlModelId = resource.getURI() + Long.toString(System.currentTimeMillis());
-			}
-		}
-		return xmlModelId;
-	}
-
-	protected ResourceSet getResourceSet() {
-		return resource == null ? null : resource.getResourceSet();
-	}
-
-	/**
-	 * Return the DOM model for this resource.
-	 */
-	public IDOMModel getXMLModel() {
-		return xmlModel;
-	}
-
-	public String getXMLModelId() {
-		return xmlModelId;
-	}	
-	
-	private IDOMModel initializeXMLModel(IFile file, boolean forWrite) throws UnsupportedEncodingException, IOException {
-		if (file == null || !file.exists())
-			throw new FileNotFoundException((file == null) ? "null" : file.getFullPath().toOSString()); //$NON-NLS-1$
-		try {
-			IModelManager manager = getModelManager();
-			String id = manager.calculateId(file);			
-			if (forWrite) {
-				IDOMModel mod = (IDOMModel)manager.getExistingModelForEdit(id);
-				if (mod == null)
-					setXMLModel((IDOMModel) manager.getModelForEdit(file));
-				else {
-					setXMLModel(mod);
-				}
-			}
-			else {
-				IDOMModel mod = (IDOMModel)manager.getExistingModelForRead(id);
-				if (mod == null)
-					setXMLModel((IDOMModel) manager.getModelForRead(file));
-				else {
-					setXMLModel(mod);
-				}
-			}
-			setXMLModelId(getXMLModel().getId());
-			needsToCreateDOM = false;
-		}
-		catch (CoreException e) {
-			Logger.logException(e);
-			return null;
-		}
-		String id = getXMLModel().getId();
-		syncReferenceCounts(id, forWrite);
-		if (xmlModel != null)
-			document = xmlModel.getDocument();
-		return xmlModel;
-	}
-
-	public boolean isBatchMode() {
-		return isBatchChanges;
-	}
-
-	public boolean isModified() {
-		return (getXMLModel() != null && getXMLModel().isDirty());
-	}
-
-	public boolean isShared() {
-		
-		if( xmlModel == null) { //resource could be in process of being unloaded - check with model manager
-			String id = getModelManagerId();
-			return getModelManager().isShared(id);
-		}
-		if (getResourceSet() == null)
-			return false;
-		return xmlModel.isShared();
-	}
-
-	public boolean isSharedForWrite() {
-		if (getResourceSet() == null || xmlModel == null)
-			return false;
-		return xmlModel.isSharedForEdit();
-	}
-
-	protected void loadDocument(InputStream in, Map options) throws IOException {
-		if (null != in) {
-			throw new RuntimeException(this.getClass().getName() + " should not use an InputStream for loading");} //$NON-NLS-1$
-		IFile file = WorkbenchResourceHelper.getFile(resource);
-		initializeXMLModel(file, (resource.getWriteCount() != 0));
-		cacheSynchronizationStamp();
-	}
-
-	protected boolean managesDOMAdapters() {
-		return false;
-	}
-
-	public void modelAboutToBeChanged(IStructuredModel model) {
-		if (model.getStructuredDocument() != null)
-			aboutToChangeNode = model.getStructuredDocument().getFirstStructuredDocumentRegion();
-	}
-
-	public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
-		// TODO Auto-generated method stub
-
-	}
-
-	private void modelAccessForWrite() {
-		String id = getModelManagerId();
-		getModelManager().getExistingModelForEdit(id);
-	}
-
-	public void modelChanged(IStructuredModel model) {
-		if (isBatchChanges)
-			return;
-		try {
-			if (aboutToChangeNode != null && model.getStructuredDocument() != null
-					&& model.getStructuredDocument().getFirstStructuredDocumentRegion() != aboutToChangeNode) {
-				String id = getModelManagerId();
-				IStructuredModel tempModel = null;
-				try {
-					tempModel = getModelManager().getExistingModelForEdit(id);
-					xmlModelReverted = true;
-					resource.unload();
-				} finally {
-					if (tempModel != null && (tempModel.getReferenceCountForEdit() > 0)) {
-						tempModel.releaseFromEdit();
-					}
-				}
-			}
-		} finally {
-			aboutToChangeNode = null;
-		}
-	} 
-	
-	public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
-		if (!isDirty && resource.isModified()) { // The XMLModel was saved
-			resource.setModified(false);
-			long stamp = WorkbenchResourceHelper.computeModificationStamp(resource);
-			WorkbenchResourceHelper.setSynhronizationStamp(resource, stamp);
-			IProject proj = WorkbenchResourceHelper.getProject(resource);
-			ResourceSetWorkbenchEditSynchronizer synchronizer = (ResourceSetWorkbenchEditSynchronizer) ((ProjectResourceSet) WorkbenchResourceHelperBase.getResourceSet(proj)).getSynchronizer();
-			IFile aFile = WorkbenchResourceHelper.getFile(resource);
-			synchronizer.preSave(aFile, resource);
-		}
-		if (isDirty)
-			resource.setModified(true);
-	}
-
-	public void modelReinitialized(IStructuredModel structuredModel) {
-		// TODO Auto-generated method stub
-
-	}
-
-	public void modelResourceDeleted(IStructuredModel model) {
-		// Do nothing
-	}
-
-	public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) {
-		// Do nothing
-	}
-
-	/**
-	 * This method is called just prior to being removed from the ResourceSet.
-	 * Ensure that all reference counts to the XMLModel are removed.
-	 */
-	public void preDelete() {
-		if (resource.isLoaded())
-			deregisterFromXMLModel();
-	}
-
-	public void preUnload() {
-		deregisterFromXMLModel();
-	}
-
-	public void processPostModelEvent(ModelLifecycleEvent event) {
-		// TODO Auto-generated method stub
-
-	}
-
-	public void processPreModelEvent(ModelLifecycleEvent event) {
-		if (!isSaving) {
-			if (event.getType() == ModelLifecycleEvent.MODEL_SAVED) {
-				ResourceSetWorkbenchEditSynchronizer synchronizer = (ResourceSetWorkbenchEditSynchronizer) ((ProjectResourceSet) resource.getResourceSet()).getSynchronizer();
-				IFile aFile = WorkbenchResourceHelper.getFile(resource);
-				synchronizer.preSave(aFile, resource);
-			}
-		}
-	}
-
-
-	public void registerAsModelLifecycleListener() {
-		this.xmlModel.addModelLifecycleListener(this);
-	}
-
-	/**
-	 * Insert the method's description here. Creation date: (9/7/2001 10:49:53
-	 * AM)
-	 */
-	public void registerAsModelStateListener() {
-		this.xmlModel.addModelStateListener(this);
-	}
-
-	public void releaseFromRead() {
-		if (xmlModel != null)
-			xmlModel.releaseFromRead();
-	}
-
-	public void releaseFromWrite() {
-		if (xmlModel != null)
-			xmlModel.releaseFromEdit();
-	}
-
-	public void removeDOMAdapter(Node aNode, EMF2DOMAdapter anAdapter) {
-		((IDOMNode) aNode).removeAdapter((EMF2DOMSSEAdapter) anAdapter);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jem.internal.util.emf.xml.EMF2DOMRenderer#replaceDocumentType(java.lang.String,
-	 *      java.lang.String, java.lang.String)
-	 */
-	public void replaceDocumentType(String docTypeName, String publicId, String systemId) {
-		if (document == null)
-			return;
-		DocumentTypeImpl docType = (DocumentTypeImpl) document.getDoctype();
-		if (docType == null)
-			return;
-		if (publicId == null && systemId == null)
-			document.removeChild(docType);
-		else {
-			docType.setPublicId(publicId);
-			docType.setSystemId(systemId);
-		}
-	}
-
-	/**
-	 * @deprecated use batchModeStart and BatchModeEnd instead even if you do
-	 *             not use batchModelStart/End, you still need to use the
-	 *             try/finally pattern documented there.
-	 */
-
-	public void setBatchMode(boolean isBatch) {
-
-		// This is some extra processing for clients to know they may be using
-		// incorrectly
-		if (isBatch) {
-			if (isBatchChanges) {
-				Logger.log(Logger.INFO_DEBUG, "setBatch was set to true when it was already true. This can be an indication of invalid calling order"); //$NON-NLS-1$
-			}
-		}
-
-
-		if (isBatch) {
-			batchModeStart();
-		}
-		else {
-			batchModeEnd();
-		}
-	}
-
-	private void setRootNodeAdapterNotificationEnabled(boolean b) {
-		EObject root = resource.getRootObject();
-		if (root != null) {
-			EMF2DOMAdapter adapter = (EMF2DOMAdapter) EcoreUtil.getExistingAdapter(root, EMF2DOMAdapter.ADAPTER_CLASS);
-			if (adapter != null) {
-				adapter.setNotificationEnabled(b);
-				if (b)
-					adapter.updateDOM();
-			}
-		}
-	}
-
-	/**
-	 * Return the DOM model for this resource.
-	 */
-	public void setXMLModel(IDOMModel xmlModel) {
-		deRegisterAsModelStateListener();
-		deRegisterAsModelLifecycleListener();
-		this.xmlModel = xmlModel;
-		registerAsModelStateListener();
-		registerAsModelLifecycleListener();
-	}
-
-	public void setXMLModelId(String id) {
-		xmlModelId = id;
-	}
-
-	private void syncReferenceCounts(String id, boolean forWrite) {
-		int editIndex = 0, readIndex = 0;
-		if (forWrite)
-			editIndex++;
-		else
-			readIndex++;
-		int writeCount = resource.getWriteCount();
-		int readCount = resource.getReadCount();
-		for (int i = writeCount; i > editIndex; i--)
-			modelManager.getExistingModelForEdit(id);
-		for (int i = readCount; i > readIndex; i--)
-			modelManager.getExistingModelForRead(id);
-	}
-
-	public boolean useStreamsForIO() {
-		return false;
-	}
-
-	public boolean wasReverted() {
-		return xmlModelReverted;
-	}
-
-	public void setResource(TranslatorResource resource) {
-		super.setResource(resource);
-		if (resource != null)
-			resourceClass = resource.getClass();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERendererFactory.java b/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERendererFactory.java
deleted file mode 100644
index 9b79123..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERendererFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.emf2xml;
-
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.RendererFactory;
-
-/**
- * @author schacher
- */
-public class EMF2DOMSSERendererFactory extends RendererFactory {
-
-	public static final EMF2DOMSSERendererFactory INSTANCE = new EMF2DOMSSERendererFactory();
-
-	public EMF2DOMSSERendererFactory() {
-		// Default constructor
-	}
-
-
-	public Renderer createRenderer() {
-		return new EMF2DOMSSERenderer();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/ComponentSearchContributor.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/ComponentSearchContributor.java
deleted file mode 100644
index 6c1dcde..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/ComponentSearchContributor.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public abstract class ComponentSearchContributor  {
-
-	protected HashMap declarations;
-
-	protected HashMap references;
-
-	protected String[] namespaces;
-
-	public ComponentSearchContributor() {
-		super();
-	}
-
-	public XMLSearchPattern getDeclarationPattern(QualifiedName componentName) {
-		return (XMLSearchPattern) getDeclarations().get(componentName);
-	}
-
-	protected Map getDeclarations() {
-		if (declarations == null) {
-			initializeDeclarations();
-		}
-		return declarations;
-	}
-
-	protected Map getReferences() {
-		if (references == null) {
-			initializeReferences();
-		}
-		return references;
-	}
-
-	public XMLSearchPattern[] getReferencesPatterns(QualifiedName componentName) {
-		List references = (List) getReferences().get(componentName);
-		if (references != null) {
-			return (XMLSearchPattern[]) references
-					.toArray(new XMLSearchPattern[references.size()]);
-		}
-		return new XMLSearchPattern[0];
-	}
-	
-	
-	public boolean supports(QualifiedName componentName){
-		return getReferencesPatterns(componentName).length > 0 ||
-			getDeclarationPattern(componentName) != null;
-	}
-
-	public String[] getSupportedNamespaces() {
-		return namespaces;
-	}
-
-	protected abstract void initializeDeclarations();
-
-	protected abstract void initializeReferences();
-
-	protected abstract void initializeSupportedNamespaces();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/TargetNamespaceReferencePattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/TargetNamespaceReferencePattern.java
deleted file mode 100644
index 6321b7c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/TargetNamespaceReferencePattern.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-
-public class TargetNamespaceReferencePattern extends SearchPattern {
-	
-	String namespaceURI;
-	
-	public TargetNamespaceReferencePattern(int matchRule, String namespaceuri) {
-		super(matchRule);
-		namespaceURI = namespaceuri;
-	}
-	
-	public TargetNamespaceReferencePattern(String namespaceuri) {
-		super();
-		namespaceURI = namespaceuri;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentDeclarationPattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentDeclarationPattern.java
deleted file mode 100644
index 19f475b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentDeclarationPattern.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public class XMLComponentDeclarationPattern extends XMLComponentSearchPattern {
-
-	public XMLComponentDeclarationPattern(QualifiedName elementQName, QualifiedName typeQName, int matchRule) {
-		super(null, elementQName, typeQName, matchRule);
-		
-	}
-
-	public XMLComponentDeclarationPattern(IFile file, QualifiedName elementQName, QualifiedName typeQName) {
-		super(file, elementQName, typeQName);
-	}
-	
-	public XMLComponentDeclarationPattern(QualifiedName elementQName, QualifiedName typeQName) {
-		super(null, elementQName, typeQName);
-	}
-
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentReferencePattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentReferencePattern.java
deleted file mode 100644
index e68a8a4..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentReferencePattern.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public class XMLComponentReferencePattern extends XMLComponentSearchPattern{
-
-	public XMLComponentReferencePattern(IFile file, QualifiedName elementQName, QualifiedName typeQName, int matchRule) {
-		super(file, elementQName, typeQName, matchRule);
-		
-	}
-
-	public XMLComponentReferencePattern(IFile file, QualifiedName elementQName, QualifiedName typeQName) {
-		super(file, elementQName, typeQName);
-		
-	}
-	
-	public XMLComponentReferencePattern(QualifiedName elementQName, QualifiedName typeQName) {
-		super(null, elementQName, typeQName);
-		
-	}
-	
-	
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentSearchPattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentSearchPattern.java
deleted file mode 100644
index dff3048..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentSearchPattern.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.SearchParticipant;
-import org.eclipse.wst.common.core.search.pattern.ComponentSearchPattern;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-/**
- * XML component search pattern is a composite pattern that combines XML element pattern.
- *
- */
-public class XMLComponentSearchPattern extends ComponentSearchPattern {
-	
-	/**
-	 * Containing element patterns
-	 * @deprecated
-	 */
-	XMLSearchPattern[] children = new XMLSearchPattern[0];
-	
-	/**
-	 * A map of XMLSearchPattern[] by {@link SearchParticipant search participant}.
-	 */
-	protected Map childPatternsByParticipant = new HashMap();
-	
-	public XMLComponentSearchPattern(IFile file, QualifiedName elementQName, QualifiedName typeQName, int matchRule) {
-		super(file, elementQName, typeQName, matchRule);
-		
-	}
-
-
-	public XMLComponentSearchPattern(IFile file, QualifiedName elementQName, QualifiedName typeQName) {
-		super(file, elementQName, typeQName);
-		
-	}
-
-	/**
-	 * @deprecated Use {@link #getChildren(SearchParticipant)} instead.
-	 */
-	public XMLSearchPattern[] getChildren(){
-		return children;
-	}
-	
-    /**
-     * @deprecated Use {@link #addChildren(SearchParticipant, XMLSearchPattern[])} instead.
-     */
-	public void setChildren(XMLSearchPattern[] patterns){
-		children = patterns;
-		
-	}
-	
-	/**
-	 * Provides the child patterns contributed by the given search participant. 
-	 * @param searchParticipant the {@link SearchParticipant search participant} that contributed the patterns.
-     * @see XMLComponentSearchPattern#addChildren(SearchParticipant, XMLSearchPattern[]) addChildren
-	 * @return an array with the {@link XMLSearchPattern patterns} contributed by the {@link SearchParticipant search participant}.
-	 */
-	public XMLSearchPattern[] getChildren(SearchParticipant searchParticipant){
-	  XMLSearchPattern[] childPatterns = getChildren();
-	  if (searchParticipant != null){
-	    childPatterns = (XMLSearchPattern[])childPatternsByParticipant.get(searchParticipant);
-	    if (childPatterns == null){
-	      childPatterns = getChildren();
-	    }
-	  }
-	  return childPatterns;
-	}
-
-	/**
-	 * Saves the child patterns contributed by the given search participant.
-	 * @param searchParticipant the {@link SearchParticipant search participant} that is contributing the child search patterns.
-	 * @param childPatterns the child patterns contributed by the {@link SearchParticipant searchParticipant search participant}.
-	 * @see XMLComponentSearchPattern#getChildren(SearchParticipant) getChildren
-	 */
-	public void addChildren(SearchParticipant searchParticipant, XMLSearchPattern[] childPatterns){
-	  if (searchParticipant != null && childPatterns != null) {
-	    childPatternsByParticipant.put(searchParticipant, childPatterns);
-	  }
-	  else {
-	    children = childPatterns;
-	  }
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java
deleted file mode 100644
index b709f58..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java
+++ /dev/null
@@ -1,387 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchParticipant;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.document.ComponentDeclarationEntry;
-import org.eclipse.wst.common.core.search.document.Entry;
-import org.eclipse.wst.common.core.search.document.FileReferenceEntry;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.common.core.search.document.SearchDocumentSet;
-import org.eclipse.wst.common.core.search.pattern.ComponentSearchPattern;
-import org.eclipse.wst.common.core.search.pattern.FileReferencePattern;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.common.core.search.scope.ContentTypeSearchScope;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.search.impl.IXMLSearchConstants;
-import org.eclipse.wst.xml.core.internal.search.impl.XMLSearchDocument;
-import org.eclipse.wst.xml.core.internal.search.matching.PatternMatcher;
-import org.eclipse.wst.xml.core.internal.search.matching.XMLSearchPatternMatcher;
-import org.eclipse.wst.xml.core.internal.search.quickscan.XMLQuickScan;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- *
- */
-public abstract class XMLSearchParticipant extends SearchParticipant {
-	
-	protected static final boolean debugPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.xml.core.internal.search/perf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	public XMLSearchParticipant() {
-		super();
-	}
-
-	
-	/*
- public  boolean initialize(SearchPattern pattern, String[] contentTypes){
-		
-	    super.initialize(pattern, contentTypes);
-		this.supportedContentTypes = contentTypes;
-		
-		if(pattern instanceof XMLComponentSearchPattern){
-			return true;
-		}
-		return false;
-	}*/
-
-	
-
-	public SearchDocument createSearchDocument(String documentPath) {
-
-		return new XMLSearchDocument(documentPath, this);
-
-	}
-
-	public String getDescription() {
-		return "XML search participant"; //$NON-NLS-1$
-	}
-
-
-
-	private void locateMatches(SearchPattern pattern, SearchDocument document,
-			SearchRequestor requestor, Map searchOptions, IProgressMonitor monitor) {
-
-        // TODO... utilize search options (that should get passed down via the SearchEngine)
-        // to specify if accurate source coordinates are req'd if not, simply use the SAX results
-        //
-        if (pattern.getMatchRule() == SearchPattern.R_PATTERN_MATCH)
-        {          
-          IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(document.getPath()));
-          // TODO.. don't assume the category is COMPONENT_DECL... handle any arbitarty category
-          Entry[] entries = document.getEntries(IXMLSearchConstants.COMPONENT_DECL, null, 0);
-          for (int i = 0; i < entries.length; i++)
-          {
-            // TODO.. don't assume this is just a component declaration entry            
-            ComponentDeclarationEntry entry = (ComponentDeclarationEntry)entries[i];
-            SearchMatch searchMatch = new SearchMatch(null, 0, 0, file);
-            searchMatch.map.put("name", entry.getName()); //$NON-NLS-1$
-            searchMatch.map.put("metaName", entry.getMetaName()); //$NON-NLS-1$
-            try
-            {
-              requestor.acceptSearchMatch(searchMatch);
-            }
-            catch (Exception e)
-            {              
-            }
-          }  
-        }
-        else 
-        {  if (document.getModel() instanceof IDOMModel) {
-			IDOMModel domModel = (IDOMModel) document.getModel();
-			IDOMElement contextNode = (IDOMElement) domModel.getDocument()
-					.getDocumentElement();
-			DOMVisitor visitor = new DOMVisitor(document.getPath(), pattern,
-					requestor);
-			visitor.visit(contextNode);
-		}
-        }
-	}
-	
-	private PatternMatcher getAdapter(Object adaptableObject, Class adapterType) {
-		if (PatternMatcher.class.equals(adapterType) &&
-				(adaptableObject instanceof XMLSearchPattern ||
-				adaptableObject instanceof XMLComponentSearchPattern) ) {
-			return new XMLSearchPatternMatcher(this);
-		} 
-		return null; 
-	}
-
-	private class DOMVisitor {
-
-		String path;
-		SearchPattern pattern;
-		SearchRequestor requestor;
-		PatternMatcher matcher;
-
-		
-		protected DOMVisitor(String path, SearchPattern pattern,
-				SearchRequestor requestor) {
-			super();
-			this.path = path;
-			this.pattern = pattern;
-			
-			matcher = (PatternMatcher)pattern.getAdapter(PatternMatcher.class);
-			if(matcher == null){
-				matcher = getAdapter(pattern, PatternMatcher.class);
-			}
-			this.requestor = requestor;
-		}
-
-		private void visit(Node node) {
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				match((Element)node);
-				NodeList nodeList = node.getChildNodes();
-				for (int i = 0; i < nodeList.getLength(); i++) {
-					Node aNode = nodeList.item(i);
-					visit(aNode);
-				}
-			}
-		}
-
-		private void match(Element node) {
-			IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(
-					new Path(path));
-			if(matcher != null){
-				matcher.locateMatches(pattern, file, node, requestor);
-			}
-
-			
-		}
-
-	}
-
-	public SearchScope selectDocumentLocations(SearchPattern pattern, SearchScope scope, Map searchOptions, IProgressMonitor monitor) {
-		/*
-		 * gate #1: reduce the scope to the files with the content type that
-		 * could be searched using this participant
-		 */ 
-		String[] contentTypes = getSupportedContentTypes();	
-		if(contentTypes != null && contentTypes.length > 0){
-			scope = new ContentTypeSearchScope(scope, contentTypes);
-		}
-		return super.selectDocumentLocations(pattern, scope, searchOptions, monitor);
-	}
-	
-	public abstract ComponentSearchContributor getSearchContributor();
-
-
-	public void beginSearching(SearchPattern pattern, Map searchOptions) {
-		
-		super.beginSearching(pattern, searchOptions);
-		if(pattern instanceof XMLComponentDeclarationPattern){
-			XMLComponentDeclarationPattern componentPattern = (XMLComponentDeclarationPattern)pattern;
-			XMLSearchPattern childPattern = getSearchContributor().getDeclarationPattern(componentPattern.getMetaName());
-			if(childPattern != null){
-					childPattern.setSearchName(componentPattern.getName().getLocalName());
-					childPattern.setSearchNamespace(componentPattern.getName().getNamespace());
-	     			componentPattern.addChildren(this, new XMLSearchPattern[]{childPattern});
-			}
-			
-		}
-		else if(pattern instanceof XMLComponentReferencePattern){
-			XMLComponentReferencePattern componentPattern = (XMLComponentReferencePattern)pattern;
-			XMLSearchPattern[] childPatterns = getSearchContributor().getReferencesPatterns(componentPattern.getMetaName());
-			for (int i = 0; i < childPatterns.length; i++) {
-				XMLSearchPattern childPattern = childPatterns[i];
-				childPattern.setSearchName(componentPattern.getName().getLocalName());
-				childPattern.setSearchNamespace(componentPattern.getName().getNamespace());				
-			}
-			componentPattern.addChildren(this, childPatterns);
-			
-		}
-	}
-	
-	
-	/**
-	 * The intend of this method is to limit the search to the files that have content 
-	 * which can be searched for the given pattern. It is called from 
-	 * {@link #selectDocumentLocations(SearchPattern, SearchScope, IProgressMonitor)}
-	 * 
-	 * @param pattern the search pattern that is searched for
-	 * @return content type's unique identifiers that could be searched for the given pattern.
-	 */
-	public abstract String[] getSupportedContentTypes();
-
-	public void populateSearchDocument(SearchDocument document, SearchPattern pattern)
-	{
-		PatternMatcher matcher = (PatternMatcher)pattern.getAdapter(PatternMatcher.class);
-		if(matcher == null){
-			matcher = getAdapter(pattern, PatternMatcher.class);
-		}
-		XMLQuickScan.populateSearchDocument(document, matcher, pattern);		
-	}
-
-	public void locateMatches(SearchDocumentSet documentSet, SearchPattern pattern, SearchScope scope, SearchRequestor requestor, Map searchOptions, IProgressMonitor monitor) throws CoreException
-	{
-		long time = System.currentTimeMillis();
-		
-		// TODO: use the file reference entries in the documents to reduce the scope to the referenced files only
-		// SearchDocument[] documents = documentSet.getSearchDocuments(id);
-                
-        // check to see if the search pattern is qualified by a file location
-        // if this is the case then we can use file scoping rules to prune the matches
-        IFile targetFile = null;
-        if (pattern instanceof ComponentSearchPattern)
-        {
-          ComponentSearchPattern componentSearchPattern = (ComponentSearchPattern)pattern;
-          targetFile = componentSearchPattern.getFile();                                       
-        }		
-        
-		// here we should have in scope only referenced files
-		IFile[] files = scope.enclosingFiles();  
-		for (int i = 0; i < files.length; i++)
-		{
-			IFile file = files[i];
-			String path = file.getLocation().toString();
-			SearchDocument document = documentSet.getSearchDocument(path, id); 
-			if (document != null)
-			{              
-			Entry[] entries = document.getEntries(getSearchEntryCategory(pattern), null, 0);           
-			if ((entries != null && entries.length > 0) || (searchOptions != null && searchOptions.get("searchDirtyContent") != null))
-            {
-              //for (int j = 0; j < entries.length; j++)
-              //{
-              //  Entry entry = entries[j];
-                //System.out.println("entry " + entry.getCategory() + " " + entry.getKey() + " " + entry.getClass().getName());                 
-              //}  
-              
-              boolean isInScope = true;
-              if (targetFile != null)
-              {
-                try
-                {
-                  isInScope = isLinked(documentSet, "file:///" + path, "file:///" + targetFile.getLocation().toString()); //$NON-NLS-1$ //$NON-NLS-2$
-                  //if (path.endsWith("CancelSelection.wsdl")  && path.indexOf("clone1") != -1)
-                  //{
-                  //  fileReferenceTable.debug(qualifiedPath, 0, 5);
-                  //}                   
-                }
-                catch (Exception e)
-                {
-                  e.printStackTrace();
-                }
-              }              
-              if (isInScope)
-              { 
-			    this.locateMatches(pattern, document, requestor, searchOptions, monitor);
-              }  
-            }
-			}
-		}
-		
-		
-		if (debugPerf)
-		{
-			System.out
-					.println("" //$NON-NLS-1$
-							+ getDescription()
-							+ ": " + (System.currentTimeMillis() - time) + "ms for locateMatches"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		
-	}
-    
-    private boolean isLinked(SearchDocumentSet set, String source, String target)
-    {
-      return isLinked(set, source, target, new HashMap());
-    }
-    
-    private boolean isLinked(SearchDocumentSet set, String source, String target, HashMap visited)
-    {
-      if (source.equals(target))
-        return true;
-      
-      String fileProtocol = "file:///";             //$NON-NLS-1$
-      
-      // Fix for bug 204174 - Begin
-      if(target.charAt(fileProtocol.length()) == '/')  //$NON-NLS-1$
-      {
-          target = fileProtocol + target.substring(fileProtocol.length() + 1);
-      }
-      // Fix for bug 204174 - End
-            
-      if (source.startsWith(fileProtocol))
-      {    
-        
-      SearchDocument document = set._tempGetSearchDocumetn(source.substring(fileProtocol.length()));      
-      if (document != null)
-      {        
-        URIResolver uriResolver = URIResolverPlugin.createResolver();        
-        Entry[] entries = document.getEntries(IXMLSearchConstants.REF, null, 0);
-        String[] resolveEntry = new String[entries.length];        
-        for (int j = 0; j < entries.length; j++)
-        {
-          Entry entry = entries[j];
-          if (entry instanceof FileReferenceEntry)
-          {
-            FileReferenceEntry fileReferenceEntry = (FileReferenceEntry)entry;
-            // TODO.. record an utilize the public id from the fileReferenceEntry
-            //
-            if (fileReferenceEntry.getRelativeFilePath() != null)
-            {  
-              String resolvedURI = uriResolver.resolve(source, null, fileReferenceEntry.getRelativeFilePath());
-              resolveEntry[j] = resolvedURI;
-              if (resolvedURI.equals(target))
-              {
-                return true;
-              }             
-            }  
-          }
-        }
-        // now see if there's an indirect link from the source to the target
-        // we keep track of the nodes we've already visited to avoid cycles
-        if (visited.get(source) == null)
-        {
-          visited.put(source, Boolean.TRUE);
-          for (int j = 0; j < entries.length; j++)
-          {                     
-            String resolvedURI = resolveEntry[j];
-            if (resolvedURI != null && isLinked(set, resolveEntry[j], target, visited))                
-              return true;            
-          }    
-        }                      
-      }            
-      } 
-      return false;
-    }
-    
-   
-    
-	public static String getSearchEntryCategory(SearchPattern pattern){
-		if(pattern instanceof XMLComponentDeclarationPattern){
-			return IXMLSearchConstants.COMPONENT_DECL;
-		}
-		else if(pattern instanceof XMLComponentReferencePattern){
-			return IXMLSearchConstants.COMPONENT_REF;
-		}
-		else if(pattern instanceof FileReferencePattern){
-		   return IXMLSearchConstants.COMPONENT_REF;
-		}
-		return null;
-	}   
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchPattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchPattern.java
deleted file mode 100644
index e3b58e1..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchPattern.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-
-public class XMLSearchPattern extends SearchPattern{
-	
-	private String elementNamespace = null;
-	private String elementName = null;
-	private String attributeName = null;
-	private String searchName = null;
-	private String searchNamespace = null;
-	private String parentName = null;
-    private int depth = -1;
-
-    public XMLSearchPattern(String elementNamespace, String parentElementName,String elementName, String attributeName) {
-    	this(elementNamespace, parentElementName, elementName, attributeName, -1);
-    }
-	
-	public XMLSearchPattern(String elementNamespace, String elementName, String attributeName) {
-       this(elementNamespace, null, elementName, attributeName, -1);
-    }
-    
-    public XMLSearchPattern(String elementNamespace, String elementName, String attributeName, int depth) {
-    	this(elementNamespace, null, elementName, attributeName, depth);       
-    }
-           
-    private XMLSearchPattern(String elementNamespace, String parentElementName, String elementName, String attributeName, int depth) {
-        super();
-        this.attributeName = attributeName;
-        this.elementName = elementName;
-        this.parentName = parentElementName;
-        this.elementNamespace = elementNamespace;
-        this.depth = depth;
-    }
-    
-	public XMLSearchPattern(){
-		
-	}
-	
-	public String getAttributeName() {
-		return attributeName;
-	}
-
-	public String getElementName() {
-		return elementName;
-	}
-
-	public String getElementNamespace() {
-		return elementNamespace;
-	}
-
-	public String getSearchName() {
-		return searchName;
-	}
-
-	public String getSearchNamespace() {
-		return searchNamespace;
-	}
-
-	public void setSearchName(String searchName) {
-		this.searchName = searchName;
-	}
-
-	public void setSearchNamespace(String searchNamespace) {
-		this.searchNamespace = searchNamespace;
-	}
-
-	public void setAttributeName(String attributeName) {
-		this.attributeName = attributeName;
-	}
-
-	public void setElementName(String elementName) {
-		this.elementName = elementName;
-	}
-
-	public void setElementNamespace(String elementNamespace) {
-		this.elementNamespace = elementNamespace;
-	}
-
-  public int getDepth()
-  {
-    return depth;
-  }
-
-  public void setDepth(int depth)
-  {
-    this.depth = depth;
-  }
-
-public String getParentName() {
-	return parentName;
-}
-
-public void setParentName(String parentName) {
-	this.parentName = parentName;
-}
-	
-
-	
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/IXMLSearchConstants.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/IXMLSearchConstants.java
deleted file mode 100644
index d160d81..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/IXMLSearchConstants.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.impl;
-
-public interface IXMLSearchConstants
-{
-		String REF= "outLink"; //$NON-NLS-1$
-		String COMPONENT_DECL = "componentDecl"; //$NON-NLS-1$
-		String COMPONENT_REF = "componentDecl"; //$NON-NLS-1$
-	
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/Messages.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/Messages.java
deleted file mode 100644
index d7ae22f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/Messages.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.impl;
-
-import java.text.MessageFormat;
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-	
-	private static final String BUNDLE_NAME = "org.eclipse.wst.xml.core.internal.search.messages";//$NON-NLS-1$
-
-	
-	static {
-		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
-	}
-	private Messages() {
-		// Do not instantiate
-	}
-	
-	/**
-	 * Bind the given message's substitution locations with the given string values.
-	 * 
-	 * @param message the message to be manipulated
-	 * @return the manipulated String
-	 */
-	public static String bind(String message) {
-		return bind(message, null);
-	}
-	
-	/**
-	 * Bind the given message's substitution locations with the given string values.
-	 * 
-	 * @param message the message to be manipulated
-	 * @param binding the object to be inserted into the message
-	 * @return the manipulated String
-	 */
-	public static String bind(String message, Object binding) {
-		return bind(message, new Object[] {binding});
-	}
-
-	/**
-	 * Bind the given message's substitution locations with the given string values.
-	 * 
-	 * @param message the message to be manipulated
-	 * @param binding1 An object to be inserted into the message
-	 * @param binding2 A second object to be inserted into the message
-	 * @return the manipulated String
-	 */
-	public static String bind(String message, Object binding1, Object binding2) {
-		return bind(message, new Object[] {binding1, binding2});
-	}
-
-	/**
-	 * Bind the given message's substitution locations with the given string values.
-	 * 
-	 * @param message the message to be manipulated
-	 * @param bindings An array of objects to be inserted into the message
-	 * @return the manipulated String
-	 */
-	public static String bind(String message, Object[] bindings) {
-		return MessageFormat.format(message, bindings);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/XMLSearchDocument.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/XMLSearchDocument.java
deleted file mode 100644
index 7908adf..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/XMLSearchDocument.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.impl;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.core.search.document.Entry;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchParticipant;
-
-public class XMLSearchDocument extends SearchDocument {
-	
-	IDOMModel model;
-	Map entries = new HashMap(); // category -> set (entry)	
-
-	public XMLSearchDocument(String documentPath, XMLSearchParticipant participant) {
-		super(documentPath, participant);
-	}
-
-	public Object getModel() {
-		if(model == null){
-            //System.out.println("creating DOM for " + getPath());
-			IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(getPath()));
-			if(file != null){
-				try {
-					model = (IDOMModel)StructuredModelManager.getModelManager().getModelForEdit(file);
-				} catch (IOException e) {
-					e.printStackTrace();
-				} catch (CoreException e) {
-					e.printStackTrace();
-				}
-			
-			}
-		}
-		return model;
-	}
-
-	public Entry[] getEntries(String category, String key, int matchRule)
-	{
-		// TODO use matchRule
-		Set results = new HashSet();
-		if(category != null){
-			Set values = (Set)entries.get(category);
-			if(values == null){
-				return new Entry[0];
-			}
-			if(key == null || "".equals(key) || "*".equals(key)){ //$NON-NLS-1$ //$NON-NLS-2$
-				// entries with any key in the given category
-				results.addAll(values);
-			}
-			else{
-				// entries with the specified key in the given category
-				for (Iterator iter = values.iterator(); iter.hasNext();)
-				{
-					Entry entry = (Entry) iter.next();
-					if(key.equals(entry.getKey())){
-						results.add(entry);
-					}
-				}
-			}
-			
-		}
-		return (Entry[]) results.toArray(new Entry[results.size()]);
-	}
-
-	public void putEntry(Entry entry)
-	{
-		if(entry.getCategory() != null){
-			Set values = (Set)entries.get(entry.getCategory());
-			if(values == null){
-				entries.put(entry.getCategory(), values=new HashSet());
-			}
-			values.add(entry);
-		}
-		
-	}
-
-    public void dispose()
-    {     
-      if (model != null)
-      {  
-        model.releaseFromEdit();        
-      }  
-    }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/messages.properties b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/messages.properties
deleted file mode 100644
index 43aea95..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/messages.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java
deleted file mode 100644
index fa518e8..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.matching;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * This class contains matching implementation.  
- * <p>
- * Subclasses of the PatternMatches should provide an implementation of the specific pattern matching.
- * </p>
- * <p>
- * Subclasses of the PatternMatches should be set as adapters for the patterns that they match.
- * </p>
- * An implementation of {@link org.eclipse.wst.common.core.search.SearchParticipant#selectDocumentLocations()} will call 
- * { @link PatternMatcher#matches() } on the adapter on pattern matcher.
- * 
- * An implementation of {@link org.eclipse.wst.common.core.search.SearchParticipant#locateMatches()} will call 
- * { @link PatternMatcher#locateMatches() } on the adapter on pattern matcher.
- *
- */
-public abstract class PatternMatcher {
-	
-	
-	/**
-	 * This method does dive actual match location to the requestor if there are matches
-	 */
-	public abstract void locateMatches(SearchPattern pattern, IFile file, Element element, SearchRequestor requestor);
-
-	/**
-	 * This method only answers if the pattern matches element, it does not give actual match location
-	 */
-	public abstract boolean matches(SearchPattern pattern, Object element);
-    
-    protected SearchMatch createSearchMatch(IFile file, Attr attributeNode)
-    {
-        int start = 0;
-        int length = 0;
-        if(attributeNode instanceof IDOMAttr){
-            IDOMAttr domAttr = (IDOMAttr)attributeNode;
-            start = domAttr.getValueRegionStartOffset();
-            length = domAttr.getValueRegionText().length();
-        }
-        SearchMatch match = new SearchMatch(attributeNode, start, length, file);
-        return match;
-    }
-	
-	protected void addMatch(SearchPattern pattern, IFile file, Attr attributeNode, SearchRequestor requestor) {
-        //System.out.println("addMatch " + pattern + " " + attributeNode.getName() + "=" + attributeNode.getValue());
-		if (attributeNode != null) {
-				SearchMatch match = createSearchMatch(file, attributeNode);                
-				if(requestor != null){
-					try {
-						requestor.acceptSearchMatch(match);
-					} catch (CoreException e) {
-						//do nothing
-					}
-				}
-		}
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/SAXSearchElement.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/SAXSearchElement.java
deleted file mode 100644
index a9ec4a1..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/SAXSearchElement.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.matching;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.xml.sax.Attributes;
-
-public class SAXSearchElement{
-	Attributes attributes;
-	String elementName;
-	String elementNamespace;
-	Map namespaceMap = new HashMap(); // Map of string prefix keys and namespace
-	String targetNamespace = ""; //$NON-NLS-1$
-	String parentName;
-    int depth = -1;
-	
-	public SAXSearchElement() {
-		super();
-	}
-	public Attributes getAttributes() {
-		return attributes;
-	}
-	public String getElementName() {
-		return elementName;
-	}
-	public String getElementNamespace() {
-		return elementNamespace;
-	}
-	public Map getNamespaceMap() {
-		return namespaceMap;
-	}
-	public String getTargetNamespace() {
-		return targetNamespace;
-	}
-	public void setAttributes(Attributes attributes) {
-		this.attributes = attributes;
-	}
-	public void setElementName(String elementName) {
-		this.elementName = elementName;
-	}
-	public void setElementNamespace(String elementNamespace) {
-		this.elementNamespace = elementNamespace;
-	}
-	public void setNamespaceMap(Map namespaceMap) {
-		this.namespaceMap = namespaceMap;
-	}
-	public void setTargetNamespace(String targetNamespace) {
-		this.targetNamespace = targetNamespace;
-	}
-  public int getDepth()
-  {
-    return depth;
-  }
-  public void setDepth(int depth)
-  {
-    this.depth = depth;
-  }
-public String getParentName() {
-	return parentName;
-}
-public void setParentName(String parentName) {
-	this.parentName = parentName;
-}
-	
-	
-	
-	
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/XMLSearchPatternMatcher.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/XMLSearchPatternMatcher.java
deleted file mode 100644
index a5ee621..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/XMLSearchPatternMatcher.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.matching;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchParticipant;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentSearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchPattern;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class XMLSearchPatternMatcher extends PatternMatcher{
-	
-   /**
-    * The active search participant.
-    */
-    private SearchParticipant searchParticipant;
-  
-    /**
-     * Constructs a pattern matcher given a search participant.
-     * @param searchParticipant the active {@link SearchParticipant search participant}.
-     */
-    public XMLSearchPatternMatcher(SearchParticipant searchParticipant)
-    {
-      this.searchParticipant = searchParticipant;
-    }
-    
-	protected String computeNamespaceForPrefix(Element element, String prefix)
-	{
-	  String result = null;
-	  for (Node node = element; node != null; node = node.getParentNode())
-	  {
-		if (node.getNodeType() == Node.ELEMENT_NODE)
-		{
-		  Element e = (Element)node;
-		  String attributeName = (prefix != null && prefix.length() > 0) ? ("xmlns:" + prefix) : "xmlns";  //$NON-NLS-1$ //$NON-NLS-2$
-		  result = e.getAttribute(attributeName);
-		  if (result != null)
-		  {
-			 break;  
-		  }	  
-		}	
-	  }	  
-	  return result;
-	}
-	
-
-	protected void initialize(XMLSearchPattern pattern, Element domElement) {
-	
-			pattern.setElementName(domElement.getLocalName());
-			pattern.setElementNamespace(domElement.getNamespaceURI());
-            // TODO (cs) set the depth attribute on the pattern
-            //
-			String actualValue = domElement.getAttribute(pattern.getAttributeName());
-			 if(actualValue != null){
-					int n = actualValue.indexOf(":"); //$NON-NLS-1$
-					if(n > 0){
-						String prefix = actualValue.substring(0, n);
-						pattern.setSearchName(actualValue.substring(n+1));      
-						
-						String namespace = computeNamespaceForPrefix(domElement, prefix);
-						pattern.setSearchNamespace(namespace);
-					
-					}
-					else {
-						pattern.setSearchName(actualValue);
-						pattern.setSearchNamespace(domElement.getOwnerDocument().getDocumentElement().getAttribute("targetNamespace")); //$NON-NLS-1$
-					}
-			    }
-		
-	}
-	
-	protected void initialize(XMLSearchPattern pattern, SAXSearchElement saxElement) {
-		
-		pattern.setElementName(saxElement.getElementName());
-		pattern.setElementNamespace(saxElement.getElementNamespace());
-        pattern.setDepth(saxElement.getDepth());
-        pattern.setParentName(saxElement.getParentName());
-		String actualValue = saxElement.getAttributes().getValue(pattern.getAttributeName());
-		 if(actualValue != null){
-				int n = actualValue.indexOf(":"); //$NON-NLS-1$
-				if(n > 0){
-					String prefix = actualValue.substring(0, n);
-					pattern.setSearchName(actualValue.substring(n+1));
-					pattern.setSearchNamespace((String)saxElement.getNamespaceMap().get(prefix));
-				
-				}
-				else {
-					pattern.setSearchName(actualValue);
-					pattern.setSearchNamespace(saxElement.getTargetNamespace());
-				}
-		    }
-	
-	}
-	
-	XMLSearchPattern searchPattern;
-	
-	public XMLSearchPatternMatcher() {
-		super();
-		
-	}
-
-	
-
-	
-	/**
-	 * This method does dive actual match location to the requestor if there are matches
-	 */
-	
-	public void locateMatches(SearchPattern pattern, IFile file, Element element, SearchRequestor requestor) {
-		if(pattern instanceof XMLComponentSearchPattern){
-			XMLSearchPattern[] childPatterns = ((XMLComponentSearchPattern)pattern).getChildren(searchParticipant);
-			if (childPatterns == null){
-			  return;
-			}
-			for (int i = 0; i < childPatterns.length; i++) {
-				PatternMatcher matcher = (PatternMatcher)childPatterns[i].getAdapter(PatternMatcher.class);
-				if(matcher == null){
-					matcher = this;
-				}
-				if(matcher != null){
-					matcher.locateMatches(childPatterns[i], file, element, requestor);
-				}
-			}
-		}
-		else if(pattern instanceof XMLSearchPattern){
-			if(matches(pattern, element)){
-				Attr attribute = element.getAttributeNode(((XMLSearchPattern)pattern).getAttributeName());
-				addMatch(pattern, file, attribute, requestor);
-			}
-		
-		}
-	}
-	
-	/**
-	 * This method only answers if the pattern matches element, it does not give actual match location
-	 */
-	public boolean matches(SearchPattern pattern, Object element){
-		if(pattern instanceof XMLComponentSearchPattern){
-			XMLSearchPattern[] childPatterns = ((XMLComponentSearchPattern)pattern).getChildren(searchParticipant);
-            if (childPatterns == null){
-              return false;
-            }
-			for (int i = 0; i < childPatterns.length; i++) {
-				PatternMatcher matcher = (PatternMatcher)childPatterns[i].getAdapter(PatternMatcher.class);
-				if(matcher == null){
-					matcher = this;
-				}
-				if(matcher != null){
-					if(matcher.matches(childPatterns[i], element)){
-						return true;
-					}
-				}
-				
-			}
-		}
-		else if(pattern instanceof XMLSearchPattern){
-			
-			XMLSearchPattern possibleMatch = new XMLSearchPattern();
-			possibleMatch.setAttributeName(((XMLSearchPattern)pattern).getAttributeName());
-			if(element instanceof Element){
-				initialize(possibleMatch, (Element)element);
-			}
-			else if(element instanceof SAXSearchElement){
-				initialize(possibleMatch, (SAXSearchElement)element);
-			}
-			searchPattern = (XMLSearchPattern)pattern;
-			return matchesPattern(possibleMatch);
-		}
-		return false;
-	}
-	
-	protected boolean matchesPattern(SearchPattern pattern) {
-		if(searchPattern != null && pattern instanceof XMLSearchPattern){
-			XMLSearchPattern decodedPattern = (XMLSearchPattern)pattern;
-            if(searchPattern.getElementName().equals(decodedPattern.getElementName()) &&                    
-					searchPattern.getElementNamespace().equals(decodedPattern.getElementNamespace())){                
-                if(searchPattern.getParentName() != null &&
-                   decodedPattern.getParentName() != null &&
-                   !searchPattern.getParentName().equals(decodedPattern.getParentName()))
-                {
-                  return false;  
-                }  
-                if(searchPattern.getSearchName() == null)
-                {  
-                  return false;
-                }
-                else if ("*".equals(searchPattern.getSearchName())) //$NON-NLS-1$
-                {
-                  return true;
-                }  
-                else if(searchPattern.getSearchNamespace() == null){
-					return searchPattern.getSearchName().equals(decodedPattern.getSearchName());
-				}
-				else{
-					return searchPattern.getSearchName().equals(decodedPattern.getSearchName()) &&
-					searchPattern.getSearchNamespace().equals(decodedPattern.getSearchNamespace());
-				}
-			}
-		}
-		
-		return false;
-	}
-	
-    
-    protected SearchMatch createSearchMatch(IFile file, Attr attributeNode)
-    {
-      SearchMatch match = super.createSearchMatch(file, attributeNode);
-      // todo... remove this ugly hack!!
-      if ("name".equals(attributeNode.getName())) //$NON-NLS-1$
-      {
-        QualifiedName qualifiedName = new QualifiedName("todo-compute-targetNamespace", attributeNode.getValue()); //$NON-NLS-1$
-        match.map.put("name", qualifiedName); //$NON-NLS-1$
-      }
-      //Element element = attributeNode.getOwnerDocument().getDocumentElement();
-      //if (element.getAttribute("targetNamespace"))
-      //{        
-      //}  
-      return match;
-    }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScan.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScan.java
deleted file mode 100644
index bf8a14c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScan.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.search.quickscan;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.matching.PatternMatcher;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-
-/**
- * 
- */
-public class XMLQuickScan
-{
-    /*
-	public static String getTargetNamespace(String fullFilePath)
-	{
-		XMLQuickScanContentHandler handler = new XMLQuickScanContentHandler();
-		parseFile(fullFilePath, handler);
-		return handler.getTargetNamespace();
-	}*/
-	
-	/*
-	 * Returns information about matches encountered based on the criteria
-	 * provided.
-	 *
-	public static boolean hasMatch(String fullFilePath, PatternMatcher matcher, SearchPattern pattern)
-	{
-		XMLQuickScanContentHandler handler = new XMLQuickScanContentHandler(matcher, pattern);
-		parseFile(fullFilePath, handler);
-		return handler.hasMatch();
-	}*/
-	
-	public static boolean populateSearchDocument(SearchDocument document, PatternMatcher matcher, SearchPattern pattern)
-	{
-		XMLQuickScanContentHandler handler = new XMLQuickScanContentHandler(document, matcher, pattern);
-		parseFile(document.getPath(), handler);
-		return handler.hasMatch();
-	}
-
-    private static XMLReader reader;
-    private static XMLReader getOrCreateReader()
-    {
-       if (reader == null)
-       {
-         try
-         {
-          SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
-          reader = parser.getXMLReader();  
-          reader.setFeature("http://xml.org/sax/features/namespaces", true); //$NON-NLS-1$
-          reader.setErrorHandler(new InternalErrorHandler());          
-         }
-         catch (Exception e)
-         {           
-         }
-       } 
-       return reader;
-    }
-    
-    static class InternalErrorHandler implements ErrorHandler
-    {
-      public void error(SAXParseException exception) throws SAXException
-      {          
-      }
-      
-      public void fatalError(SAXParseException exception) throws SAXException
-      {
-      }
-      public void warning(SAXParseException exception) throws SAXException
-      {        
-      }
-    }
-    
-	private synchronized static void parseFile(String fullFilePath,
-			XMLQuickScanContentHandler handler)
-	{
-		FileInputStream inputStream = null;
-		try
-		{            
-			inputStream = new FileInputStream(new File(fullFilePath));
-			XMLReader reader = getOrCreateReader();
-            reader.setContentHandler(handler);
-			//System.out.println("parseFile" + reader + " (" +  fullFilePath + ")");			
-			reader.parse(new InputSource(inputStream));
-		} catch (Exception e)
-		{
-			// skip the file
-		} 
-		finally{
-			if(inputStream != null){
-				try {
-					inputStream.close();
-				} catch (IOException e) {
-					// can not do much 
-				}
-			}
-			
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScanContentHandler.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScanContentHandler.java
deleted file mode 100644
index 65d87cd..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScanContentHandler.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.quickscan;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Stack;
-
-import org.eclipse.wst.common.core.search.document.ComponentDeclarationEntry;
-import org.eclipse.wst.common.core.search.document.ComponentReferenceEntry;
-import org.eclipse.wst.common.core.search.document.FileReferenceEntry;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentReferencePattern;
-import org.eclipse.wst.xml.core.internal.search.impl.IXMLSearchConstants;
-import org.eclipse.wst.xml.core.internal.search.matching.PatternMatcher;
-import org.eclipse.wst.xml.core.internal.search.matching.SAXSearchElement;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * This class is a SAX content handler, it should be recycled before scanning a file for the new SearchPattern.
- *
- */
-public class XMLQuickScanContentHandler extends DefaultHandler
-{
-	private Map namespaceMap = new HashMap(); // Map of string prefix keys and namespace
-	private String targetNamespace = ""; //$NON-NLS-1$
-	
-	private SearchPattern pattern;
-	private SearchDocument document;  // we'll add useful entries in the search document as we parsing
-	private SAXSearchElement searchElement = new SAXSearchElement();
-
-	private boolean hasMatch = false;
-	private Stack currentPath = new Stack();
-	private PatternMatcher matcher;
-	
-	public static final String XMLSCHEMA_NAMESPACE = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$
-  public static final String WSDL_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/"; //$NON-NLS-1$
-
-	
-	public XMLQuickScanContentHandler(PatternMatcher matcher, SearchPattern pattern) {
-		super();
-		this.pattern = pattern;
-		this.matcher = matcher;
-	}
-	
-	public XMLQuickScanContentHandler(SearchDocument document, PatternMatcher matcher, SearchPattern pattern) {
-		super();
-		this.pattern = pattern;
-		this.matcher = matcher;
-		this.document = document;
-	}
-	
-	public XMLQuickScanContentHandler() {
-		super();
-	}
-
-	public void startElement(String uri, String localName, String qName,
-			Attributes attributes) throws SAXException
-	{	
-		// Search for targetNamespace if we haven't encountered it yet.
-		if (targetNamespace.equals("")) //$NON-NLS-1$
-		{
-			int nAttributes = attributes.getLength();
-			for (int i = 0; i < nAttributes; i++)
-			{
-				if ("targetNamespace".equals(attributes.getQName(i))) //$NON-NLS-1$
-				{
-					targetNamespace = attributes.getValue(i);
-					break;
-				}
-			}
-		}
-		
-		// collect link info
-    
-    // TODO This code should be refactored to delegate the responsibility to
-    // detect links between files to the search providers/contributors.
-    // The current code only handles the XSD and WSDL cases. 
-    
-		if("import".equals(localName) && namespaceMatches(uri)){ //$NON-NLS-1$
-			FileReferenceEntry documentEntry = new FileReferenceEntry();
-			documentEntry.setCategory(IXMLSearchConstants.REF);
-			documentEntry.setKey("import"); //$NON-NLS-1$
-			String namespace = attributes.getValue("namespace"); //$NON-NLS-1$
-			String location = attributes.getValue(getLocationAttributeName(uri)); //$NON-NLS-1$
-			documentEntry.setPublicIdentifier(namespace);
-			documentEntry.setRelativeFilePath(location);            
-			document.putEntry(documentEntry);
-		}
-		if(("redefine".equals(localName)|| "include".equals(localName)) && //$NON-NLS-1$ //$NON-NLS-2$
-				namespaceMatches(uri)){
-			FileReferenceEntry documentEntry = new FileReferenceEntry();
-			documentEntry.setCategory(IXMLSearchConstants.REF);
-			documentEntry.setKey("include"); //$NON-NLS-1$
-			String location = attributes.getValue(getLocationAttributeName(uri)); //$NON-NLS-1$
-			documentEntry.setPublicIdentifier(uri);
-			documentEntry.setRelativeFilePath(location);
-			document.putEntry(documentEntry);
-		}
-		
-		
-        // issue (cs) you may want to try perf measurements to compate reusing the same
-        // instance of a SAXSearchElement instead of newing one each time 
-		//XMLSearchPattern.SAXSearchElement searchElement = new XMLSearchPattern.SAXSearchElement();
-		searchElement.setElementName(localName);
-		searchElement.setElementNamespace(uri);
-		searchElement.setAttributes(attributes);
-		searchElement.setNamespaceMap(namespaceMap);
-		searchElement.setTargetNamespace(targetNamespace);
-		if (currentPath.size() > 0)
-		{
-		  String parentName = (String)currentPath.peek();
-		  searchElement.setParentName(parentName);
-		}			
-	
-
-		if(matcher != null){
-			if(matcher.matches(pattern, searchElement)){
-				hasMatch = true;
-				if(pattern instanceof XMLComponentReferencePattern){
-					ComponentReferenceEntry documentEntry = new ComponentReferenceEntry();
-					documentEntry.setCategory(IXMLSearchConstants.COMPONENT_REF);
-					QualifiedName name = new QualifiedName(uri, localName);
-					documentEntry.setKey(name.toString());
-					documentEntry.setName(name);
-					document.putEntry(documentEntry);
-				}
-				else if(pattern instanceof XMLComponentDeclarationPattern){
-					ComponentDeclarationEntry documentEntry = new ComponentDeclarationEntry();
-					documentEntry.setCategory(IXMLSearchConstants.COMPONENT_DECL);
-                    QualifiedName name = new QualifiedName(targetNamespace, attributes.getValue("name")); //$NON-NLS-1$
-					QualifiedName metaName = new QualifiedName(uri, localName);                    
-					documentEntry.setKey(name.toString());
-                    documentEntry.setName(name);
-					documentEntry.setMetaName(metaName);
-					document.putEntry(documentEntry);
-				}
-			}
-		}
-		currentPath.push(localName); //$NON-NLS-1$		
-	}
-
-  private String getLocationAttributeName(String uri)
-  {
-    if (XMLSCHEMA_NAMESPACE.equals(uri))
-    {
-      return "schemaLocation";
-    }
-    
-    else if (WSDL_NAMESPACE.equals(uri))
-    {
-      return "location";
-    }
-    
-    return "";
-  }
-
-  private boolean namespaceMatches(String uri)
-  {
-    return XMLSCHEMA_NAMESPACE.equals(uri) ||
-          WSDL_NAMESPACE.equals(uri);
-  }
-	
-	public void endElement(String uri, String localName, String qName)
-			throws SAXException
-	{
-		currentPath.pop();
-	}
-
-	/**
-	 * Callback for SAX parser
-	 * 
-	 * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String,
-	 *      java.lang.String)
-	 */
-	public void startPrefixMapping(String arg0, String arg1)
-			throws SAXException
-	{
-		if (arg0 != null && arg0.length() > 0)
-		{
-			this.namespaceMap.put(arg0, arg1);
-		}
-	}
-
-	public String getTargetNamespace() {
-		return targetNamespace;
-	}
-
-	public void setTargetNamespace(String targetNamespace) {
-		this.targetNamespace = targetNamespace;
-	}
-
-	public boolean hasMatch() {
-		return hasMatch;
-	}
-
-	
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java
deleted file mode 100644
index 96c578c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URL;
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-import java.util.Vector;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * A helper class for the XML validator.
- * 
- * @author Craig Salter, IBM
- * @author Lawrence Mandel, IBM
- */
-public class ValidatorHelper
-{                           
-  public List namespaceURIList = new Vector();
-  public boolean isGrammarEncountered = false;    
-  public boolean isDTDEncountered = false;
-  public boolean isNamespaceEncountered = false;
-  public String schemaLocationString = ""; //$NON-NLS-1$
-  public int numDTDElements = 0;
-
-  /**
-   * Constructor.
-   */
-  public ValidatorHelper()
-  {
-  }
- 
-  /**
-   * Create an XML Reader.
-   * 
-   * @return An XML Reader if one can be created or null.
-   * @throws Exception
-   */
-  protected XMLReader createXMLReader(String uri) throws Exception
-  {     
-    XMLReader reader = null;
-    
-    reader = new org.apache.xerces.parsers.SAXParser();     
-    reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", false); //$NON-NLS-1$
-    reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); //$NON-NLS-1$
-    reader.setFeature("http://xml.org/sax/features/namespaces", false); //$NON-NLS-1$
-    reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); //$NON-NLS-1$
-    reader.setContentHandler(new MyContentHandler(uri));
-    reader.setErrorHandler(new InternalErrorHandler()); 
-
-    LexicalHandler lexicalHandler = new LexicalHandler()
-    {      
-      public void startDTD (String name, String publicId, String systemId)
-      {
-        isGrammarEncountered = true;   
-        isDTDEncountered = true;
-      }
-
-      public void endDTD() throws SAXException
-      {
-      }
-
-      public void startEntity(String name) throws SAXException
-      {
-      }
-
-      public void endEntity(String name) throws SAXException
-      {
-      }
-
-      public void startCDATA() throws SAXException
-      {
-      }
-
-      public void endCDATA() throws SAXException
-      {
-      }
- 
-      public void comment (char ch[], int start, int length) throws SAXException
-      {
-      }
-    };
-    reader.setProperty("http://xml.org/sax/properties/lexical-handler", lexicalHandler); //$NON-NLS-1$
-    
-    return reader;
-  }  
-
-  /**
-   * An error handler to suppress error and warning information.
-   */
-  private class InternalErrorHandler implements org.xml.sax.ErrorHandler
-  {
-	public InternalErrorHandler()
-	{
-	  super();
-	}
-	
-    public void error(SAXParseException exception) throws SAXException
-    {
-    }
-
-    public void fatalError(SAXParseException exception) throws SAXException
-    {
-    }
-
-    public void warning(SAXParseException exception) throws SAXException
-    {
-    }
-  }
-
- 
-  /**
-   * Figures out the information needed for validation.
-   * 
-   * @param uri The uri of the file to validate.
-   * @param uriResolver A helper to resolve locations.
-   */
-  public void computeValidationInformation(String uri, Reader characterStream, URIResolver uriResolver)
-  {
-    try
-    {
-      XMLReader reader = createXMLReader(uri);  
-      InputSource inputSource = new InputSource(uri);
-      inputSource.setCharacterStream(characterStream);
-      reader.parse(inputSource);
-    }
-    catch (Exception e)
-    {     
-      //System.out.println(e);
-    }
-  }
-  
- 
-
-  /**
-   * Handle the content while parsing the file.
-   */
-  class MyContentHandler extends org.xml.sax.helpers.DefaultHandler
-  {      
-    /* (non-Javadoc)
-     * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
-     */
-    boolean isRootElement = true;
-    String baseURI;
-    
-    MyContentHandler(String uri)
-    {
-      this.baseURI = uri;  
-    }
-    
-    public void error(SAXParseException e) throws SAXException
-    {
-    }
-    /* (non-Javadoc)
-     * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
-     */
-    public void fatalError(SAXParseException e) throws SAXException
-    {
-    }
-    /* (non-Javadoc)
-     * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
-     */
-    public void warning(SAXParseException e) throws SAXException
-    {
-    }
-    public String getPrefix(String name)
-    {
-      String prefix = null;
-      int index = name.indexOf(":"); //$NON-NLS-1$
-      if (index != -1)
-      {
-        prefix = name.substring(0, index);
-      }
-      return prefix;
-    }    
-        
-    public String getUnprefixedName(String name)
-    {
-      int index = name.indexOf(":"); //$NON-NLS-1$
-      if (index != -1)
-      {
-        name = name.substring(index + 1);
-      }
-      return name;
-    }
-    
-    public String getPrefixedName(String prefix, String localName)
-    {
-      return prefix != null && prefix.length() > 0 ? prefix + ":" + localName : localName;      //$NON-NLS-1$
-    }
-
-    public void startElement(String namespaceURI, String localName, String rawName, Attributes atts)
-    {      
-      //String explicitLocation = null;
-      if (isRootElement)
-      {  
-        
-        isRootElement = false;  
-        int nAtts = atts.getLength();    
-        String schemaInstancePrefix = null;
-        for (int i =0; i < nAtts; i++)
-        {              
-          String attributeName = atts.getQName(i);       
-          if (attributeName.equals("xmlns") || attributeName.startsWith("xmlns:")) //$NON-NLS-1$ //$NON-NLS-2$
-          {                                         
-            isNamespaceEncountered = true;    
-            String value = atts.getValue(i);                 
-            if (value.startsWith("http://www.w3.org/") && value.endsWith("/XMLSchema-instance")) //$NON-NLS-1$ //$NON-NLS-2$
-            {
-              schemaInstancePrefix = attributeName.equals("xmlns") ? "" : getUnprefixedName(attributeName); //$NON-NLS-1$ //$NON-NLS-2$
-            }                   
-          }                 
-        }
-        
-        String prefix = getPrefix(rawName);
-        String rootElementNamespaceDeclarationName = (prefix != null && prefix.length() > 0) ? "xmlns:" + prefix : "xmlns"; //$NON-NLS-1$ //$NON-NLS-2$
-        String rootElementNamespace = rootElementNamespaceDeclarationName != null ? atts.getValue(rootElementNamespaceDeclarationName) : null;        
-        
-        String location = null;
-        
-        // first we use any 'xsi:schemaLocation' or 'xsi:noNamespaceSchemaLocation' attribute
-        // to determine a location
-        if (schemaInstancePrefix != null)
-        {                     
-          location = atts.getValue(getPrefixedName(schemaInstancePrefix, "noNamespaceSchemaLocation")); //$NON-NLS-1$
-          if (location == null)
-          {            
-        	String schemaLoc = atts.getValue(getPrefixedName(schemaInstancePrefix, "schemaLocation"));  //$NON-NLS-1$
-            location = getSchemaLocationForNamespace(schemaLoc, rootElementNamespace);
-          }  
-        }  
-        if (rootElementNamespace == null)
-        {
-          rootElementNamespace = "";
-        }
-        
-        location = URIResolverPlugin.createResolver().resolve(baseURI, rootElementNamespace, location);    
-        location = URIResolverPlugin.createResolver().resolvePhysicalLocation(baseURI, rootElementNamespace, location);                                                    
-        location = URIHelper.addImpliedFileProtocol(location);
-        
-        schemaLocationString = location;
-        
-        if (location != null)
-        {  
-          InputStream is = null;
-          try
-          {
-            URL url = new URL(location);
-            is = url.openStream();
-            isGrammarEncountered = true;
-          }
-          catch(Exception e)
-          {
-        	// Do nothing.
-          }
-          finally
-          {
-        	if(is != null)
-        	{
-        	  try
-        	  {
-        	    is.close();
-        	  }
-        	  catch(Exception e)
-        	  {
-        		// Do nothing.
-        	  }
-        	}
-          }
-        }        
-      }
-    }     
-    /* (non-Javadoc)
-     * @see org.xml.sax.ext.DeclHandler#elementDecl(java.lang.String, java.lang.String)
-     */
-    public void elementDecl(String name, String model) 
-    {
-      numDTDElements++;
-    }
-    
-    // The xsiSchemaLocationValue is a list of namespace/location pairs that are separated by whitespace 
-    // this method walks the list of pairs looking for the specified namespace and returns the associated
-    // location.
-    //   
-    protected String getSchemaLocationForNamespace(String xsiSchemaLocationValue, String namespace)
-    {      
-      String result = null;
-      if (xsiSchemaLocationValue != null && namespace != null)
-      {
-        
-        StringTokenizer st = new StringTokenizer(xsiSchemaLocationValue);
-        while(st.hasMoreTokens())
-        {
-          if(st.nextToken().equals(namespace))
-          {
-            if(st.hasMoreTokens())
-            {
-              result = st.nextToken();
-            }
-          }
-          else
-          {
-            if(st.hasMoreTokens())
-            {
-              st.nextToken();
-            }
-          }
-        }
-      }
-      return result;
-    }         
-  }   
-       
-  
-  /**
-   * Replace all instances in the string of the old pattern with the new pattern.
-   * 
-   * @param string The string to replace the patterns in.
-   * @param oldPattern The old pattern to replace.
-   * @param newPattern The pattern used for replacement.
-   * @return The modified string with all occurrances of oldPattern replaced by new Pattern.
-   */
-  protected static String replace(String string, String oldPattern, String newPattern)
-  {     
-    int index = 0;
-    while (index != -1)
-    {
-      index = string.indexOf(oldPattern, index);
-      if (index != -1)
-      {
-        string = string.substring(0, index) + newPattern + string.substring(index + oldPattern.length());
-        index = index + oldPattern.length();
-      }
-    }
-    return string;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java
deleted file mode 100644
index 2b01b88..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation;
-
-/**
- * An XML validation configuration allows setting specific configuration
- * information for a WTP XML validation run. Any features and properties
- * set on this configuration should not be confused with those from
- * parsers such as Xerces. (This object does not by default wrap features
- * and properties from specific parsers.)
- */
-public class XMLValidationConfiguration 
-{
-  /**
-   * @deprecated
-   */
-  public static String WARN_NO_GRAMMAR = "WARN_NO_GRAMMAR"; //$NON-NLS-1$
-  public static String INDICATE_NO_GRAMMAR = "INDICATE_NO_GRAMMAR"; //$NON-NLS-1$
-  private boolean warn_no_grammar_value = false;
-  private int indicate_no_grammar_value = 1;
-  
-  /**
-   * Set a feature of this configuration.
-   * 
-   * @param feature
-   * 		The feature to set.
-   * @param value
-   * 		The value to set for the feature.
-   * @throws 
-   * 		An exception is thrown if the feature is not recognized.
-   */
-  public void setFeature(String feature, boolean value) throws Exception
-  {
-	if(WARN_NO_GRAMMAR.equals(feature))
-	  warn_no_grammar_value = value;
-	else
-	  throw new Exception("Feature not recognized."); //$NON-NLS-1$
-	
-  }
-  
-  /**
-   * Set a feature of this configuration.
-   * 
-   * @param feature
-   * 		The feature to set.
-   * @param value
-   * 		The value to set for the feature.
-   * @throws 
-   * 		An exception is thrown if the feature is not recognized.
-   */
-  public void setFeature(String feature, int value) throws Exception
-  {
-	if(INDICATE_NO_GRAMMAR.equals(feature))
-	  indicate_no_grammar_value = value;
-	else
-	  throw new IllegalArgumentException("Feature not recognized."); //$NON-NLS-1$
-	
-  }
-  
-  
-  /**
-   * Get the value for a given feature. If the feature is not defined
-   * this method will throw an exception.
-   * 
-   * @param feature
-   * 		The feature for which to retrieve the value.
-   * @return
-   * 		The feature's value, true or false.
-   * @throws 
-   * 		An exception is thrown if the feature is not recognized.
-   */
-  public boolean getFeature(String feature) throws Exception
-  {
-	if(WARN_NO_GRAMMAR.equals(feature))
-	  return warn_no_grammar_value;
-	
-	throw new Exception("Feature not recognized."); //$NON-NLS-1$
-  }
-
-  /**
-   * Get the value for a given feature. If the feature is not defined
-   * this method will throw an exception.
-   * 
-   * @param feature
-   * 		The feature for which to retrieve the value.
-   * @return
-   * 		The feature's value, true or false.
-   * @throws 
-   * 		An exception is thrown if the feature is not recognized.
-   */
-  public int getIntFeature(String feature) throws Exception
-  {
-	if(INDICATE_NO_GRAMMAR.equals(feature))
-	  return indicate_no_grammar_value;
-	
-	throw new IllegalArgumentException("Feature not recognized."); //$NON-NLS-1$
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java
deleted file mode 100644
index 888bc40..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     David Carver - STAR - [205989] - [validation] validate XML after XInclude resolution
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation;
-
-import java.util.Stack;
-
-import org.apache.xerces.xni.XMLLocator;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
-import org.eclipse.wst.xml.core.internal.validation.errorcustomization.ErrorCustomizationManager;
-
-
-/**
- * A validation information object specific to XML validators.
- */
-public class XMLValidationInfo extends ValidationInfo implements XMLValidationReport
-{
-  protected boolean grammarEncountered = false;
-  protected boolean dtdEncountered = false;
-  protected boolean namespaceEncountered = false;
-  protected int elementDeclCount = 0;
-  protected String currentErrorKey;
-  protected Object messageArguments[] = null;
-  protected XMLLocator locator = null;
-  protected ErrorCustomizationManager errorCustomizationManager = null;
-  
-  /**
-   * A stack of start tag locations, used to move errors
-   * reported at the close tag to be reported at the start tag.
-   */
-  protected Stack startElementLocations = new Stack();
-  
-  /**
-   * Constructor.
-   * 
-   * @param uri The URI of the file this report describes.
-   */
-  public XMLValidationInfo(String uri)
-  {
-    super(uri);
-  }
-  
-  public boolean isGrammarEncountered()
-  {
-    return grammarEncountered;
-  }
-  
-  /**
-   * Set whether a grammar has been encountered or not.
-   * 
-   * @param grammarEncountered Set true if a grammar has been encountered, false otherwise.
-   */
-  public void setGrammarEncountered(boolean grammarEncountered)
-  {
-    this.grammarEncountered = grammarEncountered;
-  }
-  
-  public boolean isDTDWithoutElementDeclarationEncountered()
-  {
-    return dtdEncountered && elementDeclCount == 0;
-  }
-  
-  /**
-   * Set whether a DTD without an element declaration was encountered.
-   * 
-   * @param dtdWithoutElementDeclarationEncountered Set true if a DTD without an
-   *         element declaration was encountered, false otherwise.
-   */
-  public void setDTDEncountered(boolean dtdEncountered)
-  {
-    this.dtdEncountered = dtdEncountered;
-  }
-  
-  public boolean isNamespaceEncountered()
-  {
-    return namespaceEncountered;
-  }
-  
-  /**
-   * Set whether a namespace was encountered.
-   * 
-   * @param namespaceEncountered Set true if a namespace was encountered, false otherwise.
-   */
-  public void setNamespaceEncountered(boolean namespaceEncountered)
-  {
-    this.namespaceEncountered = namespaceEncountered;
-  }
-  
-  /**
-   * Increase the element declaration count for DTD elements by one.
-   */
-  public void increaseElementDeclarationCount()
-  {
-    this.elementDeclCount++;
-  }
-  
-  /**
-   * Set the number of DTD elements encountered.
-   * 
-   * @param count The number of DTD elements encountered.
-   */
-  public void setElementDeclarationCount(int count)
-  {
-  	elementDeclCount = count;
-  }
-  
-  /**
-   * Get the XML locator if one has been specified.
-   * 
-   * @return The XML locator if one has been specified or null.
-   */
-  public XMLLocator getXMLLocator()
-  {
-    return locator;
-  }
-  
-  /**
-   * Set the XMLLocator.
-   * 
-   * @param locator The XMLLocator to set.
-   */
-  public void setXMLLocator(XMLLocator locator)
-  {
-    this.locator = locator;
-  }
-  
-  /**
-   * Get the current error key.
-   * 
-   * @return Returns the currentErrorKey.
-   */
-  public String getCurrentErrorKey()
-  {
-    return currentErrorKey;
-  }
-  
-  /**
-   * Set the current error key.
-   * 
-   * @param currentErrorKey The currentErrorKey to set.
-   */
-  public void setCurrentErrorKey(String currentErrorKey)
-  {
-    this.currentErrorKey = currentErrorKey;
-  }
-
-public Object[] getMessageArguments() {
-	return messageArguments;
-}
-
-
-public void setMessageArguments(Object[] messageArguments) {
-	this.messageArguments = messageArguments;
-}
-
-  /**
-   * Get the start elements locations.
-   * 
-   * @return 
-   * 		A stack containing the start element locations.
-   */
-  protected Stack getStartElementLocations()
-  {
-    return startElementLocations;
-  }
-  
-  /**
-   * Get the error customization manager for this validation run.
-   * 
-   * @return
-   * 	The error customization manager for this validation run.
-   */
-  protected ErrorCustomizationManager getErrorCustomizationManager()
-  {
-	  if(errorCustomizationManager == null)
-	  {
-		  errorCustomizationManager = new ErrorCustomizationManager();
-	  }
-	  return errorCustomizationManager;
-  }
-  
-  public boolean isUseXInclude() {
-	  return XMLCorePlugin.getDefault().getPluginPreferences().getBoolean(XMLCorePreferenceNames.USE_XINCLUDE);
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java
deleted file mode 100644
index 7cd08da..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML Validation
- */
-public class XMLValidationMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.xml.core.internal.validation.xmlvalidation";//$NON-NLS-1$
-
-	public static String _UI_PROBLEMS_VALIDATING_UNKNOWN_HOST;
-	public static String _UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND;
-	public static String _UI_PROBLEMS_CONNECTION_REFUSED;
-	public static String _UI_REF_FILE_ERROR_MESSAGE;
-	public static String _WARN_NO_GRAMMAR;
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, XMLValidationMessages.class);
-	}
-
-	private XMLValidationMessages() {
-		// cannot create new instance
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationReport.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationReport.java
deleted file mode 100644
index 5a4f1f6..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationReport.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation;
-
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-
-/**
- * An interface represention a validation report for XML validation.
- * 
- * @author Lawrence Mandel, IBM
- */
-public interface XMLValidationReport extends ValidationReport
-{
-  
-  /**
-   * Returns whether a grammar was encountered during the validation.
-   * 
-   * @return True if a grammar was encountered, false otherwise.
-   */
-  public boolean isGrammarEncountered();
-  
-  /**
-   * Returns whether a namespace was encountered.
-   * 
-   * @return True if a namespace was encountered, false otherwise.
-   */
-  public boolean isNamespaceEncountered();
-  
-  /**
-   * Returns whether a DTD without element declarations was encountered.
-   * 
-   * @return True if a DTD without element declarations was encountered.
-   */
-  public boolean isDTDWithoutElementDeclarationEncountered();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
deleted file mode 100644
index 1a44faf..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
+++ /dev/null
@@ -1,756 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     David Carver - STAR - [205989] - [validation] validate XML after XInclude resolution
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation;
-
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.StringReader;
-import java.net.ConnectException;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.apache.xerces.impl.XMLErrorReporter;
-import org.apache.xerces.impl.msg.XMLMessageFormatter;
-import org.apache.xerces.parsers.XIncludeAwareParserConfiguration;
-import org.apache.xerces.xni.Augmentations;
-import org.apache.xerces.xni.NamespaceContext;
-import org.apache.xerces.xni.QName;
-import org.apache.xerces.xni.XMLAttributes;
-import org.apache.xerces.xni.XMLLocator;
-import org.apache.xerces.xni.XMLResourceIdentifier;
-import org.apache.xerces.xni.XNIException;
-import org.apache.xerces.xni.parser.XMLEntityResolver;
-import org.apache.xerces.xni.parser.XMLInputSource;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.validation.core.LazyURLInputStream;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * This class performs validation using a xerces sax parser.  
- * Here's a quick overview of the details : 
- *   - an ErrorHandler is used to collect errors into a list (so they may be displayed by the UI)
- *   - an EntityResolver is used along with the xerces "external-schemaLocation" property to implement XML Catalog support
- */
-public class XMLValidator
-{
-  protected URIResolver uriResolver = null;
-  protected Hashtable ingoredErrorKeyTable = new Hashtable();
-  protected Set adjustLocationErrorKeySet = new TreeSet();
-
-  protected static final String IGNORE_ALWAYS = "IGNORE_ALWAYS"; //$NON-NLS-1$
-  protected static final String IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL = "IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL"; //$NON-NLS-1$
-  protected static final String PREMATURE_EOF = "PrematureEOF"; //$NON-NLS-1$
-  protected static final String ROOT_ELEMENT_TYPE_MUST_MATCH_DOCTYPEDECL = "RootElementTypeMustMatchDoctypedecl"; //$NON-NLS-1$
-  protected static final String MSG_ELEMENT_NOT_DECLARED = "MSG_ELEMENT_NOT_DECLARED"; //$NON-NLS-1$
-  
-  // WTP XML validator specific key.
-  protected static final String NO_GRAMMAR_FOUND = "NO_GRAMMAR_FOUND"; //$NON-NLS-1$
-  
-  private static final String FILE_NOT_FOUND_KEY = "FILE_NOT_FOUND"; //$NON-NLS-1$
-
-  /**
-   * Constructor.
-   */
-  public XMLValidator()
-  {                          
-    // Here we add some error keys that we need to filter out when we're validation 
-    // against a DTD without any element declarations.       
-    ingoredErrorKeyTable.put(PREMATURE_EOF, IGNORE_ALWAYS);
-    ingoredErrorKeyTable.put(ROOT_ELEMENT_TYPE_MUST_MATCH_DOCTYPEDECL, IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL);
-    ingoredErrorKeyTable.put(MSG_ELEMENT_NOT_DECLARED, IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL);
-    
-    // Here we add some error keys that we need to adjust the location information for.
-    // The location information will be adjusted to place the message on the line of the starting
-    // element instead of on the line of the closing element.
-    adjustLocationErrorKeySet.add("MSG_CONTENT_INVALID");
-    adjustLocationErrorKeySet.add("MSG_CONTENT_INCOMPLETE");
-    adjustLocationErrorKeySet.add("cvc-complex-type.2.4.b");
-    adjustLocationErrorKeySet.add("cvc-complex-type.2.3");
-  }
-
-  /**
-   * Set the URI Resolver to use.
-   * 
-   * @param uriResolver The URI Resolver to use.
-   */
-  public void setURIResolver(URIResolver uriResolver)
-  {
-    this.uriResolver = uriResolver;
-    //entityResolver = new MyEntityResolver(uriResolver);
-  }
-
- 
-  /**
-   * Create an XML Reader.
-   * 
-   * @return The newly created XML reader or null if unsuccessful.
-   * @throws Exception
-   */
-  protected XMLReader createXMLReader(final XMLValidationInfo valinfo, XMLEntityResolver entityResolver) throws Exception
-  {     
-    XMLReader reader = null;
-    // move to Xerces-2... add the contextClassLoader stuff
-    ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader();
-    try
-    {
-      Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
-      MyStandardParserConfiguration configuration = new MyStandardParserConfiguration(valinfo);
-      reader = new org.apache.xerces.parsers.SAXParser(configuration)
-      {
-    	private XMLLocator locator = null;
-    	
-        /* (non-Javadoc)
-         * @see org.apache.xerces.parsers.AbstractSAXParser#startDocument(org.apache.xerces.xni.XMLLocator, java.lang.String, org.apache.xerces.xni.NamespaceContext, org.apache.xerces.xni.Augmentations)
-         */
-        public void startDocument(org.apache.xerces.xni.XMLLocator theLocator, java.lang.String encoding, NamespaceContext nscontext, org.apache.xerces.xni.Augmentations augs) 
-        {
-          locator = theLocator;
-          valinfo.setXMLLocator(theLocator);
-          super.startDocument(theLocator, encoding, nscontext, augs); 
-        }
-
-        /* (non-Javadoc)
-         * @see org.apache.xerces.parsers.AbstractSAXParser#startElement(org.apache.xerces.xni.QName, org.apache.xerces.xni.XMLAttributes, org.apache.xerces.xni.Augmentations)
-         */
-        public void startElement(QName arg0, XMLAttributes arg1, Augmentations arg2) throws XNIException 
-        {
-          valinfo.getStartElementLocations().push(new LocationCoordinate(locator.getLineNumber(), locator.getColumnNumber()));
-		  super.startElement(arg0, arg1, arg2);
-		}
-        
-		/* (non-Javadoc)
-		 * @see org.apache.xerces.parsers.AbstractSAXParser#endElement(org.apache.xerces.xni.QName, org.apache.xerces.xni.Augmentations)
-		 */
-		public void endElement(QName arg0, Augmentations arg1) throws XNIException {
-			super.endElement(arg0, arg1);
-			valinfo.getStartElementLocations().pop();
-		}
-      };
-
-      reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", false); //$NON-NLS-1$
-      reader.setFeature("http://xml.org/sax/features/namespace-prefixes", valinfo.isNamespaceEncountered()); //$NON-NLS-1$
-      reader.setFeature("http://xml.org/sax/features/namespaces", valinfo.isNamespaceEncountered());               //$NON-NLS-1$
-      reader.setFeature("http://xml.org/sax/features/validation", valinfo.isGrammarEncountered());  //$NON-NLS-1$
-      reader.setFeature("http://apache.org/xml/features/validation/schema", valinfo.isGrammarEncountered()); //$NON-NLS-1$
-   	  reader.setFeature("http://apache.org/xml/features/xinclude", valinfo.isUseXInclude()); //$NON-NLS-1$      
-      reader.setContentHandler(new DefaultHandler()
-      {
-        public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
-          valinfo.getErrorCustomizationManager().startElement(uri, localName);                    
-        }
-        
-        public void endElement(String uri, String localName, String qName) throws SAXException {
-          valinfo.getErrorCustomizationManager().endElement(uri, localName);
-        }
-      });      
-      
-      // MH make sure validation works even when a customer entityResolver is note set (i.e. via setURIResolver())
-      if (entityResolver != null)
-      {  
-        reader.setProperty("http://apache.org/xml/properties/internal/entity-resolver", entityResolver); //$NON-NLS-1$
-      }  
-      reader.setProperty("http://xml.org/sax/properties/declaration-handler", new MyDeclHandler());      //$NON-NLS-1$
-    } 
-    catch(Exception e)
-    { 
-      Logger.logException(e);
-      //e.printStackTrace();
-    }
-    finally
-    {
-      Thread.currentThread().setContextClassLoader(prevClassLoader);
-    }
-    return reader;
-  }  
-
-  /**
-   * Validate the file located at the given URI.
-   * 
-   * @param uri The URI of the file to validate.
-   * @return Returns an XML validation report.
-   */
-  public XMLValidationReport validate(String uri)
-  {
-    return validate(uri, null, new XMLValidationConfiguration());  
-  }
-
-  final String createStringForInputStream(InputStream inputStream)
-  {
-    // Here we are reading the file and storing to a stringbuffer.
-    StringBuffer fileString = new StringBuffer();
-    try
-    {
-      InputStreamReader inputReader = new InputStreamReader(inputStream, "UTF-8");
-      BufferedReader reader = new BufferedReader(inputReader);
-      char[] chars = new char[1024];
-      int numberRead = reader.read(chars);
-      while (numberRead != -1)
-      {
-        fileString.append(chars, 0, numberRead);
-        numberRead = reader.read(chars);
-      }
-    }
-    catch (Exception e)
-    {
-      //TODO: log error message
-      //e.printStackTrace();
-    }
-    return fileString.toString();
-  }
-  /**
-   * Validate the inputStream
-   * 
-   * @param uri The URI of the file to validate.
-   * @param the inputStream of the file to validate
-   * @return Returns an XML validation report.
-   */
-  public XMLValidationReport validate(String uri, InputStream inputStream)
-  {
-	return validate(uri, inputStream, new XMLValidationConfiguration());
-  }
-  /**
-   * Validate the inputStream
-   * 
-   * @param uri 
-   * 		The URI of the file to validate.
-   * @param inputstream
-   * 		The inputStream of the file to validate
-   * @param configuration
-   * 		A configuration for this validation session.
-   * @return 
-   * 		Returns an XML validation report.
-   */
-  public XMLValidationReport validate(String uri, InputStream inputStream, XMLValidationConfiguration configuration)
-  {
-    return validate(uri, inputStream, configuration, null);  
-  }
- 
-  /**
-   * Validate the inputStream
-   * 
-   * @param uri 
-   *    The URI of the file to validate.
-   * @param inputstream
-   *    The inputStream of the file to validate
-   * @param configuration
-   *    A configuration for this validation session.
-   * @param result
-   *    The validation result
-   * @return 
-   *    Returns an XML validation report.
-   */
-  public XMLValidationReport validate(String uri, InputStream inputStream, XMLValidationConfiguration configuration, ValidationResult result)
-  {
-    String grammarFile = "";
-    Reader reader1 = null; // Used for the preparse.
-    Reader reader2 = null; // Used for validation parse.
-    
-    if (inputStream != null)
-    {  
-      String string = createStringForInputStream(inputStream);
-      reader1 = new StringReader(string);
-      reader2 = new StringReader(string);
-    } 
-        
-    XMLValidationInfo valinfo = new XMLValidationInfo(uri);
-    MyEntityResolver entityResolver = new MyEntityResolver(uriResolver); 
-    ValidatorHelper helper = new ValidatorHelper(); 
-    try
-    {  
-        helper.computeValidationInformation(uri, reader1, uriResolver);
-        valinfo.setDTDEncountered(helper.isDTDEncountered);
-        valinfo.setElementDeclarationCount(helper.numDTDElements);
-        valinfo.setNamespaceEncountered(helper.isNamespaceEncountered);
-        valinfo.setGrammarEncountered(helper.isGrammarEncountered);
-        
-        XMLReader reader = createXMLReader(valinfo, entityResolver);
-        XMLErrorHandler errorhandler = new XMLErrorHandler(valinfo);
-        reader.setErrorHandler(errorhandler);
-        
-        InputSource inputSource = new InputSource(uri);
-        inputSource.setCharacterStream(reader2);
-        reader.parse(inputSource);   
-        if(configuration.getIntFeature(XMLValidationConfiguration.INDICATE_NO_GRAMMAR) > 0 && 
-        		valinfo.isValid() && !helper.isGrammarEncountered)
-        {
-          if(configuration.getIntFeature(XMLValidationConfiguration.INDICATE_NO_GRAMMAR) == 1)
-            valinfo.addWarning(XMLValidationMessages._WARN_NO_GRAMMAR, 1, 0, uri, NO_GRAMMAR_FOUND, null);
-          else // 2
-              valinfo.addError(XMLValidationMessages._WARN_NO_GRAMMAR, 1, 0, uri, NO_GRAMMAR_FOUND, null);
-        }
-
-        if (helper.isDTDEncountered)
-          grammarFile = entityResolver.getLocation();
-        else
-          grammarFile = helper.schemaLocationString;
-    }
-    catch (SAXParseException saxParseException)
-    {
-      // These errors are caught by the error handler.
-      //addValidationMessage(valinfo, saxParseException);
-    }                 
-    catch (IOException ioException)
-    {
-      addValidationMessage(valinfo, ioException);
-    }                 
-    catch (Exception exception)
-    {  
-    	Logger.logException(exception.getLocalizedMessage(), exception);
-    }
-
-    // Now set up the dependencies
-    // Wrap with try catch so that if something wrong happens, validation can
-    // still proceed as before
-    if (result != null)
-    {
-      try
-      {
-        IResource resource = getWorkspaceFileFromLocation(grammarFile);
-        ArrayList resources = new ArrayList();
-        if (resource != null)
-          resources.add(resource);
-        result.setDependsOn((IResource [])resources.toArray(new IResource [0]));
-      }
-      catch (Exception e)
-      {
-        Logger.logException(e.getLocalizedMessage(), e);
-      }
-    }
-    
-    return valinfo;
-       
-  }
-
-  /**
-   * Add a validation message to the specified list.
-   * 
-   * @param valinfo The validation info object to add the error to.
-   * @param exception The exception that contains the validation information.
-   */
-  protected void addValidationMessage(XMLValidationInfo valinfo, IOException exception)
-  { 
-    String validationMessageStr = exception.getMessage();
-	Throwable cause = exception.getCause() != null ? exception.getCause() : exception;
-	while(validationMessageStr == null && cause != null){
-		String localizedMessage = cause.getLocalizedMessage();
-	    cause = cause.getCause();
-	    if(cause == null && localizedMessage != null )
-	    {
-	      validationMessageStr = localizedMessage;
-	    }
-	}
-	
-	if (validationMessageStr != null)
-    {
-      if (cause instanceof FileNotFoundException)
-      {
-        validationMessageStr = NLS.bind(XMLValidationMessages._UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND, new Object [] { validationMessageStr });
-      }
-      else if (cause instanceof UnknownHostException)
-      {
-    	validationMessageStr = NLS.bind(XMLValidationMessages._UI_PROBLEMS_VALIDATING_UNKNOWN_HOST, new Object [] { validationMessageStr });
-      }
-      else if(cause instanceof ConnectException)
-      {
-    	validationMessageStr = XMLValidationMessages._UI_PROBLEMS_CONNECTION_REFUSED;
-      }
-    }
-
-    if (validationMessageStr != null)
-    {
-      XMLLocator locator = valinfo.getXMLLocator();
-      valinfo.addWarning(validationMessageStr, locator != null ? locator.getLineNumber() : 1, locator != null ? locator.getColumnNumber() : 0, valinfo.getFileURI(), FILE_NOT_FOUND_KEY, null);
-    }
-  }
-                                                                    
-  /**
-   * Add a validation message to the specified list.
-   * 
-   * @param valinfo The validation info object to add the error to.
-   * @param exception The exception that contains the validation information.
-   */
-  protected void addValidationMessage(XMLValidationInfo valinfo, SAXParseException exception)
-  { 
-    if (exception.getMessage() != null)
-    { 
-      valinfo.addError(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), exception.getSystemId());
-    }
-  }
-
-  
-  /**
-   * A custom entity resolver that uses the URI resolver specified to resolve entities.
-   */
-  protected class MyEntityResolver implements XMLEntityResolver 
-  {
-    private URIResolver uriResolver;
-    private String resolvedDTDLocation;
-   
-    /**
-     * Constructor.
-     * 
-     * @param uriResolver The URI resolver to use with this entity resolver.
-     */
-    public MyEntityResolver(URIResolver uriResolver)
-    {
-      this.uriResolver = uriResolver;
-    }
-    
-    /* (non-Javadoc)
-     * @see org.apache.xerces.xni.parser.XMLEntityResolver#resolveEntity(org.apache.xerces.xni.XMLResourceIdentifier)
-     */
-    public XMLInputSource resolveEntity(XMLResourceIdentifier rid) throws XNIException, IOException
-    {
-      try
-      {
-        XMLInputSource inputSource = _internalResolveEntity(uriResolver, rid);
-        if (inputSource != null)
-        {
-          resolvedDTDLocation = inputSource.getSystemId();
-        }
-        return inputSource;
-      }
-      catch(IOException e)
-      {
-        //e.printStackTrace();   
-      }      
-      return null;
-    }
-   
-    public String getLocation()
-    {
-      return resolvedDTDLocation;
-    }
-  }
-  
-  // cs : I've refactored the common SAX based resolution code into this method for use by other validators 
-  // (i.e. XML Schema, WSDL etc).   The other approach is maintain a copy for each validator that has
-  // identical code.  In any case we should strive to ensure that the validators perform resolution consistently. 
-  public static XMLInputSource _internalResolveEntity(URIResolver uriResolver, XMLResourceIdentifier rid) throws  IOException
-  {
-    XMLInputSource is = null;
-    
-    if (uriResolver != null)
-    {         
-      String id = rid.getPublicId();
-      if(id == null)
-      {
-        id = rid.getNamespace();
-      }
-      
-      String location = null;
-      if (id != null || rid.getLiteralSystemId() != null)
-      {  
-        location = uriResolver.resolve(rid.getBaseSystemId(), id, rid.getLiteralSystemId());
-      }  
-      
-      if (location != null)
-      {                     
-        String physical = uriResolver.resolvePhysicalLocation(rid.getBaseSystemId(), id, location);
-        is = new XMLInputSource(rid.getPublicId(), location, location);
-        
-        // This block checks that the file exists. If it doesn't we need to throw
-        // an exception so Xerces will report an error. note: This may not be
-        // necessary with all versions of Xerces but has specifically been 
-        // experienced with the version included in IBM's 1.4.2 JDK.
-        InputStream isTemp = null;
-        try
-        {
-          isTemp = new URL(physical).openStream();
-        }
-        finally
-        {
-          if(isTemp != null)
-          {
-            isTemp.close();
-          }
-        }
-        is.setByteStream(new LazyURLInputStream(physical));      
-      }
-    }
-    return is;    
-  }      
-  
-  /**
-   * An error handler to catch errors encountered while parsing the XML document.
-   */
-  protected class XMLErrorHandler implements org.xml.sax.ErrorHandler
-  {
-
-    private final int ERROR = 0;
-    private final int WARNING = 1;
-    private XMLValidationInfo valinfo;
-    
-    /**
-     * Constructor.
-     * 
-     * @param valinfo The XML validation info object that will hold the validation messages.
-     */
-    public XMLErrorHandler(XMLValidationInfo valinfo)
-    {
-      this.valinfo = valinfo;
-    }
-
-    /**
-     * Add a validation message with the given severity.
-     * 
-     * @param exception The exception that contains the message.
-     * @param severity The severity of the message.
-     */
-    
-    protected void addValidationMessage(SAXParseException exception, int severity)
-    {
-      if(exception.getSystemId() != null)
-      {       	
-    	int lineNumber = exception.getLineNumber();
-    	int columnNumber = exception.getColumnNumber();
-    	
-    	// For the following three errors the line number will be modified to use that of the start
-    	// tag instead of the end tag.
-    	String currentErrorKey = valinfo.currentErrorKey;
-    	if (currentErrorKey != null && adjustLocationErrorKeySet.contains(currentErrorKey))  
-    	{
-    	  LocationCoordinate adjustedCoordinates = (LocationCoordinate)valinfo.getStartElementLocations().peek();
-    	  lineNumber = adjustedCoordinates.getLineNumber();
-    	  columnNumber = adjustedCoordinates.getColumnNumner();
-    	}
-    	
-        if(severity == WARNING)
-        {
-          valinfo.addWarning(exception.getLocalizedMessage(), lineNumber, columnNumber, exception.getSystemId());
-        }
-        else
-        {
-          valinfo.addError(exception.getLocalizedMessage(), lineNumber, columnNumber, exception.getSystemId(), valinfo.getCurrentErrorKey(), valinfo.getMessageArguments());
-        }
-      }
-    }
-
-    /* (non-Javadoc)
-     * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
-     */
-    public void error(SAXParseException exception) throws SAXException
-    {
-      addValidationMessage(exception, ERROR);
-    }
-
-    /* (non-Javadoc)
-     * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
-     */
-    public void fatalError(SAXParseException exception) throws SAXException
-    {
-      addValidationMessage(exception, ERROR);
-    }
-
-    /* (non-Javadoc)
-     * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
-     */
-    public void warning(SAXParseException exception) throws SAXException
-    {
-      addValidationMessage(exception, WARNING);
-    }
-  }
-                                                                          
-  /** 
-   * This class is used to count the elementDecls that are encountered in a DTD.
-   */
-  protected class MyDeclHandler implements DeclHandler 
-  {
-    
-    /**
-     * Constructor.
-     * 
-     * @param valinfo The XMLValidationInfo object that will count the declarations.
-     */
-    public MyDeclHandler()
-    {
-    }
-    
-    /* (non-Javadoc)
-     * @see org.xml.sax.ext.DeclHandler#attributeDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
-     */
-    public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) 
-    {
-    }                                    
-
-    /* (non-Javadoc)
-     * @see org.xml.sax.ext.DeclHandler#elementDecl(java.lang.String, java.lang.String)
-     */
-    public void elementDecl(String name, String model) 
-    {
-      //valinfo.increaseElementDeclarationCount();
-    }
-  
-    /* (non-Javadoc)
-     * @see org.xml.sax.ext.DeclHandler#externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
-     */
-    public void externalEntityDecl(String name, String publicId, String systemId) 
-    {
-    }      
-
-    /* (non-Javadoc)
-     * @see org.xml.sax.ext.DeclHandler#internalEntityDecl(java.lang.String, java.lang.String)
-     */
-    public void internalEntityDecl(String name, String value) 
-    {
-    }
-  }
-
-  /**
-   * A XIncludeAwareParserConfiguration that creates an error reporter which can ignore
-   * DTD error messages for DTD's with no elements defined.
-   */
-
-  protected class MyStandardParserConfiguration extends XIncludeAwareParserConfiguration
-  {
-  	XMLValidationInfo valinfo = null;
-    List reportedExceptions = new ArrayList(); 
-  	
-  	/**
-  	 * Constructor.
-  	 * 
-  	 * @param valinfo The XMLValidationInfo object to use.
-  	 */
-  	public MyStandardParserConfiguration(XMLValidationInfo valinfo)
-  	{
-  	  this.valinfo = valinfo;
-  	  
-  	  XMLErrorReporter errorReporter = createErrorReporter();
-      if (errorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
-          XMLMessageFormatter xmft = new XMLMessageFormatter();
-          errorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
-          errorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
-      }  	  
-      fErrorReporter = errorReporter;
-	  setProperty(ERROR_REPORTER, errorReporter);
-	  fCommonComponents.remove(fErrorReporter);
-	  fCommonComponents.add(fErrorReporter);
-  	}
-
-    /* (non-Javadoc)
-     * @see org.apache.xerces.parsers.DTDConfiguration#createErrorReporter()
-     */
-    protected XMLErrorReporter createErrorReporter() 
-    {
-    	return new XMLErrorReporter()
-		{
-    		/* (non-Javadoc)
-    		 * @see org.apache.xerces.impl.XMLErrorReporter#reportError(java.lang.String, java.lang.String, java.lang.Object[], short)
-    		 */
-    		public void reportError(String domain, String key, Object[] arguments, short severity) throws XNIException 
-    	    {                    
-		      boolean reportError = true;
-              valinfo.setCurrentErrorKey(key);  
-			  valinfo.setMessageArguments(arguments);
-		      String ignoreCondition = (String)ingoredErrorKeyTable.get(key);
-		      if (ignoreCondition != null)
-		      {
-		        if (ignoreCondition.equals(XMLValidator.IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL))
-		        {                    
-		          boolean isDTDWithoutElementDeclarationEncountered = valinfo.isDTDWithoutElementDeclarationEncountered(); 
-		          reportError = !isDTDWithoutElementDeclarationEncountered;  
-		        }
-		        else 
-		        {
-		          reportError = false;
-		        }
-		      }
-		      if ("schema_reference.4".equals(key) && arguments.length > 0) //$NON-NLS-1$
-              {
-                Object location = arguments[0];  
-                if (location != null)
-                {  
-                  if(reportedExceptions.contains(location))
-                  {
-                    reportError = false;
-                  }
-                  else
-                  {
-                    reportedExceptions.add(location);
-                  }
-                }
-              }          
-		      if (reportError)
-		      {
-		        super.reportError(domain, key, arguments, severity);
-		        valinfo.getErrorCustomizationManager().considerReportedError(valinfo, key, arguments);
-		      }
-		    }
-		};
-    }
-  }
-  
-  /** 
-   * A line and column number coordinate.
-   */
-  protected class LocationCoordinate
-  {	
-	private int lineNo = -1;
-    private int columnNo = -1;
-    
-    public LocationCoordinate(int lineNumber, int columnNumber)
-    {
-      this.lineNo = lineNumber;
-      this.columnNo = columnNumber;
-    }
-    	
-    public int getLineNumber()
-    { 
-      return this.lineNo;
-    }
-    	
-    public int getColumnNumner()
-    { 
-      return this.columnNo;
-    } 
-  }
-  
-  protected IResource getWorkspaceFileFromLocation(String location)
-  {
-    if (location == null) return null;
-    IWorkspace workspace = ResourcesPlugin.getWorkspace();
-    // To canonicalize the EMF URI
-    IPath canonicalForm = new Path(location);
-    // Need to convert to absolute location...
-    IPath pathLocation = new Path(URIHelper.removeProtocol(canonicalForm.toString()));
-    // ...to find the resource file that is in the workspace
-    IResource resourceFile = workspace.getRoot().getFileForLocation(pathLocation);
-    // If the resource is resolved to a file from http, or a file outside
-    // the workspace, then we will just ignore it.
-    return resourceFile;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java
deleted file mode 100644
index 9a48579..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.core;
-
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
-
-/**
- * An abstract validator that assists validators in running and contributing
- * nested messages in the validation results. 
- * *note: Subclasses do not need to contribute nested messages in order to
- * benefit from the use of this class. This class takes care of iterating
- * through results for validators that use the standard context.
- */
-public abstract class AbstractNestedValidator extends AbstractValidator implements IValidatorJob 
-{
-  // Locally used, non-UI strings.
-  private static final String REFERENCED_FILE_ERROR_OPEN = "referencedFileError("; //$NON-NLS-1$
-  private static final String REFERENCED_FILE_ERROR_CLOSE = ")"; //$NON-NLS-1$
-  private static final String FILE_PROTOCOL_NO_SLASH = "file:"; //$NON-NLS-1$
-  private static final String FILE_PROTOCOL = "file:///"; //$NON-NLS-1$
-  private final String GET_FILE = "getFile"; //$NON-NLS-1$
-  private final String GET_PROJECT_FILES = "getAllFiles"; //$NON-NLS-1$
-  private final String GET_INPUTSTREAM = "inputStream"; //$NON-NLS-1$
-  
-  // Internal strings. These strings are common addition information types.
-  protected static final String COLUMN_NUMBER_ATTRIBUTE = "columnNumber"; //$NON-NLS-1$
-  protected static final String SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE = "squiggleSelectionStrategy"; //$NON-NLS-1$
-  protected static final String SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE = "squiggleNameOrValue"; //$NON-NLS-1$
-
-  /**
-   * Perform the validation using version 2 of the validation framework.
-   */
-  public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor){
-	  ValidationResult result = new ValidationResult();  
-	  IReporter reporter = result.getReporter(monitor);
-	  NestedValidatorContext nestedcontext = new NestedValidatorContext();
-		setupValidation(nestedcontext);
-		IFile file = null;
-		if (resource instanceof IFile)file = (IFile)resource;
-		if (file != null)validate(file, null, result, reporter, nestedcontext);
-		teardownValidation(nestedcontext);
-	    return result;
-  }
- 
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.validation.internal.provisional.core.IValidatorJob#validateInJob(org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter)
-   */
-  public IStatus validateInJob(IValidationContext context, IReporter reporter) throws ValidationException 
-  {
-	NestedValidatorContext nestedcontext = new NestedValidatorContext();
-	setupValidation(nestedcontext);
-	String[] fileURIs = context.getURIs();
-	if (fileURIs != null && fileURIs.length > 0) 
-	{
-	  int numFiles = fileURIs.length;
-	  for (int i = 0; i < numFiles && !reporter.isCancelled(); i++) 
-	  {
-	    String fileName = fileURIs[i];
-	    if (fileName != null)
-	    {          
-	      Object []parms = {fileName};
-
-	      IFile file = (IFile) context.loadModel(GET_FILE, parms);
-	      if (file != null && shouldValidate(file)) 
-	      { 
-	    	// The helper may not have a file stored in it but may have an InputStream if being
-	    	// called from a source other than the validation framework such as an editor.
-	        if (context.loadModel(GET_INPUTSTREAM) instanceof InputStream) //$NON-NLS-1$
-	        {
-	          validate(file, (InputStream)context.loadModel(GET_INPUTSTREAM), null, reporter, nestedcontext); //do we need the fileName?  what is int ruleGroup? //$NON-NLS-1$
-	        }
-	        else
-	        {
-	    	  validate(file, null, null, reporter, nestedcontext);
-	        }
-	      }
-	    }
-	  }
-	}
-	// TODO: Is this needed? Shouldn't the framework pass the complete list? 
-	// Should I know that I'm validating a project as opposed to files?
-	else 
-    {
-      Object []parms = {getValidatorID()};
-      Collection files = (Collection) context.loadModel(GET_PROJECT_FILES, parms);
-      Iterator iter = files.iterator();
-      while (iter.hasNext() && !reporter.isCancelled()) 
-      {
-        IFile file = (IFile) iter.next();
-        if(shouldValidate(file))
-        {
-	      validate(file, null, null, reporter, nestedcontext);
-        }
-      }
-    }
-	
-	teardownValidation(nestedcontext);
-	if(reporter.isCancelled())
-	  return Status.CANCEL_STATUS;
-    return Status.OK_STATUS;
-  }
-  
-  /**
-   * Provides the id of this validator. The ID is used by the validation
-   * framework. It usually is the fully qualified class name of the class
-   * implementing the IValidator interface.
-   * 
-   * @return a String with the ID of this validator.
-   */
-  protected String getValidatorID()
-  {
-    return this.getClass().getName();
-  }
-  
-  /**
-   * Perform set up before validation runs. Subclasses may implement this
-   * method to perform validation specific set up.
-   * 
-   * @param context
-   * 		The context of the current validation.
-   */
-  protected void setupValidation(NestedValidatorContext context)
-  {
-	// Default implementation does nothing.
-  }
-  
-  /**
-   * Perform tear down after validation runs. Subclasses may implement this
-   * method to perform validation specific tear down.
-   * 
-   * @param context
-   * 		The context of the current validation.
-   */
-  protected void teardownValidation(NestedValidatorContext context)
-  {
-	// Default implementation does nothing.
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.validation.internal.provisional.core.IValidatorJob#getSchedulingRule(org.eclipse.wst.validation.internal.provisional.core.IValidationContext)
-   */
-  public ISchedulingRule getSchedulingRule(IValidationContext arg0) 
-  {
-	// TODO review whether returning a null rule is correct. Gary had a suggestion in the bug report.
-	return null;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.validation.internal.provisional.core.IValidator#cleanup(org.eclipse.wst.validation.internal.provisional.core.IReporter)
-   */
-  public void cleanup(IReporter arg0) 
-  {
-    // No cleanup to perform. Subclasses are free to implement this method.
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.validation.internal.provisional.core.IValidator#validate(org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter)
-   */
-  public void validate(IValidationContext context, IReporter reporter) throws ValidationException 
-  {  
-	validateInJob(context, reporter);
-  }
-	
-	
-  /**
-   * Determine if a given file should be validated. 
-   * 
-   * @param file The file that may be validated.
-   * @return True if the file should be validated, false otherwise.
-   */
-  private static boolean shouldValidate(IFile file) 
-  {
-	IResource resource = file;
-	do 
-	{
-	  if (resource.isDerived() || resource.isTeamPrivateMember() || 
-		  !resource.isAccessible() || resource.getName().charAt(0) == '.') 
-	  {
-		return false;
-	  }
-	  resource = resource.getParent();
-	}while ((resource.getType() & IResource.PROJECT) == 0);
-	
-	return true;
-  }
-  
-  /**
-   * Validate the given file and use the reporter for the validation messages.
-   * This method does not perform the validation logic but rather delegates
-   * to the validate method in subclasses to validate. This method is responsible
-   * for reporting the messages that result from validation.
-   * 
-   * @param file 
-   * 		An IFile to validate.
-   * @param inputstream 
-   * 		An InputStream that represents the file. The InputStream may be null
-   * 		in which case the files should be validated from the IFile.
-   * @param result - The validation result
-   * @param reporter 
-   * 		The reporter with which to report validation messages.
-   * @param context
-   * 		The context of the current validation.
-   */
-  private void validate(IFile file, InputStream inputstream, ValidationResult result, IReporter reporter, NestedValidatorContext context)
-  {  
-	Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, file.getFullPath().toString());
-    reporter.displaySubtask(this, message);
-    
-	String locationString = null;		
-	if (file.getLocation() != null) {
-		locationString = file.getLocation().toString();
-	}
-	if (locationString == null && file.getLocationURI() != null) {
-		locationString = file.getLocationURI().toString();
-	}
-	if (locationString == null) {
-		locationString = file.getFullPath().toString();
-	}
-	String uri = createURIForFilePath(locationString);
-
-	clearMarkers(file, this, reporter);
-	
-	ValidationReport valreport = null;
-	if (result == null)
-	  valreport = validate(uri, inputstream, context);
-	else
-	  valreport = validate(uri, inputstream, context, result);
-	
-	createMarkers(file, valreport.getValidationMessages(), reporter);
-	        
-	try
-	{
-	  file.setSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME, valreport.getNestedMessages());
-	}
-	catch(CoreException e)
-	{
-	  System.out.println("Unable to set nested messages property."); //$NON-NLS-1$
-	}
-  }
-	
-  /**
-   * Validate the given file and use the reporter for the validation messages.
-   * Clients must implement this method with their specific validation logic.
-   * 
-   * @param uri
-   * 		The URI of the file to validate.
-   * @param inputstream 
-   * 		An InputStream that represents the file. The InputStream may be null
-   * 		in which case the files should be validated from the IFile.
-   * @param context
-   * 		The context of the current validation.
-   * @return
-   * 		A validation report summarizing the validation.
-   */
-  public abstract ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context);
-  
-  /**
-   * Validate the given file and use the reporter for the validation messages.
-   * Clients should override this method with their specific validation logic.
-   * This method should now be used instead of the abstract version.
-   * Design decision to not make this abstract.
-   * 
-   * @param uri
-   * @param inputstream
-   * @param context
-   * @param result
-   * @return
-   */
-  public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context, ValidationResult result)
-  {
-    return validate(uri, inputstream, context);
-  }
-
-  /**
-   * This method clears all the markers on the given IFile for a specified
-   * validator.
-   * This is a convenience method for subclasses.
-   * 
-   * @param iFile
-   * 		The IFile from which to clear the markers.
-   * @param validator
-   * 		The validator for which to remove the markers.
-   * @param reporter
-   * 		The reporter that can remove the markers.
-   */
-  private void clearMarkers(IFile iFile, IValidator validator, IReporter reporter)
-  {
-	if (fileIsAccessible(iFile))
-	{
-	  reporter.removeAllMessages(validator, iFile);
-	}
-  }
-	  
-  /**
-   * Test whether the given file is accessible and may be used for validation. A file is 
-   * available if 
-   * 1. It is not null.
-   * 2. It exists. 
-   * 3. The project containing the file is accessible.
-   * 
-   * @param file 
-   * 		The file to check to ensure it is accessible.
-   * @return 
-   * 		True if the file is accessible, false otherwise.
-   */
-  private boolean fileIsAccessible(IFile file)
-  {
-    if (file != null && file.exists() && file.getProject().isAccessible())
-	{
-	  return true;
-	}
-	return false;
-  }
-	  
-  /**
-   * Format a file name into a correct URI. 
-   * This is a convenience method for subclasses.
-   * 
-   * @param filename 
-   * 		The file name to format.
-   * @return 
-   * 		
-   * The formatted URI.
-   */
-  private String createURIForFilePath(String filename)
-  {
-	if(!filename.startsWith(FILE_PROTOCOL_NO_SLASH))
-	{
-	  while(filename.startsWith("/")) //$NON-NLS-1$
-	  {
-	    filename = filename.substring(1);
-	  }
-	  filename = FILE_PROTOCOL + filename;
-	}
-	return filename;
-  }
-	  
-  /**
-   * Create markers for the valiation messages generated from the validation.
-   * 
-   * @param iFile
-   *          The resource to create the markers on.
-   * @param valmessages
-   *          The array of validation messages.
-   */
-  public void createMarkers(IFile iFile, ValidationMessage[] valmessages, IReporter reporter)
-  {
-    if (!fileIsAccessible(iFile))
-    {
-      return;
-    }
-    int nummessages = valmessages.length;
-    for (int i = 0; i < nummessages; i++)
-    {
-      ValidationMessage validationMessage = valmessages[i];
-      String uri = validationMessage.getUri();
-
-      LocalizedMessage message;
-      if (validationMessage.getSeverity() == ValidationMessage.SEV_LOW)
-      {
-        message = new LocalizedMessage(IMessage.NORMAL_SEVERITY, 
-        		validationMessage.getMessage(), iFile);
-      }
-      else
-      { 
-        message = new LocalizedMessage(IMessage.HIGH_SEVERITY, validationMessage.getMessage(), iFile);
-      }
-      
-      message.setLineNo(validationMessage.getLineNumber());
-      addInfoToMessage(validationMessage, message);
-      
-      List nestederrors = validationMessage.getNestedMessages();
-      if (nestederrors != null && !nestederrors.isEmpty())
-      {
-        message.setGroupName(REFERENCED_FILE_ERROR_OPEN + uri + REFERENCED_FILE_ERROR_CLOSE);
-      }
-
-      reporter.addMessage(this, message);
-	      
-    }
-  }
-	  
-  /**
-   * This method allows the addition of information to the validation message
-   * @param validationmessage
-   * 		The ValidationMessage to retrieve the information from.
-   * @param message
-   * 		The IMessage to add the information to.
-   */
-  protected void addInfoToMessage (ValidationMessage validationmessage, IMessage message)
-  { 
-	// This method may be overidden by subclasses
-  }
-	  
-  /**
-   * A localized message is a specialized type of IMessage that allows setting
-   * and using a localized message string for a message.
-   */
-  class LocalizedMessage extends Message 
-  {
-    private String _message = null;
-
-	public LocalizedMessage(int severity, String messageText) 
-	{
-	  this(severity, messageText, null);
-	}
-
-	public LocalizedMessage(int severity, String messageText, IResource targetObject) 
-	{
-	  this(severity, messageText, (Object) targetObject);
-	}
-
-	public LocalizedMessage(int severity, String messageText, Object targetObject) 
-	{
-	  super(null, severity, null);
-	  setLocalizedMessage(messageText);
-	  setTargetObject(targetObject);
-	}
-
-	public void setLocalizedMessage(String message) 
-	{
-	  _message = message;
-	}
-
-	public String getLocalizedMessage() 
-	{
-	  return _message;
-	}
-
-	public String getText() 
-	{
-	  return getLocalizedMessage();
-	}
-
-	public String getText(ClassLoader cl) 
-	{
-	  return getLocalizedMessage();
-	}
-
-	public String getText(Locale l) 
-	{
-	  return getLocalizedMessage();
-	}
-
-	public String getText(Locale l, ClassLoader cl) 
-	{
-	  return getLocalizedMessage();
-	}
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/Helper.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/Helper.java
deleted file mode 100644
index d9497af..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/Helper.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.core;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.validation.internal.operations.ValidatorManager;
-import org.eclipse.wst.validation.internal.operations.WorkbenchContext;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-/**
- * A helper class for validation in the validation framework.
- * 
- * @author Ernest Mah (ernest@ca.ibm.com)
- * @author Lawrence Mandel, IBM
- */
-public class Helper extends WorkbenchContext
-{
-  public static final String GET_PROJECT_FILES = "getAllFiles"; //$NON-NLS-1$
-  public static final String GET_FILE = "getFile"; //$NON-NLS-1$
-  //dw private static final IContainer[] NO_CONTAINERS = new IContainer[0];
-  public static final String VALIDATION_MARKER = "org.eclipse.wst.validation.problemmarker"; //$NON-NLS-1$
-  public static final String VALIDATION_MARKER_OWNER = "owner";   //$NON-NLS-1$
-
-  /**
-   * Constructor.
-   */
-  public Helper()
-  {
-    super();
-
-    // the following will register the helper's symbolic methods
-    Class [] args = new Class[1] ;
-    args[0] = String.class ;  // a string argument denoting a specific JSP.
-    
-    registerModel(GET_FILE, "getFile", args);//$NON-NLS-1$
-    registerModel(GET_PROJECT_FILES, "getFiles", args);//$NON-NLS-1$
-  }
-
-  /**
-   * Get the IFile for the given filename.
-   * 
-   * @param filename The name of the file to retrieve.
-   * @return An IFile representing the file specified or null if it can't be resolved.
-   */
-  public IFile getFile(String filename)
-  {
-    //    System.out.println("file name = " + filename);
-    IResource res = getProject().findMember(filename, true); // true means include phantom resources
-    if (res instanceof IFile) 
-    {
-      return (IFile) res;
-    }
-    return null;
-  }
-  
-  /**
-   * Get the collection of files from the project that are relevant for the
-   * validator with the given class name.
-   * 
-   * @param validatorClassName The name of the validator class.
-   * @return The collection of files relevant for the validator class specified.
-   */
-  public Collection getFiles(String validatorClassName)
-  {
-    IProject project = getProject();
-    List files = new ArrayList();
-    getFiles(files, project, validatorClassName);
-    return files;
-  }
-
-  /**
-   * Get the collection of files from the project that are relevant for the
-   * validator with the given class name.
-   * 
-   * @param files The files relevant for the class name.
-   * @param resource The resource to look for files in.
-   * @param validatorClassName The name of the validator class.
-   */
-  protected void getFiles(Collection files, IContainer resource, String validatorClassName)
-  {
-    try
-    {
-      IResource [] resourceArray = resource.members(false);
-      for (int i=0; i<resourceArray.length; i++)
-      {       
-        if (ValidatorManager.getManager().isApplicableTo(validatorClassName, resourceArray[i])) 
-        {
-          if (resourceArray[i] instanceof IFile) 
-          {
-            files.add(resourceArray[i]);
-          }
-        }
-        if (resourceArray[i].getType() == IResource.FOLDER)
-         getFiles(files,(IContainer)resourceArray[i], validatorClassName) ;
-      }
-    }
-    catch (Exception e) {}
-  }
-
-  
-/**
- * Return the name of the resource, without the project-specific information 
- * in front.
- *
- * This method is used by ValidationOperation to calculate the non-environment 
- * specific names of the files. Only the IWorkbenchContext implementation knows how 
- * much information to strip off of the IResource name. For example, if there is
- * an EJB Project named "MyEJBProject", and it uses the default names for the 
- * source and output folders, "source" and "ejbModule", respectively, then the
- * current implementation of EJB Helper knows how much of that structure is 
- * eclipse-specific. 
- *
- * Since the "source" folder contains Java source files, a portable name would
- * be the fully-qualified name of the Java class, without the eclipse-specific
- * project and folder names in front of the file name. The EJBHelper knows that 
- * everything up to the "source" folder, for example, can be removed, because, 
- * according to the definition of the EJB Project, everything contained
- * in the source folder is java source code. So if there is an IResource in an
- * EJB Project named "/MyEJBProject/source/com/ibm/myclasses/MyJavaFile.java",
- * this method would make this name portable by stripping off the
- * "/MyEJBProject/source", and returning "com/ibm/myclasses/MyJavaFile.java".
- *
- * The output of this method is used by the ValidationOperation, when it
- * is calculating the list of added/changed/deleted file names for incremental
- * validation. If getPortableName(IResource) returns null, that means
- * that the IWorkbenchContext's implementation does not support that particular
- * type of resource, and the resource should not be included in the array of
- * IFileDelta objects in the IValidator's "validate" method. 
- * 
- * @param resource The resource to get the name from.
- * @return The portable name of the resource.
- */
-public String getPortableName(IResource resource)
-  {
-    //    System.out.println("get portablename for " + resource);
-    return resource.getProjectRelativePath().toString();
-  }
-
-/**
- * When an IValidator associates a target object with an IMessage,
- * the WorkbenchReporter eventually resolves that target object
- * with an IResource. Sometimes more than one target object resolves
- * to the same IResource (usually the IProject, which is the default
- * IResource when an IFile cannot be found). This method is called,
- * by the WorkbenchReporter, so that the WorkbenchReporter can 
- * distinguish between the IMessages which are on the same IResource, 
- * but refer to different target objects. This is needed for the 
- * removeAllMessages(IValidator, Object) method, so that when one
- * target object removes all of its messages, that it doesn't remove
- * another target object's messages.
- *
- * This method may return null only if object is null. Otherwise, an
- * id which can uniquely identify a particular object must be returned.
- * The id needs to be unique only within one particular IValidator.
- * 
- * @param object The object from which to get the name.
- * @return The name of the object or null if the object is null.
- */
-public String getTargetObjectName(Object object)
-  {
-    if (object == null) 
-    {
-      return null;
-    }
-    
-    //    System.out.println("get targetname for " + object);
-    return object.toString();
-  }
-  
-  /**
-   * Delete the markers of the specified type from the specified resource.
-   * 
-   * @param resource The resource to delete the markers from.
-   * @param markerType The type of markers to delete from the resource.
-   * @param attributeName The name of the attribute which the markers must have to be deleted.
-   * @param attributeValue The value of the attribute corresponding to attributeName which the markers must have to be deleted.
-   * @throws CoreException
-   */
-  public static void deleteMarkers(IResource resource, String markerType, final String attributeName, final Object attributeValue) throws CoreException
-  {          
-    final IMarker[] v400Markers = resource.findMarkers(IMarker.PROBLEM, false, IResource.DEPTH_INFINITE);
-    final IMarker[] markers = resource.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
-    IWorkspaceRunnable op = new IWorkspaceRunnable() 
-     {
-       public void run(IProgressMonitor progressMonitor) throws CoreException 
-       {    
-         // this fixes defect 193406
-         // here we remove markers that may have been added by the v400 code
-         // hopefully the '.markers' metadata files will be removed for the V5 install
-         // and this kludge will not be needed there
-         for (int i = 0; i < v400Markers.length; i++)
-         {
-           IMarker marker = markers[i];           
-           marker.delete();           
-         }
-    
-         for (int i = 0; i < markers.length; i++) 
-         {
-           IMarker marker = markers[i];
-           
-           Object value = marker.getAttribute(attributeName);
-           if (value != null &&
-               value.equals(attributeValue)) 
-           {
-             marker.delete();
-           }
-         }
-       }
-     };
-    
-    try
-    {
-      ResourcesPlugin.getWorkspace().run(op, null);
-    }
-    catch (Exception e) { }
-  }
-  
-  /**
-   * Get the validation framework severity for the given severity.
-   * 
-   * @param severity The severity to convert to validation framework severity.
-   * @return The validation framework severity for the given severity.
-   */
-  static public int getValidationFrameworkSeverity(int severity)
-  {
-    switch (severity)
-    {
-      case IMarker.SEVERITY_ERROR:
-        return IMessage.HIGH_SEVERITY;
-      case IMarker.SEVERITY_WARNING:
-        return IMessage.NORMAL_SEVERITY;
-      case IMarker.SEVERITY_INFO:
-        return IMessage.LOW_SEVERITY;
-    }
-    return IMessage.LOW_SEVERITY;  
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/LazyURLInputStream.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/LazyURLInputStream.java
deleted file mode 100644
index 834cb0b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/LazyURLInputStream.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.core;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-
-/**
- * This class allows InputStreams to be created and returned to xerces without
- * actually opening file handles or network connections until it is absolutely
- * neccessary.
- */
-public class LazyURLInputStream extends InputStream
-{  
-  private static int debugTotalOpenStreamCount = 0; 
-  protected InputStream inner;
-  protected String url;
-  protected boolean error;
-  boolean hasMarks;
-  boolean pretendFileIsStillOpen;
-
-  public LazyURLInputStream(String url)
-  {
-    this.url = url;
-	inner = null;
-	pretendFileIsStillOpen = false;
-  }
-
-  private void createInnerStreamIfRequired() throws IOException
-  {
-    if (inner == null && !error)
-    {
-      debugTotalOpenStreamCount++;
-    
-      try
-      {
-        inner = new URL(url).openStream();
-		pretendFileIsStillOpen = false;
-		hasMarks = false;
-      }
-      finally 
-      {
-        if (inner == null)
-        {  
-          error = true;
-        }
-      }
-    }
-  }
-
-	protected void closeStream() throws IOException {
-		if (inner != null && !pretendFileIsStillOpen) {
-			inner.close();
-			pretendFileIsStillOpen = true;
-		}
-  	}
-
-  public int available() throws IOException
-  {
-	if (pretendFileIsStillOpen) return 0;
-	createInnerStreamIfRequired();
-	if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
-	return inner.available();
-  }
-
-  public void close() throws IOException
-  {
-	if (pretendFileIsStillOpen) {
-		// Stop behaving as if the stream were still open.
-		pretendFileIsStillOpen = false;
-	} else {
-		if (inner != null) {
-			debugTotalOpenStreamCount--;
-			inner.close();
-		}
-	}
-  }
-
-  public void mark(int readlimit)
-  {
-	if (pretendFileIsStillOpen) return;
-	hasMarks = true;
-	try {
-		createInnerStreamIfRequired();
-		inner.mark(readlimit);
-	} catch (IOException e) {
-		// TODO Auto-generated catch block
-		e.printStackTrace();
-	}
-  }
-
-  public boolean markSupported()
-  {
-	if (pretendFileIsStillOpen) return false;
-	try {
-		createInnerStreamIfRequired();
-		if (inner == null) return false;
-		return inner.markSupported();
-	} catch (IOException e) {
-		// TODO Auto-generated catch block
-		e.printStackTrace();
-	}
-	return false;
-  }
-
-  public int read() throws IOException
-  {
-	if (pretendFileIsStillOpen) return -1;
-	createInnerStreamIfRequired();
-	if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
-	int bytesRead = inner.read();
-	if (bytesRead == -1 && !hasMarks) closeStream();
-	return bytesRead;
-  }
-
-
-	public int read(byte[] b) throws IOException {
-		if (pretendFileIsStillOpen) return -1;
-		createInnerStreamIfRequired();
-		if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
-		int bytesRead = inner.read(b);
-		if (bytesRead == -1 && !hasMarks) closeStream();
-		return bytesRead;
-	}
-
-  public int read(byte[] b, int off, int len) throws IOException
-  {    
-	if (pretendFileIsStillOpen) return -1;
-	createInnerStreamIfRequired();
-	if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
-	int bytesRead = inner.read(b, off, len);
-	if (bytesRead == -1 && !hasMarks) closeStream();
-	return bytesRead;
-  }
-
-  public void reset() throws IOException
-  {
-	if (pretendFileIsStillOpen) return;
-	createInnerStreamIfRequired();
-	if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
-	inner.reset();
-  }
-
-  public long skip(long n) throws IOException
-  {   
-	if (pretendFileIsStillOpen) return 0;
-	createInnerStreamIfRequired();
-	if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
-	return inner.skip(n);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/NestedValidatorContext.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/NestedValidatorContext.java
deleted file mode 100644
index 3c2710a..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/NestedValidatorContext.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.core;
-
-
-/**
- * A context class for validators to be able to determine the context of
- * given validation session. Currently this class is only used to identify
- * the unique context.
- */
-public class NestedValidatorContext 
-{
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java
deleted file mode 100644
index fa2e1a5..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation.core;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.xml.core.internal.validation.XMLValidationMessages;
-
-/**
- * This class handles messages from a validator. This class can handle
- * 
- * @author Lawrence Mandel, IBM
- */
-public class ValidationInfo implements ValidationReport
-{
-  private boolean WRAPPER_ERROR_SUPPORT_ENABLED = true;
-  public static int SEV_ERROR = 0;
-  public static int SEV_WARNING = 1;
-  
-  private String validating_file_uri = null;
-  private URL validating_file_url = null;
-  private boolean valid = true;
-  private List messages = new ArrayList();
-  private HashMap nestedMessages = new HashMap();
-
-  /**
-   * Constructor.
-   * 
-   * @param uri
-   *            The URI of the file for the validation.
-   */
-  public ValidationInfo(String uri)
-  {
-    if(uri != null)
-    {
-      this.validating_file_uri = uri;
-      try
-      {
-        this.validating_file_url = new URL(uri);
-      } catch (MalformedURLException e)
-      {
-      }
-    }
-  }
-
-  public String getFileURI()
-  {
-    return validating_file_uri;
-  }
-
-  public boolean isValid()
-  {
-    return valid;
-  }
-
-  /**
-   * Add an error message.
-   * 
-   * @param message The message to add.
-   * @param line The line location of the message.
-   * @param column The column location of the message.
-   * @param uri The URI of the file that contains the message.
-   */
-  public void addError(String message, int line, int column, String uri)
-  {
-    addError(message, line, column, uri, null, null);
-  }  
-  
-  /**
-   * 
-   * Add an error message.
-   * 
-   * @param message The message to add.
-   * @param line The line location of the message.
-   * @param column The column location of the message.
-   * @param uri The URI of the file that contains the message.
-   * @param key The key for the message.
-   * @param messageArguments more information about the error
-   */
-  public void addError(String message, int line, int column, String uri, String key, Object[] messageArguments)
-  {    
-    if(addMessage(message, line, column, uri, SEV_ERROR, key, messageArguments))
-    {
-      valid = false;
-    }
-  }
-
-  /**
-   * Add a warning message.
-   * 
-   * @param message The string message of the warning.
-   * @param line The line location of the warning.
-   * @param column The column location of the warning.
-   * @param uri The URI of the file that contains the warning.
-   */
-  public void addWarning(String message, int line, int column, String uri)
-  {
-    addWarning(message, line, column, uri, null, null);
-  }
-  
-  /**
-   * 
-   * Add an error message.
-   * 
-   * @param message The message to add.
-   * @param line The line location of the message.
-   * @param column The column location of the message.
-   * @param uri The URI of the file that contains the message.
-   * @param key The key for the message.
-   * @param messageArguments more information about the error
-   */
-  public void addWarning(String message, int line, int column, String uri, String key, Object[] messageArguments)
-  {    
-    addMessage(message, line, column, uri, SEV_WARNING, key, messageArguments);
-  }
-  
-  /**
-   * Add a message to the list. Return true if successful, false otherwise.
-   * 
-   * @param message The message to add to the list.
-   * @param line The line location of the message.
-   * @param column The column location of the message.
-   * @param uri The URI of the file that contains the message.
-   * @param severity The severity of the message.
-   * @param key the Xerces error key for this error
-   * @param messageArguments more information on the error
-   * @return True if the message was successfully added, false otherwise.
-   */
-  private boolean addMessage(String message, int line, int column, String uri, int severity, String key, Object[] messageArguments)
-  {
-    boolean successfullyAdded = false;
-    // If the message if null there is nothing to add.
-    if(message == null)
-    {
-      return successfullyAdded;
-    }
-    String errorURI = normalize(uri);
-    URL errorURL = null;
-    if (errorURI != null)
-    {
-      try
-      {
-        errorURL = new URL(errorURI);
-      } catch (MalformedURLException e)
-      {
-      }
-      //errorURI = normalizeURI(errorURI);
-    }
-    //boolean doDialog = true;
-    if (errorURL != null)
-    {
-      successfullyAdded = true;
-      // Add to the appropriate list if nested error support is off or
-      // this message is for the current file.
-      if (!WRAPPER_ERROR_SUPPORT_ENABLED || validating_file_url.sameFile(errorURL))
-      {
-
-        ValidationMessage valmes = new ValidationMessage(message, line,
-            column, validating_file_uri, key, messageArguments);
-        if (severity == SEV_ERROR)
-        {
-          valmes.setSeverity(ValidationMessage.SEV_NORMAL);
-        } else if (severity == SEV_WARNING)
-        {
-          valmes.setSeverity(ValidationMessage.SEV_LOW);
-        }
-        messages.add(valmes);
-      }
-      // If nested error support is enabled create a nested error.
-      else if (WRAPPER_ERROR_SUPPORT_ENABLED)
-      {
-        String nesteduri = errorURL.toExternalForm();
-        ValidationMessage nestedmess = new ValidationMessage(message, line,
-            column, nesteduri, key, messageArguments);
-        if(severity == SEV_WARNING)
-        {
-          nestedmess.setSeverity(ValidationMessage.SEV_LOW);
-        }
-        else
-        {
-          nestedmess.setSeverity(ValidationMessage.SEV_NORMAL);
-        }
-
-        ValidationMessage container = (ValidationMessage) nestedMessages.get(nesteduri);
-        if(container == null)
-        {
-          container = new ValidationMessage(NLS.bind(XMLValidationMessages._UI_REF_FILE_ERROR_MESSAGE, new Object [] { nesteduri }), 1, 0, nesteduri);
-       
-          // Initially set the nested error to a warning. This will automatically be changed
-          // to an error if a nested message has a severity of error.
-          container.setSeverity(ValidationMessage.SEV_LOW);
-          nestedMessages.put(nesteduri, container);
-          messages.add(container);
-        }
-        container.addNestedMessage(nestedmess);
-      }
-    }
-    return successfullyAdded;
-  }
-  
-  
-  /**
-   * Add a nested message to the validation information.
-   * 
-   * @param message The string message of the validation message.
-   * @param line The line location of the validation message.
-   * @param column The column location of the validation message.
-   * @param uri The URI of the validation message.
-   * @param severity The severity of the validation message.
-   */
-//  public void addNestedMessage(String message, int line, int column, String uri, int severity)
-//  {
-//    ValidationMessage nestedmess = new ValidationMessage(message, line, column, uri);
-//    if(severity == SEV_WARNING)
-//    {
-//      nestedmess.setSeverity(ValidationMessage.SEV_LOW);
-//    }
-//    else
-//    {
-//      nestedmess.setSeverity(ValidationMessage.SEV_NORMAL);
-//    }
-//    ValidationMessage container = (ValidationMessage)nestedMessages.get(uri);
-//    if(container == null)
-//    {
-//      container = new ValidationMessage(XMLCoreValidationPlugin.getResourceString(_UI_REF_FILE_ERROR_MESSAGE, uri), 1, 0, validating_file_uri);
-//      // Initially set the nested error to a warning. This will automatically be changed
-//      // to an error if a nested message has a severity of error.
-//      container.setSeverity(ValidationMessage.SEV_LOW);
-//      nestedMessages.put(uri, container);
-//      messages.add(container);
-//    }
-//    container.addNestedMessage(nestedmess);
-//  }
-
-  /**
-   * @see org.eclipse.wsdl.validate.ValidationReport#getValidationMessages()
-   */
-  public ValidationMessage[] getValidationMessages()
-  {
-    return (ValidationMessage[])messages.toArray(new ValidationMessage[messages.size()]);
-  }
-
-  public HashMap getNestedMessages()
-  {
-    return nestedMessages;
-  }
-  
-  /**
-   * Put the URI in a standard format.
-   * 
-   * @param uri The URI to put into a standard format.
-   * @return The standard format of the URI.
-   */
-  private String normalize(String uri)
-  {
-//    if(uri.startsWith("platform:"))
-//    {
-//      try
-//      {
-//        uri = Platform.resolve(new URL(uri)).toString();
-//      }
-//      catch(Exception e)
-//      {
-//      }
-//    }
-    uri = uri.replaceAll("%20"," "); //$NON-NLS-1$ //$NON-NLS-2$
-    uri = uri.replaceAll("%5E", "^"); //$NON-NLS-1$ //$NON-NLS-2$
-    uri = uri.replace('\\','/');
-    
-    return uri;
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java
deleted file mode 100644
index 5e1dcf7..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.core;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * A class for holding validation message information. Holds the message and the
- * message location.
- */
-public class ValidationMessage
-{
-  public static final QualifiedName ERROR_MESSAGE_MAP_QUALIFIED_NAME = new QualifiedName("org.eclipse.wst.xml.validation", "errorMessageMap"); //$NON-NLS-1$ //$NON-NLS-2$
-  protected String message;
-  protected int lineNumber;
-  protected int columnNumber;
-  protected String uri;
-  protected List nestedErrors;
-  protected String key;
-  protected Object[] messageArguments;
-  protected int startOffset;
-  protected int severity = IMessage.NORMAL_SEVERITY;
-  public static int SEV_HIGH = IMessage.HIGH_SEVERITY;
-  public static int SEV_NORMAL = IMessage.NORMAL_SEVERITY;
-  public static int SEV_LOW = IMessage.LOW_SEVERITY;
-
-  /**
-   * Constructor.
-   * 
-   * @param message The message for the validation message.
-   * @param lineNumber The line location of the message.
-   * @param columnNumber The column location of the message.
-   */
-  public ValidationMessage(String message, int lineNumber, int columnNumber)
-  {
-    this(message, lineNumber, columnNumber, null);
-  }
-
-  /** 
-   * Constructor.
-   * 
-   * @param message The message for the validation message.
-   * @param lineNumber The line location of the message.
-   * @param columnNumber The column location of the message.
-   * @param uri The uri of the file the message is for.
-   */
-   public ValidationMessage(String message, int lineNumber, int columnNumber, String uri)
-  {
-     this(message, lineNumber, columnNumber, uri, null, null);
-  }
-   
-   /** 
-    * Constructor.
-    * 
-    * @param message The message for the validation message.
-    * @param lineNumber The line location of the message.
-    * @param columnNumber The column location of the message.
-    * @param uri The uri of the file the message is for.
-    * @param key a unique string representing the error
-    * @param messageArguments the arguments Xerces uses to create the message
-    */
-    public ValidationMessage(String message, int lineNumber, int columnNumber, String uri, String key, Object[] messageArguments)
-   {
-     this.message = message;
-     this.lineNumber = lineNumber;
-     this.columnNumber = columnNumber;
-     this.uri = uri;
-     this.key = key;
-	 this.messageArguments = messageArguments;
-     this.startOffset = 0;    
-   }
-   
-
-  /**
-   * Get the message for this valiation message.
-   * 
-   * @return The message for this validation message.
-   */
-  public String getMessage()
-  {
-    return message;
-  }
-
-  /**
-   * Get the column location.
-   * 
-   * @return The column number.
-   */
-  public int getColumnNumber()
-  {
-    return columnNumber;
-  }
-
-  /**
-   * Get the line location.
-   * 
-   * @return The line number.
-   */
-  public int getLineNumber()
-  {
-    return lineNumber;
-  }
-
-  /**
-   * Get the uri for the file that contains the message.
-   * 
-   * @return The uri of the file that contains the message.
-   */
-  public String getUri()
-  {
-    return uri;
-  }
-  
-  /**
-   * Add a nested validation message to this validation message.
-   * 
-   * @param validationMessage The validation message to add as a nested message.
-   */
-  public void addNestedMessage(ValidationMessage validationMessage)
-  {
-    if (nestedErrors == null)
-    {
-      nestedErrors = new ArrayList();
-    }
-    nestedErrors.add(validationMessage);
-    int validaitonmessageSeverity = validationMessage.getSeverity();
-    if(validaitonmessageSeverity == SEV_NORMAL || validaitonmessageSeverity == SEV_HIGH)
-    {
-      setSeverity(SEV_NORMAL);
-    }
-  }
-
-  /**
-   * Get the list of nested validation messages.
-   * 
-   * @return The list of nested validation messages.
-   */
-  public List getNestedMessages()
-  {
-    return nestedErrors != null ? nestedErrors : Collections.EMPTY_LIST;
-  }
-  
-  /**
-   * Get the severity of the defect.
-   * 
-   * @return The severity of the defect.
-   */
-  public int getSeverity()
-  {
-  	return severity;
-  }
-  
-  /**
-   * Set the severity of the message.
-   * 
-   * @param sev The severity to set.
-   */
-  public void setSeverity(int sev)
-  {
-  	severity = sev;
-  }
-  
-  public void setStartOffset(int offset)
-  {
-    this.startOffset = offset;
-  }
-  
-  /**
-   * @return Returns the key.
-   */
-  public String getKey()
-  {
-    return key;
-  }
-  
-  public Object[] getMessageArguments()
-  {
-	  return this.messageArguments;
-  }
-  
-
-  public void setMessage(String message)
-  {
-    this.message = message;
-  }  
-                                     
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationReport.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationReport.java
deleted file mode 100644
index dbb1570..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationReport.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation.core;
-
-import java.util.HashMap;
-
-/**
- * An interface for a validation report.
- * 
- * @author Lawrence Mandel, IBM
- */
-public interface ValidationReport
-{
-  /**
-   * Returns the URI for the file the report refers to.
-   * 
-   * @return The URI for the file the report refers to.
-   */
-  public String getFileURI();
-  
-  /**
-   * Returns whether the file is valid. The file may have warnings associated with it.
-   * 
-   * @return True if the file is valid, false otherwise.
-   */
-  public boolean isValid();
-
-  /**
-   * Returns an array of validation messages.
-   * 
-   * @return An array of validation messages.
-   */
-  public ValidationMessage[] getValidationMessages();
-  
-  public HashMap getNestedMessages();
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/CommandLineLogger.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/CommandLineLogger.java
deleted file mode 100644
index 0d38f38..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/CommandLineLogger.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.core.logging;
-
-/**
- * A logger that will print log info to System.out.
- * 
- * @author Lawrence Mandel, IBM
- */
-public class CommandLineLogger implements ILogger
-{
-  public void logError(String error, Throwable exception)
-  {
-    System.out.println(error);
-    System.out.println(exception.toString());
-  }
-
-  public void logWarning(String warning, Throwable exception)
-  {
-    System.out.println(warning);
-    System.out.println(exception.toString());
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/EclipseLogger.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/EclipseLogger.java
deleted file mode 100644
index 573cf2d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/EclipseLogger.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.core.logging;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-
-
-/**
- * A logger that will log to the log file in the eclipse metadata directory.
- */
-public class EclipseLogger implements ILogger
-{
-  
-  public void logError(String error, Throwable exception)
-  {
-    XMLCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR, XMLCorePlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, error, exception));
-  }
- 
-  public void logWarning(String warning, Throwable exception)
-  {
-    XMLCorePlugin.getDefault().getLog().log(new Status(IStatus.WARNING, XMLCorePlugin.getDefault().getBundle().getSymbolicName(), IStatus.WARNING, warning, exception));
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/ILogger.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/ILogger.java
deleted file mode 100644
index e81a410..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/ILogger.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation.core.logging;
-
-/**
- * The interface for a standard logger. Allows for logging errors and warnings.
- * 
- * @author Lawrence Mandel, IBM
- */
-public interface ILogger
-{
-  /**
-   * Log an error message.
-   * 
-   * @param error The error message to log.
-   * @param exception The exception to log.
-   */
-  public void logError(String error, Throwable exception);
-
-  /**
-   * Log a warning message.
-   * 
-   * @param warning The warning message to log.
-   * @param exception The exception to log.
-   */
-  public void logWarning(String warning, Throwable exception);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/LoggerFactory.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/LoggerFactory.java
deleted file mode 100644
index 81549e3..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/LoggerFactory.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation.core.logging;
-
-/**
- * The logger factory allows for simple use of whatever logging mechanism is in
- * place. The tool can specify a custom logging class and can request the
- * logger from this class.
- * 
- * @author Lawrence Mandel, IBM
- * 
- * @deprecated - not used in WTP or by any adopters as of 9/12/2007
- */
-public class LoggerFactory
-{
-  private static ILogger      logger            = null;
-  private static ClassLoader  classloader       = null;
-  private static String       loggerClass       = null;
-  private static final String commandlinelogger = "org.eclipse.wst.xml.validation.internal.core.logging.CommandLineLogger"; //$NON-NLS-1$
-  private static final String eclipselogger     = "org.eclipse.wst.xml.validation.internal.core.logging.EclipseLogger"; //$NON-NLS-1$
-  private static String       defaultlogger     = commandlinelogger;
-
-  /**
-   * Get the one and only instance of the logger.
-   * 
-   * @return The one and only instance of the logger.
-   */
-  public static ILogger getLoggerInstance()
-  {
-    if(logger == null)
-    {
-      if(loggerClass != null)
-      {
-        if(classloader != null)
-        {
-          try
-          {
-            Class lc = classloader.loadClass(loggerClass);
-            logger = (ILogger) lc.newInstance();
-          }
-          catch (Exception e)
-          {
-          }
-        }
-        if(logger == null)
-        {
-          try
-          {
-            Class lc = LoggerFactory.class.getClassLoader().loadClass(loggerClass);
-            logger = (ILogger) lc.newInstance();
-          }
-          catch (Exception e)
-          {
-          }
-        }
-      }
-      if(logger == null)
-      {
-        try
-        {
-          Class lc = LoggerFactory.class.getClassLoader().loadClass(defaultlogger);
-          logger = (ILogger) lc.newInstance();
-        }
-        catch (Exception e)
-        {
-        }
-      }
-    }
-    return logger;
-  }
-
-  /**
-   * Specify the logger implementation to be used.
-   * 
-   * @param classname
-   *            The name of the logger class.
-   * @param loggerclassloader
-   *            The classloader to use to load the logger. If null, the default
-   *            classloader will be used.
-   */
-  public static void specifyLogger(String classname, ClassLoader loggerclassloader)
-  {
-    loggerClass = classname;
-    classloader = loggerclassloader;
-  }
-
-  /**
-   * Set the default logger to the eclipse logger.
-   */
-  public static void useEclipseLogger()
-  {
-    defaultlogger = eclipselogger;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/ErrorCustomizationPluginRegistryReader.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/ErrorCustomizationPluginRegistryReader.java
deleted file mode 100644
index 44a6481..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/ErrorCustomizationPluginRegistryReader.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation.eclipse;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.validation.errorcustomization.ErrorCustomizationRegistry;
-import org.eclipse.wst.xml.core.internal.validation.errorcustomization.ErrorMessageCustomizerDelegate;
-import org.osgi.framework.Bundle;
-/**
- * This class reads the plug-in manifests and registers each extension
- * error customizer with the ErrorCustomizationRegistry.
- */
-public class ErrorCustomizationPluginRegistryReader {
-	
-	  protected static final String PLUGIN_ID = "org.eclipse.wst.xml.core"; //$NON-NLS-1$
-	  protected static final String ATT_CLASS = "class"; //$NON-NLS-1$
-	  protected static final String ATT_NAMESPACE = "namespace"; //$NON-NLS-1$
-	  protected static final String EXTENSION_POINT_ID = "errorCustomizer"; //$NON-NLS-1$
-	  protected static final String tagName = EXTENSION_POINT_ID;
-
-	  /**
-	   * Read from plugin registry for the errorcustomizer extension.
-	   */
-	  public void readRegistry()
-	  {
-	    IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry();
-	    IExtensionPoint point = pluginRegistry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
-	    if (point != null)
-	    {
-	      IConfigurationElement[] elements = point.getConfigurationElements();
-	      for (int i = 0; i < elements.length; i++)
-	      {
-	        readElement(elements[i]);
-	      }
-	    }
-	  }
-
-	  /**
-	   * readElement() - parse and deal with an extension like:
-	   *
-	   * <extension point="org.eclipse.wst.xml.core.errorCustomizer"
-	   *            id="specificErrorCustomizer"
-	   *            name="Specific Error Customizer">
-	   *   <errorCustomizer
-	   *   			namespace="http://specificnamespace"
-	   *   			class="org.eclipse.wst.xml.core.MySpecificErrorCustomizer/>
-	   * </extension>
-	   */
-	  protected void readElement(IConfigurationElement element)
-	  {
-	    if (element.getName().equals(tagName))
-	    {
-	      String errorCustomizerClass = element.getAttribute(ATT_CLASS);
-	      String namespace = element.getAttribute(ATT_NAMESPACE);
-
-	      if (errorCustomizerClass != null)
-	      {
-	        try
-	        {
-	          Bundle pluginBundle = Platform.getBundle(element.getDeclaringExtension().getContributor().getName());
-	          ErrorMessageCustomizerDelegate delegate = new ErrorMessageCustomizerDelegate(pluginBundle, errorCustomizerClass);
-	          ErrorCustomizationRegistry.getInstance().addErrorMessageCustomizer(namespace, delegate);
-	        }
-	        catch (Exception e)
-	        {
-	        }
-	      }
-	    }
-	  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java
deleted file mode 100644
index 79acb37..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.eclipse;
-
-import java.io.InputStream;
-
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.validation.XMLValidationConfiguration;
-import org.eclipse.wst.xml.core.internal.validation.XMLValidationReport;
-import org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator;
-import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-
-public class Validator extends AbstractNestedValidator
-{
-  protected int indicateNoGrammar = 0;
-  
-  /**
-   * Set any preferences for XML validation.
-   * 
-   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#setupValidation(org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
-   */
-  protected void setupValidation(NestedValidatorContext context) 
-  {
-	super.setupValidation(context);
-	indicateNoGrammar = XMLCorePlugin.getDefault().getPluginPreferences().getInt(XMLCorePreferenceNames.INDICATE_NO_GRAMMAR);
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#validate(java.lang.String, java.io.InputStream, org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
-   */
-  public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context)
-  {
-    return validate(uri, inputstream, context, null);
-  }
-
-  public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context, ValidationResult result)
-  {
-    XMLValidator validator = XMLValidator.getInstance();
-
-    XMLValidationConfiguration configuration = new XMLValidationConfiguration();
-    try
-    {
-      configuration.setFeature(XMLValidationConfiguration.INDICATE_NO_GRAMMAR, indicateNoGrammar);
-    }
-    catch(Exception e)
-    {
-      // TODO: Unable to set the preference. Log this problem.
-    }
-    
-    XMLValidationReport valreport = null;
-    if (inputstream != null)
-    {
-      valreport = validator.validate(uri, inputstream, configuration, result);
-    }
-    else
-    {
-      valreport = validator.validate(uri, null, configuration, result);
-    }
-              
-    return valreport;
-  }
-	  
-  /**
-   * Store additional information in the message parameters. For XML validation there
-   * are three additional pieces of information to store:
-   * param[0] = the column number of the error
-   * param[1] = the 'squiggle selection strategy' for which DOM part to squiggle
-   * param[2] = the name or value of what is to be squiggled
-   * 
-   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#addInfoToMessage(org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage, org.eclipse.wst.validation.internal.provisional.core.IMessage)
-   */
-  protected void addInfoToMessage(ValidationMessage validationMessage, IMessage message)
-  { 
-	String key = validationMessage.getKey();
-	if(key != null)
-	{
-      XMLMessageInfoHelper messageInfoHelper = new XMLMessageInfoHelper();
-      String[] messageInfo = messageInfoHelper.createMessageInfo(key, validationMessage.getMessageArguments());
-      
-      message.setAttribute(COLUMN_NUMBER_ATTRIBUTE, new Integer(validationMessage.getColumnNumber()));
-      message.setAttribute(SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE, messageInfo[0]);
-      message.setAttribute(SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE, messageInfo[1]);
-	}
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLMessageInfoHelper.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLMessageInfoHelper.java
deleted file mode 100644
index 4582514..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLMessageInfoHelper.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.eclipse;
-
-/**
- * The message info helper determines the selection strategy for elements
- * in a SSE editor.
- *
- */
-public class XMLMessageInfoHelper
-{
-  public XMLMessageInfoHelper()
-  {
-    super();
-  }
-
-  /**
-   *  Returns an array containing information about what should be underlined with the red "squiggles"
-   *  using the errorKey, and the messageArguments.
-   *  <br>Position 0 of the array returned contains the selection Strategy, or what DOM Element to underline.  
-   *  For example "ATTRIBUTE_NAME"  
-   *  <br>Position 1 contains the name or value to squiggle.
-   *  <p>For example, if we wanted to squiggle the attribute name of an attribute name
-   *  foo this method would return {"ATTRIBUTE_NAME", "foo"}
-   *  </p>
-   *  @param errorKey 
-   *  		The error key given by the Xerces parser.
-   *  @param messageArguments 
-   *  		The arguments used by Xerces to "fill in the blanks" of their messages.
-   *  @return 
-   *  		An array containing the squiggle information.
-   *  @see org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidator
-   *  
-   */
-  public String[] createMessageInfo(String errorKey, Object[] messageArguments)
-  { 
-    String selectionStrategy = null;
-    String nameOrValue = null;
-    
-    if(errorKey != null)
-    {
-      if (errorKey.equals("cvc-complex-type.2.4.a") || errorKey.equals("cvc-complex-type.2.4.d") || errorKey.equals("cvc-complex-type.2.4.b") || errorKey.equals("MSG_CONTENT_INVALID") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-        | errorKey.equals("MSG_CONTENT_INCOMPLETE") || errorKey.equals("MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED") || errorKey.equals("cvc-complex-type.4")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-      {
-        selectionStrategy = "START_TAG"; //$NON-NLS-1$
-      }
-      else if (errorKey.equals("cvc-type.3.1.3")) //$NON-NLS-1$
-      {
-        selectionStrategy = "TEXT"; //$NON-NLS-1$
-      }
-      else if (errorKey.equals("cvc-complex-type.2.3")) //$NON-NLS-1$
-      {
-    	selectionStrategy = "FIRST_NON_WHITESPACE_TEXT"; //$NON-NLS-1$
-      }
-      else if (errorKey.equals("cvc-type.3.1.1")) //$NON-NLS-1$
-      {
-        selectionStrategy = "ALL_ATTRIBUTES"; //$NON-NLS-1$
-      }
-      else if (errorKey.equals("cvc-complex-type.3.2.2") || errorKey.equals("MSG_ATTRIBUTE_NOT_DECLARED")) //$NON-NLS-1$ //$NON-NLS-2$
-      {
-        selectionStrategy = "ATTRIBUTE_NAME"; //$NON-NLS-1$
-	    //in this case we need nameOrValue to be the name of the attribute to underline
-	    nameOrValue = (String)messageArguments[1];
-      }
-      else if (errorKey.equals("cvc-attribute.3") || errorKey.equals("MSG_ATTRIBUTE_VALUE_NOT_IN_LIST") || errorKey.equals("cvc-complex-type.3.1")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-      {	
-    	selectionStrategy = "ATTRIBUTE_VALUE";   //$NON-NLS-1$
-		//in this case we need nameOrValue to be the name of the Attribute
-    	if (errorKey.equals("cvc-attribute.3") || errorKey.equals("cvc-complex-type.3.1")) //$NON-NLS-1$ //$NON-NLS-2$
-    	{ 
-    	  nameOrValue = (String)messageArguments[1];
-    	}
-    	else if (errorKey.equals("MSG_ATTRIBUTE_VALUE_NOT_IN_LIST")) //$NON-NLS-1$
-    	{	
-    	  nameOrValue = (String)messageArguments[0];
-    	}
-      }
-      else if (errorKey.equals("cvc-elt.4.2")) //$NON-NLS-1$
-      {	
-    	selectionStrategy="VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE"; //$NON-NLS-1$
-		//in this case we need nameOrValue to be the value of the attribute we want to unerline
-    	nameOrValue = (String)messageArguments[1];	
-      }
-      else if (errorKey.equals("EntityNotDeclared")) //$NON-NLS-1$
-      {  	
-    	selectionStrategy="TEXT_ENTITY_REFERENCE"; //$NON-NLS-1$
-        nameOrValue = (String)messageArguments[0];
-      }
-      else if (errorKey.equals("ElementUnterminated")) //$NON-NLS-1$
-      {
-        selectionStrategy = "ENTIRE_ELEMENT"; //$NON-NLS-1$
-      }
-      else if (errorKey.equals("ETagUnterminated") || errorKey.equals("ETagRequired"))  //$NON-NLS-1$  //$NON-NLS-2$
-      {
-        selectionStrategy = "END_TAG";   //$NON-NLS-1$
-      }
-    }
-    String messageInfo[] = new String[2];
-    messageInfo[0] = selectionStrategy != null? selectionStrategy: ""; //$NON-NLS-1$
-    messageInfo[1] = nameOrValue;
-    return messageInfo;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLValidator.java
deleted file mode 100644
index d481058..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLValidator.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.eclipse;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-
-/**
- * An XML validator specific to Eclipse. This validator will wrap the internal
- * XML validator and provide automatic URI resolution support. This class also
- * reads from the plug-in registry and registers all error customizers with the
- * registry.
- */
-public class XMLValidator extends org.eclipse.wst.xml.core.internal.validation.XMLValidator
-{
-  private static XMLValidator instance = null;
-  
-  /**
-   * Return the one and only instance of the XML validator. The validator
-   * can be reused and cannot be customized so there should only be one instance of it.
-   * 
-   * @return The one and only instance of the XML validator.
-   */
-  public static XMLValidator getInstance()
-  {
-    if(instance == null)
-    {
-      instance = new XMLValidator();
-    }
-    return instance;
-  }
-  /**
-   * Constructor. Create the XML validator, set the URI resolver and
-   * get the extension error customizers from the registry.
-   */
-  protected XMLValidator()
-  {
-    setURIResolver(URIResolverPlugin.createResolver());
-    new ErrorCustomizationPluginRegistryReader().readRegistry();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ElementInformation.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ElementInformation.java
deleted file mode 100644
index 649c99e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ElementInformation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A simple class to store information about an XML element.
- */
-public class ElementInformation
-{
-  protected String localName;
-  protected String namespace;
-  protected List children = new ArrayList();
-
-  /**
-   * Constructor.
-   * 
-   * @param uri
-   * 		The namespace URI of the element.
-   * @param localName
-   * 		The local name of the element.
-   */
-  public ElementInformation(String uri, String localName)
-  {
-    this.localName = localName;
-    this.namespace = uri;
-  }
-  
-  /**
-   * Get the namespace of this element.
-   * 
-   * @return
-   * 		The namespace of this element.
-   */
-  public String getNamespace()
-  {
-	return namespace;
-  }
-  
-  /**
-   * Get the local name of this element.
-   * 
-   * @return
-   * 		The local name of this element.
-   */
-  public String getLocalname()
-  {
-	return localName;
-  }
-  
-  /**
-   * Get the list of children of this element. The list contains
-   * ElementInformation objects representing the children of this element.
-   * 
-   * @return
-   * 		The list of children of this element.
-   */
-  public List getChildren()
-  {
-	return children;
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationManager.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationManager.java
deleted file mode 100644
index 745acc0..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationManager.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
-
-import java.util.Stack;
-
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-
-/**
- * This class tracks the context of the parsed document to help identify error
- * conditions
- */
-public class ErrorCustomizationManager
-{
-  protected Stack elementInformationStack = new Stack();
-  protected ErrorMessageInformation messageForConsideration;
-
-  /**
-   * This method should be called in the start element method of the XML validator's
-   * content handler.
-   * 
-   * @param uri
-   * 		The namespace of the element.
-   * @param localName
-   * 		The local name of the element.
-   */
-  public void startElement(String uri, String localName)
-  { 
-    ElementInformation elementInformation = new ElementInformation(uri, localName);
-    if (elementInformationStack.size() > 0)
-    {
-      ElementInformation parent = (ElementInformation) elementInformationStack.peek();
-      parent.children.add(elementInformation);
-    }
-    elementInformationStack.push(elementInformation);
-  }
-
-  /**
-   * This method should be called in the end element method of the XML validator's
-   * content handler.
-   * 
-   * @param uri
-   * 		The namespace of the element.
-   * @param localName
-   * 		The local name of the element.
-   */
-  public void endElement(String uri, String localName)
-  {   
-    if (elementInformationStack.size() > 0)
-    {
-      ElementInformation elementInformation = (ElementInformation)elementInformationStack.pop();
-      if (messageForConsideration != null)
-      {  
-        IErrorMessageCustomizer[] customizers = ErrorCustomizationRegistry.getInstance().getCustomizers(elementInformation.getNamespace());
-        int numCustomizers = customizers.length;
-        for(int i = 0; i < numCustomizers; i++)
-        {
-          String message = customizers[i].customizeMessage(elementInformation, messageForConsideration.key, messageForConsideration.arguments);
-          if(message != null)
-          {
-        	messageForConsideration.message.setMessage(message);
-        	break;
-          }
-        }
-      }  
-    }
-  }
-
-  /**
-   * Consider the reported error for customization.
-   * 
-   * @param valInfo
-   * 		The current ValidationInfo object containing validation specific information.
-   * @param key
-   * 		The key related to the message.
-   * @param arguments
-   * 		Any message arguments.
-   */
-  public void considerReportedError(ValidationInfo valInfo, String key, Object[] arguments)
-  {
-    messageForConsideration = null;
-    ValidationMessage[] messages = valInfo.getValidationMessages();
-    if (messages.length > 0)
-    {  
-      messageForConsideration = new ErrorMessageInformation();
-      messageForConsideration.key = key;
-      messageForConsideration.arguments = arguments;
-      messageForConsideration.message = messages[messages.length - 1]; 
-    }
-  }
-  
-  /**
-   * A simple class to hold error message information.
-   */
-  public class ErrorMessageInformation
-  {
-	public String key = null;
-	public Object[] arguments = null;
-	public ValidationMessage message = null;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationRegistry.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationRegistry.java
deleted file mode 100644
index 2094879..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationRegistry.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * The error customization regsitry manages all registered
- * IErrorMessageCustomizers by namespace.
- */
-public class ErrorCustomizationRegistry 
-{
-  protected static ErrorCustomizationRegistry registry = null;
-  protected Map customizers = new HashMap();
-  
-  /**
-   * Restricted constructor in keeping with the singleton pattern.
-   */
-  protected ErrorCustomizationRegistry()
-  {
-  }
-  
-  /**
-   * Get the one and only instance of the registry.
-   * 
-   * @return
-   * 		The one and only instance of the registry.
-   */
-  public static ErrorCustomizationRegistry getInstance()
-  {
-	if(registry == null)
-	{
-	  registry = new ErrorCustomizationRegistry();
-	}
-	return registry;
-  }
-  
-  /**
-   * Add a customizer to the registry. 
-   * 
-   * @param namespace
-   * 		The namespace the customizer will act on.
-   * @param customizer
-   * 		The error customizer to register.
-   */
-  public void addErrorMessageCustomizer(String namespace, IErrorMessageCustomizer customizer)
-  {
-	// To register a customizer for the no namespace use an empty string.
-	if(namespace == null)
-	{
-	  namespace = ""; //$NON-NLS-1$
-	}
-	List customizersForNS = (List)customizers.get(namespace);
-	if(customizersForNS == null)
-	{
-	  customizersForNS = new ArrayList();
-	  customizers.put(namespace, customizersForNS);
-	}
-	if(customizer != null)
-	{
-	  customizersForNS.add(customizer);
-	}
-  }
-  
-  /**
-   * Get the error customizers for a given namespace.
-   * 
-   * @param namespace
-   * 		The namespace for which to retrieve the customizers.
-   * @return
-   * 		An array of customizers registered for this namespace.
-   */
-  public IErrorMessageCustomizer[] getCustomizers(String namespace)
-  {
-	if(namespace == null)
-	{
-	  namespace = ""; //$NON-NLS-1$
-	}
-	List customizersForNS = (List)customizers.get(namespace);
-	if(customizersForNS == null)
-	{
-	  customizersForNS = new ArrayList();
-	}
-	return (IErrorMessageCustomizer[])customizersForNS.toArray(new IErrorMessageCustomizer[customizersForNS.size()]);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorMessageCustomizerDelegate.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorMessageCustomizerDelegate.java
deleted file mode 100644
index 07147c1..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorMessageCustomizerDelegate.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.osgi.framework.Bundle;
-
-/**
- * An error message customizer delegate is used to allow for
- * lazy loading of error customizers.
- *
- */
-public class ErrorMessageCustomizerDelegate implements IErrorMessageCustomizer
-{
-  protected Bundle bundle = null;
-  protected String classname = null;
-  protected IErrorMessageCustomizer customizer = null;
-  
-  public ErrorMessageCustomizerDelegate(Bundle bundle, String classname)
-  {
-	this.bundle = bundle;
-	this.classname = classname;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xml.core.internal.validation.errorcustomization.IErrorMessageCustomizer#customizeMessage(org.eclipse.wst.xml.core.internal.validation.errorcustomization.ElementInformation, java.lang.String, java.lang.Object[])
-   */
-  public String customizeMessage(ElementInformation elementInfo, String errorKey, Object[] arguments) 
-  {
-	if(customizer == null)
-	{
-	  loadCustomizer();
-	}
-	if(customizer == null)
-	{
-	  return null;
-	}
-	return customizer.customizeMessage(elementInfo, errorKey, arguments);
-  }
-  
-  /**
-   * Load the customizer class.
-   */
-  protected void loadCustomizer()
-  {
-	try
-	{
-	  Class customizerClass = bundle.loadClass(classname);
-	  customizer = (IErrorMessageCustomizer)customizerClass.newInstance();
-	}
-	catch(Exception e)
-	{
-	  XMLCorePlugin.getDefault().getLog().log(
-			  new Status(IStatus.WARNING, 
-					     XMLCorePlugin.getDefault().getBundle().getSymbolicName(), 
-					     IStatus.OK, 
-					     "The XML validator error customizer was unable to load class " + classname, e)); //$NON-NLS-1$
-	}
-  }
-  
-  
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/IErrorMessageCustomizer.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/IErrorMessageCustomizer.java
deleted file mode 100644
index ac6d1e0..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/IErrorMessageCustomizer.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
-
-/**
- * An error message customizer will be called by the XML validator to customize
- * XML validation errors for a given namespace. The customizer can be used to 
- * create clearer errors for specific application domains.
- */
-public interface IErrorMessageCustomizer 
-{
-  /**
-   * Return a customized error message for the given element. Null should be returned
-   * if the message should not be customized.
-   * 
-   * @param elementInformation
-   * 		The information about the element for which to customize the error.
-   * @param errorKey
-   * 		The key for the error for which to replace the message.
-   * @param arguments
-   * 		Arguments related the the error message.
-   * @return
-   * 		A customized error message or null if this customizer will not customize the message.
-   */
-  public String customizeMessage(ElementInformation elementInfo, String errorKey, Object[] arguments);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties
deleted file mode 100644
index 91fc0ce..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-!-- Constants for strings  
-
-! Usage:
-!   {0} replaced with the host name
-!
-_UI_PROBLEMS_VALIDATING_UNKNOWN_HOST             = The file cannot be validated as the host "{0}" is currently unreachable.
-
-! Usage:
-!   {0} replaced with the file name
-!
-_UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND           = The file cannot be validated as the XML Schema "{0}" that is specified as describing the syntax of the file cannot be located.
-
-_UI_PROBLEMS_CONNECTION_REFUSED                  = The file cannot be validated as there was a connection problem.
-
-!
-! Referenced File Dialog Related Message
-!
-_UI_REF_FILE_ERROR_MESSAGE                       = Referenced file contains errors ({0}).  For more information, right click on the message and select "Show Details..."
-
-# Warning when no grammar is located.
-_WARN_NO_GRAMMAR                                 = No grammar constraints (DTD or XML schema) detected for the document.
- 
diff --git a/bundles/org.eclipse.wst.xml.core/src/.cvsignore b/bundles/org.eclipse.wst.xml.core/src/.cvsignore
deleted file mode 100644
index 101c29e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-notebook.jpage
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/DebugAdapterFactory.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/DebugAdapterFactory.java
deleted file mode 100644
index 266b80a..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/DebugAdapterFactory.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal;
-
-import java.util.ArrayList;
-
-import org.eclipse.wst.sse.core.internal.PropagatingAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-
-public class DebugAdapterFactory extends AbstractAdapterFactory implements PropagatingAdapterFactory {
-
-	/**
-	 * Constructor for DebugAdapterFactory.
-	 */
-	public DebugAdapterFactory() {
-		this(IDebugAdapter.class, true);
-	}
-
-	/**
-	 * Constructor  for DebugAdapterFactory.
-	 * 
-	 * @param fAdapterKey
-	 * @param registerAdapters
-	 */
-	private DebugAdapterFactory(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-	
-	public void addContributedFactories(INodeAdapterFactory factory) {
-		//none expected
-	}
-
-	public INodeAdapterFactory copy() {
-		return new DebugAdapterFactory(getAdapterKey(), isShouldRegisterAdapter());
-	}
-
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		EveryNodeDebugAdapter result = null;
-		result = EveryNodeDebugAdapter.getInstance();
-		return result;
-
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.IAdapterFactory#isFactoryForType(java.lang.Object)
-	 */
-	public boolean isFactoryForType(Object type) {
-
-		return IDebugAdapter.class == type;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.PropagatingAdapterFactory#setContributedFactories(java.util.ArrayList)
-	 */
-	public void setContributedFactories(ArrayList list) {
-		// none expected
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/EveryNodeDebugAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/EveryNodeDebugAdapter.java
deleted file mode 100644
index baa718c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/EveryNodeDebugAdapter.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.events.AboutToBeChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.IModelAboutToBeChangedListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-
-/**
- * Purely for use in debugging
- */
-public class EveryNodeDebugAdapter implements IDebugAdapter {
-
-	static class InternalDocumentListener implements IDocumentListener {
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
-		 */
-		public void documentAboutToBeChanged(DocumentEvent event) {
-			Debug.println("IdocumentAboutToBeChanged: " + event); //$NON-NLS-1$
-
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
-		 */
-		public void documentChanged(DocumentEvent event) {
-			Debug.println("IdocumentChanged: " + event); //$NON-NLS-1$
-
-		}
-
-	}
-
-	static class InternalModelStateListener implements IModelStateListener {
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.IModelStateListener#modelAboutToBeChanged(org.eclipse.wst.sse.core.IStructuredModel)
-		 */
-		public void modelAboutToBeChanged(IStructuredModel model) {
-			Debug.println("modelAboutToBeChanged: " + model); //$NON-NLS-1$
-
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.IModelStateListener#modelChanged(org.eclipse.wst.sse.core.IStructuredModel)
-		 */
-		public void modelChanged(IStructuredModel model) {
-			Debug.println("modelChanged: " + model); //$NON-NLS-1$
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.IModelStateListener#modelDirtyStateChanged(org.eclipse.wst.sse.core.IStructuredModel,
-		 *      boolean)
-		 */
-		public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
-			Debug.println("modelDirtyStateChanged: " + model); //$NON-NLS-1$
-
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.IModelStateListener#modelResourceDeleted(org.eclipse.wst.sse.core.IStructuredModel)
-		 */
-		public void modelResourceDeleted(IStructuredModel model) {
-			Debug.println("modelResourceDeleted: " + model); //$NON-NLS-1$
-
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.IModelStateListener#modelResourceMoved(org.eclipse.wst.sse.core.IStructuredModel,
-		 *      org.eclipse.wst.sse.core.IStructuredModel)
-		 */
-		public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) {
-			Debug.println("modelResourceMoved: " + "oldModel: " + oldModel + "newModel: " + newModel); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		}
-
-		public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
-			Debug.println("modelAboutToBeReinitialized: " + "structuredModel: " + structuredModel); //$NON-NLS-1$ //$NON-NLS-2$
-
-		}
-
-		public void modelReinitialized(IStructuredModel structuredModel) {
-			Debug.println("modelReinitialized: " + "structuredModel: " + structuredModel); //$NON-NLS-1$ //$NON-NLS-2$
-
-		}
-
-	}
-
-	static class InternalStructuredDocumentAboutToChange implements IModelAboutToBeChangedListener {
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.events.IModelAboutToBeChangedListener#modelAboutToBeChanged(org.eclipse.wst.sse.core.events.AboutToBeChangedEvent)
-		 */
-		public void modelAboutToBeChanged(AboutToBeChangedEvent structuredDocumentEvent) {
-			Debug.println("structuredDocumentAboutToBeChanged: " + structuredDocumentEvent); //$NON-NLS-1$
-
-		}
-
-	}
-
-	static class InternalStructuredDocumentListener implements IStructuredDocumentListener {
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#newModel(org.eclipse.wst.sse.core.events.NewDocumentContentEvent)
-		 */
-		public void newModel(NewDocumentEvent structuredDocumentEvent) {
-			Debug.println("structuredDocumentChanged - newModel: " + structuredDocumentEvent); //$NON-NLS-1$
-
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#noChange(org.eclipse.wst.sse.core.events.NoChangeEvent)
-		 */
-		public void noChange(NoChangeEvent structuredDocumentEvent) {
-			Debug.println("structuredDocumentChanged - noChange: " + structuredDocumentEvent); //$NON-NLS-1$
-
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#nodesReplaced(org.eclipse.wst.sse.core.events.StructuredDocumentRegionsReplacedEvent)
-		 */
-		public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
-			Debug.println("structuredDocumentChanged - nodesReplaced: " + structuredDocumentEvent); //$NON-NLS-1$
-
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#regionChanged(org.eclipse.wst.sse.core.events.RegionChangedEvent)
-		 */
-		public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
-			Debug.println("structuredDocumentChanged - regionChanged: " + structuredDocumentEvent); //$NON-NLS-1$
-
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#regionsReplaced(org.eclipse.wst.sse.core.events.RegionsReplacedEvent)
-		 */
-		public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
-			Debug.println("structuredDocumentChanged - regionsReplaced: " + structuredDocumentEvent); //$NON-NLS-1$
-
-		}
-
-	}
-
-	private static EveryNodeDebugAdapter singletonInstance;
-
-	public static EveryNodeDebugAdapter getInstance() {
-		if (singletonInstance == null) {
-			singletonInstance = new EveryNodeDebugAdapter();
-		}
-		return singletonInstance;
-	}
-
-	InternalDocumentListener fInternalDocumentListener;
-	InternalModelStateListener fInternalModelStateListener;
-	InternalStructuredDocumentAboutToChange fInternalStructuredDocumentAboutToChange;
-	InternalStructuredDocumentListener fInternalStructuredDocumentListener;
-	IStructuredModel fModel;
-
-	/**
-	 * 
-	 */
-	public EveryNodeDebugAdapter() {
-		super();
-		fInternalDocumentListener = new InternalDocumentListener();
-		fInternalStructuredDocumentAboutToChange = new InternalStructuredDocumentAboutToChange();
-		fInternalStructuredDocumentListener = new InternalStructuredDocumentListener();
-		fInternalModelStateListener = new InternalModelStateListener();
-	}
-
-	/**
-	 * @param target
-	 */
-	public EveryNodeDebugAdapter(INodeNotifier target) {
-		this();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.INodeAdapter#isAdapterForType(java.lang.Object)
-	 */
-	public boolean isAdapterForType(Object type) {
-		return (type == IDebugAdapter.class);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.INodeAdapter#notifyChanged(org.eclipse.wst.sse.core.INodeNotifier,
-	 *      int, java.lang.Object, java.lang.Object, java.lang.Object, int)
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		if (notifier instanceof IDOMNode) {
-			setModel(((IDOMNode) notifier).getModel());
-		}
-		Debug.println("notifier: " + notifier + " " + INodeNotifier.EVENT_TYPE_STRINGS[eventType] + " changedFeature: " + changedFeature + " oldValue: " + oldValue + " newValue: " + newValue + " pos: " + pos); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
-
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.internal.IDebugAdapter#setDocument(org.eclipse.wst.sse.core.text.IStructuredDocument)
-	 */
-	private void setModel(IStructuredModel structuredModel) {
-		if (fModel == structuredModel)
-			return;
-
-		if (fModel != null) {
-			fModel.removeModelStateListener(fInternalModelStateListener);
-			//
-			IStructuredDocument structuredDocument = fModel.getStructuredDocument();
-			if (structuredDocument != null) {
-				structuredDocument.removeDocumentListener(fInternalDocumentListener);
-				structuredDocument.removeDocumentAboutToChangeListener(fInternalStructuredDocumentAboutToChange);
-				structuredDocument.removeDocumentChangedListener(fInternalStructuredDocumentListener);
-			}
-		}
-		fModel = structuredModel;
-		if (fModel != null) {
-
-			fModel.addModelStateListener(fInternalModelStateListener);
-			//
-			IStructuredDocument structuredDocument = fModel.getStructuredDocument();
-			if (structuredDocument != null) {
-				structuredDocument.addDocumentListener(fInternalDocumentListener);
-				structuredDocument.addDocumentAboutToChangeListener(fInternalStructuredDocumentAboutToChange);
-				structuredDocument.addDocumentChangedListener(fInternalStructuredDocumentListener);
-			}
-		}
-
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/IDebugAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/IDebugAdapter.java
deleted file mode 100644
index 35c5712..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/IDebugAdapter.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-
-
-public interface IDebugAdapter extends INodeAdapter {
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/Logger.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/Logger.java
deleted file mode 100644
index 798c9bb..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/Logger.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal;
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if
- * desired, the console. This class should only be used by classes in this
- * plugin. Other plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
-	private static final String PLUGIN_ID = "org.eclipse.wst.xml.core"; //$NON-NLS-1$
-	
-	public static final int ERROR = IStatus.ERROR; // 4
-	public static final int ERROR_DEBUG = 200 + ERROR;
-	public static final int INFO = IStatus.INFO; // 1
-	public static final int INFO_DEBUG = 200 + INFO;
-
-	public static final int OK = IStatus.OK; // 0
-
-	public static final int OK_DEBUG = 200 + OK;
-
-	private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
-	public static final int WARNING = IStatus.WARNING; // 2
-	public static final int WARNING_DEBUG = 200 + WARNING;
-
-	/**
-	 * Adds message to log.
-	 * 
-	 * @param level
-	 *            severity level of the message (OK, INFO, WARNING, ERROR,
-	 *            OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
-	 * @param message
-	 *            text to add to the log
-	 * @param exception
-	 *            exception thrown
-	 */
-	protected static void _log(int level, String message, Throwable exception) {
-		if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
-			if (!isDebugging())
-				return;
-		}
-
-		int severity = IStatus.OK;
-		switch (level) {
-			case INFO_DEBUG :
-			case INFO :
-				severity = IStatus.INFO;
-				break;
-			case WARNING_DEBUG :
-			case WARNING :
-				severity = IStatus.WARNING;
-				break;
-			case ERROR_DEBUG :
-			case ERROR :
-				severity = IStatus.ERROR;
-		}
-		message = (message != null) ? message : "null"; //$NON-NLS-1$
-		Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
-		Bundle bundle = Platform.getBundle(PLUGIN_ID);
-		if (bundle != null) 
-			Platform.getLog(bundle).log(statusObj);
-	}
-
-	/**
-	 * Prints message to log if category matches /debug/tracefilter option.
-	 * 
-	 * @param message
-	 *            text to print
-	 * @param category
-	 *            category of the message, to be compared with
-	 *            /debug/tracefilter
-	 */
-	protected static void _trace(String category, String message, Throwable exception) {
-		if (isTracing(category)) {
-			message = (message != null) ? message : "null"; //$NON-NLS-1$
-			Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
-			Bundle bundle = Platform.getBundle(PLUGIN_ID);
-			if (bundle != null) 
-				Platform.getLog(bundle).log(statusObj);
-		}
-	}
-
-	/**
-	 * @return true if the platform is debugging
-	 */
-	public static boolean isDebugging() {
-		return Platform.inDebugMode();
-	}
-
-	/**
-	 * Determines if currently tracing a category
-	 * 
-	 * @param category
-	 * @return true if tracing category, false otherwise
-	 */
-	public static boolean isTracing(String category) {
-		if (!isDebugging())
-			return false;
-
-		String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
-		if (traceFilter != null) {
-			StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
-			while (tokenizer.hasMoreTokens()) {
-				String cat = tokenizer.nextToken().trim();
-				if (category.equals(cat)) {
-					return true;
-				}
-			}
-		}
-		return false;
-	}
-
-	public static void log(int level, String message) {
-		_log(level, message, null);
-	}
-
-	public static void log(int level, String message, Throwable exception) {
-		_log(level, message, exception);
-	}
-
-	public static void logException(String message, Throwable exception) {
-		_log(ERROR, message, exception);
-	}
-
-	public static void logException(Throwable exception) {
-		_log(ERROR, exception.getMessage(), exception);
-	}
-
-	public static void trace(String category, String message) {
-		_trace(category, message, null);
-	}
-
-	public static void traceException(String category, String message, Throwable exception) {
-		_trace(category, message, exception);
-	}
-
-	public static void traceException(String category, Throwable exception) {
-		_trace(category, exception.getMessage(), exception);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCoreMessages.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCoreMessages.java
deleted file mode 100644
index 7d05ad0..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCoreMessages.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005 IBM Corporation and others. All rights reserved.   This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: 
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.xml.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML Core
- * 
- * @plannedfor 1.0
- */
-public class XMLCoreMessages {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.xml.core.internal.XMLCorePluginResources";//$NON-NLS-1$
-	
-	public static String Invalid_character_lt_fo_ERROR_;
-	public static String Invalid_character_gt_fo_ERROR_;
-	public static String Invalid_character_amp_fo_ERROR_;
-	public static String Invalid_character__f_EXC_;
-	public static String loading;
-	public static String Catalog_entry_key_not_set;
-	public static String Catalog_entry_uri_not_set;
-	public static String Catalog_next_catalog_location_uri_not_set;
-	public static String Catalog_resolution_null_catalog;
-	public static String Catalog_resolution_malformed_url;
-	public static String Catalog_resolution_io_exception;
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, XMLCoreMessages.class);
-	}
-	
-	private XMLCoreMessages() {
-		// cannot create new instance
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java
deleted file mode 100644
index bb148a2..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.xml.core.internal.catalog.Catalog;
-import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class XMLCorePlugin extends Plugin {
-	// The shared instance.
-	private static XMLCorePlugin plugin;
-	public static final String USER_CATALOG_ID = "user_catalog"; //$NON-NLS-1$
-	public static final String DEFAULT_CATALOG_ID = "default_catalog"; //$NON-NLS-1$
-	public static final String SYSTEM_CATALOG_ID = "system_catalog"; //$NON-NLS-1$
-	private CatalogSet catalogSet = null;
-	private String defaultCatalogFileStateLocation;
-
-
-	/**
-	 * Returns the shared instance.
-	 */
-	public static XMLCorePlugin getDefault() {
-		return plugin;
-	}
-
-	/**
-	 * @deprecated use ResourcesPlugin.getWorkspace() directly
-	 */
-	public static IWorkspace getWorkspace() {
-		return ResourcesPlugin.getWorkspace();
-	}
-
-	/**
-	 * The constructor.
-	 */
-	public XMLCorePlugin() {
-		super();
-		plugin = this;
-	}
-
-	private String getPluginStateLocation(String fileName) {
-		String location = getStateLocation().append(fileName).toString();
-		String file_protocol = "file:"; //$NON-NLS-1$
-		if (location != null && !location.startsWith(file_protocol)) {
-			location = file_protocol + location;
-		}
-		return location;
-	}
-
-	public ICatalog getDefaultXMLCatalog() {
-		if (catalogSet == null) {
-			catalogSet = new CatalogSet();
-
-			defaultCatalogFileStateLocation = getPluginStateLocation(Catalog.DEFAULT_CATALOG_FILE);
-
-			catalogSet.putCatalogPersistenceLocation(DEFAULT_CATALOG_ID, defaultCatalogFileStateLocation);
-			catalogSet.putCatalogPersistenceLocation(SYSTEM_CATALOG_ID, getPluginStateLocation(Catalog.SYSTEM_CATALOG_FILE));
-			catalogSet.putCatalogPersistenceLocation(USER_CATALOG_ID, getPluginStateLocation(Catalog.USER_CATALOG_FILE));
-		}
-		return catalogSet.lookupOrCreateCatalog(DEFAULT_CATALOG_ID, defaultCatalogFileStateLocation);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePluginResources.properties b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePluginResources.properties
deleted file mode 100644
index ca630a2..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePluginResources.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-#     IBM Corporation - initial API and implementation
-#     Jens Lukowski/Innoopract - initial renaming/restructuring
-#     
-###############################################################################
-Invalid_character_lt_fo_ERROR_=Invalid character ('<') found
-Invalid_character_gt_fo_ERROR_=Invalid character ('>') found
-Invalid_character_amp_fo_ERROR_=Invalid character ('&') found
-Invalid_character__f_EXC_=Invalid character ('\"') found
-###############################################################################
-# contentmodel strings
-loading=loading 
-# catalog strings
-Catalog_entry_key_not_set=Catalog entry key is not set
-Catalog_entry_uri_not_set=Catalog entry uri is not set
-Catalog_next_catalog_location_uri_not_set=Next catalog location uri is not set
-Catalog_resolution_null_catalog=Catalog resolution attempted with null catalog; ignored
-Catalog_resolution_malformed_url=Malformed URL exception trying to resolve
-Catalog_resolution_io_exception=I/O exception trying to resolve
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/CleanupProcessorXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/CleanupProcessorXML.java
deleted file mode 100644
index e62e98b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/CleanupProcessorXML.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.internal.cleanup.AbstractStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.formatter.XMLFormatterFormatProcessor;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.w3c.dom.Node;
-
-
-public class CleanupProcessorXML extends AbstractStructuredCleanupProcessor {
-	protected IStructuredCleanupPreferences fCleanupPreferences = null;
-
-	protected IStructuredCleanupHandler getCleanupHandler(Node node) {
-		short nodeType = node.getNodeType();
-		IStructuredCleanupHandler cleanupHandler = null;
-		switch (nodeType) {
-			case Node.ELEMENT_NODE : {
-				cleanupHandler = new ElementNodeCleanupHandler();
-				break;
-			}
-			case Node.TEXT_NODE : {
-				cleanupHandler = new NodeCleanupHandler();
-				break;
-			}
-			default : {
-				cleanupHandler = new NodeCleanupHandler();
-			}
-		}
-
-		// init CleanupPreferences
-		cleanupHandler.setCleanupPreferences(getCleanupPreferences());
-
-		return cleanupHandler;
-	}
-
-	public IStructuredCleanupPreferences getCleanupPreferences() {
-		if (fCleanupPreferences == null) {
-			fCleanupPreferences = new StructuredCleanupPreferences();
-
-			Preferences preferences = getModelPreferences();
-			if (preferences != null) {
-				fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
-				fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
-				fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(XMLCorePreferenceNames.INSERT_MISSING_TAGS));
-				fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(XMLCorePreferenceNames.QUOTE_ATTR_VALUES));
-				fCleanupPreferences.setFormatSource(preferences.getBoolean(XMLCorePreferenceNames.FORMAT_SOURCE));
-				fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(XMLCorePreferenceNames.CONVERT_EOL_CODES));
-				fCleanupPreferences.setEOLCode(preferences.getString(XMLCorePreferenceNames.CLEANUP_EOL_CODE));
-			}
-		}
-
-		return fCleanupPreferences;
-	}
-
-	protected String getContentType() {
-		return ContentTypeIdForXML.ContentTypeID_XML;
-	}
-
-	protected IStructuredFormatProcessor getFormatProcessor() {
-		return new XMLFormatterFormatProcessor();
-	}
-
-	protected Preferences getModelPreferences() {
-		return XMLCorePlugin.getDefault().getPluginPreferences();
-	}
-
-	protected void refreshCleanupPreferences() {
-		fCleanupPreferences = null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java
deleted file mode 100644
index fcf9a21..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java
+++ /dev/null
@@ -1,557 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.cleanup;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class ElementNodeCleanupHandler extends NodeCleanupHandler {
-	protected static final char DOUBLE_QUOTE = '\"'; //$NON-NLS-1$
-	protected static final String DOUBLE_QUOTES = "\"\""; //$NON-NLS-1$
-	protected static final String EMPTY_TAG_CLOSE = "/>"; //$NON-NLS-1$
-	protected static final String END_TAG_OPEN = "</"; //$NON-NLS-1$
-	protected static final char SINGLE_QUOTE = '\''; //$NON-NLS-1$
-	protected static final String SINGLE_QUOTES = "''"; //$NON-NLS-1$
-
-	/** Non-NLS strings */
-	protected static final String START_TAG_OPEN = "<"; //$NON-NLS-1$
-	protected static final String TAG_CLOSE = ">"; //$NON-NLS-1$
-
-	public Node cleanup(Node node) {
-		Node newNode = cleanupChildren(node);
-		IDOMNode renamedNode = newNode instanceof IDOMNode ? (IDOMNode) newNode : null;
-
-		// call quoteAttrValue() first so it will close any unclosed attr
-		// quoteAttrValue() will return the new start tag if there is a
-		// structure change
-		renamedNode = quoteAttrValue(renamedNode);
-
-		// insert tag close if missing
-		// if node is not comment tag
-		// and not implicit tag
-		if (!isCommentTag(renamedNode) && !isImplicitTag(renamedNode)) {
-			IDOMModel structuredModel = renamedNode.getModel();
-
-			// save start offset before insertTagClose()
-			// or else renamedNode.getStartOffset() will be zero if
-			// renamedNode replaced by insertTagClose()
-			int startTagStartOffset = renamedNode.getStartOffset();
-
-			// for start tag
-			IStructuredDocumentRegion startTagStructuredDocumentRegion = renamedNode.getStartStructuredDocumentRegion();
-			insertTagClose(structuredModel, startTagStructuredDocumentRegion);
-
-			// update renamedNode and startTagStructuredDocumentRegion after
-			// insertTagClose()
-			renamedNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset);
-			startTagStructuredDocumentRegion = renamedNode.getStartStructuredDocumentRegion();
-
-			// for end tag
-			IStructuredDocumentRegion endTagStructuredDocumentRegion = renamedNode.getEndStructuredDocumentRegion();
-			if (endTagStructuredDocumentRegion != startTagStructuredDocumentRegion)
-				insertTagClose(structuredModel, endTagStructuredDocumentRegion);
-		}
-
-		// call insertMissingTags() next, it will generate implicit tags if
-		// there are any
-		// insertMissingTags() will return the new missing start tag if one is
-		// missing
-		renamedNode = insertMissingTags(renamedNode);
-
-		renamedNode = compressEmptyElementTag(renamedNode);
-
-		renamedNode = insertRequiredAttrs(renamedNode);
-
-		return renamedNode;
-	}
-
-	protected Node cleanupChildren(Node node) {
-		Node parentNode = node;
-
-		if (node != null) {
-			Node childNode = node.getFirstChild();
-			while (childNode != null) {
-				// get cleanup handler
-				IStructuredCleanupHandler cleanupHandler = getCleanupHandler(childNode);
-
-				// cleanup each child
-				childNode = cleanupHandler.cleanup(childNode);
-
-				// get new parent node
-				parentNode = childNode.getParentNode();
-
-				// get next child node
-				childNode = childNode.getNextSibling();
-			}
-		}
-
-		return parentNode;
-	}
-
-	private IDOMNode compressEmptyElementTag(IDOMNode node) {
-		boolean compressEmptyElementTags = getCleanupPreferences().getCompressEmptyElementTags();
-		IDOMNode newNode = node;
-
-		IStructuredDocumentRegion startTagStructuredDocumentRegion = newNode.getFirstStructuredDocumentRegion();
-		IStructuredDocumentRegion endTagStructuredDocumentRegion = newNode.getLastStructuredDocumentRegion();
-
-		if (compressEmptyElementTags && startTagStructuredDocumentRegion != endTagStructuredDocumentRegion && startTagStructuredDocumentRegion != null) {
-			ITextRegionList regions = startTagStructuredDocumentRegion.getRegions();
-			ITextRegion lastRegion = regions.get(regions.size() - 1);
-			// format children and end tag if not empty element tag
-			if (lastRegion.getType() != DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-				NodeList childNodes = newNode.getChildNodes();
-				if (childNodes == null || childNodes.getLength() == 0 || (childNodes.getLength() == 1 && (childNodes.item(0)).getNodeType() == Node.TEXT_NODE && ((childNodes.item(0)).getNodeValue().trim().length() == 0))) {
-					IDOMModel structuredModel = newNode.getModel();
-					IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
-					int startTagStartOffset = newNode.getStartOffset();
-					int offset = endTagStructuredDocumentRegion.getStart();
-					int length = endTagStructuredDocumentRegion.getLength();
-					structuredDocument.replaceText(structuredDocument, offset, length, ""); //$NON-NLS-1$
-					newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
-
-					offset = startTagStructuredDocumentRegion.getStart() + lastRegion.getStart();
-					structuredDocument.replaceText(structuredDocument, offset, 0, "/"); //$NON-NLS-1$
-					newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
-				}
-			}
-		}
-
-		return newNode;
-	}
-
-	protected IStructuredCleanupHandler getCleanupHandler(Node node) {
-		short nodeType = node.getNodeType();
-		IStructuredCleanupHandler cleanupHandler = null;
-		switch (nodeType) {
-			case org.w3c.dom.Node.ELEMENT_NODE : {
-				cleanupHandler = new ElementNodeCleanupHandler();
-				break;
-			}
-			case org.w3c.dom.Node.TEXT_NODE : {
-				cleanupHandler = new NodeCleanupHandler();
-				break;
-			}
-			default : {
-				cleanupHandler = new NodeCleanupHandler();
-			}
-		}
-
-		// init CleanupPreferences
-		cleanupHandler.setCleanupPreferences(getCleanupPreferences());
-
-		return cleanupHandler;
-	}
-
-
-	protected ModelQuery getModelQuery(Node node) {
-		if (node.getNodeType() == Node.DOCUMENT_NODE) {
-			return ModelQueryUtil.getModelQuery((Document) node);
-		} else {
-			return ModelQueryUtil.getModelQuery(node.getOwnerDocument());
-		}
-	}
-
-	protected List getRequiredAttrs(Node node) {
-		List result = new ArrayList();
-
-		ModelQuery modelQuery = getModelQuery(node);
-		if (modelQuery != null) {
-			CMElementDeclaration elementDecl = modelQuery.getCMElementDeclaration((Element) node);
-			if (elementDecl != null) {
-				CMNamedNodeMap attrMap = elementDecl.getAttributes();
-				Iterator it = attrMap.iterator();
-				CMAttributeDeclaration attr = null;
-				while (it.hasNext()) {
-					attr = (CMAttributeDeclaration) it.next();
-					if (attr.getUsage() == CMAttributeDeclaration.REQUIRED) {
-						result.add(attr);
-					}
-				}
-			}
-		}
-
-		return result;
-	}
-
-	private IDOMNode insertEndTag(IDOMNode node) {
-		IDOMNode newNode = node;
-		IDOMElement element = (IDOMElement) node;
-		if (element.isCommentTag())
-			return node; // do nothing
-
-		int startTagStartOffset = node.getStartOffset();
-		IDOMModel structuredModel = node.getModel();
-
-		if (isEmptyElement(element)) {
-			IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-			IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
-			ITextRegionList regions = startStructuredDocumentRegion.getRegions();
-			ITextRegion lastRegion = regions.get(regions.size() - 1);
-			structuredDocument.replaceText(structuredDocument, startStructuredDocumentRegion.getStartOffset(lastRegion), lastRegion.getLength(), EMPTY_TAG_CLOSE);
-
-			if (regions.size() > 1) {
-				ITextRegion regionBeforeTagClose = regions.get(regions.size() - 1 - 1);
-
-				// insert a space separator before tag close if the previous
-				// region does not have extra spaces
-				if (regionBeforeTagClose.getTextLength() == regionBeforeTagClose.getLength())
-					structuredDocument.replaceText(structuredDocument, startStructuredDocumentRegion.getStartOffset(lastRegion), 0, " "); //$NON-NLS-1$
-			}
-		} else {
-			String tagName = node.getNodeName();
-			String endTag = END_TAG_OPEN.concat(tagName).concat(TAG_CLOSE);
-
-			IDOMNode lastChild = (IDOMNode) node.getLastChild();
-			int endTagStartOffset = 0;
-			if (lastChild != null)
-				// if this node has children, insert the end tag after the
-				// last child
-				endTagStartOffset = lastChild.getEndOffset();
-			else
-				// if this node does not has children, insert the end tag
-				// after the start tag
-				endTagStartOffset = node.getEndOffset();
-
-			IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-			structuredDocument.replaceText(structuredDocument, endTagStartOffset, 0, endTag);
-		}
-
-		newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
-		// new
-		// node
-
-		return newNode;
-	}
-
-	private IDOMNode insertMissingTags(IDOMNode node) {
-		boolean insertMissingTags = getCleanupPreferences().getInsertMissingTags();
-		IDOMNode newNode = node;
-
-		if (insertMissingTags) {
-			IStructuredDocumentRegion startTagStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
-			if (startTagStructuredDocumentRegion == null) {
-				// implicit start tag; generate tag for it
-				newNode = insertStartTag(node);
-				startTagStructuredDocumentRegion = newNode.getStartStructuredDocumentRegion();
-			}
-
-			IStructuredDocumentRegion endTagStructuredDocumentRegion = newNode.getEndStructuredDocumentRegion();
-			ITextRegionList startStructuredDocumentRegionRegions = startTagStructuredDocumentRegion.getRegions();
-			if (startTagStructuredDocumentRegion != null && startStructuredDocumentRegionRegions != null && (startStructuredDocumentRegionRegions.get(startStructuredDocumentRegionRegions.size() - 1)).getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-
-			} else {
-				if (startTagStructuredDocumentRegion == null) {
-					// start tag missing
-					if (isStartTagRequired(newNode))
-						newNode = insertStartTag(newNode);
-				} else if (endTagStructuredDocumentRegion == null) {
-					// end tag missing
-					if (isEndTagRequired(newNode))
-						newNode = insertEndTag(newNode);
-				}
-			}
-		}
-
-		return newNode;
-	}
-
-	private IDOMNode insertRequiredAttrs(IDOMNode node) {
-		boolean insertRequiredAttrs = getCleanupPreferences().getInsertRequiredAttrs();
-		IDOMNode newNode = node;
-
-		if (insertRequiredAttrs) {
-			List requiredAttrs = getRequiredAttrs(newNode);
-			if (requiredAttrs.size() > 0) {
-				NamedNodeMap currentAttrs = node.getAttributes();
-				List insertAttrs = new ArrayList();
-				if (currentAttrs.getLength() == 0)
-					insertAttrs.addAll(requiredAttrs);
-				else {
-					for (int i = 0; i < requiredAttrs.size(); i++) {
-						String requiredAttrName = ((CMAttributeDeclaration) requiredAttrs.get(i)).getAttrName();
-						boolean found = false;
-						for (int j = 0; j < currentAttrs.getLength(); j++) {
-							String currentAttrName = currentAttrs.item(j).getNodeName();
-							if (requiredAttrName.compareToIgnoreCase(currentAttrName) == 0) {
-								found = true;
-								break;
-							}
-						}
-						if (!found)
-							insertAttrs.add(requiredAttrs.get(i));
-					}
-				}
-				if (insertAttrs.size() > 0) {
-					IStructuredDocumentRegion startStructuredDocumentRegion = newNode.getStartStructuredDocumentRegion();
-					int index = startStructuredDocumentRegion.getEndOffset();
-					ITextRegion lastRegion = startStructuredDocumentRegion.getLastRegion();
-					if (lastRegion.getType() == DOMRegionContext.XML_TAG_CLOSE) {
-						index--;
-						lastRegion = startStructuredDocumentRegion.getRegionAtCharacterOffset(index - 1);
-					} else if (lastRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-						index = index - 2;
-						lastRegion = startStructuredDocumentRegion.getRegionAtCharacterOffset(index - 1);
-					}
-					MultiTextEdit multiTextEdit = new MultiTextEdit();
-					try {
-						for (int i = insertAttrs.size() - 1; i >= 0; i--) {
-							CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) insertAttrs.get(i);
-							String requiredAttributeName = attrDecl.getAttrName();
-							String defaultValue = attrDecl.getDefaultValue();
-							if (defaultValue == null)
-								defaultValue = ""; //$NON-NLS-1$
-							String nameAndDefaultValue = " "; //$NON-NLS-1$
-							if (i == 0 && lastRegion.getLength() > lastRegion.getTextLength())
-								nameAndDefaultValue = ""; //$NON-NLS-1$
-							nameAndDefaultValue += requiredAttributeName + "=\"" + defaultValue + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-							multiTextEdit.addChild(new InsertEdit(index, nameAndDefaultValue));
-							// BUG3381: MultiTextEdit applies all child
-							// TextEdit's basing on offsets
-							//          in the document before the first TextEdit, not
-							// after each
-							//          child TextEdit. Therefore, do not need to
-							// advance the index.
-							//index += nameAndDefaultValue.length();
-						}
-						multiTextEdit.apply(newNode.getStructuredDocument());
-					} catch (BadLocationException e) {
-						// log for now, unless we find reason not to
-						Logger.log(Logger.INFO, e.getMessage());
-					}
-				}
-			}
-		}
-
-		return newNode;
-	}
-
-	private IDOMNode insertStartTag(IDOMNode node) {
-		IDOMNode newNode = node;
-
-		if (isCommentTag(node))
-			return node; // do nothing
-
-		String tagName = node.getNodeName();
-		String startTag = START_TAG_OPEN.concat(tagName).concat(TAG_CLOSE);
-		int startTagStartOffset = node.getStartOffset();
-
-		IDOMModel structuredModel = node.getModel();
-		IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-		structuredDocument.replaceText(structuredDocument, startTagStartOffset, 0, startTag);
-		newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
-		// new
-		// node
-
-		return newNode;
-	}
-
-	private void insertTagClose(IDOMModel structuredModel, IStructuredDocumentRegion flatNode) {
-		if (flatNode != null) {
-			ITextRegionList flatnodeRegions = flatNode.getRegions();
-			if (flatnodeRegions != null) {
-				ITextRegion lastRegion = flatnodeRegions.get(flatnodeRegions.size() - 1);
-				if (lastRegion != null) {
-					String regionType = lastRegion.getType();
-					if ((regionType != DOMRegionContext.XML_EMPTY_TAG_CLOSE) && (regionType != DOMRegionContext.XML_TAG_CLOSE)) {
-						IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
-						// insert ">" after lastRegion of flatNode
-						// as in "<a</a>" if flatNode is for start tag, or in
-						// "<a></a" if flatNode is for end tag
-						structuredDocument.replaceText(structuredDocument, flatNode.getTextEndOffset(lastRegion), 0, ">"); //$NON-NLS-1$
-					}
-				}
-			}
-		}
-	}
-
-	/**
-	 * @param renamedNode
-	 * @return
-	 */
-	private boolean isCommentTag(Node renamedNode) {
-		boolean result = false;
-		if (renamedNode instanceof IDOMElement) {
-			IDOMElement element = (IDOMElement) renamedNode;
-			result = element.isCommentTag();
-		}
-		return result;
-	}
-
-	private boolean isEmptyElement(IDOMElement element) {
-		Document document = element.getOwnerDocument();
-		if (document == null)
-			// undefined tag, return default
-			return false;
-
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
-		if (modelQuery == null)
-			// undefined tag, return default
-			return false;
-
-		CMElementDeclaration decl = modelQuery.getCMElementDeclaration(element);
-		if (decl == null)
-			// undefined tag, return default
-			return false;
-
-		return (decl.getContentType() == CMElementDeclaration.EMPTY);
-	}
-
-	private boolean isEndTagRequired(IDOMNode node) {
-		if (node == null)
-			return false;
-		return node.isContainer();
-	}
-
-	/**
-	 * A tag is implicit if it has not corresponding region in document.
-	 * 
-	 * @param renamedNode
-	 * @return
-	 */
-	private boolean isImplicitTag(IDOMNode renamedNode) {
-		return renamedNode.getStartStructuredDocumentRegion() == null;
-	}
-
-	/**
-	 * The end tags of HTML EMPTY content type, such as IMG, and HTML
-	 * undefined tags are parsed separately from the start tags. So inserting
-	 * the missing start tag is useless and even harmful.
-	 */
-	private boolean isStartTagRequired(IDOMNode node) {
-		if (node == null)
-			return false;
-		return node.isContainer();
-	}
-
-	private boolean isXMLType(IDOMModel structuredModel) {
-		boolean result = false;
-
-		if (structuredModel != null && structuredModel != null) {
-			IDOMDocument document = structuredModel.getDocument();
-
-			if (document != null)
-				result = document.isXMLType();
-		}
-
-		return result;
-	}
-
-	private IDOMNode quoteAttrValue(IDOMNode node) {
-		IDOMNode newNode = node;
-		//XMLElement element = (XMLElement) node;
-		if (isCommentTag(node))
-			return node; // do nothing
-
-		boolean quoteAttrValues = getCleanupPreferences().getQuoteAttrValues();
-
-		if (quoteAttrValues) {
-			NamedNodeMap attributes = newNode.getAttributes();
-			if (attributes != null) {
-				int attributesLength = attributes.getLength();
-				ISourceGenerator generator = node.getModel().getGenerator();
-
-				for (int i = 0; i < attributesLength; i++) {
-					attributes = newNode.getAttributes();
-					attributesLength = attributes.getLength();
-					IDOMAttr eachAttr = (IDOMAttr) attributes.item(i);
-					//ITextRegion oldAttrValueRegion =
-					// eachAttr.getValueRegion();
-					String oldAttrValue = eachAttr.getValueRegionText();
-					if (oldAttrValue == null) {
-						IDOMModel structuredModel = node.getModel();
-						if (isXMLType(structuredModel)) {
-							String newAttrValue = "\"" + eachAttr.getNameRegionText() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-
-							IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-							if (eachAttr.getEqualRegion() != null)
-								// equal region exists
-								structuredDocument.replaceText(structuredDocument, eachAttr.getEndOffset(), 0, newAttrValue);
-							else
-								// no equal region
-								structuredDocument.replaceText(structuredDocument, eachAttr.getNameRegionTextEndOffset(), 0, "=".concat(newAttrValue)); //$NON-NLS-1$
-							newNode = (IDOMNode) structuredModel.getIndexedRegion(node.getStartOffset()); // save
-							// new
-							// node
-						}
-					} else {
-						//String oldAttrValue = oldAttrValueRegion.getText();
-						char quote = StringUtils.isQuoted(oldAttrValue) ? oldAttrValue.charAt(0) : DOUBLE_QUOTE;
-						String newAttrValue = generator.generateAttrValue(eachAttr, quote);
-
-						// There is a problem in
-						// StructuredDocumentRegionUtil.getAttrValue(ITextRegion)
-						// when the region is instanceof ContextRegion.
-						// Workaround for now...
-						if (oldAttrValue.length() == 1) {
-							char firstChar = oldAttrValue.charAt(0);
-							if (firstChar == SINGLE_QUOTE)
-								newAttrValue = SINGLE_QUOTES;
-							else if (firstChar == DOUBLE_QUOTE)
-								newAttrValue = DOUBLE_QUOTES;
-						}
-
-						if (newAttrValue != null) {
-							if (newAttrValue.compareTo(oldAttrValue) != 0) {
-								int attrValueStartOffset = eachAttr.getValueRegionStartOffset();
-								int attrValueLength = oldAttrValue.length();
-								int startTagStartOffset = node.getStartOffset();
-
-								IDOMModel structuredModel = node.getModel();
-								IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-								structuredDocument.replaceText(structuredDocument, attrValueStartOffset, attrValueLength, newAttrValue);
-								newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
-								// new
-								// node
-							}
-						}
-					}
-				}
-			}
-		}
-
-		return newNode;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/NodeCleanupHandler.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/NodeCleanupHandler.java
deleted file mode 100644
index 95c2097..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/NodeCleanupHandler.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.cleanup;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.w3c.dom.Node;
-
-
-public class NodeCleanupHandler implements IStructuredCleanupHandler {
-
-	protected IStructuredCleanupPreferences fCleanupPreferences = null;
-	protected IProgressMonitor fProgressMonitor = null;
-
-
-	public Node cleanup(Node node) {
-
-		return node;
-	}
-
-	public IStructuredCleanupPreferences getCleanupPreferences() {
-		if (fCleanupPreferences == null) {
-			fCleanupPreferences = new StructuredCleanupPreferences();
-
-			Preferences preferences = getModelPreferences();
-			if (preferences != null) {
-				fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
-				fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
-				fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(XMLCorePreferenceNames.INSERT_MISSING_TAGS));
-				fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(XMLCorePreferenceNames.QUOTE_ATTR_VALUES));
-				fCleanupPreferences.setFormatSource(preferences.getBoolean(XMLCorePreferenceNames.FORMAT_SOURCE));
-				fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(XMLCorePreferenceNames.CONVERT_EOL_CODES));
-				fCleanupPreferences.setEOLCode(preferences.getString(XMLCorePreferenceNames.CLEANUP_EOL_CODE));
-			}
-		}
-
-		return fCleanupPreferences;
-	}
-
-	protected Preferences getModelPreferences() {
-		return XMLCorePlugin.getDefault().getPluginPreferences();
-	}
-
-	public void setCleanupPreferences(IStructuredCleanupPreferences cleanupPreferences) {
-
-		fCleanupPreferences = cleanupPreferences;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/XMLCleanupPreferencesImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/XMLCleanupPreferencesImpl.java
deleted file mode 100644
index 473c487..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/XMLCleanupPreferencesImpl.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLPreferenceNames;
-
-/**
- * @deprecated renamed to StructuredCleanupPreferences
- * 
- * TODO will delete in C5
- */
-public class XMLCleanupPreferencesImpl {
-
-	private static XMLCleanupPreferencesImpl fInstance;
-
-	public synchronized static XMLCleanupPreferencesImpl getInstance() {
-
-		// added for one method in CleanupDialog ... may be better way
-		if (fInstance == null) {
-			fInstance = new XMLCleanupPreferencesImpl();
-		}
-		return fInstance;
-	}
-
-	private int fAttrNameCase;
-	private boolean fConvertEOLCodes;
-	private String fEOLCode;
-	private boolean fFormatSource;
-	private boolean fInsertMissingTags;
-	// private IPreferenceStore fPreferenceStore = null;
-	private Preferences fPreferences = null;
-	private boolean fQuoteAttrValues;
-	private int fTagNameCase;
-
-	public int getAttrNameCase() {
-
-		return fAttrNameCase;
-	}
-
-	public boolean getConvertEOLCodes() {
-
-		return fConvertEOLCodes;
-	}
-
-	public String getEOLCode() {
-
-		return fEOLCode;
-	}
-
-	public boolean getFormatSource() {
-
-		return fFormatSource;
-	}
-
-	public boolean getInsertMissingTags() {
-
-		return fInsertMissingTags;
-	}
-
-	public Preferences getPreferences() {
-
-		if (fPreferences == null) {
-			fPreferences = SSECorePlugin.getDefault().getPluginPreferences();
-		}
-		return fPreferences;
-	}
-
-	public boolean getQuoteAttrValues() {
-
-		return fQuoteAttrValues;
-	}
-
-	public int getTagNameCase() {
-
-		return fTagNameCase;
-	}
-
-	public void setAttrNameCase(int attrNameCase) {
-
-		fAttrNameCase = attrNameCase;
-	}
-
-	public void setConvertEOLCodes(boolean convertEOLCodes) {
-
-		fConvertEOLCodes = convertEOLCodes;
-	}
-
-	public void setEOLCode(String EOLCode) {
-
-		fEOLCode = EOLCode;
-	}
-
-	public void setFormatSource(boolean formatSource) {
-
-		fFormatSource = formatSource;
-	}
-
-	public void setInsertMissingTags(boolean insertMissingTags) {
-
-		fInsertMissingTags = insertMissingTags;
-	}
-
-	public void setPreferences(Preferences prefs) {
-
-		fPreferences = prefs;
-		updateOptions();
-	}
-
-	public void setQuoteAttrValues(boolean quoteAttrValues) {
-
-		fQuoteAttrValues = quoteAttrValues;
-	}
-
-	public void setTagNameCase(int tagNameCase) {
-
-		fTagNameCase = tagNameCase;
-	}
-
-	protected void updateOptions() {
-
-		Preferences p = getPreferences();
-		fTagNameCase = p.getInt(IXMLPreferenceNames.CLEANUP_TAG_NAME_CASE);
-		fAttrNameCase = p.getInt(IXMLPreferenceNames.CLEANUP_ATTR_NAME_CASE);
-		fInsertMissingTags = p.getBoolean(IXMLPreferenceNames.INSERT_MISSING_TAGS);
-		fQuoteAttrValues = p.getBoolean(IXMLPreferenceNames.QUOTE_ATTR_VALUES);
-		fFormatSource = p.getBoolean(IXMLPreferenceNames.FORMAT_SOURCE);
-		fConvertEOLCodes = p.getBoolean(IXMLPreferenceNames.CONVERT_EOL_CODES);
-		fEOLCode = p.getString(IXMLPreferenceNames.CLEANUP_EOL_CODE);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java
deleted file mode 100644
index c06af5e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.commentelement;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.commentelement.impl.CommentElementConfiguration;
-import org.eclipse.wst.xml.core.internal.document.TagAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-
-/**
- */
-public class CommentElementAdapter implements TagAdapter {
-	private CommentElementConfiguration fConfiguration;
-
-	private boolean fEndTag;
-	private CommentElementHandler fHandler;
-
-	public CommentElementAdapter(boolean isEndTag, CommentElementHandler handler) {
-		fEndTag = isEndTag;
-		fHandler = handler;
-	}
-
-	private String generateCommentClose(IDOMElement element) {
-		return (element.isJSPTag()) ? "--%>" : "-->"; //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	private String generateCommentOpen(IDOMElement element) {
-		return (element.isJSPTag()) ? "<%--" : "<!--"; //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	private CommentElementConfiguration getConfiguration() {
-		return fConfiguration;
-	}
-
-	public String getEndTag(IDOMElement element) {
-		String content = fHandler.generateEndTagContent(element);
-		if (content == null) {
-			return null;
-		}
-		StringBuffer buffer = new StringBuffer();
-
-		buffer.append(generateCommentOpen(element));
-		buffer.append(content);
-		buffer.append(generateCommentClose(element));
-
-		return buffer.toString();
-	}
-
-	public String getHandlerID() {
-		return getConfiguration().getHandlerID();
-	}
-
-
-	public String getProperty(String name) {
-		return getConfiguration().getProperty(name);
-	}
-
-	public String getStartTag(IDOMElement element) {
-		String content = fHandler.generateStartTagContent(element);
-		if (content == null) {
-			return null;
-		}
-		StringBuffer buffer = new StringBuffer();
-
-		buffer.append(generateCommentOpen(element));
-		buffer.append(content);
-		buffer.append(generateCommentClose(element));
-
-		return buffer.toString();
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return (type == CommentElementAdapter.class || type == TagAdapter.class);
-	}
-
-	public boolean isContainer() {
-		return (!fHandler.isEmpty());
-	}
-
-	public boolean isEndTag() {
-		return fEndTag;
-	}
-
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-	}
-
-	public void setConfiguration(CommentElementConfiguration configuration) {
-		fConfiguration = configuration;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementHandler.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementHandler.java
deleted file mode 100644
index 93e8e6e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementHandler.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.commentelement;
-
-
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- */
-public interface CommentElementHandler {
-	/**
-	 * This method is called when the prefix of the comment content matches
-	 * the string specified in &lt;startswith prefix=""/&gt; in plugin
-	 * extension. Comment content is parsed and new DOM element is created in
-	 * this method. Implementor has to do following:
-	 * <li>For start tag :
-	 * <ul>
-	 * <li>parse comment content and create new element instance.</li>
-	 * </ul>
-	 * </li>
-	 * <li>For end tag :
-	 * <ul>
-	 * <li>parse comment content and create new element instance.</li>
-	 * <li>make isEndTag flag true.</li>
-	 * <li>Parser framework searches mached start tag element instance after
-	 * this createElement call, and new instance is just thrown away.</li>
-	 * </ul>
-	 * </li>
-	 * <li>For empty tag :
-	 * <ul>
-	 * <li>parse comment content and create new element instance.</li>
-	 * <li>make isEndTag flag true.</li>
-	 * </ul>
-	 * </li>
-	 * 
-	 * @param document
-	 *            parent DOM document
-	 * @param data
-	 *            comment content. comment prefix (&lt;!-- or &lt;%--), suffix
-	 *            (--&gt; or --%&gt;), and surrounding spaces are trimmed.
-	 * @param isJSPTag
-	 *            true if the comment is JSP style comment. This information
-	 *            may be required by handler when the handler accepts both XML
-	 *            style and JSP style comment (namely,
-	 *            commenttype=&quot;both&quot; in plugin.xml).
-	 * @return comment element instance if the comment content is rightly
-	 *         parsed. if parse failed, returns null.
-	 */
-	Element createElement(Document document, String data, boolean isJSPTag);
-
-	/**
-	 * This method generates the source text of the end tag for the passed
-	 * element. Do not generate comment prefix (&lt;!-- or &lt;%--) and suffix
-	 * (--&gt; or --%&gt;). XMLGenerator uses this method to generate XML/HTML
-	 * source for a comment element.
-	 * 
-	 * @param element
-	 *            the comment element
-	 * @return generated tag string
-	 */
-	String generateEndTagContent(IDOMElement element);
-
-	/**
-	 * This method generates the source text of the start tag for the passed
-	 * element. Do not generate comment prefix (&lt;!-- or &lt;%--) and suffix
-	 * (--&gt; or --%&gt;). XMLGenerator uses this method to generate XML/HTML
-	 * source for a comment element.
-	 * 
-	 * @param element
-	 *            the comment element
-	 * @return generated tag string
-	 */
-	String generateStartTagContent(IDOMElement element);
-
-	/**
-	 * 
-	 * @param element
-	 *            the element
-	 * @return boolean whether the element is comment element or not
-	 */
-	boolean isCommentElement(IDOMElement element);
-
-	/**
-	 * 
-	 * @return boolean whether this element can have children or not
-	 */
-	boolean isEmpty();
-
-	/**
-	 * @return String
-	 */
-	//	String getElementPrefix();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/BasicCommentElementHandler.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/BasicCommentElementHandler.java
deleted file mode 100644
index caf6228..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/BasicCommentElementHandler.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.commentelement.impl;
-
-
-
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler;
-import org.eclipse.wst.xml.core.internal.commentelement.util.CommentElementFactory;
-import org.eclipse.wst.xml.core.internal.commentelement.util.TagScanner;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-
-/**
- */
-class BasicCommentElementHandler implements CommentElementHandler {
-
-	private String elementName;
-	private boolean isEmpty;
-
-	public BasicCommentElementHandler(String elementName, boolean isEmpty) {
-		super();
-		this.elementName = elementName;
-		this.isEmpty = isEmpty;
-	}
-
-
-	public Element createElement(Document document, String data, boolean isJSPTag) {
-		Element element = null;
-		String str = data.trim();
-		CommentElementFactory factory = new CommentElementFactory(document, isJSPTag, this);
-		if (str.charAt(0) == '/') { // end tag
-			TagScanner scanner = new TagScanner(str, 1); // skip '/'
-			String name = scanner.nextName();
-			if (name.equals(elementName)) {
-				element = factory.create(name, CommentElementFactory.IS_END);
-			}
-		} else { // start tag
-			TagScanner scanner = new TagScanner(str, 0);
-			String name = scanner.nextName();
-			if (name.equals(elementName)) {
-				element = factory.create(name, (isEmpty) ? CommentElementFactory.IS_EMPTY : CommentElementFactory.IS_START);
-				// set attributes
-				String attrName = scanner.nextName();
-				while (attrName != null) {
-					String attrValue = scanner.nextValue();
-					Attr attr = document.createAttribute(attrName);
-					if (attr != null) {
-						if (attrValue != null)
-							((IDOMAttr) attr).setValueSource(attrValue);
-						element.setAttributeNode(attr);
-					}
-					attrName = scanner.nextName();
-				}
-			}
-		}
-		return element;
-	}
-
-
-	public String generateEndTagContent(IDOMElement element) {
-		if (isEmpty) {
-			return null;
-		}
-		ISourceGenerator generator = element.getModel().getGenerator();
-		StringBuffer buffer = new StringBuffer();
-
-		buffer.append(" /"); //$NON-NLS-1$
-		String tagName = generator.generateTagName(element);
-		if (tagName != null) {
-			buffer.append(tagName);
-		}
-		buffer.append(' ');
-
-		return buffer.toString();
-	}
-
-	public String generateStartTagContent(IDOMElement element) {
-		ISourceGenerator generator = element.getModel().getGenerator();
-		StringBuffer buffer = new StringBuffer();
-
-		buffer.append(' ');
-		String tagName = generator.generateTagName(element);
-		if (tagName != null) {
-			buffer.append(tagName);
-		}
-
-		NamedNodeMap attributes = element.getAttributes();
-		int length = attributes.getLength();
-		for (int i = 0; i < length; i++) {
-			Attr attr = (Attr) attributes.item(i);
-			if (attr == null) {
-				continue;
-			}
-			buffer.append(' ');
-			String attrName = generator.generateAttrName(attr);
-			if (attrName != null) {
-				buffer.append(attrName);
-			}
-			String attrValue = generator.generateAttrValue(attr);
-			if (attrValue != null) {
-				// attr name only for HTML boolean and JSP
-				buffer.append('=');
-				buffer.append(attrValue);
-			}
-		}
-
-		buffer.append(' ');
-
-		return buffer.toString();
-	}
-
-	public boolean isCommentElement(IDOMElement element) {
-		return (element != null && element.getTagName().equals(elementName)) ? true : false;
-	}
-
-	public boolean isEmpty() {
-		return isEmpty;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java
deleted file mode 100644
index 73133b2..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.commentelement.impl;
-
-
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementAdapter;
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- */
-public class CommentElementConfiguration {
-	private Map fAttributes = null;
-	private boolean fCustom;
-	private IConfigurationElement fElement = null;
-
-	private boolean fEmpty;
-	private CommentElementHandler fHandler = null;
-	private String fID = null;
-	private boolean fJSPComment;
-	private String[] fPrefix = null;
-	private boolean fXMLComment;
-
-	CommentElementConfiguration() {
-		super();
-	}
-
-	CommentElementConfiguration(IConfigurationElement element) {
-		super();
-		fElement = element;
-		fCustom = (element.getName().equalsIgnoreCase("handler-custom")) ? true : false; //$NON-NLS-1$
-
-		fillAttributes(element);
-
-		fXMLComment = fJSPComment = false;
-		String commentType = getProperty("commenttype"); //$NON-NLS-1$
-		if (commentType.equalsIgnoreCase("xml")) { //$NON-NLS-1$
-			fXMLComment = true;
-		} else if (commentType.equalsIgnoreCase("jsp")) { //$NON-NLS-1$
-			fJSPComment = true;
-		} else if (commentType.equalsIgnoreCase("both")) { //$NON-NLS-1$
-			fXMLComment = fJSPComment = true;
-		}
-		String empty = getProperty("isempty"); //$NON-NLS-1$
-		fEmpty = (empty != null && !empty.equals("false")) ? true : false; //$NON-NLS-1$
-	}
-
-	public boolean acceptJSPComment() {
-		return fJSPComment;
-	}
-
-	public boolean acceptXMLComment() {
-		return fXMLComment;
-	}
-
-	public Element createElement(Document document, String data, boolean isJSPTag) {
-		IDOMElement element = (IDOMElement) getHandler().createElement(document, data, isJSPTag);
-		if (element != null) {
-			CommentElementAdapter adapter = (CommentElementAdapter) element.getAdapterFor(CommentElementAdapter.class);
-			if (adapter != null) {
-				adapter.setConfiguration(this);
-			}
-		}
-		return element;
-	}
-
-	private void fillAttributes(IConfigurationElement element) {
-		if (fAttributes == null) {
-			fAttributes = new HashMap();
-		} else {
-			fAttributes.clear();
-		}
-		String[] names = element.getAttributeNames();
-		if (names == null) {
-			return;
-		}
-		int length = names.length;
-		for (int i = 0; i < length; i++) {
-			String name = names[i];
-			fAttributes.put(name.toLowerCase(), element.getAttribute(name));
-		}
-	}
-
-	public CommentElementHandler getHandler() {
-		if (fHandler == null) {
-			if (fElement != null) {
-				try {
-					if (isCustom()) {
-						fHandler = (CommentElementHandler) fElement.createExecutableExtension("class"); //$NON-NLS-1$
-					} else {
-						String elementName = getProperty("elementname"); //$NON-NLS-1$
-						fHandler = new BasicCommentElementHandler(elementName, fEmpty);
-					}
-					//					((AbstractCommentElementHandler)fHandler).setElementPrefix(fElement.getAttribute("prefix"));
-				} catch (Exception e) {
-					// catch and log (and ignore) ANY exception created
-					// by executable extension.
-					Logger.logException(e);
-					fHandler = null;
-				}
-			}
-			if (fHandler == null) {
-				fHandler = new CommentElementHandler() {
-					public Element createElement(Document document, String data, boolean isJSPTag) {
-						return null;
-					}
-
-					public String generateEndTagContent(IDOMElement element) {
-						return null;
-					}
-
-					public String generateStartTagContent(IDOMElement element) {
-						return null;
-					}
-
-// removed in RC2, ro removed "unused" error/warning
-//					public String getElementPrefix() {
-//						return null;
-//					}
-
-					public boolean isCommentElement(IDOMElement element) {
-						return false;
-					}
-
-					public boolean isEmpty() {
-						return false;
-					}
-				};
-			}
-		}
-		return fHandler;
-	}
-
-	public String getHandlerID() {
-		if (fID == null) {
-			fID = getProperty("id"); //$NON-NLS-1$
-			if (fID == null) {
-				if (isCustom()) {
-					fID = getProperty("class"); //$NON-NLS-1$				
-				} else {
-					StringBuffer buf = new StringBuffer();
-					buf.append(fElement.getDeclaringExtension().getNamespace());
-					buf.append('.');
-					buf.append(getProperty("elementname")); //$NON-NLS-1$
-					fID = buf.toString();
-				}
-			}
-		}
-		return fID;
-	}
-
-
-	public String[] getPrefix() {
-		if (fPrefix == null) {
-			if (fElement != null) {
-				if (isCustom()) { // custom
-					IConfigurationElement[] prefixes = fElement.getChildren("startwith"); //$NON-NLS-1$	
-					if (prefixes != null) {
-						fPrefix = new String[prefixes.length];
-						for (int i = 0; i < prefixes.length; i++) {
-							fPrefix[i] = prefixes[i].getAttribute("prefix"); //$NON-NLS-1$	
-						}
-					}
-				} else { // basic
-					String name = getProperty("elementname"); //$NON-NLS-1$
-					if (name != null) {
-						if (isEmpty()) {
-							fPrefix = new String[1];
-							fPrefix[0] = name;
-						} else {
-							fPrefix = new String[2];
-							fPrefix[0] = name;
-							fPrefix[1] = '/' + name;
-						}
-					}
-				}
-			}
-		}
-		if (fPrefix == null) {
-			fPrefix = new String[1];
-			fPrefix[0] = ""; //$NON-NLS-1$
-		}
-		return fPrefix;
-	}
-
-	public String getProperty(String name) {
-		return (fAttributes != null) ? (String) fAttributes.get(name) : null;
-	}
-
-	private boolean isCustom() {
-		return fCustom;
-	}
-
-	private boolean isEmpty() {
-		return fEmpty;
-	}
-
-	void setupCommentElement(IDOMElement element) {
-		element.setCommentTag(true);
-		CommentElementAdapter adapter = new CommentElementAdapter(false, fHandler);
-		adapter.setConfiguration(this);
-		element.addAdapter(adapter);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementRegistry.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementRegistry.java
deleted file mode 100644
index efd1f67..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementRegistry.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.commentelement.impl;
-
-
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-
-/**
- */
-public class CommentElementRegistry {
-
-	private static CommentElementRegistry fInstance = null;
-
-	public synchronized static CommentElementRegistry getInstance() {
-		if (fInstance == null) {
-			fInstance = new CommentElementRegistry();
-		}
-		return fInstance;
-	}
-
-	private String EXTENSION_POINT_ID = "commentElementHandler"; //$NON-NLS-1$
-	private CommentElementConfiguration[] fConfigurations = null;
-
-	private String PLUGIN_ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
-
-	/**
-	 * Constructor for CommentElementRegistry.
-	 */
-	private CommentElementRegistry() {
-		super();
-	}
-
-	public CommentElementConfiguration[] getConfigurations() {
-		if (fConfigurations == null) {
-			IExtensionRegistry registry = Platform.getExtensionRegistry();
-			IExtensionPoint point = registry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
-			if (point != null) {
-				IConfigurationElement[] elements = point.getConfigurationElements();
-				fConfigurations = new CommentElementConfiguration[elements.length];
-				for (int i = 0; i < elements.length; i++) {
-					fConfigurations[i] = new CommentElementConfiguration(elements[i]);
-				}
-			}
-			if (fConfigurations == null) {
-				fConfigurations = new CommentElementConfiguration[0];
-			}
-		}
-		return fConfigurations;
-	}
-
-	public boolean setupCommentElement(IDOMElement element) {
-		CommentElementConfiguration configurations[] = getConfigurations();
-		int length = configurations.length;
-		for (int i = 0; i < length; i++) {
-			CommentElementConfiguration conf = configurations[i];
-			boolean isJSP = element.isJSPTag();
-			if (isJSP && conf.acceptJSPComment() || !isJSP && conf.acceptXMLComment()) {
-				CommentElementHandler handler = conf.getHandler();
-				if (handler.isCommentElement(element)) {
-					conf.setupCommentElement(element);
-					return true;
-				}
-			}
-		}
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/CommentElementFactory.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/CommentElementFactory.java
deleted file mode 100644
index 2ac27ba..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/CommentElementFactory.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.commentelement.util;
-
-
-
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementAdapter;
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- */
-public class CommentElementFactory {
-	public static final int IS_EMPTY = 4866;
-	public static final int IS_END = 1808;
-
-	public static final int IS_START = 28011;
-
-	private Document fDocument;
-	private CommentElementHandler fHandler;
-	private boolean fJSPTag;
-
-	/**
-	 * Constructor for CommentElementFactory.
-	 */
-	private CommentElementFactory() {
-		super();
-	}
-
-	public CommentElementFactory(Document document, boolean isJSPTag, CommentElementHandler handler) {
-		this();
-		fDocument = document;
-		fJSPTag = isJSPTag;
-		fHandler = handler;
-	}
-
-	public Element create(String name, int nodeType) {
-		IDOMElement element = (IDOMElement) fDocument.createElement(name);
-		if (element == null)
-			return null;
-		element.setCommentTag(true);
-		if (nodeType == IS_EMPTY) {
-			element.setEmptyTag(true);
-		}
-		element.setJSPTag(fJSPTag);
-
-		CommentElementAdapter adapter = new CommentElementAdapter((nodeType == IS_END), fHandler);
-		element.addAdapter(adapter);
-
-		return element;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/TagScanner.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/TagScanner.java
deleted file mode 100644
index 1d0d404..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/TagScanner.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.commentelement.util;
-
-
-
-/**
- */
-public class TagScanner {
-
-	/**
-	 */
-	private static boolean isEqual(char c) {
-		return (c == '=');
-	}
-
-	/**
-	 */
-	private static boolean isQuote(char c) {
-		return (c == '"' || c == '\'');
-	}
-
-	/**
-	 */
-	private static boolean isSpace(char c) {
-		return Character.isWhitespace(c);
-	}
-
-	private int length = 0;
-	private int memOffset = 0;
-	private int offset = 0;
-	private boolean oneLine = false;
-
-	private String tag = null;
-
-	/**
-	 */
-	public TagScanner(String tag, int offset) {
-		super();
-
-		this.tag = tag;
-		this.offset = offset;
-		this.memOffset = -1;
-		if (tag != null)
-			this.length = tag.length();
-	}
-
-	/**
-	 */
-	public TagScanner(String tag, int offset, boolean oneLine) {
-		this(tag, offset);
-
-		this.oneLine = oneLine;
-	}
-
-	/**
-	 */
-	public int getNextOffset() {
-		int i;
-		char c;
-		for (i = offset; i < length; i++) {
-			c = tag.charAt(i);
-			if (isEnd(c))
-				break;
-			if (isQuote(c)) {
-				i++;
-				break;
-			}
-			if (!isSpace(c) && !isEqual(c))
-				break;
-		}
-		return i;
-	}
-
-	/**
-	 */
-	public int getOffset() {
-		return this.memOffset;
-	}
-
-	/**
-	 */
-	private final boolean isEnd(char c) {
-		return (this.oneLine && (c == '\r' || c == '\n'));
-	}
-
-	/**
-	 */
-	public boolean isNewLine() {
-		if (oneLine)
-			return false;
-		char c;
-		for (int i = memOffset - 1; 0 <= i; i--) {
-			c = tag.charAt(i);
-			if (c == '\r' || c == '\n')
-				return true;
-			if (!isSpace(c))
-				return false;
-		}
-		return false;
-	}
-
-	/**
-	 */
-	private char nextChar() {
-		for (; this.offset < this.length; this.offset++) {
-			char c = this.tag.charAt(this.offset);
-			if (isEnd(c))
-				break;
-			if (!isSpace(c))
-				return c;
-		}
-		return 0;
-	}
-
-	/**
-	 */
-	public String nextName() {
-		if (this.tag == null)
-			return null;
-		if (this.offset >= this.length)
-			return null;
-
-		if (nextChar() == 0)
-			return null;
-
-		int nameOffset = this.offset;
-		for (; this.offset < this.length; this.offset++) {
-			char c = this.tag.charAt(this.offset);
-			if (isEnd(c) || isSpace(c))
-				break;
-			if (isEqual(c) && this.offset > nameOffset)
-				break;
-		}
-		if (this.offset == nameOffset)
-			return null;
-
-		this.memOffset = nameOffset;
-		return this.tag.substring(nameOffset, this.offset);
-	}
-
-	/**
-	 */
-	public String nextValue() {
-		if (this.tag == null)
-			return null;
-		if (this.offset >= this.length)
-			return null;
-
-		char seperator = nextChar();
-		if (!isEqual(seperator))
-			return null;
-		this.offset++; // skip '='
-		char quote = nextChar();
-		if (quote == 0)
-			return null;
-		if (isQuote(quote))
-			this.offset++;
-		else
-			quote = 0;
-
-		int valueOffset = this.offset;
-		for (; this.offset < this.length; this.offset++) {
-			char c = this.tag.charAt(this.offset);
-			if (isEnd(c)) {
-				quote = 0;
-				break;
-			}
-			if (quote == 0) {
-				if (isSpace(c))
-					break;
-			} else {
-				if (c == quote)
-					break;
-			}
-		}
-		int valueEnd = this.offset;
-		if (quote != 0 && this.offset < this.length)
-			this.offset++;
-		if (valueEnd == valueOffset)
-			return null;
-
-		this.memOffset = valueOffset;
-		return this.tag.substring(valueOffset, valueEnd);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/AbstractResourceEncodingDetector.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/AbstractResourceEncodingDetector.java
deleted file mode 100644
index fcbcbea..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/AbstractResourceEncodingDetector.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contenttype;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.UnsupportedCharsetException;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-
-
-public abstract class AbstractResourceEncodingDetector implements IResourceCharsetDetector {
-
-	protected EncodingMemento fEncodingMemento;
-
-	protected boolean fHeaderParsed;
-
-	protected Reader fReader;
-
-	/**
-	 *  
-	 */
-	public AbstractResourceEncodingDetector() {
-		super();
-	}
-
-	/**
-	 * Note: once this instance is created, trace info still needs to be
-	 * appended by caller, depending on the context its created.
-	 */
-	private void createEncodingMemento(String detectedCharsetName) {
-		fEncodingMemento = new EncodingMemento();
-		fEncodingMemento.setJavaCharsetName(getAppropriateJavaCharset(detectedCharsetName));
-		fEncodingMemento.setDetectedCharsetName(detectedCharsetName);
-		// TODO: if detectedCharset and spec default is
-		// null, need to use "work
-		// bench based" defaults.
-		fEncodingMemento.setAppropriateDefault(getSpecDefaultEncoding());
-	}
-
-	/**
-	 * convience method all subclasses can use (but not override)
-	 * 
-	 * @param detectedCharsetName
-	 * @param reason
-	 */
-	final protected void createEncodingMemento(String detectedCharsetName, String reason) {
-		createEncodingMemento(detectedCharsetName);
-	}
-
-	/**
-	 * convience method all subclasses can use (but not override)
-	 */
-	final protected void ensureInputSet() {
-		if (fReader == null) {
-			throw new IllegalStateException("input must be set before use"); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * This method can return null, if invalid charset name (in which case
-	 * "appropriateDefault" should be used, if a name is really need for some
-	 * "save anyway" cases).
-	 * 
-	 * @param detectedCharsetName
-	 * @return
-	 */
-	private String getAppropriateJavaCharset(String detectedCharsetName) {
-		String result = null;
-		// 1. Check explicit mapping overrides from
-		// property file -- its here we pick up "rules" for cases
-		// that are not even in Java
-		result = CodedIO.checkMappingOverrides(detectedCharsetName);
-		// 2. Use the "canonical" name from JRE mappings
-		// Note: see Charset JavaDoc, the name you get one
-		// with can be alias,
-		// the name you get back is "standard" name.
-		Charset javaCharset = null;
-		try {
-			javaCharset = Charset.forName(detectedCharsetName);
-		} catch (UnsupportedCharsetException e) {
-			// only set invalid, if result is same as detected -- they won't
-			// be equal if
-			// overridden
-			if (result != null && result.equals(detectedCharsetName)) {
-				fEncodingMemento.setInvalidEncoding(detectedCharsetName);
-			}
-		} catch (IllegalCharsetNameException e) {
-			// only set invalid, if result is same as detected -- they won't
-			// be equal if
-			// overridden
-			if (result != null && result.equals(detectedCharsetName)) {
-				fEncodingMemento.setInvalidEncoding(detectedCharsetName);
-			}
-		}
-		// give priority to java cononical name, if present
-		if (javaCharset != null) {
-			result = javaCharset.name();
-			// but still allow overrides
-			result = CodedIO.checkMappingOverrides(result);
-		}
-		return result;
-	}
-
-	public String getEncoding() throws IOException {
-		return getEncodingMemento().getDetectedCharsetName();
-	}
-
-	// to ensure consist overall rules used, we'll mark as
-	// final,
-	// and require subclasses to provide certain pieces of
-	// the
-	// implementation
-	public EncodingMemento getEncodingMemento() throws IOException {
-		ensureInputSet();
-		if (!fHeaderParsed) {
-			parseInput();
-			// we keep track of if header's already been
-			// parse, so can make
-			// multiple 'get' calls, without causing
-			// reparsing.
-			fHeaderParsed = true;
-			// Note: there is a "hidden assumption" here
-			// that an empty
-			// string in content should be treated same as
-			// not present.
-		}
-		if (fEncodingMemento == null) {
-			handleSpecDefault();
-		}
-		if (fEncodingMemento == null) {
-			// safty net
-			fEncodingMemento = new NullMemento();
-		}
-		return fEncodingMemento;
-	}
-
-	/**
-	 * This is to return a default encoding -- as specified by an industry
-	 * content type spec -- when not present in the stream, for example, XML
-	 * specifies UTF-8, JSP specifies ISO-8859-1. This method should return
-	 * null if there is no such "spec default".
-	 */
-	abstract public String getSpecDefaultEncoding();
-
-	public EncodingMemento getSpecDefaultEncodingMemento() {
-		resetAll();
-		EncodingMemento result = null;
-		String enc = getSpecDefaultEncoding();
-		if (enc != null) {
-			createEncodingMemento(enc, EncodingMemento.DEFAULTS_ASSUMED_FOR_EMPTY_INPUT);
-			fEncodingMemento.setAppropriateDefault(enc);
-			result = fEncodingMemento;
-		}
-		return result;
-	}
-
-	private void handleSpecDefault() {
-		String encodingName;
-		encodingName = getSpecDefaultEncoding();
-		if (encodingName != null) {
-			//createEncodingMemento(encodingName,
-			// EncodingMemento.USED_CONTENT_TYPE_DEFAULT);
-			fEncodingMemento = new EncodingMemento();
-			fEncodingMemento.setJavaCharsetName(encodingName);
-			fEncodingMemento.setAppropriateDefault(encodingName);
-		}
-	}
-
-	/**
-	 * Every subclass must provide a way to parse the input. This method has
-	 * several critical responsibilities:
-	 * <li>set the fEncodingMemento field appropriately, according to the
-	 * results of the parse of fReader.</li>
-	 * <li>set fHarderParsed to true, to avoid wasted re-parsing.</li>
-	 */
-	abstract protected void parseInput() throws IOException;
-
-	/**
-	 *  
-	 */
-	protected void resetAll() {
-		fReader = null;
-		fHeaderParsed = false;
-		fEncodingMemento = null;
-	}
-
-	/**
-	 *  
-	 */
-	public void set(InputStream inputStream) {
-		resetAll();
-		fReader = new ByteReader(inputStream);
-		try {
-			fReader.mark(CodedIO.MAX_MARK_SIZE);
-		} catch (IOException e) {
-			// impossible, since we know ByteReader
-			// supports marking
-			throw new Error(e);
-		}
-	}
-
-	/**
-	 *  
-	 */
-	public void set(IStorage iStorage) throws CoreException {
-		resetAll();
-		InputStream inputStream = iStorage.getContents();
-		InputStream resettableStream = new BufferedInputStream(inputStream, CodedIO.MAX_BUF_SIZE);
-		resettableStream.mark(CodedIO.MAX_MARK_SIZE);
-		set(resettableStream);
-		// TODO we'll need to "remember" IFile, or
-		// get its (or its project's) settings, in case
-		// those are needed to handle cases when the
-		// encoding is not in the file stream.
-	}
-
-	/**
-	 * Note: this is not part of interface to help avoid confusion ... it
-	 * expected this Reader is a well formed character reader ... that is, its
-	 * all ready been determined to not be a unicode marked input stream. And,
-	 * its assumed to be in the correct position, at position zero, ready to
-	 * read first character.
-	 */
-	public void set(Reader reader) {
-		resetAll();
-		fReader = reader;
-		if (!fReader.markSupported()) {
-			fReader = new BufferedReader(fReader);
-		}
-		try {
-			fReader.mark(CodedIO.MAX_MARK_SIZE);
-		} catch (IOException e) {
-			// impossble, since we just checked if markable
-			throw new Error(e);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ByteReader.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ByteReader.java
deleted file mode 100644
index 3d50b3f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ByteReader.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contenttype;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-
-/**
- * This is an "adapter" class, simply to get in input stream to act like a
- * reader. We could not use InputStreamReader directly because its internal
- * buffers are not controllable, and it sometimes pulls too much out of input
- * stream (even when it wasn't needed for our purposes).
- * 
- * The use of this class is highly specialized and by not means meant to be
- * general purpose. Its use is restricted to those cases where the input
- * stream can be regarded as ascii just long enough to determine what the real
- * encoding should be.
- */
-
-public class ByteReader extends Reader {
-
-	public static final int DEFAULT_BUFFER_SIZE = CodedIO.MAX_BUF_SIZE;
-
-	protected byte[] fBuffer;
-
-	protected InputStream fInputStream;
-
-	protected ByteReader() {
-		super();
-	}
-
-	public ByteReader(InputStream inputStream) {
-		this(inputStream, DEFAULT_BUFFER_SIZE);
-		if (!inputStream.markSupported()) {
-			throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
-		}
-	}
-
-	public ByteReader(InputStream inputStream, int size) {
-		fInputStream = inputStream;
-		if (!inputStream.markSupported()) {
-			throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
-		}
-		fBuffer = new byte[size];
-
-	}
-
-	public void close() throws IOException {
-		fInputStream.close();
-	}
-
-	public void mark(int readAheadLimit) throws IOException {
-		fInputStream.mark(readAheadLimit);
-	}
-
-	public boolean markSupported() {
-		return true;
-	}
-
-	public int read() throws IOException {
-		int b0 = fInputStream.read();
-		return (b0 & 0x00FF);
-	}
-
-	public int read(char ch[], int offset, int length) throws IOException {
-		if (length > fBuffer.length) {
-			length = fBuffer.length;
-		}
-
-		int count = fInputStream.read(fBuffer, 0, length);
-
-		for (int i = 0; i < count; i++) {
-			int b0 = fBuffer[i];
-			// the 0x00FF is to "lose" the negative bits filled in the byte to
-			// int conversion
-			// (and which would be there if cast directly from byte to char).
-			char c0 = (char) (b0 & 0x00FF);
-			ch[offset + i] = c0;
-		}
-		return count;
-	}
-
-	public boolean ready() throws IOException {
-		return fInputStream.available() > 0;
-	}
-
-	public void reset() throws IOException {
-		fInputStream.reset();
-	}
-
-	public long skip(long n) throws IOException {
-		return fInputStream.skip(n);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ContentDescriberForXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ContentDescriberForXML.java
deleted file mode 100644
index 9e56e70..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ContentDescriberForXML.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contenttype;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescriber;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.ITextContentDescriber;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.IContentDescriptionExtended;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-
-
-public final class ContentDescriberForXML implements ITextContentDescriber {
-	private final static QualifiedName[] SUPPORTED_OPTIONS = {IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK, IContentDescriptionExtended.DETECTED_CHARSET, IContentDescriptionExtended.UNSUPPORTED_CHARSET, IContentDescriptionExtended.APPROPRIATE_DEFAULT};
-	/**
-	 * <code>restrictedMode</code> is used just for testing/experiments.
-	 * 
-	 * If in restrictedMode, our "custom" contentType is seen as valid only in
-	 * cases that the platform's standard one does not cover.
-	 */
-	private final static boolean restrictedMode = true;
-	private IResourceCharsetDetector getDetector() {
-			return new XMLResourceEncodingDetector();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.content.IContentDescriber#describe(java.io.InputStream,
-	 *      org.eclipse.core.runtime.content.IContentDescription)
-	 */
-	public int describe(InputStream contents, IContentDescription description) throws IOException {
-		// for this special case, always assume invalid, unless
-		// our special circumstances are met.
-		int result = IContentDescriber.INVALID;
-
-		if (description == null) {
-			// purely request for validty
-			result = determineValidity(result, contents);
-		}
-		else {
-			result = calculateSupportedOptions(result, contents, description);
-		}
-		return result;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.content.ITextContentDescriber#describe(java.io.Reader,
-	 *      org.eclipse.core.runtime.content.IContentDescription)
-	 */
-	public int describe(Reader contents, IContentDescription description) throws IOException {
-		// for this special case, always assume invalid, unless
-		// our special circumstances are met.
-		int result = IContentDescriber.INVALID;
-
-		if (description == null) {
-			// purely request for validty
-			result = determineValidity(result, contents);
-		}
-		else {
-			result = calculateSupportedOptions(result, contents, description);
-		}
-		return result;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.content.IContentDescriber#getSupportedOptions()
-	 */
-	public QualifiedName[] getSupportedOptions() {
-
-		return SUPPORTED_OPTIONS;
-	}
-
-	private int calculateSupportedOptions(int result, InputStream contents, IContentDescription description) throws IOException {
-		int returnResult = result;
-		if (isRelevent(description)) {
-			IResourceCharsetDetector detector = getDetector();
-			contents.reset();
-			detector.set(contents);
-			returnResult = handleCalculations(result, description, detector);
-		}
-		return returnResult;
-	}
-
-	private int determineValidity(int result, InputStream contents) throws IOException {
-		int returnResult = result;
-		IResourceCharsetDetector detector = getDetector();
-		contents.reset();
-		detector.set(contents);
-		returnResult = determineValidity(detector, returnResult);
-		return returnResult;
-	}
-	private int determineValidity(int result, Reader contents) throws IOException {
-		int returnResult = result;
-		IResourceCharsetDetector detector = getDetector();
-		contents.reset();
-		detector.set(contents);
-		returnResult = determineValidity(detector, returnResult);
-		return returnResult;
-	}
-	/**
-	 * @param contents
-	 * @param description
-	 * @throws IOException
-	 */
-	private int calculateSupportedOptions(int result, Reader contents, IContentDescription description) throws IOException {
-		int returnResult = result;
-		if (isRelevent(description)) {
-			IResourceCharsetDetector detector = getDetector();
-			detector.set(contents);
-			returnResult = handleCalculations(result, description, detector);
-		}
-		return returnResult;
-	}
-
-	private void handleDetectedSpecialCase(IContentDescription description, Object detectedCharset, Object javaCharset) {
-		// since equal, we don't need to add, but if our detected version is
-		// different than
-		// javaCharset, then we should add it. This will happen, for example,
-		// if there's
-		// differences in case, or differences due to override properties
-		if (detectedCharset != null) {
-			// if (!detectedCharset.equals(javaCharset)) {
-			// description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET,
-			// detectedCharset);
-			// }
-
-			// Once we detected a charset, we should set the property even
-			// though it's the same as javaCharset
-			// because there are clients that rely on this property to
-			// determine if the charset is actually detected in file or not.
-			description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET, detectedCharset);
-		}
-	}
-
-	/**
-	 * @param description
-	 * @return
-	 */
-	private boolean isRelevent(IContentDescription description) {
-		boolean result = false;
-		if (description == null)
-			result = false;
-		else if (description.isRequested(IContentDescription.BYTE_ORDER_MARK))
-			result = true;
-		else if (description.isRequested(IContentDescription.CHARSET))
-			result = true;
-		else if (description.isRequested(IContentDescriptionExtended.APPROPRIATE_DEFAULT))
-			result = true;
-		else if (description.isRequested(IContentDescriptionExtended.DETECTED_CHARSET))
-			result = true;
-		else if (description.isRequested(IContentDescriptionExtended.UNSUPPORTED_CHARSET))
-			result = true;
-		return result;
-	}
-
-	/**
-	 * @param description
-	 * @param detector
-	 * @throws IOException
-	 */
-	private int handleCalculations(int result, IContentDescription description, IResourceCharsetDetector detector) throws IOException {
-		int returnResult = result;
-		EncodingMemento encodingMemento = ((XMLResourceEncodingDetector) detector).getEncodingMemento();
-		if (description != null) {
-			// TODO: I need to verify to see if this BOM work is always done
-			// by text type.
-			Object detectedByteOrderMark = encodingMemento.getUnicodeBOM();
-			if (detectedByteOrderMark != null) {
-				Object existingByteOrderMark = description.getProperty(IContentDescription.BYTE_ORDER_MARK);
-				// not sure why would ever be different, so if is different,
-				// may
-				// need to "push" up into base.
-				if (!detectedByteOrderMark.equals(existingByteOrderMark))
-					description.setProperty(IContentDescription.BYTE_ORDER_MARK, detectedByteOrderMark);
-			}
-
-
-			if (!encodingMemento.isValid()) {
-				// note: after setting here, its the mere presence of
-				// IContentDescriptionExtended.UNSUPPORTED_CHARSET
-				// in the resource's description that can be used to determine
-				// if invalid in those cases, the "detected" property contains
-				// an "appropriate default" to use.
-				description.setProperty(IContentDescriptionExtended.UNSUPPORTED_CHARSET, encodingMemento.getInvalidEncoding());
-				description.setProperty(IContentDescriptionExtended.APPROPRIATE_DEFAULT, encodingMemento.getAppropriateDefault());
-			}
-
-			Object detectedCharset = encodingMemento.getDetectedCharsetName();
-			Object javaCharset = encodingMemento.getJavaCharsetName();
-
-			// we always include detected, if its different than java
-			handleDetectedSpecialCase(description, detectedCharset, javaCharset);
-
-			if (javaCharset != null) {
-				Object existingCharset = description.getProperty(IContentDescription.CHARSET);
-				if (javaCharset.equals(existingCharset)) {
-					handleDetectedSpecialCase(description, detectedCharset, javaCharset);
-				}
-				else {
-					// we may need to add what we found, but only need to add
-					// if different from the default
-					Object defaultCharset = detector.getSpecDefaultEncoding();
-					if (defaultCharset != null) {
-						if (!defaultCharset.equals(javaCharset)) {
-							description.setProperty(IContentDescription.CHARSET, javaCharset);
-						}
-					}
-					else {
-						// assuming if there is no spec default, we always
-						// need to add.
-						// TODO: this is probably a dead branch in current
-						// code, should re-examine for removal.
-						description.setProperty(IContentDescription.CHARSET, javaCharset);
-					}
-				}
-			}
-		}
-
-		returnResult = determineValidity(detector, returnResult);
-		return returnResult;
-	}
-
-	private int determineValidity(IResourceCharsetDetector detector, int returnResult) {
-		// we always expect XMLResourceEncodingDetector, but just to make safe
-		// cast.
-		if (detector instanceof XMLResourceEncodingDetector) {
-			XMLResourceEncodingDetector xmlResourceDetector = (XMLResourceEncodingDetector) detector;
-			if (xmlResourceDetector.isDeclDetected()) {
-				if (restrictedMode) {
-					// if there is no initial whitespace, then platform's
-					// default one will do.
-					if (xmlResourceDetector.hasInitialWhiteSpace()) {
-						returnResult = IContentDescriber.VALID;
-					}
-				}
-				else {
-					returnResult = IContentDescriber.VALID;
-				}
-			}
-		}
-		return returnResult;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/EncodingParserConstants.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/EncodingParserConstants.java
deleted file mode 100644
index d4542a4..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/EncodingParserConstants.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contenttype;
-
-
-public interface EncodingParserConstants {
-
-	final String EOF = "EOF"; //$NON-NLS-1$
-	final String InvalidTerminatedStringValue = "InvalidTerminatedStringValue"; //$NON-NLS-1$
-	final String InvalidTermintatedUnDelimitedStringValue = "InvalidTermintatedUnDelimitedStringValue"; //$NON-NLS-1$
-	final String MAX_CHARS_REACHED = "MAX_CHARS_REACHED"; //$NON-NLS-1$
-	final String StringValue = "strval"; //$NON-NLS-1$
-	final String UnDelimitedStringValue = "UnDelimitedStringValue"; //$NON-NLS-1$
-	public final String UTF16BE = "UTF16BE"; //$NON-NLS-1$
-	public final String UTF16LE = "UTF16LE"; //$NON-NLS-1$
-
-
-	public final String UTF83ByteBOM = "UTF83ByteBOM"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/HeadParserToken.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/HeadParserToken.java
deleted file mode 100644
index 0f14b8b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/HeadParserToken.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contenttype;
-
-public class HeadParserToken {
-	private int fStart;
-
-	private String fText;
-	private String fType;
-
-	protected HeadParserToken() {
-		super();
-	}
-
-	public HeadParserToken(String type, int start, String text) {
-		this();
-		fType = type;
-		fStart = start;
-		fText = text;
-
-	}
-
-	public String getText() {
-		return fText;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public String toString() {
-		return ("text: " + fText + " offset: " + fStart + " type: " + fType); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/IntStack.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/IntStack.java
deleted file mode 100644
index 1d1052d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/IntStack.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contenttype;
-
-/*
- * 
- * A non-resizable class implementing the behavior of java.util.Stack, but
- * directly for the <code> integer </code> primitive.
- */
-import java.util.EmptyStackException;
-
-public class IntStack {
-	private int[] list = null;
-
-	private int size = 0;
-
-	public IntStack() {
-		this(100);
-	}
-
-	public IntStack(int maxdepth) {
-		super();
-		list = new int[maxdepth];
-		initialize();
-	}
-
-	public void clear() {
-		initialize();
-	}
-
-	public boolean empty() {
-		return size == 0;
-	}
-
-	public int get(int slot) {
-		return list[slot];
-	}
-
-	private void initialize() {
-		for (int i = 0; i < list.length; i++)
-			list[i] = -1;
-	}
-
-	/**
-	 * Returns the int at the top of the stack without removing it
-	 * 
-	 * @return int at the top of this stack.
-	 * @exception EmptyStackException
-	 *                when empty.
-	 */
-	public int peek() {
-		if (size == 0)
-			throw new EmptyStackException();
-		return list[size - 1];
-	}
-
-	/**
-	 * Removes and returns the int at the top of the stack
-	 * 
-	 * @return int at the top of this stack.
-	 * @exception EmptyStackException
-	 *                when empty.
-	 */
-	public int pop() {
-		int value = peek();
-		list[size - 1] = -1;
-		size--;
-		return value;
-	}
-
-	/**
-	 * Pushes an item onto the top of this stack.
-	 * 
-	 * @param newValue -
-	 *            the int to be pushed onto this stack.
-	 * @return the <code>newValue</code> argument.
-	 */
-	public int push(int newValue) {
-		if (size == list.length) {
-			throw new StackOverflowError();
-		}
-		list[size++] = newValue;
-		return newValue;
-	}
-
-	public int size() {
-		return list.length;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/NullMemento.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/NullMemento.java
deleted file mode 100644
index 23f7462..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/NullMemento.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contenttype;
-
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.NonContentBasedEncodingRules;
-
-
-
-/**
- * This class can be used in place of an EncodingMemento (its super class),
- * when there is not in fact ANY encoding information. For example, when a
- * structuredDocument is created directly from a String
- */
-public class NullMemento extends EncodingMemento {
-	/**
-	 *  
-	 */
-	public NullMemento() {
-		super();
-		String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null);
-		setJavaCharsetName(defaultCharset);
-		setAppropriateDefault(defaultCharset);
-		setDetectedCharsetName(null);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLDeclDetector.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLDeclDetector.java
deleted file mode 100644
index 40d0fde..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLDeclDetector.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contenttype;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-
-public class XMLDeclDetector {
-	private static final int MAX_BUF_SIZE = 1024 * 8;
-	private static final int MAX_MARK_SIZE = 1024 * 8;
-	protected boolean fHeaderParsed;
-	private boolean fIsXML;
-	protected Reader fReader;
-	//private boolean DEBUG = false;
-	private XMLHeadTokenizer fTokenizer;
-
-	private boolean canHandleAsUnicodeStream(String tokenType) {
-		boolean canHandleAsUnicodeStream = false;
-		if (tokenType == EncodingParserConstants.UTF83ByteBOM) {
-			canHandleAsUnicodeStream = true;
-			//fUnicode = "UTF-8"; //$NON-NLS-1$
-		} else if (tokenType == EncodingParserConstants.UTF16BE) {
-			canHandleAsUnicodeStream = true;
-			//fUnicode = "UTF-16BE"; //$NON-NLS-1$
-		} else if (tokenType == EncodingParserConstants.UTF16LE) {
-			canHandleAsUnicodeStream = true;
-			//fUnicode = "UTF-16"; //$NON-NLS-1$
-		}
-		return canHandleAsUnicodeStream;
-	}
-
-	final private void ensureInputSet() {
-		if (fReader == null) {
-			throw new IllegalStateException("input must be set before use"); //$NON-NLS-1$
-		}
-	}
-
-	//private String fUnicode;
-
-	/**
-	 * @return Returns the tokenizer.
-	 */
-	private XMLHeadTokenizer getTokenizer() {
-		if (fTokenizer == null) {
-			fTokenizer = new XMLHeadTokenizer();
-		}
-		return fTokenizer;
-	}
-
-	/**
-	 * @return Returns the isXML.
-	 */
-	public boolean isXML() throws IOException {
-		ensureInputSet();
-		if (!fHeaderParsed) {
-			parseInput();
-		}
-		return fIsXML;
-	}
-
-	private void parseInput() throws IOException {
-		XMLHeadTokenizer tokenizer = getTokenizer();
-		tokenizer.reset(fReader);
-		HeadParserToken token = null;
-		String tokenType = null;
-		do {
-			token = tokenizer.getNextToken();
-			tokenType = token.getType();
-			if (canHandleAsUnicodeStream(tokenType)) {
-				fReader.reset();
-				// this is (obviously) not always true.
-				// TODO: need to fix so we "remember" original iFile or
-				// inputstream, and
-				// create appropriate InputStreamReader.
-				// I'm not sure what to do for the set(reader) case ... if its
-				// even relevent.
-				// plus, ensure against infinite loops!
-				fIsXML = true;
-				//fReader = new InputStreamReader(fReader, fUnicode);
-				// parseInput();
-			} else {
-				if (tokenType == XMLHeadTokenizerConstants.XMLDelEncoding) {
-					fIsXML = true;
-				}
-			}
-		} while (tokenizer.hasMoreTokens());
-
-	}
-
-	private void resetAll() {
-		fReader = null;
-		fHeaderParsed = false;
-		fIsXML = false;
-		//fUnicode = null;
-
-	}
-
-	public void set(IFile iFile) throws CoreException {
-		resetAll();
-		InputStream inputStream = iFile.getContents(true);
-		InputStream resettableStream = new BufferedInputStream(inputStream, MAX_BUF_SIZE);
-		resettableStream.mark(MAX_MARK_SIZE);
-		set(resettableStream);
-	}
-
-	public void set(InputStream inputStream) {
-		resetAll();
-		fReader = new ByteReader(inputStream);
-		try {
-			fReader.mark(MAX_MARK_SIZE);
-		} catch (IOException e) {
-			// impossible, since we know ByteReader supports marking
-			throw new Error(e);
-		}
-	}
-
-	/**
-	 * Note: this is not part of interface to help avoid confusion ... it
-	 * expected this Reader is a well formed character reader ... that is, its
-	 * all ready been determined to not be a unicode marked input stream. And,
-	 * its assumed to be in the correct position, at position zero, ready to
-	 * read first character.
-	 */
-	public void set(Reader reader) {
-		resetAll();
-		fReader = reader;
-		if (!fReader.markSupported()) {
-			fReader = new BufferedReader(fReader);
-		}
-
-		try {
-			fReader.mark(MAX_MARK_SIZE);
-		} catch (IOException e) {
-			// impossble, since we just checked if markable
-			throw new Error(e);
-		}
-
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java
deleted file mode 100644
index 76fb40b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java
+++ /dev/null
@@ -1,1451 +0,0 @@
-/* The following code was generated by JFlex 1.4.2 on 7/28/08 9:29 AM */
-
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.xml.core.internal.contenttype;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
-
-
-
-/**
- * This class is a scanner generated by 
- * <a href="http://www.jflex.de/">JFlex</a> 1.4.2
- * on 7/28/08 9:29 AM from the specification file
- * <tt>D:/workspaces/wtp301/workspace/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex</tt>
- */
-public class XMLHeadTokenizer {
-
-  /** This character denotes the end of file */
-  public static final int YYEOF = -1;
-
-  /** initial size of the lookahead buffer */
-  private static final int ZZ_BUFFERSIZE = 8192;
-
-  /** lexical states */
-  public static final int YYINITIAL = 0;
-  public static final int UnDelimitedString = 10;
-  public static final int DQ_STRING = 6;
-  public static final int SQ_STRING = 8;
-  public static final int ST_XMLDecl = 2;
-  public static final int QuotedAttributeValue = 4;
-
-  /**
-   * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
-   * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l
-   *                  at the beginning of a line
-   * l is of the form l = 2*k, k a non negative integer
-   */
-  private static final int ZZ_LEXSTATE[] = { 
-     0,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6, 6
-  };
-
-  /** 
-   * Translates characters to character classes
-   */
-  private static final String ZZ_CMAP_PACKED = 
-    "\1\11\10\0\1\6\1\10\2\0\1\7\22\0\1\6\1\0\1\33"+
-    "\2\0\1\35\1\0\1\34\24\0\1\13\1\12\1\32\1\14\3\0"+
-    "\1\27\1\30\1\21\1\0\1\31\1\0\1\24\2\0\1\17\1\16"+
-    "\1\26\1\25\2\0\1\22\1\23\2\0\1\20\1\0\1\15\12\0"+
-    "\1\27\1\30\1\21\1\0\1\31\1\0\1\24\2\0\1\17\1\16"+
-    "\1\26\1\25\2\0\1\22\1\23\2\0\1\20\1\0\1\15\102\0"+
-    "\1\4\3\0\1\5\17\0\1\3\16\0\1\1\20\0\1\3\16\0"+
-    "\1\1\1\2\170\0\1\2\ufe87\0";
-
-  /** 
-   * Translates characters to character classes
-   */
-  private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
-
-  /** 
-   * Translates DFA states to action switch labels.
-   */
-  private static final int [] ZZ_ACTION = zzUnpackAction();
-
-  private static final String ZZ_ACTION_PACKED_0 =
-    "\7\0\13\1\2\2\1\1\1\2\1\3\1\4\1\5"+
-    "\1\6\1\1\1\5\1\7\1\1\1\5\1\10\1\1"+
-    "\1\11\1\12\1\13\12\0\1\14\5\0\1\2\1\3"+
-    "\1\4\1\6\2\0\1\15\1\7\2\0\1\10\1\11"+
-    "\1\16\3\0\1\14\4\0\1\2\1\15\14\0\1\17"+
-    "\5\0\1\17\6\0\1\20\3\0\1\20\2\0\1\21"+
-    "\1\0\1\21\1\0";
-
-  private static int [] zzUnpackAction() {
-    int [] result = new int[111];
-    int offset = 0;
-    offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
-    return result;
-  }
-
-  private static int zzUnpackAction(String packed, int offset, int [] result) {
-    int i = 0;       /* index in packed string  */
-    int j = offset;  /* index in unpacked array */
-    int l = packed.length();
-    while (i < l) {
-      int count = packed.charAt(i++);
-      int value = packed.charAt(i++);
-      do result[j++] = value; while (--count > 0);
-    }
-    return j;
-  }
-
-
-  /* error codes */
-  private static final int ZZ_UNKNOWN_ERROR = 0;
-  private static final int ZZ_NO_MATCH = 1;
-  private static final int ZZ_PUSHBACK_2BIG = 2;
-
-  /* error messages for the codes above */
-  private static final String ZZ_ERROR_MSG[] = {
-    "Unkown internal scanner error",
-    "Error: could not match input",
-    "Error: pushback value was too large"
-  };
-
-  /** the input device */
-  private java.io.Reader zzReader;
-
-  /** the current state of the DFA */
-  private int zzState;
-
-  /** the current lexical state */
-  private int zzLexicalState = YYINITIAL;
-
-  /** this buffer contains the current text to be matched and is
-      the source of the yytext() string */
-  private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
-
-  /** the textposition at the last accepting state */
-  private int zzMarkedPos;
-
-  /** the current text position in the buffer */
-  private int zzCurrentPos;
-
-  /** startRead marks the beginning of the yytext() string in the buffer */
-  private int zzStartRead;
-
-  /** endRead marks the last character in the buffer, that has been read
-      from input */
-  private int zzEndRead;
-
-  /** number of newlines encountered up to the start of the matched text */
-//  private int yyline;
-
-  /** the number of characters up to the start of the matched text */
-  private int yychar;
-
-  /**
-   * the number of characters from the last newline up to the start of the 
-   * matched text
-   */
-//  private int yycolumn;
-
-  /** 
-   * zzAtBOL == true <=> the scanner is currently at the beginning of a line
-   */
-  private boolean zzAtBOL = true;
-
-  /** zzAtEOF == true <=> the scanner is at the EOF */
-  private boolean zzAtEOF;
-
-  /** denotes if the user-EOF-code has already been executed */
-  private boolean zzEOFDone;
-
-  /* user code: */
-
-
-	private boolean hasMore = true;
-	private final static int MAX_TO_SCAN = 8000;
-	StringBuffer string = new StringBuffer();
-	// state stack for easier state handling
-	private IntStack fStateStack = new IntStack();
-	private String valueText = null;
-
-
-	public XMLHeadTokenizer() {
-		super();
-	}
-
-	  public void reset (Reader in) {
-                /* the input device */
-                zzReader = in;
-
-                /* the current state of the DFA */
-                zzState = 0;
-
-                /* the current lexical state */
-                zzLexicalState = YYINITIAL;
-
-                /* this buffer contains the current text to be matched and is
-                 the source of the yytext() string */
-                java.util.Arrays.fill(zzBuffer, (char)0);
-
-                /* the textposition at the last accepting state */
-                zzMarkedPos = 0;
-
-                /* the textposition at the last state to be included in yytext */
-//                zzPushbackPos = 0;
-
-                /* the current text position in the buffer */
-                zzCurrentPos = 0;
-
-                /* startRead marks the beginning of the yytext() string in the buffer */
-                zzStartRead = 0;
-
-                /**
-                 * endRead marks the last character in the buffer, that has been read
-                 * from input
-                 */
-                zzEndRead = 0;
-
-                /* number of newlines encountered up to the start of the matched text */
-//                yyline = 0;
-
-                /* the number of characters up to the start of the matched text */
-                yychar = 0;
-
-                /**
-                 * the number of characters from the last newline up to the start
-                 * of the matched text
-                 */
-//                yycolumn = 0;
-
-                /**
-                 * yy_atBOL == true <=> the scanner is currently at the beginning
-                 * of a line
-                 */
-                zzAtBOL = true;
-
-                /* yy_atEOF == true <=> the scanner has returned a value for EOF */
-                zzAtEOF = false;
-
-                /* denotes if the user-EOF-code has already been executed */
-                zzEOFDone = false;
-
-
-                fStateStack.clear();
-
-                hasMore = true;
-  		
-  	}
-
-
-	public final HeadParserToken getNextToken() throws IOException {
-		String context = null;
-		context = primGetNextToken();
-		HeadParserToken result = null;
-		if (valueText != null) {
-			result = createToken(context, yychar, valueText);
-			valueText = null;
-		} else {
-			result = createToken(context, yychar, yytext());
-		}
-		return result;
-	}
-
-	public final boolean hasMoreTokens() {
-		return hasMore && yychar < MAX_TO_SCAN;
-	}
-	private void pushCurrentState() {
-		fStateStack.push(yystate());
-
-	}
-
-	private void popState() {
-		yybegin(fStateStack.pop());
-	}
-	
-	private HeadParserToken createToken(String context, int start, String text) {
-		return new HeadParserToken(context, start, text);
-	}	
-
-
-
-  /**
-   * Creates a new scanner
-   * There is also a java.io.InputStream version of this constructor.
-   *
-   * @param   in  the java.io.Reader to read input from.
-   */
-  public XMLHeadTokenizer(java.io.Reader in) {
-    this.zzReader = in;
-  }
-
-  /**
-   * Creates a new scanner.
-   * There is also java.io.Reader version of this constructor.
-   *
-   * @param   in  the java.io.Inputstream to read input from.
-   */
-  public XMLHeadTokenizer(java.io.InputStream in) {
-    this(new java.io.InputStreamReader(in));
-  }
-
-  /** 
-   * Unpacks the compressed character translation table.
-   *
-   * @param packed   the packed character translation table
-   * @return         the unpacked character translation table
-   */
-  private static char [] zzUnpackCMap(String packed) {
-    char [] map = new char[0x10000];
-    int i = 0;  /* index in packed string  */
-    int j = 0;  /* index in unpacked array */
-    while (i < 150) {
-      int  count = packed.charAt(i++);
-      char value = packed.charAt(i++);
-      do map[j++] = value; while (--count > 0);
-    }
-    return map;
-  }
-
-
-  /**
-   * Refills the input buffer.
-   *
-   * @return      <code>false</code>, iff there was new input.
-   * 
-   * @exception   java.io.IOException  if any I/O-Error occurs
-   */
-  private boolean zzRefill() throws java.io.IOException {
-
-    /* first: make room (if you can) */
-    if (zzStartRead > 0) {
-      System.arraycopy(zzBuffer, zzStartRead,
-                       zzBuffer, 0,
-                       zzEndRead-zzStartRead);
-
-      /* translate stored positions */
-      zzEndRead-= zzStartRead;
-      zzCurrentPos-= zzStartRead;
-      zzMarkedPos-= zzStartRead;
-      zzStartRead = 0;
-    }
-
-    /* is the buffer big enough? */
-    if (zzCurrentPos >= zzBuffer.length) {
-      /* if not: blow it up */
-      char newBuffer[] = new char[zzCurrentPos*2];
-      System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
-      zzBuffer = newBuffer;
-    }
-
-    /* finally: fill the buffer with new input */
-    int numRead = zzReader.read(zzBuffer, zzEndRead,
-                                            zzBuffer.length-zzEndRead);
-
-    if (numRead > 0) {
-      zzEndRead+= numRead;
-      return false;
-    }
-    // unlikely but not impossible: read 0 characters, but not at end of stream    
-    if (numRead == 0) {
-      int c = zzReader.read();
-      if (c == -1) {
-        return true;
-      } else {
-        zzBuffer[zzEndRead++] = (char) c;
-        return false;
-      }     
-    }
-
-	// numRead < 0
-    return true;
-  }
-
-    
-  /**
-   * Closes the input stream.
-   */
-  public final void yyclose() throws java.io.IOException {
-    zzAtEOF = true;            /* indicate end of file */
-    zzEndRead = zzStartRead;  /* invalidate buffer    */
-
-    if (zzReader != null)
-      zzReader.close();
-  }
-
-
-  /**
-   * Resets the scanner to read from a new input stream.
-   * Does not close the old reader.
-   *
-   * All internal variables are reset, the old input stream 
-   * <b>cannot</b> be reused (internal buffer is discarded and lost).
-   * Lexical state is set to <tt>ZZ_INITIAL</tt>.
-   *
-   * @param reader   the new input stream 
-   */
-  public final void yyreset(java.io.Reader reader) {
-    zzReader = reader;
-    zzAtBOL  = true;
-    zzAtEOF  = false;
-    zzEndRead = zzStartRead = 0;
-    zzCurrentPos = zzMarkedPos = 0;
-    yychar = 0;
-    zzLexicalState = YYINITIAL;
-  }
-
-
-  /**
-   * Returns the current lexical state.
-   */
-  public final int yystate() {
-    return zzLexicalState;
-  }
-
-
-  /**
-   * Enters a new lexical state
-   *
-   * @param newState the new lexical state
-   */
-  public final void yybegin(int newState) {
-    zzLexicalState = newState;
-  }
-
-
-  /**
-   * Returns the text matched by the current regular expression.
-   */
-  public final String yytext() {
-    return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
-  }
-
-
-  /**
-   * Returns the character at position <tt>pos</tt> from the 
-   * matched text. 
-   * 
-   * It is equivalent to yytext().charAt(pos), but faster
-   *
-   * @param pos the position of the character to fetch. 
-   *            A value from 0 to yylength()-1.
-   *
-   * @return the character at position pos
-   */
-  public final char yycharat(int pos) {
-    return zzBuffer[zzStartRead+pos];
-  }
-
-
-  /**
-   * Returns the length of the matched text region.
-   */
-  public final int yylength() {
-    return zzMarkedPos-zzStartRead;
-  }
-
-
-  /**
-   * Reports an error that occured while scanning.
-   *
-   * In a wellformed scanner (no or only correct usage of 
-   * yypushback(int) and a match-all fallback rule) this method 
-   * will only be called with things that "Can't Possibly Happen".
-   * If this method is called, something is seriously wrong
-   * (e.g. a JFlex bug producing a faulty scanner etc.).
-   *
-   * Usual syntax/scanner level error handling should be done
-   * in error fallback rules.
-   *
-   * @param   errorCode  the code of the errormessage to display
-   */
-  private void zzScanError(int errorCode) {
-    String message;
-    try {
-      message = ZZ_ERROR_MSG[errorCode];
-    }
-    catch (ArrayIndexOutOfBoundsException e) {
-      message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
-    }
-
-    throw new Error(message);
-  } 
-
-
-  /**
-   * Pushes the specified amount of characters back into the input stream.
-   *
-   * They will be read again by then next call of the scanning method
-   *
-   * @param number  the number of characters to be read again.
-   *                This number must not be greater than yylength()!
-   */
-  public void yypushback(int number)  {
-    if ( number > yylength() )
-      zzScanError(ZZ_PUSHBACK_2BIG);
-
-    zzMarkedPos -= number;
-  }
-
-
-  /**
-   * Contains user EOF-code, which will be executed exactly once,
-   * when the end of file is reached
-   */
-  private void zzDoEOF() {
-    if (!zzEOFDone) {
-      zzEOFDone = true;
-    	hasMore=false;
-
-    }
-  }
-
-
-  /**
-   * Resumes scanning until the next regular expression is matched,
-   * the end of input is encountered or an I/O-Error occurs.
-   *
-   * @return      the next token
-   * @exception   java.io.IOException  if any I/O-Error occurs
-   */
-  public String primGetNextToken() throws java.io.IOException {
-    int zzInput;
-    int zzAction;
-
-    // cached fields:
-    int zzCurrentPosL;
-    int zzMarkedPosL;
-    int zzEndReadL = zzEndRead;
-    char [] zzBufferL = zzBuffer;
-    char [] zzCMapL = ZZ_CMAP;
-
-
-    while (true) {
-      zzMarkedPosL = zzMarkedPos;
-
-      yychar+= zzMarkedPosL-zzStartRead;
-
-      if (zzMarkedPosL > zzStartRead) {
-        switch (zzBufferL[zzMarkedPosL-1]) {
-        case '\n':
-        case '\u000B':
-        case '\u000C':
-        case '\u0085':
-        case '\u2028':
-        case '\u2029':
-          zzAtBOL = true;
-          break;
-        case '\r': 
-          if (zzMarkedPosL < zzEndReadL)
-            zzAtBOL = zzBufferL[zzMarkedPosL] != '\n';
-          else if (zzAtEOF)
-            zzAtBOL = false;
-          else {
-            boolean eof = zzRefill();
-            zzMarkedPosL = zzMarkedPos;
-            zzEndReadL = zzEndRead;
-            zzBufferL = zzBuffer;
-            if (eof) 
-              zzAtBOL = false;
-            else 
-              zzAtBOL = zzBufferL[zzMarkedPosL] != '\n';
-          }
-          break;
-        default:
-          zzAtBOL = false;
-        }
-      }
-      zzAction = -1;
-
-      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
-  
-      if (zzAtBOL)
-        zzState = ZZ_LEXSTATE[zzLexicalState+1];
-      else
-        zzState = ZZ_LEXSTATE[zzLexicalState];
-
-
-      zzForAction: {
-        while (true) {
-    
-          if (zzCurrentPosL < zzEndReadL)
-            zzInput = zzBufferL[zzCurrentPosL++];
-          else if (zzAtEOF) {
-            zzInput = YYEOF;
-            break zzForAction;
-          }
-          else {
-            // store back cached positions
-            zzCurrentPos  = zzCurrentPosL;
-            zzMarkedPos   = zzMarkedPosL;
-            boolean eof = zzRefill();
-            // get translated positions and possibly new buffer
-            zzCurrentPosL  = zzCurrentPos;
-            zzMarkedPosL   = zzMarkedPos;
-            zzBufferL      = zzBuffer;
-            zzEndReadL     = zzEndRead;
-            if (eof) {
-              zzInput = YYEOF;
-              break zzForAction;
-            }
-            else {
-              zzInput = zzBufferL[zzCurrentPosL++];
-            }
-          }
-          zzInput = zzCMapL[zzInput];
-
-          boolean zzIsFinal = false;
-          boolean zzNoLookAhead = false;
-
-          zzForNext: { switch (zzState) {
-            case 0:
-              switch (zzInput) {
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 7; break zzForNext;
-              }
-
-            case 1:
-              switch (zzInput) {
-                case 1: zzIsFinal = true; zzState = 8; break zzForNext;
-                case 2: zzIsFinal = true; zzState = 9; break zzForNext;
-                case 3: zzIsFinal = true; zzState = 10; break zzForNext;
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; zzState = 11; break zzForNext;
-                case 9: zzIsFinal = true; zzState = 12; break zzForNext;
-                case 11: zzIsFinal = true; zzState = 13; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 7; break zzForNext;
-              }
-
-            case 2:
-              switch (zzInput) {
-                case 9: zzIsFinal = true; zzState = 14; break zzForNext;
-                case 12: zzIsFinal = true; zzState = 15; break zzForNext;
-                case 16: zzIsFinal = true; zzState = 16; break zzForNext;
-                case 17: zzIsFinal = true; zzState = 17; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 7; break zzForNext;
-              }
-
-            case 3:
-              switch (zzInput) {
-                case 6: 
-                case 7: zzIsFinal = true; zzState = 19; break zzForNext;
-                case 8: zzIsFinal = true; zzState = 20; break zzForNext;
-                case 9: zzIsFinal = true; zzState = 21; break zzForNext;
-                case 27: zzIsFinal = true; zzState = 22; break zzForNext;
-                case 28: zzIsFinal = true; zzState = 23; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
-              }
-
-            case 4:
-              switch (zzInput) {
-                case 7: 
-                case 8: 
-                case 11: zzIsFinal = true; zzState = 25; break zzForNext;
-                case 9: zzIsFinal = true; zzState = 26; break zzForNext;
-                case 12: zzIsFinal = true; zzState = 27; break zzForNext;
-                case 27: zzIsFinal = true; zzState = 28; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
-              }
-
-            case 5:
-              switch (zzInput) {
-                case 7: 
-                case 8: 
-                case 11: zzIsFinal = true; zzState = 25; break zzForNext;
-                case 28: zzIsFinal = true; zzState = 28; break zzForNext;
-                case 9: zzIsFinal = true; zzState = 29; break zzForNext;
-                case 29: zzIsFinal = true; zzState = 30; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
-              }
-
-            case 6:
-              switch (zzInput) {
-                case 11: zzIsFinal = true; zzState = 25; break zzForNext;
-                case 12: zzIsFinal = true; zzState = 30; break zzForNext;
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; zzState = 31; break zzForNext;
-                case 9: zzIsFinal = true; zzState = 32; break zzForNext;
-                case 27: 
-                case 28: zzIsFinal = true; zzState = 33; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
-              }
-
-            case 8:
-              switch (zzInput) {
-                case 2: zzIsFinal = true; zzNoLookAhead = true; zzState = 34; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 9:
-              switch (zzInput) {
-                case 1: zzIsFinal = true; zzNoLookAhead = true; zzState = 35; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 10:
-              switch (zzInput) {
-                case 4: zzState = 36; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 11:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzState = 37; break zzForNext;
-                case 9: zzState = 38; break zzForNext;
-                case 11: zzState = 39; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 12:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzState = 37; break zzForNext;
-                case 11: zzState = 39; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 13:
-              switch (zzInput) {
-                case 9: zzState = 40; break zzForNext;
-                case 12: zzState = 41; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 14:
-              switch (zzInput) {
-                case 12: zzState = 42; break zzForNext;
-                case 16: zzState = 43; break zzForNext;
-                case 17: zzState = 44; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 15:
-              switch (zzInput) {
-                case 9: zzState = 45; break zzForNext;
-                case 26: zzIsFinal = true; zzState = 46; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 16:
-              switch (zzInput) {
-                case 9: zzState = 47; break zzForNext;
-                case 17: zzState = 48; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 17:
-              switch (zzInput) {
-                case 9: zzState = 49; break zzForNext;
-                case 22: zzState = 50; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 19:
-              switch (zzInput) {
-                case 6: 
-                case 7: zzIsFinal = true; break zzForNext;
-                case 8: zzState = 51; break zzForNext;
-                case 9: zzIsFinal = true; zzState = 52; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
-              }
-
-            case 20:
-              switch (zzInput) {
-                case 6: 
-                case 7: zzIsFinal = true; zzState = 19; break zzForNext;
-                case 8: zzState = 51; break zzForNext;
-                case 9: zzIsFinal = true; zzState = 52; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
-              }
-
-            case 21:
-              switch (zzInput) {
-                case 27: zzIsFinal = true; zzState = 22; break zzForNext;
-                case 28: zzIsFinal = true; zzState = 23; break zzForNext;
-                case 6: 
-                case 7: 
-                case 8: zzState = 51; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 22:
-              switch (zzInput) {
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 53; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 23:
-              switch (zzInput) {
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 54; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 25:
-              switch (zzInput) {
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 55; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 26:
-              switch (zzInput) {
-                case 7: 
-                case 8: 
-                case 11: zzIsFinal = true; zzState = 25; break zzForNext;
-                case 27: zzIsFinal = true; zzState = 28; break zzForNext;
-                case 12: zzState = 56; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 27:
-              switch (zzInput) {
-                case 9: zzState = 57; break zzForNext;
-                case 26: zzIsFinal = true; zzState = 58; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 28:
-              switch (zzInput) {
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 59; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 29:
-              switch (zzInput) {
-                case 7: 
-                case 8: 
-                case 11: zzIsFinal = true; zzState = 25; break zzForNext;
-                case 28: zzIsFinal = true; zzState = 28; break zzForNext;
-                case 29: zzState = 60; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 30:
-              switch (zzInput) {
-                case 26: zzIsFinal = true; zzState = 25; break zzForNext;
-                case 9: zzState = 61; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 31:
-              switch (zzInput) {
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 62; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 32:
-              switch (zzInput) {
-                case 11: zzIsFinal = true; zzState = 25; break zzForNext;
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; zzState = 31; break zzForNext;
-                case 27: 
-                case 28: zzIsFinal = true; zzState = 33; break zzForNext;
-                case 12: zzState = 60; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 33:
-              switch (zzInput) {
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 63; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 36:
-              switch (zzInput) {
-                case 5: zzIsFinal = true; zzNoLookAhead = true; zzState = 64; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 37:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: break zzForNext;
-                case 9: zzState = 38; break zzForNext;
-                case 11: zzState = 39; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 38:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzState = 37; break zzForNext;
-                case 11: zzState = 39; break zzForNext;
-                case 9: zzState = 65; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 39:
-              switch (zzInput) {
-                case 9: zzState = 40; break zzForNext;
-                case 12: zzState = 41; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 40:
-              switch (zzInput) {
-                case 12: zzState = 41; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 41:
-              switch (zzInput) {
-                case 9: zzState = 66; break zzForNext;
-                case 13: zzState = 67; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 42:
-              switch (zzInput) {
-                case 9: zzState = 45; break zzForNext;
-                case 26: zzIsFinal = true; zzState = 46; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 43:
-              switch (zzInput) {
-                case 9: zzState = 47; break zzForNext;
-                case 17: zzState = 48; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 44:
-              switch (zzInput) {
-                case 9: zzState = 49; break zzForNext;
-                case 22: zzState = 50; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 45:
-              switch (zzInput) {
-                case 26: zzIsFinal = true; zzState = 46; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 46:
-              switch (zzInput) {
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 68; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 47:
-              switch (zzInput) {
-                case 17: zzState = 48; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 48:
-              switch (zzInput) {
-                case 9: zzState = 69; break zzForNext;
-                case 18: zzState = 70; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 49:
-              switch (zzInput) {
-                case 22: zzState = 50; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 50:
-              switch (zzInput) {
-                case 9: zzState = 71; break zzForNext;
-                case 23: zzState = 72; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 51:
-              switch (zzInput) {
-                case 6: 
-                case 7: zzIsFinal = true; zzState = 19; break zzForNext;
-                case 8: break zzForNext;
-                case 9: zzIsFinal = true; zzState = 52; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
-              }
-
-            case 52:
-              switch (zzInput) {
-                case 6: 
-                case 7: zzIsFinal = true; zzState = 19; break zzForNext;
-                case 8: zzState = 51; break zzForNext;
-                case 9: zzIsFinal = true; zzState = 73; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
-              }
-
-            case 56:
-              switch (zzInput) {
-                case 9: zzState = 57; break zzForNext;
-                case 26: zzIsFinal = true; zzState = 58; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 57:
-              switch (zzInput) {
-                case 26: zzIsFinal = true; zzState = 58; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 58:
-              switch (zzInput) {
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 74; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 60:
-              switch (zzInput) {
-                case 26: zzIsFinal = true; zzState = 25; break zzForNext;
-                case 9: zzState = 61; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 61:
-              switch (zzInput) {
-                case 26: zzIsFinal = true; zzState = 25; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 65:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzState = 37; break zzForNext;
-                case 11: zzState = 39; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 66:
-              switch (zzInput) {
-                case 13: zzState = 67; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 67:
-              switch (zzInput) {
-                case 9: zzState = 75; break zzForNext;
-                case 14: zzState = 76; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 69:
-              switch (zzInput) {
-                case 18: zzState = 70; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 70:
-              switch (zzInput) {
-                case 9: zzState = 77; break zzForNext;
-                case 19: zzState = 78; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 71:
-              switch (zzInput) {
-                case 23: zzState = 72; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 72:
-              switch (zzInput) {
-                case 9: zzState = 79; break zzForNext;
-                case 21: zzState = 80; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 73:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzState = 51; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 75:
-              switch (zzInput) {
-                case 14: zzState = 76; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 76:
-              switch (zzInput) {
-                case 9: zzState = 81; break zzForNext;
-                case 15: zzState = 82; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 77:
-              switch (zzInput) {
-                case 19: zzState = 78; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 78:
-              switch (zzInput) {
-                case 9: zzState = 83; break zzForNext;
-                case 20: zzState = 84; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 79:
-              switch (zzInput) {
-                case 21: zzState = 80; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 80:
-              switch (zzInput) {
-                case 9: zzState = 85; break zzForNext;
-                case 24: zzState = 86; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 81:
-              switch (zzInput) {
-                case 15: zzState = 82; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 82:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; zzState = 87; break zzForNext;
-                case 9: zzState = 88; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 83:
-              switch (zzInput) {
-                case 20: zzState = 84; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 84:
-              switch (zzInput) {
-                case 9: zzState = 89; break zzForNext;
-                case 21: zzState = 90; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 85:
-              switch (zzInput) {
-                case 24: zzState = 86; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 86:
-              switch (zzInput) {
-                case 9: zzState = 91; break zzForNext;
-                case 20: zzState = 92; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 87:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; break zzForNext;
-                case 9: zzIsFinal = true; zzState = 93; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 88:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; zzState = 87; break zzForNext;
-                case 9: zzState = 94; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 89:
-              switch (zzInput) {
-                case 21: zzState = 90; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 90:
-              switch (zzInput) {
-                case 9: zzState = 95; break zzForNext;
-                case 22: zzState = 96; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 91:
-              switch (zzInput) {
-                case 20: zzState = 92; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 92:
-              switch (zzInput) {
-                case 9: zzState = 97; break zzForNext;
-                case 22: zzState = 98; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 93:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; zzState = 87; break zzForNext;
-                case 9: zzState = 94; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 94:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; zzState = 87; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 95:
-              switch (zzInput) {
-                case 22: zzState = 96; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 96:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: break zzForNext;
-                case 9: zzState = 99; break zzForNext;
-                case 10: zzIsFinal = true; zzState = 100; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 97:
-              switch (zzInput) {
-                case 22: zzState = 98; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 98:
-              switch (zzInput) {
-                case 9: zzState = 101; break zzForNext;
-                case 25: zzState = 102; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 99:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzState = 96; break zzForNext;
-                case 10: zzIsFinal = true; zzState = 100; break zzForNext;
-                case 9: zzState = 103; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 100:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; zzState = 104; break zzForNext;
-                case 9: zzState = 105; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 101:
-              switch (zzInput) {
-                case 25: zzState = 102; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 102:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: break zzForNext;
-                case 9: zzState = 106; break zzForNext;
-                case 10: zzIsFinal = true; zzState = 107; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 103:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzState = 96; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 104:
-              switch (zzInput) {
-                case 9: zzIsFinal = true; zzState = 100; break zzForNext;
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 105:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; zzState = 104; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 106:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzState = 102; break zzForNext;
-                case 10: zzIsFinal = true; zzState = 107; break zzForNext;
-                case 9: zzState = 108; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 107:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; zzState = 109; break zzForNext;
-                case 9: zzState = 110; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 108:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzState = 102; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 109:
-              switch (zzInput) {
-                case 9: zzIsFinal = true; zzState = 107; break zzForNext;
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 110:
-              switch (zzInput) {
-                case 6: 
-                case 7: 
-                case 8: zzIsFinal = true; zzState = 109; break zzForNext;
-                default: break zzForAction;
-              }
-
-            default:
-              // if this is ever reached, there is a serious bug in JFlex
-              zzScanError(ZZ_UNKNOWN_ERROR);
-              break;
-          } }
-
-          if ( zzIsFinal ) {
-            zzAction = zzState;
-            zzMarkedPosL = zzCurrentPosL;
-            if ( zzNoLookAhead ) break zzForAction;
-          }
-
-        }
-      }
-
-      // store back cached position
-      zzMarkedPos = zzMarkedPosL;
-
-      switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
-        case 12: 
-          { yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd;
-          }
-        case 18: break;
-        case 14: 
-          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}
-          }
-        case 19: break;
-        case 9: 
-          { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;
-          }
-        case 20: break;
-        case 2: 
-          { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);
-          }
-        case 21: break;
-        case 7: 
-          { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;
-          }
-        case 22: break;
-        case 10: 
-          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;}
-          }
-        case 23: break;
-        case 1: 
-          { if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}
-          }
-        case 24: break;
-        case 6: 
-          { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
-          }
-        case 25: break;
-        case 5: 
-          { string.append( yytext() );
-          }
-        case 26: break;
-        case 13: 
-          { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
-          }
-        case 27: break;
-        case 4: 
-          { yybegin(SQ_STRING); string.setLength(0);
-          }
-        case 28: break;
-        case 3: 
-          { yybegin(DQ_STRING); string.setLength(0);
-          }
-        case 29: break;
-        case 8: 
-          { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;
-          }
-        case 30: break;
-        case 17: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;
-          }
-        case 31: break;
-        case 15: 
-          { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}
-          }
-        case 32: break;
-        case 11: 
-          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;}
-          }
-        case 33: break;
-        case 16: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;
-          }
-        case 34: break;
-        default: 
-          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
-            zzAtEOF = true;
-            zzDoEOF();
-              {
-                hasMore = false; return EncodingParserConstants.EOF;
-              }
-          } 
-          else {
-            zzScanError(ZZ_NO_MATCH);
-          }
-      }
-    }
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizerConstants.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizerConstants.java
deleted file mode 100644
index ccf23f8..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizerConstants.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contenttype;
-
-public interface XMLHeadTokenizerConstants extends EncodingParserConstants {
-
-	final String XMLDeclEnd = "XMLDeclEnd"; //$NON-NLS-1$
-	final String XMLDeclStart = "XMLDeclStart"; //$NON-NLS-1$
-	final String XMLDelEncoding = "XMLDelEncoding"; //$NON-NLS-1$
-	final String XMLDeclVersion = "XMLDeclVersion"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLResourceEncodingDetector.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLResourceEncodingDetector.java
deleted file mode 100644
index b1690f3..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLResourceEncodingDetector.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contenttype;
-
-import java.io.IOException;
-
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-
-
-public class XMLResourceEncodingDetector extends AbstractResourceEncodingDetector implements IResourceCharsetDetector {
-	private XMLHeadTokenizer fTokenizer;
-	private boolean fDeclDetected = false;
-	private boolean fInitialWhiteSpace = false;
-
-	private boolean canHandleAsUnicodeStream(String tokenType) {
-		boolean canHandleAsUnicodeStream = false;
-		if (tokenType == EncodingParserConstants.UTF83ByteBOM) {
-			canHandleAsUnicodeStream = true;
-			String enc = "UTF-8"; //$NON-NLS-1$
-			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
-			fEncodingMemento.setUTF83ByteBOMUsed(true);
-		}
-		else if (tokenType == EncodingParserConstants.UTF16BE || tokenType == EncodingParserConstants.UTF16LE) {
-			canHandleAsUnicodeStream = true;
-			String enc = "UTF-16"; //$NON-NLS-1$
-			byte[] bom = (tokenType == EncodingParserConstants.UTF16BE) ? IContentDescription.BOM_UTF_16BE : IContentDescription.BOM_UTF_16LE;
-			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
-			fEncodingMemento.setUnicodeStream(true);
-			fEncodingMemento.setUnicodeBOM(bom);
-		}
-		return canHandleAsUnicodeStream;
-	}
-
-	public String getSpecDefaultEncoding() {
-		// by default, UTF-8 as per XML spec
-		final String enc = "UTF-8"; //$NON-NLS-1$
-		return enc;
-	}
-
-	/**
-	 * @return Returns the tokenizer.
-	 */
-	private XMLHeadTokenizer getTokenizer() {
-		// TODO: need to work on 'reset' in tokenizer, so new instance isn't
-		// always needed
-		// if (fTokenizer == null) {
-		fTokenizer = new XMLHeadTokenizer();
-		// }
-		return fTokenizer;
-	}
-
-	private boolean isLegalString(String valueTokenType) {
-		if (valueTokenType == null)
-			return false;
-		else
-			return valueTokenType.equals(EncodingParserConstants.StringValue) || valueTokenType.equals(EncodingParserConstants.UnDelimitedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTerminatedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue);
-	}
-
-	protected void parseInput() throws IOException {
-		XMLHeadTokenizer tokenizer = getTokenizer();
-		tokenizer.reset(fReader);
-		HeadParserToken token = null;
-		String tokenType = null;
-		do {
-			token = tokenizer.getNextToken();
-			tokenType = token.getType();
-
-			// handle xml content type detection
-			if (tokenType == XMLHeadTokenizerConstants.XMLDeclStart) {
-				fDeclDetected = true;
-				String declText = token.getText();
-				if (declText.startsWith("<?")) { //$NON-NLS-1$
-					fInitialWhiteSpace = false;
-				}
-				else {
-					fInitialWhiteSpace = true;
-				}
-			}
-
-			// handle encoding detection
-			if (canHandleAsUnicodeStream(tokenType)) {
-				// side effect of canHandle is to create appropriate memento
-			}
-			else {
-				if (tokenType == XMLHeadTokenizerConstants.XMLDelEncoding) {
-					if (tokenizer.hasMoreTokens()) {
-						token = tokenizer.getNextToken();
-						tokenType = token.getType();
-						if (isLegalString(tokenType)) {
-							String enc = token.getText();
-							if (enc != null && enc.length() > 0) {
-								createEncodingMemento(enc, EncodingMemento.FOUND_ENCODING_IN_CONTENT);
-							}
-						}
-					}
-				}
-			}
-		}
-		while (tokenizer.hasMoreTokens());
-
-	}
-
-	public boolean isDeclDetected() {
-		if (!fHeaderParsed) {
-			try {
-				parseInput();
-			}
-			catch (IOException e) {
-				fDeclDetected = false;
-			}
-			// we keep track of if header's already been
-			// parse, so can make
-			// multiple 'get' calls, without causing
-			// reparsing.
-			fHeaderParsed = true;
-		}
-		// fDeclDetected is set as part of parsing.
-		return fDeclDetected;
-	}
-
-	public boolean hasInitialWhiteSpace() {
-		return fInitialWhiteSpace;
-	}
-
-	protected void resetAll() {
-	    super.resetAll();
-		fDeclDetected = false;
-		fInitialWhiteSpace = false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java
deleted file mode 100644
index cf2e968..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java
+++ /dev/null
@@ -1,774 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLCharEntity;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLNamespace;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-
-/**
- * AttrImpl class
- */
-public class AttrImpl extends NodeImpl implements IDOMAttr {
-	private ITextRegion equalRegion = null;
-
-	private String name = null;
-	private ITextRegion nameRegion = null;
-	private String namespaceURI = null;
-	private ElementImpl ownerElement = null;
-	private ITextRegion valueRegion = null;
-	private String valueSource = null;
-
-	/**
-	 * AttrImpl constructor
-	 */
-	protected AttrImpl() {
-		super();
-	}
-
-	/**
-	 * AttrImpl constructor
-	 * 
-	 * @param that
-	 *            AttrImpl
-	 */
-	protected AttrImpl(AttrImpl that) {
-		super(that);
-
-		if (that != null) {
-			this.name = that.name;
-			this.valueSource = that.getValueSource();
-		}
-	}
-
-	/**
-	 * cloneNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	public Node cloneNode(boolean deep) {
-		AttrImpl cloned = new AttrImpl(this);
-		notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
-		return cloned;
-	}
-
-	/**
-	 */
-	protected CMAttributeDeclaration getDeclaration() {
-		ElementImpl element = (ElementImpl) getOwnerElement();
-		if (element == null)
-			return null;
-		CMElementDeclaration elementDecl = element.getDeclaration();
-		if (elementDecl == null)
-			return null;
-		CMNamedNodeMap attributes = elementDecl.getAttributes();
-		CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attributes);
-		List nodes = ModelQueryUtil.getModelQuery(getOwnerDocument()).getAvailableContent(getOwnerElement(), elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
-		for (int k = 0; k < nodes.size(); k++) {
-			CMNode cmnode = (CMNode) nodes.get(k);
-			if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
-				allAttributes.put(cmnode);
-			}
-		}
-		attributes = allAttributes;
-		
-
-		if (attributes == null)
-			return null;
-		return (CMAttributeDeclaration) attributes.getNamedItem(getName());
-	}
-
-	/**
-	 * getEndOffset method
-	 * 
-	 * @return int
-	 */
-	public int getEndOffset() {
-		if (this.ownerElement == null)
-			return 0;
-		int offset = this.ownerElement.getStartOffset();
-		if (this.valueRegion != null) {
-			return (offset + this.valueRegion.getEnd());
-		}
-		if (this.equalRegion != null) {
-			return (offset + this.equalRegion.getEnd());
-		}
-		if (this.nameRegion != null) {
-			return (offset + this.nameRegion.getEnd());
-		}
-		return 0;
-	}
-
-
-	public ITextRegion getEqualRegion() {
-		return this.equalRegion;
-	}
-
-	/**
-	 */
-	public String getLocalName() {
-		if (this.name == null)
-			return null;
-		int index = this.name.indexOf(':');
-		if (index < 0)
-			return this.name;
-		return this.name.substring(index + 1);
-	}
-
-	/**
-	 * getName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getName() {
-		if (this.name == null)
-			return new String();
-		return this.name;
-	}
-
-
-	public ITextRegion getNameRegion() {
-		return this.nameRegion;
-	}
-
-	public int getNameRegionEndOffset() {
-		if (this.ownerElement == null)
-			return 0;
-		// assuming the firstStructuredDocumentRegion is the one that contains
-		// attributes
-		IStructuredDocumentRegion flatNode = this.ownerElement.getFirstStructuredDocumentRegion();
-		if (flatNode == null)
-			return 0;
-		return flatNode.getEndOffset(this.nameRegion);
-	}
-
-	public int getNameRegionStartOffset() {
-		if (this.ownerElement == null)
-			return 0;
-		// assuming the firstStructuredDocumentRegion is the one that contains
-		// attributes
-		IStructuredDocumentRegion flatNode = this.ownerElement.getFirstStructuredDocumentRegion();
-		if (flatNode == null)
-			return 0;
-		return flatNode.getStartOffset(this.nameRegion);
-	}
-
-	public String getNameRegionText() {
-		if (this.ownerElement == null)
-			return null;
-		// assuming the firstStructuredDocumentRegion is the one that contains
-		// attributes
-		IStructuredDocumentRegion flatNode = this.ownerElement.getFirstStructuredDocumentRegion();
-		if (flatNode == null)
-			return null;
-		return flatNode.getText(this.nameRegion);
-	}
-
-	public int getNameRegionTextEndOffset() {
-		if (this.ownerElement == null)
-			return 0;
-		// assuming the firstStructuredDocumentRegion is the one that contains
-		// attributes
-		IStructuredDocumentRegion flatNode = this.ownerElement.getFirstStructuredDocumentRegion();
-		if (flatNode == null)
-			return 0;
-		return flatNode.getTextEndOffset(this.nameRegion);
-	}
-
-	/**
-	 */
-	public String getNamespaceURI() {
-		String nsAttrName = null;
-		String prefix = getPrefix();
-		if (prefix != null && prefix.length() > 0) {
-			if (prefix.equals(IXMLNamespace.XMLNS)) {
-				// fixed URI
-				return IXMLNamespace.XMLNS_URI;
-			}
-			nsAttrName = IXMLNamespace.XMLNS_PREFIX + prefix;
-		}
-		else {
-			String name = getName();
-			if (name != null && name.equals(IXMLNamespace.XMLNS)) {
-				// fixed URI
-				return IXMLNamespace.XMLNS_URI;
-			}
-			// does not inherit namespace from owner element
-			// if (this.ownerElement != null) return
-			// this.ownerElement.getNamespaceURI();
-			return this.namespaceURI;
-		}
-
-		for (Node node = this.ownerElement; node != null; node = node.getParentNode()) {
-			if (node.getNodeType() != ELEMENT_NODE)
-				break;
-			Element element = (Element) node;
-			Attr attr = element.getAttributeNode(nsAttrName);
-			if (attr != null)
-				return attr.getValue();
-		}
-
-		return this.namespaceURI;
-	}
-
-	/**
-	 * getNodeName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		return getName();
-	}
-
-	/**
-	 * getNodeType method
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return ATTRIBUTE_NODE;
-	}
-
-	/**
-	 * getNodeValue method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeValue() {
-		return getValue();
-	}
-
-	/**
-	 * getOwnerElement method
-	 * 
-	 * @return org.w3c.dom.Element
-	 */
-	public Element getOwnerElement() {
-		return this.ownerElement;
-	}
-
-	/**
-	 */
-	public String getPrefix() {
-		if (this.name == null)
-			return null;
-		int index = this.name.indexOf(':');
-		if (index <= 0)
-			return null;
-		// exclude JSP tag in name
-		if (this.name.charAt(0) == '<')
-			return null;
-		return this.name.substring(0, index);
-	}
-
-	/**
-	 * getSpecified method
-	 * 
-	 * @return boolean
-	 */
-	public boolean getSpecified() {
-		// if there is no underlying document region, 
-		// then this attributes value has not really be specified
-		// yet in the document, and any returned values, such as 
-		// an empty string or a default value are being supplied
-		// as per spec, not per what's in the users document.
-		return this.valueRegion != null;
-	}
-
-	/**
-	 * getStartOffset method
-	 * 
-	 * @return int
-	 */
-	public int getStartOffset() {
-		if (this.ownerElement == null)
-			return 0;
-		int offset = this.ownerElement.getStartOffset();
-		if (this.nameRegion != null) {
-			return (offset + this.nameRegion.getStart());
-		}
-		if (this.equalRegion != null) {
-			return (offset + this.equalRegion.getStart());
-		}
-		if (this.valueRegion != null) {
-			return (offset + this.valueRegion.getStart());
-		}
-		return 0;
-	}
-
-	/**
-	 * getValue method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getValue() {
-		return getValue(getValueSource());
-	}
-
-	/**
-	 * Returns value for the source
-	 */
-	private String getValue(String source) {
-		if (source == null)
-			return new String();
-		if (source.length() == 0)
-			return source;
-		StringBuffer buffer = null;
-		int offset = 0;
-		int length = source.length();
-		int ref = source.indexOf('&');
-		while (ref >= 0) {
-			int end = source.indexOf(';', ref + 1);
-			if (end > ref + 1) {
-				String name = source.substring(ref + 1, end);
-				String value = getCharValue(name);
-				if (value != null) {
-					if (buffer == null)
-						buffer = new StringBuffer(length);
-					if (ref > offset)
-						buffer.append(source.substring(offset, ref));
-					buffer.append(value);
-					offset = end + 1;
-					ref = end;
-				}
-			}
-			ref = source.indexOf('&', ref + 1);
-		}
-		if (buffer == null)
-			return source;
-		if (length > offset)
-			buffer.append(source.substring(offset));
-		return buffer.toString();
-	}
-
-	public ITextRegion getValueRegion() {
-		return this.valueRegion;
-	}
-
-	/**
-	 * ISSUE: what should behavior be if this.value == null? It's an "error"
-	 * to be in that state, but seems to occur relatively easily ... probably
-	 * due to threading bugs ... but this just shows its needs to be spec'd.
-	 * 
-	 */
-	public int getValueRegionStartOffset() {
-		if (this.ownerElement == null)
-			return 0;
-		// assuming the firstStructuredDocumentRegion is the one that contains
-		// the valueRegion -- should make smarter?
-		IStructuredDocumentRegion structuredDocumentRegion = this.ownerElement.getFirstStructuredDocumentRegion();
-		if (structuredDocumentRegion == null)
-			return 0;
-		// ensure we never pass null to getStartOffset.
-		if (this.valueRegion == null) {
-			return 0;
-		}
-		return structuredDocumentRegion.getStartOffset(this.valueRegion);
-	}
-
-	public String getValueRegionText() {
-		if (this.ownerElement == null)
-			return null;
-		// assuming the firstStructuredDocumentRegion is the one that contains
-		// attributes
-		IStructuredDocumentRegion flatNode = this.ownerElement.getFirstStructuredDocumentRegion();
-		if (flatNode == null)
-			return null;
-		if (this.valueRegion == null)
-			return null;
-		return flatNode.getText(this.valueRegion);
-	}
-
-	/**
-	 */
-	public String getValueSource() {
-		if (this.valueSource != null)
-			return this.valueSource;
-		// DW: 4/16/2003 due to change in structuredDocument ... we need a
-		// flatnode to
-		// get at region values. For now I'll assume this is always the first
-		// flatnode .. may need to make smarter later (e.g. to search for
-		// the flatnode that this.valueRegion belongs to.
-		// DW: 4/30/2003 For some reason, this method is getting called a lot
-		// Not sure if its a threading problem, or a fundamental error
-		// elsewhere.
-		// It needs more investigation, but in the use cases I've seen,
-		// doesn't
-		// seem to hurt to simply return null in those cases. I saw this null
-		// case,
-		// when tryint go format an XML file.
-		if (this.ownerElement == null)
-			return null;
-		IStructuredDocumentRegion ownerRegion = this.ownerElement.getFirstStructuredDocumentRegion();
-		if (ownerRegion == null)
-			return null;
-		if (this.valueRegion != null)
-			return StructuredDocumentRegionUtil.getAttrValue(ownerRegion, this.valueRegion);
-		return new String();
-	}
-
-	private String getValueSource(ElementImpl ownerElement) {
-		if (this.valueSource != null)
-			return this.valueSource;
-		// DW: 4/16/2003 due to change in structuredDocument ... we need a
-		// flatnode to
-		// get at region values. For now I'll assume this is always the first
-		// flatnode .. may need to make smarter later (e.g. to search for
-		// the flatnode that this.valueRegion belongs to.
-		if (this.valueRegion != null)
-			return StructuredDocumentRegionUtil.getAttrValue(ownerElement.getStructuredDocumentRegion(), this.valueRegion);
-		return new String();
-	}
-
-	/**
-	 */
-	private String getValueSource(String value) {
-		if (value == null)
-			return null;
-		if (value.length() == 0)
-			return value;
-		StringBuffer buffer = null;
-		int offset = 0;
-		int length = value.length();
-		int amp = value.indexOf('&');
-		while (amp >= 0) {
-			if (buffer == null)
-				buffer = new StringBuffer(length + 4);
-			if (amp > offset)
-				buffer.append(value.substring(offset, amp));
-			buffer.append(IXMLCharEntity.AMP_REF);
-			offset = amp + 1;
-			amp = value.indexOf('&', offset);
-		}
-		if (buffer == null)
-			return value;
-		if (length > offset)
-			buffer.append(value.substring(offset));
-		return buffer.toString();
-	}
-
-	/**
-	 * Check if Attr has JSP in value
-	 */
-	public boolean hasNestedValue() {
-		if (this.valueRegion == null)
-			return false;
-		if (!(this.valueRegion instanceof ITextRegionContainer))
-			return false;
-		ITextRegionList regions = ((ITextRegionContainer) this.valueRegion).getRegions();
-		if (regions == null)
-			return false;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			if (region == null)
-				continue;
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_TAG_OPEN || isNestedLanguageOpening(regionType))
-				return true;
-		}
-		return false;
-	}
-
-	/**
-	 * Check if Attr has only name but not equal sign nor value
-	 */
-	public boolean hasNameOnly() {
-		return (this.nameRegion != null && this.equalRegion == null && this.valueRegion == null);
-	}
-
-	/**
-	 */
-	protected final boolean hasPrefix() {
-		if (this.name == null)
-			return false;
-		if (this.name.indexOf(':') <= 0)
-			return false;
-		// exclude JSP tag in name
-		if (this.name.charAt(0) == '<')
-			return false;
-		return true;
-	}
-
-	/**
-	 */
-	protected final boolean ignoreCase() {
-		if (this.ownerElement != null) {
-			if (this.ownerElement.ignoreCase()) {
-				return !hasPrefix();
-			}
-		}
-		else {
-			DocumentImpl document = (DocumentImpl) getOwnerDocument();
-			if (document != null && document.ignoreCase()) {
-				// even in case insensitive document, if having prefix, it's
-				// case sensitive
-				return !hasPrefix();
-			}
-		}
-		return false;
-	}
-
-	/**
-	 */
-	public boolean isGlobalAttr() {
-		if (hasPrefix())
-			return false;
-		if (this.ownerElement == null)
-			return false;
-		return this.ownerElement.isGlobalTag();
-	}
-
-	/**
-	 */
-	public final boolean isXMLAttr() {
-		if (this.ownerElement != null) {
-			if (!this.ownerElement.isXMLTag()) {
-				return hasPrefix();
-			}
-		}
-		else {
-			DocumentImpl document = (DocumentImpl) getOwnerDocument();
-			if (document != null && !document.isXMLType()) {
-				// even in non-XML document, if having prefix, it's XML tag
-				return hasPrefix();
-			}
-		}
-		return true;
-	}
-
-	/**
-	 * matchName method
-	 * 
-	 * @return boolean
-	 * @param name
-	 *            java.lang.String
-	 */
-	protected boolean matchName(String name) {
-		if (name == null)
-			return (this.name == null);
-		if (this.name == null)
-			return false;
-		if (this.name.length() != name.length())
-			return false;
-		if (this.name.equals(name))
-			return true;
-		return this.name.equalsIgnoreCase(name) && ignoreCase();
-	}
-
-
-	/**
-	 * notifyValueChanged method
-	 */
-	protected void notifyNameChanged() {
-		if (this.ownerElement == null)
-			return;
-		DocumentImpl document = (DocumentImpl) this.ownerElement.getContainerDocument();
-		if (document == null)
-			return;
-		DOMModelImpl model = (DOMModelImpl) document.getModel();
-		if (model == null)
-			return;
-		model.nameChanged(this);
-	}
-
-	/**
-	 * notifyValueChanged method
-	 */
-	protected void notifyValueChanged() {
-		if (this.ownerElement == null)
-			return;
-		DocumentImpl document = (DocumentImpl) this.ownerElement.getContainerDocument();
-		if (document == null)
-			return;
-		DOMModelImpl model = (DOMModelImpl) document.getModel();
-		if (model == null)
-			return;
-		model.valueChanged(this);
-	}
-
-	/**
-	 * removeRegions method
-	 */
-	void removeRegions() {
-		this.nameRegion = null;
-		this.valueRegion = null;
-		this.equalRegion = null;
-	}
-
-	/**
-	 */
-	void resetRegions() {
-		this.valueSource = getValueSource();
-		removeRegions();
-	}
-
-	/**
-	 */
-	void resetRegions(ElementImpl ownerElement) {
-		this.valueSource = getValueSource(ownerElement);
-		removeRegions();
-	}
-
-	void setEqualRegion(ITextRegion equalRegion) {
-		this.equalRegion = equalRegion;
-	}
-
-	/**
-	 * setName method
-	 * 
-	 * @param name
-	 *            java.lang.String
-	 */
-	protected void setName(String name) {
-		String value = null;
-		int startOffset = 0;
-		if (this.ownerElement != null) {
-			value = getValue();
-			startOffset = this.ownerElement.getStartOffset();
-			this.ownerElement.notify(CHANGE, this, value, null, startOffset);
-		}
-		this.name = name;
-		if (this.ownerElement != null) {
-			this.ownerElement.notify(CHANGE, this, null, value, startOffset);
-		}
-	}
-
-	void setNameRegion(ITextRegion nameRegion) {
-		this.nameRegion = nameRegion;
-	}
-
-	protected void setNamespaceURI(String namespaceURI) {
-		this.namespaceURI = namespaceURI;
-	}
-
-	/**
-	 * setNodeValue method
-	 * 
-	 * @param nodeValue
-	 *            java.lang.String
-	 */
-	public void setNodeValue(String nodeValue) throws DOMException {
-		setValue(nodeValue);
-	}
-
-	/**
-	 * setOwnerElement method
-	 * 
-	 * @param ownerElement
-	 *            org.w3c.dom.Element
-	 */
-	protected void setOwnerElement(Element ownerElement) {
-		this.ownerElement = (ElementImpl) ownerElement;
-	}
-
-	/**
-	 */
-	public void setPrefix(String prefix) throws DOMException {
-		if (this.ownerElement != null && !this.ownerElement.isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-		int prefixLength = (prefix != null ? prefix.length() : 0);
-		String localName = getLocalName();
-		if (prefixLength == 0) {
-			setName(localName);
-			return;
-		}
-		if (localName == null)
-			localName = new String();
-		int localLength = localName.length();
-		StringBuffer buffer = new StringBuffer(prefixLength + 1 + localLength);
-		buffer.append(prefix);
-		buffer.append(':');
-		buffer.append(localName);
-		setName(buffer.toString());
-
-		notifyNameChanged();
-	}
-
-	/**
-	 * setValue method
-	 * 
-	 * @param value
-	 *            java.lang.String
-	 */
-	public void setValue(String value) {
-		// Remember: as we account for "floaters" in
-		// future, remember that some are created
-		// in the natural process of implementing
-		// DOM apis.
-		// this "self notification" of about/changed,
-		// is added for this case, because it known to
-		// be called from properties pages. Should be a
-		// added to all DOM Modifiying APIs eventually.
-		try {
-			getModel().aboutToChangeModel();
-			setValueSource(getValueSource(value));
-		}
-		finally {
-			getModel().changedModel();
-		}
-	}
-
-	void setValueRegion(ITextRegion valueRegion) {
-		this.valueRegion = valueRegion;
-		if (valueRegion != null)
-			this.valueSource = null;
-	}
-
-	public void setValueSource(String source) {
-		if (this.ownerElement != null && !this.ownerElement.isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-		this.valueSource = source;
-
-		notifyValueChanged();
-	}
-
-	/**
-	 * Subclasses must override
-	 * 
-	 * @param regionType
-	 * @return
-	 */
-	protected boolean isNestedLanguageOpening(String regionType) {
-		boolean result = false;
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java
deleted file mode 100644
index 563eeec..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-
-/**
- * CDATASectionImpl class
- */
-public class CDATASectionImpl extends TextImpl implements CDATASection {
-
-	/**
-	 * CDATASectionImpl constructor
-	 */
-	protected CDATASectionImpl() {
-		super();
-	}
-
-	/**
-	 * CDATASectionImpl constructor
-	 * 
-	 * @param that
-	 *            CDATASectionImpl
-	 */
-	protected CDATASectionImpl(CDATASectionImpl that) {
-		super(that);
-	}
-
-	/**
-	 * cloneNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param deep
-	 *            boolean
-	 */
-	public Node cloneNode(boolean deep) {
-		CDATASectionImpl cloned = new CDATASectionImpl(this);
-		notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
-		return cloned;
-	}
-
-	/**
-	 * getData method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getData() throws DOMException {
-		// instead of super(TextImpl).getData(), call getCharacterData()
-		String data = getCharacterData();
-		if (data == null) {
-			data = getData(getStructuredDocumentRegion());
-			if (data == null)
-				data = new String();
-		}
-		return data;
-	}
-
-	/**
-	 */
-	private String getData(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return null;
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return null;
-
-		ITextRegion contentRegion = null;
-		StringBuffer buffer = null;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_CDATA_OPEN || regionType == DOMRegionContext.XML_CDATA_CLOSE) {
-				continue;
-			}
-			if (contentRegion == null) { // first content
-				contentRegion = region;
-			} else { // multiple contents
-				if (buffer == null) {
-					buffer = new StringBuffer(flatNode.getText(contentRegion));
-				}
-				buffer.append(flatNode.getText(region));
-			}
-		}
-
-		if (buffer != null)
-			return buffer.toString();
-		if (contentRegion != null)
-			return flatNode.getText(contentRegion);
-		return null;
-	}
-
-	/**
-	 * getNodeName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		return "#cdata-section";//$NON-NLS-1$
-	}
-
-	/**
-	 * getNodeType method
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return CDATA_SECTION_NODE;
-	}
-
-	/**
-	 */
-	public boolean isClosed() {
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode == null)
-			return true; // will be generated
-		String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode);
-		return (regionType == DOMRegionContext.XML_CDATA_CLOSE);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CMNodeUtil.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CMNodeUtil.java
deleted file mode 100644
index ae533ab..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CMNodeUtil.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-
-/**
- */
-public class CMNodeUtil {
-
-	/**
-	 */
-	public static CMAttributeDeclaration getAttributeDeclaration(Attr attr) {
-		if (attr == null)
-			return null;
-		return ((AttrImpl) attr).getDeclaration();
-	}
-
-	/**
-	 */
-	public static CMElementDeclaration getElementDeclaration(Element element) {
-		if (element == null)
-			return null;
-		return ((ElementImpl) element).getDeclaration();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterDataImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterDataImpl.java
deleted file mode 100644
index 6bf9c65..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterDataImpl.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-
-
-/**
- * CharacterDataImpl class
- */
-public abstract class CharacterDataImpl extends NodeImpl implements CharacterData {
-
-	private String data = null;
-
-	/**
-	 * CharacterDataImpl constructor
-	 */
-	protected CharacterDataImpl() {
-		super();
-	}
-
-	/**
-	 * CharacterDataImpl constructor
-	 * 
-	 * @param that
-	 *            CharacterDataImpl
-	 */
-	protected CharacterDataImpl(CharacterDataImpl that) {
-		super(that);
-
-		if (that != null) {
-			this.data = that.getData();
-		}
-	}
-
-	/**
-	 * appendData method
-	 * 
-	 * @param arg
-	 *            java.lang.String
-	 */
-	public void appendData(String arg) throws DOMException {
-		if (arg == null)
-			return;
-
-		String data = getData();
-		if (data == null)
-			data = arg;
-		else
-			data += arg;
-		setData(data);
-	}
-
-	/**
-	 * deleteData method
-	 * 
-	 * @param offset
-	 *            int
-	 * @param count
-	 *            int
-	 */
-	public void deleteData(int offset, int count) throws DOMException {
-		if (count == 0)
-			return;
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		if (count < 0 || offset < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-
-		String data = getData();
-		if (data == null) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-		int length = data.length();
-		if (offset > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-		if (offset == 0) {
-			if (count > length) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-			}
-			if (count == length)
-				data = new String();
-			else
-				data = data.substring(count);
-		} else {
-			int end = offset + count;
-			if (end > length) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-			}
-			if (end == length)
-				data = data.substring(0, offset);
-			else
-				data = data.substring(0, offset) + data.substring(end);
-		}
-		setData(data);
-	}
-
-	/**
-	 */
-	protected final String getCharacterData() {
-		return this.data;
-	}
-
-	/**
-	 * getData method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getData() throws DOMException {
-		return getCharacterData();
-	}
-
-	/**
-	 * getLength method
-	 * 
-	 * @return int
-	 */
-	public int getLength() {
-		String data = getData();
-		if (data == null)
-			return 0;
-		return data.length();
-	}
-
-	/**
-	 * getNodeValue method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeValue() {
-		return getData();
-	}
-
-	/**
-	 * insertData method
-	 * 
-	 * @param offset
-	 *            int
-	 * @param arg
-	 *            java.lang.String
-	 */
-	public void insertData(int offset, String arg) throws DOMException {
-		if (arg == null)
-			return;
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		if (offset < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-
-		String data = getData();
-		if (data == null) {
-			if (offset > 0) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-			}
-			data = arg;
-		} else if (offset == 0) {
-			data = arg + data;
-		} else {
-			int length = data.length();
-			if (offset > length) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-			}
-			if (offset == length)
-				data += arg;
-			else
-				data = data.substring(0, offset) + arg + data.substring(offset);
-		}
-		setData(data);
-	}
-
-	/**
-	 * isJSPContent method
-	 * 
-	 * @return boolean
-	 */
-	public boolean isJSPContent() {
-		Node parent = getParentNode();
-		if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE)
-			return false;
-		ElementImpl element = (ElementImpl) parent;
-		return element.isJSPContainer();
-	}
-
-	/**
-	 * replaceData method
-	 * 
-	 * @param offset
-	 *            int
-	 * @param count
-	 *            int
-	 * @param arg
-	 *            java.lang.String
-	 */
-	public void replaceData(int offset, int count, String arg) throws DOMException {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		if (arg == null) {
-			deleteData(offset, count);
-			return;
-		}
-		if (count == 0) {
-			insertData(offset, arg);
-			return;
-		}
-		if (offset < 0 || count < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-
-		String data = getData();
-		if (data == null) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		} else if (offset == 0) {
-			int length = data.length();
-			if (count > length) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-			}
-			if (count == length)
-				data = arg;
-			else
-				data = arg + data.substring(count);
-		} else {
-			int length = data.length();
-			int end = offset + count;
-			if (end > length) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-			}
-			if (end == length)
-				data = data.substring(0, offset) + arg;
-			else
-				data = data.substring(0, offset) + arg + data.substring(end);
-		}
-		setData(data);
-	}
-
-	/**
-	 */
-	void resetStructuredDocumentRegions() {
-		this.data = getData();
-		setStructuredDocumentRegion(null);
-	}
-
-	/**
-	 * setData method
-	 * 
-	 * @param data
-	 *            java.lang.String
-	 */
-	public void setData(String data) throws DOMException {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		this.data = data;
-
-		notifyValueChanged();
-	}
-
-	/**
-	 * setNodeValue method
-	 * 
-	 * @param nodeValue
-	 *            java.lang.String
-	 */
-	public void setNodeValue(String nodeValue) throws DOMException {
-		setData(nodeValue);
-	}
-
-	/**
-	 */
-	void setStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		super.setStructuredDocumentRegion(flatNode);
-		if (flatNode != null)
-			this.data = null;
-	}
-
-	/**
-	 * substringData method
-	 * 
-	 * @return java.lang.String
-	 * @param offset
-	 *            int
-	 * @param count
-	 *            int
-	 */
-	public String substringData(int offset, int count) throws DOMException {
-		if (count == 0)
-			return new String();
-		if (offset < 0 || count < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-
-		String data = getData();
-		if (data == null) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-		int length = data.length();
-		if (offset == 0 && count == length)
-			return data;
-		if (offset > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-		int end = offset + count;
-		if (end > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-		return data.substring(offset, end);
-	}
-
-	/**
-	 * toString method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String toString() {
-		StringBuffer buffer = new StringBuffer();
-		buffer.append(getNodeName());
-		buffer.append('(');
-		buffer.append(getData());
-		buffer.append(')');
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode != null) {
-			buffer.append('@');
-			buffer.append(flatNode.toString());
-		}
-		return buffer.toString();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java
deleted file mode 100644
index f834768..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-
-/**
- * CommentImpl class
- */
-public class CommentImpl extends CharacterDataImpl implements Comment {
-
-	private boolean isJSPTag = false;
-
-	/**
-	 * CommentImpl constructor
-	 */
-	protected CommentImpl() {
-		super();
-	}
-
-	/**
-	 * CommentImpl constructor
-	 * 
-	 * @param that
-	 *            CommentImpl
-	 */
-	protected CommentImpl(CommentImpl that) {
-		super(that);
-
-		if (that != null) {
-			this.isJSPTag = that.isJSPTag;
-		}
-	}
-
-	/**
-	 * cloneNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param deep
-	 *            boolean
-	 */
-	public Node cloneNode(boolean deep) {
-		CommentImpl cloned = new CommentImpl(this);
-		notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
-		return cloned;
-	}
-
-	/**
-	 * getData method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getData() throws DOMException {
-		String data = getCharacterData();
-		if (data == null) {
-			data = getData(getStructuredDocumentRegion());
-			if (data == null)
-				data = new String();
-		}
-		return data;
-	}
-
-	/**
-	 */
-	private String getData(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return null;
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return null;
-
-		ITextRegion contentRegion = null;
-		StringBuffer buffer = null;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_COMMENT_OPEN || regionType == DOMRegionContext.XML_COMMENT_CLOSE || isNestedCommentOpenClose(regionType)) {
-				continue;
-			}
-			if (contentRegion == null) { // first content
-				contentRegion = region;
-			}
-			else { // multiple contents
-				if (buffer == null) {
-					buffer = new StringBuffer(flatNode.getText(contentRegion));
-				}
-				buffer.append(flatNode.getText(region));
-			}
-		}
-
-		if (buffer != null)
-			return buffer.toString();
-		if (contentRegion != null)
-			return flatNode.getText(contentRegion);
-		return null;
-	}
-
-	/**
-	 * getNodeName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		return "#comment";//$NON-NLS-1$
-	}
-
-	/**
-	 * getNodeType method
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return COMMENT_NODE;
-	}
-
-	/**
-	 */
-	public boolean isClosed() {
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode == null)
-			return true; // will be generated
-		String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode);
-		return (regionType == DOMRegionContext.XML_COMMENT_CLOSE || isNestedCommentClose(regionType));
-	}
-
-	/**
-	 * Subclasses must override
-	 * @param regionType
-	 * @return
-	 */
-	protected boolean isNestedCommentClose(String regionType) {
-		boolean result = false;
-		return result; 
-	}
-	/**
-	 * Subclasses must override
-	 * @param regionType
-	 * @return
-	 */
-	protected boolean isNestedCommentOpenClose(String regionType) {
-		boolean result = false;
-		return result; 
-	}
-																											
-	public boolean isJSPTag() {
-		return this.isJSPTag;
-	}
-
-	/**
-	 * setJSPTag method
-	 * 
-	 * @param isJSPTag
-	 *            boolean
-	 */
-	public void setJSPTag(boolean isJSPTag) {
-		if (isJSPTag == this.isJSPTag)
-			return;
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		DocumentImpl document = (DocumentImpl) getOwnerDocument();
-		if (isJSPTag) {
-			if (document == null || !document.isJSPType())
-				return;
-		}
-
-		this.isJSPTag = isJSPTag;
-
-		if (getContainerDocument() != null) {
-			// already in the tree, update IStructuredDocument
-			setData(getData()); // calls notifyValueChanged();
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMModelImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMModelImpl.java
deleted file mode 100644
index d2149b9..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMModelImpl.java
+++ /dev/null
@@ -1,915 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-import org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- * XMLModelImpl class
- */
-public class DOMModelImpl extends AbstractStructuredModel implements IStructuredDocumentListener, IDOMModel, DOMImplementation {
-	private static String TRACE_PARSER_MANAGEMENT_EXCEPTION = "parserManagement"; //$NON-NLS-1$
-	private Object active = null;
-	private DocumentImpl document = null;
-	private ISourceGenerator generator = null;
-	private XMLModelNotifier notifier = null;
-	private XMLModelParser parser = null;
-	private boolean refresh = false;
-	private XMLModelUpdater updater = null;
-
-	/**
-	 * XMLModelImpl constructor
-	 */
-	public DOMModelImpl() {
-		super();
-		this.document = (DocumentImpl) internalCreateDocument();
-	}
-
-	/**
-	 * This API allows clients to declare that they are about to make a
-	 * "large" change to the model. This change might be in terms of content
-	 * or it might be in terms of the model id or base location.
-	 * 
-	 * Note that in the case of embedded calls, notification to listners is
-	 * sent only once.
-	 * 
-	 * Note that the client who is making these changes has the responsibility
-	 * to restore the models state once finished with the changes. See
-	 * getMemento and restoreState.
-	 * 
-	 * The method isModelStateChanging can be used by a client to determine if
-	 * the model is already in a change sequence.
-	 */
-	public void aboutToChangeModel() {
-		super.aboutToChangeModel();
-		// technically, no need to call beginChanging so often,
-		// since aboutToChangeModel can be nested.
-		// but will leave as is for this release.
-		// see modelChanged, and be sure stays coordinated there.
-		getModelNotifier().beginChanging();
-	}
-
-	public void aboutToReinitializeModel() {
-		XMLModelNotifier notifier = getModelNotifier();
-		notifier.cancelPending();
-		super.aboutToReinitializeModel();
-	}
-
-	/**
-	 * attrReplaced method
-	 * 
-	 * @param element
-	 *            org.w3c.dom.Element
-	 * @param newAttr
-	 *            org.w3c.dom.Attr
-	 * @param oldAttr
-	 *            org.w3c.dom.Attr
-	 */
-	protected void attrReplaced(Element element, Attr newAttr, Attr oldAttr) {
-		if (element == null)
-			return;
-		if (getActiveParser() == null) {
-			XMLModelUpdater updater = getModelUpdater();
-			setActive(updater);
-			updater.initialize();
-			updater.replaceAttr(element, newAttr, oldAttr);
-			setActive(null);
-		}
-		getModelNotifier().attrReplaced(element, newAttr, oldAttr);
-	}
-
-	/**
-	 * This API allows a client controlled way of notifying all ModelEvent
-	 * listners that the model has been changed. This method is a matched pair
-	 * to aboutToChangeModel, and must be called after aboutToChangeModel ...
-	 * or some listeners could be left waiting indefinitely for the changed
-	 * event. So, its suggested that changedModel always be in a finally
-	 * clause. Likewise, a client should never call changedModel without
-	 * calling aboutToChangeModel first.
-	 * 
-	 * In the case of embedded calls, the notification is just sent once.
-	 * 
-	 */
-	public void changedModel() {
-		// NOTE: the order of 'changedModel' and 'endChanging' is significant.
-		// By calling changedModel first, this basically decrements the
-		// "isChanging" counter
-		// in super class and when zero all listeners to model state events
-		// will be notified
-		// that the model has been changed. 'endChanging' will notify all
-		// deferred adapters.
-		// So, the significance of order is that adapters (and methods they
-		// call)
-		// can count on the state of model "isChanging" to be accurate.
-		// But, remember, that this means the "modelChanged" event can be
-		// received before all
-		// adapters have finished their processing.
-		// NOTE NOTE: The above note is obsolete in fact (though still states
-		// issue correctly).
-		// Due to popular demand, the order of these calls were reversed and
-		// behavior
-		// changed on 07/22/2004.
-		// 
-		// see also
-		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4302
-		// for motivation for this 'on verge of' call.
-		// this could be improved in future if notifier also used counting
-		// flag to avoid nested calls. If/when changed be sure to check if
-		// aboutToChangeModel needs any changes too.
-		if (isModelChangeStateOnVergeOfEnding()) {
-			// end lock before noticiation loop, since directly or indirectly
-			// we may be "called from foriegn code" during notification.
-			endLock();
-			// we null out here to avoid spurious"warning" message while debug
-			// tracing is enabled
-			fLockObject = null;
-			// the notifier is what controls adaper notification, which
-			// should be sent out before the 'modelChanged' event.
-			getModelNotifier().endChanging();
-		}
-		// changedModel handles 'nesting', so only one event sent out
-		// when mulitple calls to 'aboutToChange/Changed'.
-		super.changedModel();
-		handleRefresh();
-	}
-
-	/**
-	 * childReplaced method
-	 * 
-	 * @param parentNode
-	 *            org.w3c.dom.Node
-	 * @param newChild
-	 *            org.w3c.dom.Node
-	 * @param oldChild
-	 *            org.w3c.dom.Node
-	 */
-	protected void childReplaced(Node parentNode, Node newChild, Node oldChild) {
-		if (parentNode == null)
-			return;
-		if (getActiveParser() == null) {
-			XMLModelUpdater updater = getModelUpdater();
-			setActive(updater);
-			updater.initialize();
-			updater.replaceChild(parentNode, newChild, oldChild);
-			setActive(null);
-		}
-		getModelNotifier().childReplaced(parentNode, newChild, oldChild);
-	}
-
-	/**
-	 * Creates an XML <code>Document</code> object of the specified type
-	 * with its document element. HTML-only DOM implementations do not need to
-	 * implement this method.
-	 * 
-	 * @param namespaceURIThe
-	 *            namespace URI of the document element to create.
-	 * @param qualifiedNameThe
-	 *            qualified name of the document element to be created.
-	 * @param doctypeThe
-	 *            type of document to be created or <code>null</code>. When
-	 *            <code>doctype</code> is not <code>null</code>, its
-	 *            <code>Node.ownerDocument</code> attribute is set to the
-	 *            document being created.
-	 * @return A new <code>Document</code> object.
-	 * @exception DOMException
-	 *                INVALID_CHARACTER_ERR: Raised if the specified qualified
-	 *                name contains an illegal character. <br>
-	 *                NAMESPACE_ERR: Raised if the <code>qualifiedName</code>
-	 *                is malformed, if the <code>qualifiedName</code> has a
-	 *                prefix and the <code>namespaceURI</code> is
-	 *                <code>null</code>, or if the
-	 *                <code>qualifiedName</code> has a prefix that is "xml"
-	 *                and the <code>namespaceURI</code> is different from "
-	 *                http://www.w3.org/XML/1998/namespace" .<br>
-	 *                WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has
-	 *                already been used with a different document or was
-	 *                created from a different implementation.
-	 * @see DOM Level 2
-	 */
-	public Document createDocument(String namespaceURI, String qualifiedName, DocumentType doctype) throws DOMException {
-		return null;
-	}
-
-	/**
-	 * Creates an empty <code>DocumentType</code> node. Entity declarations
-	 * and notations are not made available. Entity reference expansions and
-	 * default attribute additions do not occur. It is expected that a future
-	 * version of the DOM will provide a way for populating a
-	 * <code>DocumentType</code>.<br>
-	 * HTML-only DOM implementations do not need to implement this method.
-	 * 
-	 * @param qualifiedNameThe
-	 *            qualified name of the document type to be created.
-	 * @param publicIdThe
-	 *            external subset public identifier.
-	 * @param systemIdThe
-	 *            external subset system identifier.
-	 * @return A new <code>DocumentType</code> node with
-	 *         <code>Node.ownerDocument</code> set to <code>null</code>.
-	 * @exception DOMException
-	 *                INVALID_CHARACTER_ERR: Raised if the specified qualified
-	 *                name contains an illegal character. <br>
-	 *                NAMESPACE_ERR: Raised if the <code>qualifiedName</code>
-	 *                is malformed.
-	 * @see DOM Level 2
-	 */
-	public DocumentType createDocumentType(String qualifiedName, String publicId, String systemId) throws DOMException {
-		DocumentTypeImpl documentType = new DocumentTypeImpl();
-		documentType.setName(qualifiedName);
-		documentType.setPublicId(publicId);
-		documentType.setSystemId(systemId);
-		return documentType;
-	}
-
-	/**
-	 */
-	protected void documentTypeChanged() {
-		if (this.refresh)
-			return;
-		// unlike 'resfresh', 'reinitialize' finishes loop
-		// and flushes remaining notification que before
-		// actually reinitializing.
-		// ISSUE: should reinit be used instead of handlerefresh?
-		// this.setReinitializeNeeded(true);
-		if (this.active != null || getModelNotifier().isChanging())
-			return; // defer
-		handleRefresh();
-	}
-
-	protected void editableChanged(Node node) {
-		if (node != null) {
-			getModelNotifier().editableChanged(node);
-		}
-	}
-
-	/**
-	 */
-	protected void endTagChanged(Element element) {
-		if (element == null)
-			return;
-		if (getActiveParser() == null) {
-			XMLModelUpdater updater = getModelUpdater();
-			setActive(updater);
-			updater.initialize();
-			updater.changeEndTag(element);
-			setActive(null);
-		}
-		getModelNotifier().endTagChanged(element);
-	}
-
-	/**
-	 */
-	private XMLModelParser getActiveParser() {
-		if (this.parser == null)
-			return null;
-		if (this.parser != this.active)
-			return null;
-		return this.parser;
-	}
-
-	/**
-	 */
-	private XMLModelUpdater getActiveUpdater() {
-		if (this.updater == null)
-			return null;
-		if (this.updater != this.active)
-			return null;
-		return this.updater;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-	 */
-	public Object getAdapter(Class adapter) {
-		if (Document.class.equals(adapter))
-			return getDocument();
-		return super.getAdapter(adapter);
-	}
-
-	/**
-	 * getDocument method
-	 * 
-	 * @return XMLDocument
-	 */
-	public IDOMDocument getDocument() {
-		return this.document;
-	}
-
-	public ISourceGenerator getGenerator() {
-		if (this.generator == null) {
-			this.generator = XMLGeneratorImpl.getInstance();
-		}
-		return this.generator;
-	}
-
-	/**
-	 * getNode method
-	 * 
-	 * @param offset
-	 *            int
-	 */
-	public IndexedRegion getIndexedRegion(int offset) {
-		if (this.document == null)
-			return null;
-		// search in document children
-		IDOMNode parent = null;
-		int length = this.document.getEndOffset();
-		if (offset * 2 < length) {
-			// search from the first
-			IDOMNode child = (IDOMNode) this.document.getFirstChild();
-			while (child != null) {
-				if (child.getEndOffset() <= offset) {
-					child = (IDOMNode) child.getNextSibling();
-					continue;
-				}
-				if (child.getStartOffset() > offset) {
-					break;
-				}
-				IStructuredDocumentRegion startStructuredDocumentRegion = child.getStartStructuredDocumentRegion();
-				if (startStructuredDocumentRegion != null) {
-					if (startStructuredDocumentRegion.getEnd() > offset)
-						return child;
-				}
-				IStructuredDocumentRegion endStructuredDocumentRegion = child.getEndStructuredDocumentRegion();
-				if (endStructuredDocumentRegion != null) {
-					if (endStructuredDocumentRegion.getStart() <= offset)
-						return child;
-				}
-				// dig more
-				parent = child;
-				child = (IDOMNode) parent.getFirstChild();
-			}
-		}
-		else {
-			// search from the last
-			IDOMNode child = (IDOMNode) this.document.getLastChild();
-			while (child != null) {
-				if (child.getStartOffset() > offset) {
-					child = (IDOMNode) child.getPreviousSibling();
-					continue;
-				}
-				if (child.getEndOffset() <= offset) {
-					break;
-				}
-				IStructuredDocumentRegion startStructuredDocumentRegion = child.getStartStructuredDocumentRegion();
-				if (startStructuredDocumentRegion != null) {
-					if (startStructuredDocumentRegion.getEnd() > offset)
-						return child;
-				}
-				IStructuredDocumentRegion endStructuredDocumentRegion = child.getEndStructuredDocumentRegion();
-				if (endStructuredDocumentRegion != null) {
-					if (endStructuredDocumentRegion.getStart() <= offset)
-						return child;
-				}
-				// dig more
-				parent = child;
-				child = (IDOMNode) parent.getLastChild();
-			}
-		}
-		return parent;
-	}
-
-	/**
-	 */
-	public XMLModelNotifier getModelNotifier() {
-		if (this.notifier == null) {
-			this.notifier = new XMLModelNotifierImpl();
-		}
-		return this.notifier;
-	}
-
-	/**
-	 */
-	private XMLModelParser getModelParser() {
-		if (this.parser == null) {
-			this.parser = createModelParser();
-		}
-		return this.parser;
-	}
-
-	protected XMLModelParser createModelParser() {
-		return new XMLModelParser(this);
-	}
-
-	/**
-	 */
-	private XMLModelUpdater getModelUpdater() {
-		if (this.updater == null) {
-			this.updater = createModelUpdater();
-		}
-		return this.updater;
-	}
-
-	protected XMLModelUpdater createModelUpdater() {
-		return new XMLModelUpdater(this);
-	}
-
-	/**
-	 */
-	private void handleRefresh() {
-		if (!this.refresh)
-			return;
-		XMLModelNotifier notifier = getModelNotifier();
-		boolean isChanging = notifier.isChanging();
-		if (!isChanging)
-			notifier.beginChanging(true);
-		XMLModelParser parser = getModelParser();
-		setActive(parser);
-		this.document.removeChildNodes();
-		try {
-			parser.replaceStructuredDocumentRegions(getStructuredDocument().getRegionList(), null);
-		}
-		catch (Exception ex) {
-			Logger.logException(ex);
-		}
-		finally {
-			setActive(null);
-			if (!isChanging)
-				notifier.endChanging();
-			this.refresh = false;
-		}
-	}
-
-	/**
-	 * Test if the DOM implementation implements a specific feature.
-	 * 
-	 * @param featureThe
-	 *            name of the feature to test (case-insensitive). The values
-	 *            used by DOM features are defined throughout the DOM Level 2
-	 *            specifications and listed in the section. The name must be
-	 *            an XML name. To avoid possible conflicts, as a convention,
-	 *            names referring to features defined outside the DOM
-	 *            specification should be made unique by reversing the name of
-	 *            the Internet domain name of the person (or the organization
-	 *            that the person belongs to) who defines the feature,
-	 *            component by component, and using this as a prefix. For
-	 *            instance, the W3C SVG Working Group defines the feature
-	 *            "org.w3c.dom.svg".
-	 * @param versionThis
-	 *            is the version number of the feature to test. In Level 2,
-	 *            the string can be either "2.0" or "1.0". If the version is
-	 *            not specified, supporting any version of the feature causes
-	 *            the method to return <code>true</code>.
-	 * @return <code>true</code> if the feature is implemented in the
-	 *         specified version, <code>false</code> otherwise.
-	 */
-	public boolean hasFeature(String feature, String version) {
-		if (feature == null)
-			return false;
-		if (version != null) {
-			if (!version.equals("1.0") && !version.equals("2.0")) { //$NON-NLS-2$//$NON-NLS-1$
-				return false;
-			}
-		}
-		if (feature.equalsIgnoreCase("Core")) //$NON-NLS-1$
-			return true; //$NON-NLS-1$
-		if (feature.equalsIgnoreCase("XML")) //$NON-NLS-1$
-			return true; //$NON-NLS-1$
-		return false;
-	}
-
-	/**
-	 * createDocument method
-	 * 
-	 * @return org.w3c.dom.Document
-	 */
-	protected Document internalCreateDocument() {
-		DocumentImpl document = new DocumentImpl();
-		document.setModel(this);
-		return document;
-	}
-
-	boolean isReparsing() {
-		return (active != null);
-	}
-
-	/**
-	 * nameChanged method
-	 * 
-	 * @param node
-	 *            org.w3c.dom.Node
-	 */
-	protected void nameChanged(Node node) {
-		if (node == null)
-			return;
-		if (getActiveParser() == null) {
-			XMLModelUpdater updater = getModelUpdater();
-			setActive(updater);
-			updater.initialize();
-			updater.changeName(node);
-			setActive(null);
-		}
-		// notification is already sent
-	}
-
-	/**
-	 * newModel method
-	 * 
-	 */
-	public void newModel(NewDocumentEvent structuredDocumentEvent) {
-		if (structuredDocumentEvent == null)
-			return;
-		IStructuredDocument structuredDocument = structuredDocumentEvent.getStructuredDocument();
-		if (structuredDocument == null)
-			return;
-		// this should not happen, but for the case
-		if (fStructuredDocument != null && fStructuredDocument != structuredDocument)
-			setStructuredDocument(structuredDocument);
-
-		internalSetNewDocument(structuredDocument);
-	}
-
-	private void internalSetNewDocument(IStructuredDocument structuredDocument) {
-		if (structuredDocument == null)
-			return;
-		IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
-		if ((flatNodes == null) || (flatNodes.getLength() == 0)) {
-			return;
-		}
-		if (this.document == null)
-			return; // being constructed
-		XMLModelUpdater updater = getActiveUpdater();
-		if (updater != null) { // being updated
-			try {
-				updater.replaceStructuredDocumentRegions(flatNodes, null);
-			}
-			catch (Exception ex) {
-				Logger.logException(ex);
-				this.refresh = true;
-				handleRefresh();
-			}
-			finally {
-				setActive(null);
-			}
-			// // for new model, we might need to
-			// // re-init, e.g. if someone calls setText
-			// // on an existing model
-			// checkForReinit();
-			return;
-		}
-		XMLModelNotifier notifier = getModelNotifier();
-		boolean isChanging = notifier.isChanging();
-		// call even if changing to notify doing new model
-		getModelNotifier().beginChanging(true);
-		XMLModelParser parser = getModelParser();
-		setActive(parser);
-		this.document.removeChildNodes();
-		try {
-			parser.replaceStructuredDocumentRegions(flatNodes, null);
-		}
-		catch (Exception ex) {
-			Logger.logException(ex);
-			// meaningless to refresh, because the result might be the same
-		}
-		finally {
-			setActive(null);
-			if (!isChanging) {
-				getModelNotifier().endChanging();
-			}
-			// ignore refresh
-			this.refresh = false;
-		}
-	}
-
-	/**
-	 */
-	public void noChange(NoChangeEvent event) {
-		XMLModelUpdater updater = getActiveUpdater();
-		if (updater != null) { // being updated
-			// cleanup updater staffs
-			try {
-				updater.replaceStructuredDocumentRegions(null, null);
-			}
-			catch (Exception ex) {
-				Logger.logException(ex);
-				this.refresh = true;
-				handleRefresh();
-			}
-			finally {
-				setActive(null);
-			}
-			// I guess no chanage means the model could not need re-init
-			// checkForReinit();
-			return;
-		}
-	}
-
-	/**
-	 * nodesReplaced method
-	 * 
-	 */
-	public void nodesReplaced(StructuredDocumentRegionsReplacedEvent event) {
-		if (event == null)
-			return;
-		IStructuredDocumentRegionList oldStructuredDocumentRegions = event.getOldStructuredDocumentRegions();
-		IStructuredDocumentRegionList newStructuredDocumentRegions = event.getNewStructuredDocumentRegions();
-		XMLModelUpdater updater = getActiveUpdater();
-		if (updater != null) { // being updated
-			try {
-				updater.replaceStructuredDocumentRegions(newStructuredDocumentRegions, oldStructuredDocumentRegions);
-			}
-			catch (Exception ex) {
-				if (ex.getClass().equals(StructuredDocumentRegionManagementException.class)) {
-					Logger.traceException(TRACE_PARSER_MANAGEMENT_EXCEPTION, ex);
-				}
-				else {
-					Logger.logException(ex);
-				}
-				this.refresh = true;
-				handleRefresh();
-			}
-			finally {
-				setActive(null);
-			}
-			// checkForReinit();
-			return;
-		}
-		XMLModelNotifier notifier = getModelNotifier();
-		boolean isChanging = notifier.isChanging();
-		if (!isChanging)
-			notifier.beginChanging();
-		XMLModelParser parser = getModelParser();
-		setActive(parser);
-		try {
-			parser.replaceStructuredDocumentRegions(newStructuredDocumentRegions, oldStructuredDocumentRegions);
-		}
-		catch (Exception ex) {
-			Logger.logException(ex);
-			this.refresh = true;
-			handleRefresh();
-		}
-		finally {
-			setActive(null);
-			if (!isChanging) {
-				notifier.endChanging();
-				handleRefresh();
-			}
-		}
-
-	}
-
-	/**
-	 * regionChanged method
-	 * 
-	 * @param structuredDocumentEvent
-	 */
-	public void regionChanged(RegionChangedEvent event) {
-		if (event == null)
-			return;
-		IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
-		if (flatNode == null)
-			return;
-		ITextRegion region = event.getRegion();
-		if (region == null)
-			return;
-		XMLModelUpdater updater = getActiveUpdater();
-		if (updater != null) { // being updated
-			try {
-				updater.changeRegion(flatNode, region);
-			}
-			catch (Exception ex) {
-				Logger.logException(ex);
-				this.refresh = true;
-				handleRefresh();
-			}
-			finally {
-				setActive(null);
-			}
-			// checkForReinit();
-			return;
-		}
-		XMLModelNotifier notifier = getModelNotifier();
-		boolean isChanging = notifier.isChanging();
-		if (!isChanging)
-			notifier.beginChanging();
-		XMLModelParser parser = getModelParser();
-		setActive(parser);
-		try {
-			parser.changeRegion(flatNode, region);
-		}
-		catch (Exception ex) {
-			Logger.logException(ex);
-			this.refresh = true;
-			handleRefresh();
-		}
-		finally {
-			setActive(null);
-			if (!isChanging) {
-				notifier.endChanging();
-				handleRefresh();
-			}
-		}
-		// checkForReinit();
-	}
-
-	/**
-	 * regionsReplaced method
-	 * 
-	 * @param event
-	 */
-	public void regionsReplaced(RegionsReplacedEvent event) {
-		if (event == null)
-			return;
-		IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
-		if (flatNode == null)
-			return;
-		ITextRegionList oldRegions = event.getOldRegions();
-		ITextRegionList newRegions = event.getNewRegions();
-		if (oldRegions == null && newRegions == null)
-			return;
-		XMLModelUpdater updater = getActiveUpdater();
-		if (updater != null) { // being updated
-			try {
-				updater.replaceRegions(flatNode, newRegions, oldRegions);
-			}
-			catch (Exception ex) {
-				Logger.logException(ex);
-				this.refresh = true;
-				handleRefresh();
-			}
-			finally {
-				setActive(null);
-			}
-			// checkForReinit();
-			return;
-		}
-		XMLModelNotifier notifier = getModelNotifier();
-		boolean isChanging = notifier.isChanging();
-		if (!isChanging)
-			notifier.beginChanging();
-		XMLModelParser parser = getModelParser();
-		setActive(parser);
-		try {
-			parser.replaceRegions(flatNode, newRegions, oldRegions);
-		}
-		catch (Exception ex) {
-			Logger.logException(ex);
-			this.refresh = true;
-			handleRefresh();
-		}
-		finally {
-			setActive(null);
-			if (!isChanging) {
-				notifier.endChanging();
-				handleRefresh();
-			}
-		}
-		// checkForReinit();
-	}
-
-	/**
-	 */
-	public void releaseFromEdit() {
-		if (!isShared()) {
-			// this.document.releaseStyleSheets();
-			// this.document.releaseDocumentType();
-		}
-		super.releaseFromEdit();
-	}
-
-	/**
-	 */
-	public void releaseFromRead() {
-		if (!isShared()) {
-			// this.document.releaseStyleSheets();
-			// this.document.releaseDocumentType();
-		}
-		super.releaseFromRead();
-	}
-
-	/**
-	 */
-	private void setActive(Object active) {
-		this.active = active;
-		// side effect
-		// when ever becomes active, besure tagNameCache is cleared
-		// (and not used)
-		if (active == null) {
-			document.activateTagNameCache(true);
-		}
-		else {
-			document.activateTagNameCache(false);
-		}
-
-	}
-
-	/**
-	 */
-	public void setGenerator(ISourceGenerator generator) {
-		this.generator = generator;
-	}
-
-	/**
-	 */
-	public void setModelNotifier(XMLModelNotifier notifier) {
-		this.notifier = notifier;
-	}
-
-	/**
-	 */
-	public void setModelParser(XMLModelParser parser) {
-		this.parser = parser;
-	}
-
-	/**
-	 */
-	public void setModelUpdater(XMLModelUpdater updater) {
-		this.updater = updater;
-	}
-
-	/**
-	 * setStructuredDocument method
-	 * 
-	 * @param structuredDocument
-	 */
-	public void setStructuredDocument(IStructuredDocument structuredDocument) {
-		IStructuredDocument oldStructuredDocument = super.getStructuredDocument();
-		if (structuredDocument == oldStructuredDocument)
-			return; // nothing to do
-		if (oldStructuredDocument != null)
-			oldStructuredDocument.removeDocumentChangingListener(this);
-		super.setStructuredDocument(structuredDocument);
-		if (structuredDocument != null) {
-			internalSetNewDocument(structuredDocument);
-			structuredDocument.addDocumentChangingListener(this);
-		}
-	}
-
-	/**
-	 */
-	protected void startTagChanged(Element element) {
-		if (element == null)
-			return;
-		if (getActiveParser() == null) {
-			XMLModelUpdater updater = getModelUpdater();
-			setActive(updater);
-			updater.initialize();
-			updater.changeStartTag(element);
-			setActive(null);
-		}
-		getModelNotifier().startTagChanged(element);
-	}
-
-	/**
-	 * valueChanged method
-	 * 
-	 * @param node
-	 *            org.w3c.dom.Node
-	 */
-	protected void valueChanged(Node node) {
-		if (node == null)
-			return;
-		if (getActiveParser() == null) {
-			XMLModelUpdater updater = getModelUpdater();
-			setActive(updater);
-			updater.initialize();
-			updater.changeValue(node);
-			setActive(null);
-		}
-		getModelNotifier().valueChanged(node);
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation of DOM 3.
-	 */
-	public Object getFeature(String feature, String version) {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentFragmentImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentFragmentImpl.java
deleted file mode 100644
index cde882c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentFragmentImpl.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-
-/**
- * DocumentFragmentImpl class
- */
-public class DocumentFragmentImpl extends NodeContainer implements DocumentFragment {
-
-	/**
-	 * DocumentFragmentImpl constructor
-	 */
-	protected DocumentFragmentImpl() {
-		super();
-	}
-
-	/**
-	 * DocumentFragmentImpl constructor
-	 * 
-	 * @param that
-	 *            DocumentFragmentImpl
-	 */
-	protected DocumentFragmentImpl(DocumentFragmentImpl that) {
-		super(that);
-	}
-
-	/**
-	 * cloneNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param deep
-	 *            boolean
-	 */
-	public Node cloneNode(boolean deep) {
-		DocumentFragmentImpl cloned = new DocumentFragmentImpl(this);
-		if (deep)
-			cloneChildNodes(cloned, deep);
-		
-		notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
-		return cloned;
-	}
-
-	/**
-	 * getNodeName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		return "#document-fragment";//$NON-NLS-1$
-	}
-
-	/**
-	 * getNodeType method
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return DOCUMENT_FRAGMENT_NODE;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java
deleted file mode 100644
index 3c862d2..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java
+++ /dev/null
@@ -1,1179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-// for org.apache.xerces 3.2.1
-// import org.apache.xerces.utils.XMLCharacterProperties;
-// DMW modified for XML4J 4.0.1
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.xerces.dom.TreeWalkerImpl;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.xml.core.internal.commentelement.impl.CommentElementRegistry;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMEntityDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLCharEntity;
-import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Entity;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Notation;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.ranges.DocumentRange;
-import org.w3c.dom.ranges.Range;
-import org.w3c.dom.traversal.DocumentTraversal;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-import org.w3c.dom.traversal.TreeWalker;
-
-
-/**
- * DocumentImpl class
- */
-public class DocumentImpl extends NodeContainer implements IDOMDocument, DocumentRange, DocumentTraversal {
-
-	private static int maxDocTypeSearch = 500;
-	private static int noMaxSearch = -1;
-	/**
-	 * Internal-use only class. This class was added to better able to handle
-	 * repetetive request for getElementsByTagName. The cache is cleared when
-	 * ever the document changes at all, so still not real efficient,
-	 */
-	class TagNameCache {
-
-		private boolean active = true;
-
-		private Map cache;
-
-		public TagNameCache() {
-			super();
-			cache = new HashMap();
-		}
-
-		/**
-		 * @param b
-		 */
-		public void activate(boolean b) {
-			active = b;
-			if (!b)
-				clear();
-		}
-
-		public void addItem(String tagname, NodeListImpl nodelist) {
-			if (tagname == null || nodelist == null)
-				return;
-			cache.put(tagname, nodelist);
-		}
-
-		public void clear() {
-			cache.clear();
-		}
-
-		public NodeListImpl getItem(String tagName) {
-			NodeListImpl result = null;
-			if (active) {
-				result = (NodeListImpl) cache.get(tagName);
-				// if (result != null) {
-				// System.out.println("getElementsByTagname from cache: " +
-				// tagName);
-				// }
-			}
-			return result;
-		}
-
-	}
-
-	// this is a constant just to give compile-time control over
-	// whether or not to use the cache. If, in future, its found that
-	// there are no (or few) "duplicate requests" ... then this cache
-	// is not needed.
-	private static final boolean usetagnamecache = true;
-
-	// private DocumentTypeAdapter documentTypeAdapter = null;
-
-	private DOMModelImpl model = null;
-	private TagNameCache tagNameCache;
-
-	/**
-	 * DocumentImpl constructor
-	 */
-	protected DocumentImpl() {
-		super();
-		if (usetagnamecache) {
-			tagNameCache = new TagNameCache();
-		}
-	}
-
-	/**
-	 * DocumentImpl constructor
-	 * 
-	 * @param that
-	 *            DocumentImpl
-	 */
-	protected DocumentImpl(DocumentImpl that) {
-		super(that);
-		if (usetagnamecache) {
-			tagNameCache = new TagNameCache();
-		}
-	}
-
-	/**
-	 * @param b
-	 */
-	void activateTagNameCache(boolean b) {
-		tagNameCache.activate(b);
-	}
-
-	/**
-	 * <p>
-	 * EXPERIMENTAL! Based on the <a
-	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-	 * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
-	 * <p>
-	 * Changes the <code>ownerDocument</code> of a node, its children, as
-	 * well as the attached attribute nodes if there are any. If the node has
-	 * a parent it is first removed from its parent child list. This
-	 * effectively allows moving a subtree from one document to another. The
-	 * following list describes the specifics for each type of node.
-	 * <dl>
-	 * <dt>ATTRIBUTE_NODE</dt>
-	 * <dd>The <code>ownerElement</code> attribute is set to
-	 * <code>null</code> and the <code>specified</code> flag is set to
-	 * <code>true</code> on the adopted <code>Attr</code>. The
-	 * descendants of the source <code>Attr</code> are recursively adopted.
-	 * </dd>
-	 * <dt>DOCUMENT_FRAGMENT_NODE</dt>
-	 * <dd>The descendants of the source node are recursively adopted.</dd>
-	 * <dt>DOCUMENT_NODE</dt>
-	 * <dd><code>Document</code> nodes cannot be adopted.</dd>
-	 * <dt>DOCUMENT_TYPE_NODE</dt>
-	 * <dd><code>DocumentType</code> nodes cannot be adopted.</dd>
-	 * <dt>ELEMENT_NODE</dt>
-	 * <dd>Specified attribute nodes of the source element are adopted, and
-	 * the generated <code>Attr</code> nodes. Default attributes are
-	 * discarded, though if the document being adopted into defines default
-	 * attributes for this element name, those are assigned. The descendants
-	 * of the source element are recursively adopted.</dd>
-	 * <dt>ENTITY_NODE</dt>
-	 * <dd><code>Entity</code> nodes cannot be adopted.</dd>
-	 * <dt>ENTITY_REFERENCE_NODE</dt>
-	 * <dd>Only the <code>EntityReference</code> node itself is adopted,
-	 * the descendants are discarded, since the source and destination
-	 * documents might have defined the entity differently. If the document
-	 * being imported into provides a definition for this entity name, its
-	 * value is assigned.</dd>
-	 * <dt>NOTATION_NODE</dt>
-	 * <dd><code>Notation</code> nodes cannot be adopted.</dd>
-	 * <dt>PROCESSING_INSTRUCTION_NODE, TEXT_NODE, CDATA_SECTION_NODE,
-	 * COMMENT_NODE</dt>
-	 * <dd>These nodes can all be adopted. No specifics.</dd>
-	 * Should this method simply return null when it fails? How "exceptional"
-	 * is failure for this method?Stick with raising exceptions only in
-	 * exceptional circumstances, return null on failure (F2F 19 Jun 2000).Can
-	 * an entity node really be adopted?No, neither can Notation nodes (Telcon
-	 * 13 Dec 2000).Does this affect keys and hashCode's of the adopted
-	 * subtree nodes?If so, what about readonly-ness of key and hashCode?if
-	 * not, would appendChild affect keys/hashCodes or would it generate
-	 * exceptions if key's are duplicate? Update: Hashcodes have been dropped.
-	 * Given that the key is only unique within a document an adopted node
-	 * needs to be given a new key, but what does it mean for the application?
-	 * 
-	 * TODO: Needs to notify UserDataHandlers for the node if any
-	 * 
-	 * @param source
-	 *            The node to move into this document.
-	 * @return The adopted node, or <code>null</code> if this operation
-	 *         fails, such as when the source node comes from a different
-	 *         implementation.
-	 * @exception DOMException
-	 *                NOT_SUPPORTED_ERR: Raised if the source node is of type
-	 *                <code>DOCUMENT</code>,<code>DOCUMENT_TYPE</code>.
-	 *                <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised when the source node
-	 *                is readonly.
-	 * @see DOM Level 3
-	 */
-	public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source) throws org.w3c.dom.DOMException {
-		return null;
-	}
-
-	/**
-	 * @param tagName
-	 */
-	protected void checkTagNameValidity(String tagName) {
-		if (!isValidName(tagName)) {
-			throw new DOMException(DOMException.INVALID_CHARACTER_ERR, createDOMExceptionMessage(DOMException.INVALID_CHARACTER_ERR, tagName));
-		}
-	}
-
-	/**
-	 * cloneNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param deep
-	 *            boolean
-	 */
-	public Node cloneNode(boolean deep) {
-		DocumentImpl cloned = new DocumentImpl(this);
-		if (deep)
-			cloned.importChildNodes(this, true);
-		return cloned;
-	}
-
-	/**
-	 * createAttribute method
-	 * 
-	 * @return org.w3c.dom.Attr
-	 * @param name
-	 *            java.lang.String
-	 */
-	public Attr createAttribute(String name) throws DOMException {
-		AttrImpl attr = new AttrImpl();
-		attr.setOwnerDocument(this);
-		attr.setName(name);
-		return attr;
-	}
-
-	/**
-	 */
-	public Attr createAttributeNS(String uri, String name) throws DOMException {
-		AttrImpl attr = new AttrImpl();
-		attr.setOwnerDocument(this);
-		attr.setName(name);
-		attr.setNamespaceURI(uri);
-		return attr;
-	}
-
-	/**
-	 * createCDATASection method
-	 * 
-	 * @return org.w3c.dom.CDATASection
-	 * @param data
-	 *            java.lang.String
-	 */
-	public CDATASection createCDATASection(String data) throws DOMException {
-		// allow CDATA section
-		// if (!isXMLType()) {
-		// throw new DOMException(DOMException.NOT_SUPPORTED_ERR, new
-		// String());
-		// }
-		CDATASectionImpl cdata = new CDATASectionImpl();
-		cdata.setOwnerDocument(this);
-		if (data != null)
-			cdata.setData(data);
-		return cdata;
-	}
-
-	/**
-	 * createComment method
-	 * 
-	 * @return org.w3c.dom.Comment
-	 * @param data
-	 *            java.lang.String
-	 */
-	public Comment createComment(String data) {
-		CommentImpl comment = new CommentImpl();
-		comment.setOwnerDocument(this);
-		if (data != null)
-			comment.setData(data);
-		return comment;
-	}
-
-	public Element createCommentElement(String tagName, boolean isJSPTag) throws DOMException {
-		Element result = null;
-		if (!isJSPType() && isJSPTag) {
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, new String());
-		}
-		ElementImpl element = (ElementImpl) createElement(tagName);
-		element.setJSPTag(isJSPTag);
-		CommentElementRegistry registry = CommentElementRegistry.getInstance();
-		if (registry.setupCommentElement(element)) {
-			result = element;
-		}
-		else {
-			throw new DOMException(DOMException.INVALID_CHARACTER_ERR, new String());
-		}
-		return result;
-	}
-
-	/**
-	 * createDoctype method
-	 * 
-	 * @return org.w3c.dom.DocumentType
-	 * @param name
-	 *            java.lang.String
-	 */
-	public DocumentType createDoctype(String name) {
-		DocumentTypeImpl docType = new DocumentTypeImpl();
-		docType.setOwnerDocument(this);
-		docType.setName(name);
-		return docType;
-	}
-
-	/**
-	 * createDocumentFragment method
-	 * 
-	 * @return org.w3c.dom.DocumentFragment
-	 */
-	public DocumentFragment createDocumentFragment() {
-		DocumentFragmentImpl fragment = new DocumentFragmentImpl();
-		fragment.setOwnerDocument(this);
-		return fragment;
-	}
-
-	/**
-	 * createElement method
-	 * 
-	 * @return org.w3c.dom.Element
-	 * @param tagName
-	 *            java.lang.String
-	 */
-	public Element createElement(String tagName) throws DOMException {
-		checkTagNameValidity(tagName);
-
-		ElementImpl element = new ElementImpl();
-		element.setOwnerDocument(this);
-		element.setTagName(tagName);
-		return element;
-	}
-
-	/**
-	 */
-	public Element createElementNS(String uri, String tagName) throws DOMException {
-		if (!isValidName(tagName)) {
-			throw new DOMException(DOMException.INVALID_CHARACTER_ERR, new String());
-		}
-
-		ElementImpl element = (ElementImpl) createElement(tagName);
-		element.setNamespaceURI(uri);
-		return element;
-	}
-
-	/**
-	 * createEntity method
-	 * 
-	 * @return org.w3c.dom.Entity
-	 * @param name
-	 *            java.lang.String
-	 */
-	public Entity createEntity(String name) {
-		EntityImpl entity = new EntityImpl();
-		entity.setOwnerDocument(this);
-		entity.setName(name);
-		return entity;
-	}
-
-	/**
-	 * createEntityReference method
-	 * 
-	 * @return org.w3c.dom.EntityReference
-	 * @param name
-	 *            java.lang.String
-	 */
-	public EntityReference createEntityReference(String name) throws DOMException {
-		if (!isXMLType()) {
-			throw new DOMException(DOMException.NOT_SUPPORTED_ERR, new String());
-		}
-
-		EntityReferenceImpl ref = new EntityReferenceImpl();
-		ref.setOwnerDocument(this);
-		ref.setName(name);
-		return ref;
-	}
-
-	/**
-	 */
-	public NodeIterator createNodeIterator(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) {
-		if (root == null)
-			root = this;
-		return new NodeIteratorImpl(root, whatToShow, filter);
-	}
-
-	/**
-	 * createNotation method
-	 * 
-	 * @return org.w3c.dom.Notation
-	 * @param name
-	 *            java.lang.String
-	 */
-	public Notation createNotation(String name) {
-		NotationImpl notation = new NotationImpl();
-		notation.setOwnerDocument(this);
-		notation.setName(name);
-		return notation;
-	}
-
-	/**
-	 * createProcessingInstruction method
-	 * 
-	 * @return org.w3c.dom.ProcessingInstruction
-	 * @param target
-	 *            java.lang.String
-	 * @param data
-	 *            java.lang.String
-	 */
-	public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException {
-		ProcessingInstructionImpl pi = new ProcessingInstructionImpl();
-		pi.setOwnerDocument(this);
-		pi.setTarget(target);
-		if (data != null)
-			pi.setData(data);
-		return pi;
-	}
-
-	/**
-	 */
-	public Range createRange() {
-		return new RangeImpl();
-	}
-
-	/**
-	 * createTextNode method
-	 * 
-	 * @return org.w3c.dom.Text
-	 * @param data
-	 *            java.lang.String
-	 */
-	public Text createTextNode(String data) {
-		TextImpl text = new TextImpl();
-		text.setOwnerDocument(this);
-		text.setData(data);
-		return text;
-	}
-
-	/**
-	 * Return an instance of tree walk
-	 */
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.w3c.dom.traversal.DocumentTraversal#createTreeWalker(org.w3c.dom.Node,
-	 *      int, org.w3c.dom.traversal.NodeFilter, boolean)
-	 */
-	public TreeWalker createTreeWalker(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) {
-		if (root == null) {
-			String msg = "Program Error: root node can not be null for TreeWalker";
-			throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
-		}
-		// ISSUE: we just use Xerces implementation for now, but longer term,
-		// we should make a
-		// thread/job safe version (as well as not rely on Xerces "impl"
-		// class.
-		return new TreeWalkerImpl(root, whatToShow, filter, entityReferenceExpansion);
-
-	}
-
-	private DocumentType findDoctype(Node node) {
-		
-		int countSearch = 0;
-		for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
-			if (countSearch++ > maxDocTypeSearch) {
-				break;
-			}
-			if (child.getNodeType() == DOCUMENT_TYPE_NODE && child instanceof DocumentType) {
-				return (DocumentType) child;
-			}
-			else if (child.getNodeType() == ELEMENT_NODE && ((IDOMElement) child).isCommentTag()) {
-				// search DOCTYPE inside of generic comment element
-				DocumentType docType = findDoctype(child);
-				if (docType != null) {
-					return docType;
-				}
-			}
-		}
-
-		return null;
-	}
-
-	private Element findDocumentElement(String docName, Node node, Node[] firstFound, int max) {
-		int countSearch = 0;
-		for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
-			
-			/* 
-			 * maxDocTypeSearch limits added via bug 151929
-			 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=151929
-			 * but, in other contexts, 
-			 * if noMaxSearch is specified, then do not "break out" of long searches 
-			 * */
-			if (max != noMaxSearch && countSearch++ > max) {
-				break;
-			}
-			if (child.getNodeType() != ELEMENT_NODE)
-				continue;
-			ElementImpl element = (ElementImpl) child;
-			if (element.isCommentTag()) {
-				Element docElement = findDocumentElement(docName, element, firstFound, max);
-				if (docElement != null) {
-					return docElement;
-				}
-				else {
-					// added 'else continue' to better handle cases where
-					// there is "more than one root" element
-					// especially complicated by CommentElements, which are
-					// sometimes treated as elements, but should
-					// be treated as comments in this context.
-					continue;
-				}
-			}
-			// note: the "name" won't match in the event of a jsp tag ... but
-			// incase
-			// the name is null, we do not want the jsp element returned as
-			// documentElement
-			if (element.isJSPTag())
-				continue;
-			if (docName == null)
-				return element;
-			// use local name for namespace
-			String localName = element.getLocalName();
-			if (localName == null)
-				continue;
-			if (isXMLType()) {
-				if (localName.equals(docName))
-					return element;
-			}
-			else {
-				if (localName.equalsIgnoreCase(docName))
-					return element;
-			}
-			if (firstFound[0] == null)
-				firstFound[0] = element;
-		}
-		return null;
-	}
-
-	/**
-	 * getCharValue method
-	 * 
-	 * @return java.lang.String
-	 * @param name
-	 *            java.lang.String
-	 */
-	protected String getCharValue(String name) {
-		if (name == null)
-			return null;
-		int length = name.length();
-		if (length == 0)
-			return null;
-
-		if (name.charAt(0) == '#') { // character reference
-			if (length == 1)
-				return null;
-			int radix = 10;
-			String s = null;
-			// now allow hexadecimal also for non XML document
-			if (name.charAt(1) == 'x') { // hexadecimal
-				radix = 16;
-				s = name.substring(2);
-			}
-			else { // decimal
-				s = name.substring(1);
-			}
-			if (s == null || s.length() == 0)
-				return null;
-			if (s.charAt(0) == '-')
-				return null; // no minus accepted
-			char c = 0;
-			try {
-				c = (char) Integer.parseInt(s, radix);
-			}
-			catch (NumberFormatException ex) {
-			}
-			if (c == 0)
-				return null;
-			return String.valueOf(c);
-		}
-
-		// implicit character entities for XML
-		if (name.equals(IXMLCharEntity.LT_NAME))
-			return IXMLCharEntity.LT_VALUE;
-		if (name.equals(IXMLCharEntity.GT_NAME))
-			return IXMLCharEntity.GT_VALUE;
-		if (name.equals(IXMLCharEntity.AMP_NAME))
-			return IXMLCharEntity.AMP_VALUE;
-		if (name.equals(IXMLCharEntity.QUOT_NAME))
-			return IXMLCharEntity.QUOT_VALUE;
-		if (isXMLType()) {
-			if (name.equals(IXMLCharEntity.APOS_NAME))
-				return IXMLCharEntity.APOS_VALUE;
-		}
-
-		CMDocument cm = getCMDocument();
-		if (cm != null) {
-			CMNamedNodeMap map = cm.getEntities();
-			if (map != null) {
-				CMEntityDeclaration decl = (CMEntityDeclaration) map.getNamedItem(name);
-				if (decl != null) {
-					String value = decl.getValue();
-					if (value == null)
-						return null;
-					int valueLength = value.length();
-					if (valueLength > 1 && value.charAt(0) == '&' && value.charAt(1) == '#' && value.charAt(valueLength - 1) == ';') {
-						// character reference
-						return getCharValue(value.substring(1, valueLength - 1));
-					}
-					return value;
-				}
-			}
-		}
-
-		return null;
-	}
-
-	/**
-	 */
-	protected CMDocument getCMDocument() {
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(this);
-		if (modelQuery == null)
-			return null;
-		return modelQuery.getCorrespondingCMDocument(this);
-	}
-
-	/**
-	 * getDoctype method
-	 * 
-	 * @return org.w3c.dom.DocumentType
-	 */
-	public DocumentType getDoctype() {
-		return findDoctype(this);
-	}
-
-	/**
-	 * getDocumentElement
-	 * 
-	 * @return org.w3c.dom.Element From DOM 2 Spec: documentElement of type
-	 *         Element [p.62] , readonly This is a convenience [p.119]
-	 *         attribute that allows direct access to the child node that is
-	 *         the root element of the document. For HTML documents, this is
-	 *         the element with the tagName "HTML". Note: we differ from this
-	 *         definition a little in that we don't necessarily take the first
-	 *         child but also look to match the name. In a well formed
-	 *         document, of course, the result is the same, but not
-	 *         necessarily the same in an ill-formed document.
-	 */
-	public Element getDocumentElement() {
-		String name = null;
-		DocumentType docType = getDocumentType();
-		if (docType != null) {
-			name = docType.getName();
-		}
-
-		Element first[] = new Element[1];
-		Element docElement = findDocumentElement(name, this, first, noMaxSearch);
-		if (docElement == null) {
-			docElement = first[0];
-		}
-
-		return docElement;
-	}
-
-	/**
-	 */
-	protected DocumentType getDocumentType() {
-		DocumentTypeAdapter adapter = (DocumentTypeAdapter) getAdapterFor(DocumentTypeAdapter.class);
-		if (adapter == null)
-			return getDoctype();
-		return adapter.getDocumentType();
-	}
-
-
-	public String getDocumentTypeId() {
-		DocumentType docType = getDocumentType();
-		if (docType == null)
-			return null;
-		String id = docType.getPublicId();
-		if (id == null)
-			id = docType.getSystemId();
-		return id;
-	}
-
-	/**
-	 */
-	public Element getElementById(String id) {
-		if (id == null)
-			return null;
-		NodeIterator it = createNodeIterator(this, NodeFilter.SHOW_ALL, null, false);
-		if (it == null)
-			return null;
-
-		for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
-			if (node.getNodeType() != ELEMENT_NODE)
-				continue;
-			ElementImpl element = (ElementImpl) node;
-			String value = element.getAttribute("id");//$NON-NLS-1$
-			if (value != null && value.equals(id))
-				return element;
-		}
-
-		return null;
-	}
-
-	/**
-	 * getElementsByTagName method
-	 * 
-	 * @return org.w3c.dom.NodeList
-	 * @param tagName
-	 *            java.lang.String
-	 */
-	public NodeList getElementsByTagName(String tagName) {
-		if (tagName == null)
-			return new NodeListImpl();
-
-		NodeListImpl elements = null;
-
-		if (usetagnamecache) {
-			elements = tagNameCache.getItem(tagName);
-		}
-
-		if (elements == null) {
-			elements = internalGetElementsByTagName(tagName);
-
-		}
-
-		return elements;
-	}
-
-	/**
-	 */
-	public NodeList getElementsByTagNameNS(String uri, String tagName) {
-		if (tagName == null)
-			return new NodeListImpl();
-
-		NodeIterator it = createNodeIterator(this, NodeFilter.SHOW_ALL, null, false);
-		if (it == null)
-			return new NodeListImpl();
-		NodeListImpl elements = new NodeListImpl();
-
-		if (uri != null && uri.length() == 1 && uri.charAt(0) == '*') {
-			uri = null; // do not care
-		}
-		if (tagName.length() == 1 && tagName.charAt(0) == '*') {
-			tagName = null; // do not care
-		}
-
-		for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
-			if (node.getNodeType() != ELEMENT_NODE)
-				continue;
-			ElementImpl element = (ElementImpl) node;
-			if (tagName != null) {
-				String localName = element.getLocalName();
-				if (localName == null || !localName.equals(tagName))
-					continue;
-			}
-			if (uri != null) {
-				String nsURI = element.getNamespaceURI();
-				if (nsURI == null || !nsURI.equals(uri))
-					continue;
-			}
-			elements.appendNode(element);
-		}
-
-		return elements;
-	}
-
-	/**
-	 * <p>
-	 * EXPERIMENTAL! Based on the <a
-	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-	 * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
-	 * <p>
-	 * An attribute specifying, as part of the XML declaration, the encoding
-	 * of this document. This is <code>null</code> when unspecified.
-	 * 
-	 * @see DOM Level 3
-	 */
-	public java.lang.String getEncoding() {
-		return null;
-	}
-
-	/**
-	 */
-	public DOMImplementation getImplementation() {
-		return model;
-	}
-
-	/**
-	 * other nodes will be referring to this one to get the owning model
-	 */
-	public IDOMModel getModel() {
-		return model;
-	}
-
-	/**
-	 * getNodeName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		return "#document";//$NON-NLS-1$
-	}
-
-	/**
-	 * getNodeType method
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return DOCUMENT_NODE;
-	}
-
-	/**
-	 * <p>
-	 * EXPERIMENTAL! Based on the <a
-	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-	 * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
-	 * <p>
-	 * An attribute specifying, as part of the XML declaration, whether this
-	 * document is standalone.
-	 * 
-	 * @see DOM Level 3
-	 */
-	public boolean getStandalone() {
-		return false;
-	}
-
-	/**
-	 * <p>
-	 * EXPERIMENTAL! Based on the <a
-	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-	 * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
-	 * <p>
-	 * An attribute specifying whether errors checking is enforced or not.
-	 * When set to <code>false</code>, the implementation is free to not
-	 * test every possible error case normally defined on DOM operations, and
-	 * not raise any <code>DOMException</code>. In case of error, the
-	 * behavior is undefined. This attribute is <code>true</code> by
-	 * defaults.
-	 * 
-	 * @see DOM Level 3
-	 */
-	public boolean getStrictErrorChecking() {
-		return false;
-	}
-
-	/**
-	 * <p>
-	 * EXPERIMENTAL! Based on the <a
-	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-	 * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
-	 * <p>
-	 * An attribute specifying, as part of the XML declaration, the version
-	 * number of this document. This is <code>null</code> when unspecified.
-	 * 
-	 * @see DOM Level 3
-	 */
-	public String getVersion() {
-		return null;
-	}
-
-	/**
-	 */
-	protected boolean ignoreCase() {
-		DocumentTypeAdapter adapter = (DocumentTypeAdapter) getAdapterFor(DocumentTypeAdapter.class);
-		if (adapter == null)
-			return false;
-		return (adapter.getTagNameCase() != DocumentTypeAdapter.STRICT_CASE);
-	}
-
-	/**
-	 */
-	protected void importChildNodes(Node parent, boolean deep) {
-		if (parent == null)
-			return;
-
-		removeChildNodes();
-
-		for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
-			Node imported = importNode(child, deep);
-			if (imported == null)
-				continue;
-			appendChild(imported);
-		}
-	}
-
-	/**
-	 */
-	public Node importNode(Node node, boolean deep) throws DOMException {
-		if (node == null)
-			return null;
-		NodeImpl imported = (NodeImpl) node.cloneNode(deep);
-		if (imported == null)
-			return null;
-		//successful import, notify UserDataHandlers if any
-		NodeImpl nodeToNotify=(NodeImpl) node;
-		nodeToNotify.notifyUserDataHandlers(UserDataHandler.NODE_IMPORTED, null);
-		imported.setOwnerDocument(this, deep);
-		return imported;
-	}
-
-	private NodeListImpl internalGetElementsByTagName(String tagName) {
-		// System.out.println("getElementsByTagname: " + tagName);
-		NodeIterator it = createNodeIterator(this, NodeFilter.SHOW_ALL, null, false);
-		if (it == null)
-			return new NodeListImpl();
-		NodeListImpl elements = new NodeListImpl();
-
-		if (tagName.length() == 1 && tagName.charAt(0) == '*') {
-			tagName = null; // do not care
-		}
-
-		for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
-			if (node.getNodeType() != ELEMENT_NODE)
-				continue;
-			if (tagName != null) {
-				ElementImpl element = (ElementImpl) node;
-				if (!element.matchTagName(tagName))
-					continue;
-			}
-			elements.appendNode(node);
-		}
-		if (usetagnamecache) {
-			tagNameCache.addItem(tagName, elements);
-		}
-		return elements;
-	}
-
-	/**
-	 */
-	public boolean isJSPDocument() {
-		Element element = getDocumentElement();
-		if (element == null)
-			return false;
-		String tagName = element.getTagName();
-		if (tagName == null)
-			return false;
-		return tagName.equals(JSPTag.JSP_ROOT);
-	}
-
-	/**
-	 */
-	public boolean isJSPType() {
-		if (this.model == null)
-			return false;
-		IModelHandler handler = this.model.getModelHandler();
-		if (handler == null)
-			return false;
-		String id = handler.getAssociatedContentTypeId();
-		if (id == null)
-			return false;
-		// ISSUE: -- avoid this hardcoded string
-		return id.equals("org.eclipse.jst.jsp.core.jspsource"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	protected boolean isValidName(String name) {
-		if (name == null || name.length() == 0)
-			return false;
-		// // DMW: modified for XML4J 4.0.1
-		// if (XMLChar.isValidName(name)) return true;
-		if (NameValidator.isValid(name))
-			return true;
-		// special for invalid declaration
-		if (name.length() == 1 && name.charAt(0) == '!')
-			return true;
-		// special for JSP tag in tag name
-		if (name.startsWith(JSPTag.TAG_OPEN))
-			return true;
-		return false;
-	}
-
-	/**
-	 */
-	public boolean isXMLType() {
-		DocumentTypeAdapter adapter = (DocumentTypeAdapter) getAdapterFor(DocumentTypeAdapter.class);
-		if (adapter == null)
-			return true;
-		return adapter.isXMLType();
-	}
-
-	/**
-	 */
-	// protected void releaseDocumentType() {
-	// if (this.documentTypeAdapter == null)
-	// return;
-	// this.documentTypeAdapter.release();
-	// this.documentTypeAdapter = null;
-	// }
-	/**
-	 * <p>
-	 * EXPERIMENTAL! Based on the <a
-	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-	 * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
-	 * <p>
-	 * An attribute specifying, as part of the XML declaration, the encoding
-	 * of this document. This is <code>null</code> when unspecified.
-	 * 
-	 * @see DOM Level 3
-	 */
-	public void setEncoding(java.lang.String encoding) {
-	}
-
-	/**
-	 * setModel method
-	 * 
-	 * @param model
-	 *            XMLModel
-	 */
-
-	protected void setModel(IDOMModel model) {
-		this.model = (DOMModelImpl) model;
-	}
-
-	/**
-	 * <p>
-	 * EXPERIMENTAL! Based on the <a
-	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-	 * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
-	 * <p>
-	 * An attribute specifying, as part of the XML declaration, whether this
-	 * document is standalone.
-	 * 
-	 * @see DOM Level 3
-	 */
-	public void setStandalone(boolean standalone) {
-	}
-
-	/**
-	 * <p>
-	 * EXPERIMENTAL! Based on the <a
-	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-	 * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
-	 * <p>
-	 * An attribute specifying whether errors checking is enforced or not.
-	 * When set to <code>false</code>, the implementation is free to not
-	 * test every possible error case normally defined on DOM operations, and
-	 * not raise any <code>DOMException</code>. In case of error, the
-	 * behavior is undefined. This attribute is <code>true</code> by
-	 * defaults.
-	 * 
-	 * @see DOM Level 3
-	 */
-	public void setStrictErrorChecking(boolean strictErrorChecking) {
-	}
-
-	/**
-	 * <p>
-	 * EXPERIMENTAL! Based on the <a
-	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-	 * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
-	 * <p>
-	 * An attribute specifying, as part of the XML declaration, the version
-	 * number of this document. This is <code>null</code> when unspecified.
-	 * 
-	 * @see DOM Level 3
-	 */
-	public void setVersion(java.lang.String version) {
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public String getInputEncoding() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public String getXmlEncoding() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public boolean getXmlStandalone() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public String getXmlVersion() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public void setXmlVersion(String xmlVersion) throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public String getDocumentURI() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public void setDocumentURI(String documentURI) {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public DOMConfiguration getDomConfig() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public void normalizeDocument() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapter.java
deleted file mode 100644
index d216704..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapter.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.w3c.dom.DocumentType;
-
-
-/**
- */
-public interface DocumentTypeAdapter extends INodeAdapter {
-	static final int LOWER_CASE = 2;
-	static final int STRICT_CASE = 0;
-	static final int UPPER_CASE = 1;
-
-	/**
-	 */
-	int getAttrNameCase();
-
-	/**
-	 */
-	DocumentType getDocumentType();
-
-	/**
-	 */
-	int getTagNameCase();
-
-	/**
-	 */
-	boolean hasFeature(String feature);
-
-	/**
-	 */
-	boolean isXMLType();
-
-	/**
-	 */
-	void release();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapterImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapterImpl.java
deleted file mode 100644
index 29c3e95..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapterImpl.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.DocumentType;
-
-
-/**
- */
-public class DocumentTypeAdapterImpl implements DocumentTypeAdapter {
-
-	private IDOMDocument document = null;
-	private DocumentType documentType = null;
-
-	/**
-	 */
-	protected DocumentTypeAdapterImpl() {
-		super();
-	}
-
-	/**
-	 */
-	protected DocumentTypeAdapterImpl(IDOMDocument document) {
-		this.document = document;
-		if (document != null) {
-			this.documentType = document.getDoctype();
-		}
-	}
-
-	/**
-	 */
-	public int getAttrNameCase() {
-		return STRICT_CASE;
-	}
-
-	/**
-	 */
-	protected IDOMDocument getDocument() {
-		return this.document;
-	}
-
-	/**
-	 */
-	public DocumentType getDocumentType() {
-		return this.documentType;
-	}
-
-	/**
-	 */
-	public int getTagNameCase() {
-		return STRICT_CASE;
-	}
-
-	/**
-	 */
-	public boolean hasFeature(String feature) {
-		return false;
-	}
-
-	/**
-	 */
-	public boolean isAdapterForType(Object type) {
-		return (type == DocumentTypeAdapter.class);
-	}
-
-	/**
-	 */
-	public boolean isXMLType() {
-		return true;
-	}
-
-	/**
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		if (eventType != INodeNotifier.STRUCTURE_CHANGED)
-			return;
-		if (notifier == null || !(notifier instanceof IDOMDocument))
-			return;
-		this.documentType = ((IDOMDocument) notifier).getDoctype();
-	}
-
-	/**
-	 */
-	protected void notifyDocumentTypeChanged() {
-		if (this.document == null)
-			return;
-		IDOMModel model = this.document.getModel();
-		if (model == null)
-			return;
-		((DOMModelImpl) model).documentTypeChanged();
-	}
-
-	/**
-	 */
-	public void release() {
-		// nothing to do
-	}
-
-	/**
-	 */
-	protected void setDocumentType(DocumentType documentType) {
-		this.documentType = documentType;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeImpl.java
deleted file mode 100644
index 769543f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeImpl.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-
-/**
- * DocumentType class
- */
-public class DocumentTypeImpl extends NodeImpl implements IDOMDocumentType {
-	private String internalSubset = null;
-
-	private String name = null;
-	private String publicId = null;
-	private String systemId = null;
-
-	/**
-	 * DocumentTypeImpl constructor
-	 */
-	protected DocumentTypeImpl() {
-		super();
-	}
-
-	/**
-	 * DocumentTypeImpl constructor
-	 * 
-	 * @param that
-	 *            DocumentTypeImpl
-	 */
-	protected DocumentTypeImpl(DocumentTypeImpl that) {
-		super(that);
-
-		if (that != null) {
-			this.name = that.name;
-		}
-	}
-
-	/**
-	 * cloneNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param deep
-	 *            boolean
-	 */
-	public Node cloneNode(boolean deep) {
-		DocumentTypeImpl cloned = new DocumentTypeImpl(this);
-		notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
-		return cloned;
-	}
-
-	/**
-	 * getEntities method
-	 * 
-	 * @return org.w3c.dom.NamedNodeMap
-	 */
-	public NamedNodeMap getEntities() {
-		return null;
-	}
-
-	/**
-	 */
-	public String getInternalSubset() {
-		return this.internalSubset;
-	}
-
-	/**
-	 * getName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getName() {
-		if (this.name == null)
-			return new String();
-		return this.name;
-	}
-
-	/**
-	 * getNodeName
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		return getName();
-	}
-
-	/**
-	 * getNodeType method
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return DOCUMENT_TYPE_NODE;
-	}
-
-	/**
-	 * getNotations method
-	 * 
-	 * @return org.w3c.dom.NamedNodeMap
-	 */
-	public NamedNodeMap getNotations() {
-		return null;
-	}
-
-	/**
-	 * getPublicId method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getPublicId() {
-		return this.publicId;
-	}
-
-	/**
-	 * getSystemId method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getSystemId() {
-		return this.systemId;
-	}
-
-	/**
-	 */
-	public boolean isClosed() {
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode == null)
-			return true; // will be generated
-		String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode);
-		return (regionType == DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE || regionType == DOMRegionContext.XML_DECLARATION_CLOSE);
-	}
-
-	/**
-	 */
-	public void setInternalSubset(String internalSubset) {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		this.internalSubset = internalSubset;
-	}
-
-	/**
-	 * setName method
-	 * 
-	 * @param name
-	 *            java.lang.String
-	 */
-	protected void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * setPublicId method
-	 * 
-	 * @param publicId
-	 *            java.lang.String
-	 */
-	public void setPublicId(String publicId) {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		this.publicId = publicId;
-
-		notifyValueChanged();
-	}
-
-	/**
-	 * setSystemId method
-	 * 
-	 * @param systemId
-	 *            java.lang.String
-	 */
-	public void setSystemId(String systemId) {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		this.systemId = systemId;
-
-		notifyValueChanged();
-	}
-
-	/**
-	 * toString method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String toString() {
-		StringBuffer buffer = new StringBuffer();
-		buffer.append(getName());
-		buffer.append('(');
-		buffer.append(getPublicId());
-		buffer.append(')');
-		buffer.append('(');
-		buffer.append(getSystemId());
-		buffer.append(')');
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode != null) {
-			buffer.append('@');
-			buffer.append(flatNode.toString());
-		}
-		return buffer.toString();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java
deleted file mode 100644
index 8db82f1..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java
+++ /dev/null
@@ -1,1474 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *    
- *     Valentin Baciu - https://bugs.eclipse.org/bugs/show_bug.cgi?id=139552
- *     
- *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementAdapter;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLNamespace;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-
-
-/**
- * ElementImpl class
- */
-public class ElementImpl extends NodeContainer implements IDOMElement {
-
-	private class Attributes implements NamedNodeMap {
-		Attributes() {
-			super();
-		}
-
-		public int getLength() {
-			if (attrNodes == null)
-				return 0;
-			return attrNodes.getLength();
-		}
-
-		public Node getNamedItem(String name) {
-			return getAttributeNode(name);
-		}
-
-		public Node getNamedItemNS(String uri, String name) {
-			return getAttributeNodeNS(uri, name);
-		}
-
-		public Node item(int index) {
-			if (attrNodes == null)
-				return null;
-			return attrNodes.item(index);
-		}
-
-		public Node removeNamedItem(String name) throws DOMException {
-			return removeAttributeNode(name);
-		}
-
-		public Node removeNamedItemNS(String uri, String name) throws DOMException {
-			return removeAttributeNodeNS(uri, name);
-		}
-
-		public Node setNamedItem(Node arg) throws DOMException {
-			return setAttributeNode((AttrImpl) arg);
-		}
-
-		public Node setNamedItemNS(Node arg) throws DOMException {
-			return setAttributeNodeNS((AttrImpl) arg);
-		}
-	}
-
-	NodeListImpl attrNodes = null;
-	private IStructuredDocumentRegion endStructuredDocumentRegion = null;
-	private boolean isCommentTag = false;
-	private boolean isEmptyTag = false;
-	private boolean isJSPTag = false;
-	private String namespaceURI = null;
-
-	private String tagName = null;
-
-	/**
-	 * ElementImpl constructor
-	 */
-	protected ElementImpl() {
-		super();
-	}
-
-	/**
-	 * ElementImpl constructor
-	 * 
-	 * @param that
-	 *            ElementImpl
-	 */
-	protected ElementImpl(ElementImpl that) {
-		super(that);
-
-		if (that != null) {
-			this.tagName = that.tagName;
-			this.isEmptyTag = that.isEmptyTag;
-			this.isJSPTag = that.isJSPTag;
-			this.isCommentTag = that.isCommentTag;
-
-			// clone attributes
-			that.cloneAttributes(this);
-		}
-	}
-
-	/**
-	 * addEndTag method
-	 * 
-	 * @param end
-	 *            org.w3c.dom.Element
-	 */
-	protected void addEndTag(Element endTag) {
-		if (endTag == null)
-			return;
-		if (hasEndTag())
-			return;
-		ElementImpl end = (ElementImpl) endTag;
-
-		// move the end flat node from the end tag
-		IStructuredDocumentRegion flatNode = end.getEndStructuredDocumentRegion();
-		if (flatNode == null)
-			return;
-		end.setEndStructuredDocumentRegion(null);
-		setEndStructuredDocumentRegion(flatNode);
-	}
-
-	/**
-	 * appendAttibuteNode method
-	 * 
-	 * @return org.w3c.dom.Attr
-	 * @param newAttr
-	 *            org.w3c.dom.Attr
-	 */
-	public Attr appendAttributeNode(Attr newAttr) {
-		if (newAttr == null)
-			return null;
-		AttrImpl attr = (AttrImpl) newAttr;
-		if (attr.getOwnerElement() != null)
-			return null;
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		if (this.attrNodes == null)
-			this.attrNodes = new NodeListImpl();
-		this.attrNodes.appendNode(attr);
-		attr.setOwnerElement(this);
-
-		notifyAttrReplaced(attr, null);
-		return attr;
-	}
-
-	/**
-	 * cloneAttributes method
-	 * 
-	 * @param newOwner
-	 *            org.w3c.dom.Element
-	 */
-	protected void cloneAttributes(Element newOwner) {
-		if (newOwner == null || newOwner == this)
-			return;
-
-		ElementImpl element = (ElementImpl) newOwner;
-		element.removeAttributes();
-
-		if (this.attrNodes == null)
-			return;
-
-		int length = this.attrNodes.getLength();
-		for (int i = 0; i < length; i++) {
-			Node node = this.attrNodes.item(i);
-			if (node == null)
-				continue;
-			Attr cloned = (Attr) node.cloneNode(false);
-			if (cloned != null)
-				element.appendAttributeNode(cloned);
-		}
-	}
-
-	/**
-	 * cloneNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param deep
-	 *            boolean
-	 */
-	public Node cloneNode(boolean deep) {
-		ElementImpl cloned = new ElementImpl(this);
-		if (deep)
-			cloneChildNodes(cloned, deep);
-		
-		notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
-		return cloned;
-	}
-
-	/**
-	 * getAttribute method
-	 * 
-	 * @return java.lang.String
-	 * @param name
-	 *            java.lang.String
-	 */
-	public String getAttribute(String name) {
-		Attr attr = getAttributeNode(name);
-		if (attr == null)
-			return null;
-		return attr.getValue();
-	}
-
-	/**
-	 * getAttributeNode method
-	 * 
-	 * @return org.w3c.dom.Attr
-	 * @param name
-	 *            java.lang.String
-	 */
-	public Attr getAttributeNode(String name) {
-		if (name == null)
-			return null; // invalid parameter
-		if (this.attrNodes == null)
-			return null; // no attribute
-
-		int length = this.attrNodes.getLength();
-		for (int i = 0; i < length; i++) {
-			AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
-			if (attr == null)
-				continue;
-			if (attr.matchName(name))
-				return attr; // found
-		}
-
-		return null; // not found
-	}
-
-	/**
-	 */
-	public Attr getAttributeNodeNS(String uri, String name) {
-		if (name == null)
-			return null; // invalid parameter
-		if (this.attrNodes == null)
-			return null; // no attribute
-
-		int length = this.attrNodes.getLength();
-		for (int i = 0; i < length; i++) {
-			AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
-			if (attr == null)
-				continue;
-			String localName = attr.getLocalName();
-			if (localName == null || !localName.equals(name))
-				continue;
-			String nsURI = attr.getNamespaceURI();
-			if (uri == null) {
-				if (nsURI != null)
-					continue;
-			}
-			else {
-				if (nsURI == null || !nsURI.equals(uri))
-					continue;
-			}
-
-			// found
-			return attr;
-		}
-
-		return null; // not found
-	}
-
-	/**
-	 */
-	public String getAttributeNS(String uri, String name) {
-		Attr attr = getAttributeNodeNS(uri, name);
-		if (attr == null)
-			return null;
-		return attr.getValue();
-	}
-
-	/**
-	 * getAttributes method
-	 * 
-	 * @return org.w3c.dom.NamedNodeMap
-	 */
-	public NamedNodeMap getAttributes() {
-		return new Attributes();
-	}
-
-	/**
-	 */
-	protected CMElementDeclaration getDeclaration() {
-		Document document = getOwnerDocument();
-		if (document == null)
-			return null;
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
-		if (modelQuery == null)
-			return null;
-		return modelQuery.getCMElementDeclaration(this);
-	}
-
-	/**
-	 * getElementsByTagName method
-	 * 
-	 * @return org.w3c.dom.NodeList
-	 * @param tagName
-	 *            java.lang.String
-	 */
-	public NodeList getElementsByTagName(String tagName) {
-		if (tagName == null)
-			return new NodeListImpl();
-
-		DocumentImpl document = (DocumentImpl) getOwnerDocument();
-		if (document == null)
-			return new NodeListImpl();
-		NodeIterator it = document.createNodeIterator(this, NodeFilter.SHOW_ALL, null, false);
-		if (it == null)
-			return new NodeListImpl();
-		NodeListImpl elements = new NodeListImpl();
-
-		if (tagName.length() == 1 && tagName.charAt(0) == '*') {
-			tagName = null; // do not care
-		}
-
-		for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
-			if (node.getNodeType() != ELEMENT_NODE)
-				continue;
-			if (tagName != null) {
-				ElementImpl element = (ElementImpl) node;
-				if (!element.matchTagName(tagName))
-					continue;
-			}
-			elements.appendNode(node);
-		}
-
-		return elements;
-	}
-
-	/**
-	 */
-	public NodeList getElementsByTagNameNS(String uri, String tagName) {
-		if (tagName == null)
-			return new NodeListImpl();
-
-		DocumentImpl document = (DocumentImpl) getOwnerDocument();
-		if (document == null)
-			return new NodeListImpl();
-		NodeIterator it = document.createNodeIterator(this, NodeFilter.SHOW_ALL, null, false);
-		if (it == null)
-			return new NodeListImpl();
-		NodeListImpl elements = new NodeListImpl();
-
-		if (uri != null && uri.length() == 1 && uri.charAt(0) == '*') {
-			uri = null; // do not care
-		}
-		if (tagName.length() == 1 && tagName.charAt(0) == '*') {
-			tagName = null; // do not care
-		}
-
-		for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
-			if (node.getNodeType() != ELEMENT_NODE)
-				continue;
-			ElementImpl element = (ElementImpl) node;
-			if (tagName != null) {
-				String localName = element.getLocalName();
-				if (localName == null || !localName.equals(tagName))
-					continue;
-			}
-			if (uri != null) {
-				String nsURI = element.getNamespaceURI();
-				if (nsURI == null || !nsURI.equals(uri))
-					continue;
-			}
-			elements.appendNode(element);
-		}
-
-		return elements;
-	}
-
-	/**
-	 * getEndOffset method
-	 * 
-	 * @return int
-	 */
-	public int getEndOffset() {
-		if (this.endStructuredDocumentRegion != null)
-			return this.endStructuredDocumentRegion.getEnd();
-		return super.getEndOffset();
-	}
-
-	/**
-	 * getEndStartOffset method
-	 * 
-	 * @return int
-	 */
-	public int getEndStartOffset() {
-		if (this.endStructuredDocumentRegion != null)
-			return this.endStructuredDocumentRegion.getStart();
-		return super.getEndOffset();
-	}
-
-	/**
-	 * getEndStructuredDocumentRegion method
-	 * 
-	 */
-	public IStructuredDocumentRegion getEndStructuredDocumentRegion() {
-		return this.endStructuredDocumentRegion;
-	}
-
-	public String getEndTagName() {
-		if (this.endStructuredDocumentRegion == null)
-			return null;
-
-		ITextRegionList regions = this.endStructuredDocumentRegion.getRegions();
-		if (regions == null)
-			return null;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedEndTag(regionType)) {
-				return this.endStructuredDocumentRegion.getText(region);
-			}
-		}
-
-		return null;
-	}
-
-	protected boolean isNestedEndTag(String regionType) {
-		boolean result = false;
-		return result;
-	}
-
-	/**
-	 * getFirstStructuredDocumentRegion method
-	 * 
-	 */
-	public IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode != null)
-			return StructuredDocumentRegionUtil.getStructuredDocumentRegion(flatNode);
-		return StructuredDocumentRegionUtil.getStructuredDocumentRegion(this.endStructuredDocumentRegion);
-	}
-
-	/**
-	 * getLastStructuredDocumentRegion method
-	 * 
-	 */
-	public IStructuredDocumentRegion getLastStructuredDocumentRegion() {
-		if (this.endStructuredDocumentRegion != null)
-			return StructuredDocumentRegionUtil.getStructuredDocumentRegion(this.endStructuredDocumentRegion);
-		return StructuredDocumentRegionUtil.getStructuredDocumentRegion(getStructuredDocumentRegion());
-	}
-
-	/**
-	 */
-	public String getLocalName() {
-		if (this.tagName == null)
-			return null;
-		int index = this.tagName.indexOf(':');
-		if (index < 0)
-			return this.tagName;
-		return this.tagName.substring(index + 1);
-	}
-
-	/**
-	 */
-	public String getNamespaceURI() {
-		String nsAttrName = null;
-		String prefix = getPrefix();
-		if (prefix != null && prefix.length() > 0) {
-			nsAttrName = IXMLNamespace.XMLNS_PREFIX + prefix;
-		}
-		else {
-			nsAttrName = IXMLNamespace.XMLNS;
-		}
-
-		for (Node node = this; node != null; node = node.getParentNode()) {
-			if (node.getNodeType() != ELEMENT_NODE)
-				break;
-			Element element = (Element) node;
-			Attr attr = element.getAttributeNode(nsAttrName);
-			if (attr != null)
-				return attr.getValue();
-		}
-
-		return this.namespaceURI;
-	}
-
-	/**
-	 * getNodeName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		return getTagName();
-	}
-
-	/**
-	 * getNodeType method
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return ELEMENT_NODE;
-	}
-
-	/**
-	 */
-	public String getPrefix() {
-		if (this.tagName == null)
-			return null;
-		int index = this.tagName.indexOf(':');
-		if (index <= 0)
-			return null;
-		// exclude JSP tag in tag name
-		if (this.tagName.charAt(0) == '<')
-			return null;
-		return this.tagName.substring(0, index);
-	}
-
-	/**
-	 * getStartEndOffset method
-	 * 
-	 * @return int
-	 */
-	public int getStartEndOffset() {
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode != null)
-			return flatNode.getEnd();
-		return super.getStartOffset();
-	}
-
-	/**
-	 * getStartOffset method
-	 * 
-	 * @return int
-	 */
-	public int getStartOffset() {
-		if (getStartStructuredDocumentRegion() == null && this.endStructuredDocumentRegion != null && !hasChildNodes()) {
-			return this.endStructuredDocumentRegion.getStart();
-		}
-		return super.getStartOffset();
-	}
-
-	/**
-	 * getStartStructuredDocumentRegion method
-	 * 
-	 */
-	public IStructuredDocumentRegion getStartStructuredDocumentRegion() {
-		return getStructuredDocumentRegion();
-	}
-
-	/**
-	 * getTagName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getTagName() {
-		if (this.tagName == null)
-			return new String();
-		return this.tagName;
-	}
-
-	/**
-	 */
-	public boolean hasAttribute(String name) {
-		return (getAttributeNode(name) != null);
-	}
-
-	/**
-	 */
-	public boolean hasAttributeNS(String uri, String name) {
-		return (getAttributeNodeNS(uri, name) != null);
-	}
-
-	/**
-	 */
-	public boolean hasAttributes() {
-		return (this.attrNodes != null && this.attrNodes.getLength() > 0);
-	}
-
-	/**
-	 * hasEndTag method
-	 * 
-	 * @return boolean
-	 */
-	public boolean hasEndTag() {
-		return (this.endStructuredDocumentRegion != null);
-	}
-
-	/**
-	 */
-	protected final boolean hasPrefix() {
-		if (this.tagName == null)
-			return false;
-		if (this.tagName.indexOf(':') <= 0)
-			return false;
-		// exclude JSP tag in tag name
-		if (this.tagName.charAt(0) == '<')
-			return false;
-		return true;
-	}
-
-	/**
-	 * hasStartTag method
-	 * 
-	 * @return boolean
-	 */
-	public boolean hasStartTag() {
-		return (getStructuredDocumentRegion() != null);
-	}
-
-	/**
-	 */
-	protected final boolean ignoreCase() {
-		DocumentImpl document = (DocumentImpl) getOwnerDocument();
-		if (document != null && document.ignoreCase()) {
-			// even in case insensitive document, if having prefix, it's case
-			// sensitive tag
-			return !hasPrefix();
-		}
-		return false;
-	}
-
-	/**
-	 */
-	protected Attr insertAttributeNode(Attr newAttr, int index) {
-		if (newAttr == null)
-			return null;
-		AttrImpl attr = (AttrImpl) newAttr;
-		if (attr.getOwnerElement() != null)
-			return null;
-
-		if (this.attrNodes == null)
-			this.attrNodes = new NodeListImpl();
-		this.attrNodes.insertNode(attr, index);
-		attr.setOwnerElement(this);
-
-		notifyAttrReplaced(attr, null);
-		return attr;
-	}
-
-	/**
-	 * insertBefore method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param newChild
-	 *            org.w3c.dom.Node
-	 * @param refChild
-	 *            org.w3c.dom.Node
-	 */
-	public Node insertBefore(Node newChild, Node refChild) throws DOMException {
-		// should throw DOMException instead of return null?
-		if (newChild == null)
-			return null;
-		if (!isContainer()) { // never be container
-			throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, new String());
-		}
-		if (newChild.getNodeType() != TEXT_NODE) {
-			if (isJSPContainer() || isCDATAContainer()) { // accepts only
-				// Text
-				// child
-				throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, new String());
-			}
-		}
-		return super.insertBefore(newChild, refChild);
-	}
-
-	/**
-	 */
-	protected boolean isCDATAContainer() {
-		// use BlockMaker instead of CMElementDeclaration
-		// because <style> and <script> in XHTML is not CDATA content type
-		IDOMModel model = getModel();
-		if (model == null)
-			return false; // error
-		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
-			return false; // eror
-		RegionParser parser = structuredDocument.getParser();
-		if (parser == null || !(parser instanceof XMLSourceParser))
-			return false;
-		return (((XMLSourceParser) parser).getBlockMarker(this.tagName) != null);
-		/*
-		 * CMElementDeclaration decl = getDeclaration(); if (decl == null)
-		 * return false; if (decl instanceof CMNodeWrapper) { decl =
-		 * (CMElementDeclaration)((CMNodeWrapper)decl).getOriginNode(); if
-		 * (decl == null) return false; } if (decl instanceof
-		 * TLDElementDeclaration) { String content =
-		 * ((TLDElementDeclaration)decl).getBodycontent(); if (content ==
-		 * null) return false; return
-		 * content.equals(JSP11TLDNames.CONTENT_TAGDEPENDENT); } if
-		 * (!isGlobalTag()) return false; return (decl.getContentType() ==
-		 * CMElementDeclaration.CDATA);
-		 */
-	}
-
-	/**
-	 */
-	public boolean isClosed() {
-		IStructuredDocumentRegion flatNode = null;
-		if (isEmptyTag() || !isContainer()) {
-			flatNode = getStructuredDocumentRegion();
-			if (flatNode == null)
-				return true; // will be generated
-		}
-		else {
-			flatNode = getEndStructuredDocumentRegion();
-			if (flatNode == null)
-				return false; // must be generated
-		}
-		String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode);
-		if (isCommentTag()) {
-			return (isNestedClosedComment(regionType) || regionType == DOMRegionContext.XML_COMMENT_CLOSE);
-		}
-		if (isJSPTag()) {
-			return isNestedClosed(regionType);
-		}
-		return (regionType == DOMRegionContext.XML_TAG_CLOSE || regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE || regionType == DOMRegionContext.XML_DECLARATION_CLOSE);
-	}
-
-	protected boolean isNestedClosed(String regionType) {
-		boolean result = false;
-		return result;
-	}
-
-	protected boolean isNestedClosedComment(String regionType) {
-		boolean result = false;
-		return result;
-	}
-
-	/**
-	 */
-	public final boolean isCommentTag() {
-		return this.isCommentTag;
-	}
-
-	/**
-	 * isContainer method
-	 * 
-	 * @return boolean
-	 */
-	public boolean isContainer() {
-		if (isCommentTag()) {
-			CommentElementAdapter adapter = (CommentElementAdapter) getAdapterFor(CommentElementAdapter.class);
-			if (adapter != null) {
-				return (adapter.isContainer());
-			}
-			return (getDeclaration() == null);
-		}
-		if (isJSPTag()) {
-			// exclude JSP directive
-			return (matchTagName(JSPTag.JSP_SCRIPTLET) || matchTagName(JSPTag.JSP_DECLARATION) || matchTagName(JSPTag.JSP_EXPRESSION));
-		}
-		if (!isXMLTag()) { // non-XML tag
-			CMElementDeclaration decl = getDeclaration();
-			if (decl == null)
-				return false; // undefined tag
-			return (decl.getContentType() != CMElementDeclaration.EMPTY);
-		}
-		return true;
-	}
-
-	/**
-	 * isEmptyTag method
-	 * 
-	 * @return boolean
-	 */
-	public boolean isEmptyTag() {
-		if (isJSPTag())
-			return false;
-		if (isCommentTag())
-			return false;
-		if (!isXMLTag())
-			return false;
-		return this.isEmptyTag;
-	}
-
-	/**
-	 */
-	public boolean isEndTag() {
-		return (hasEndTag() && !hasStartTag() && !hasChildNodes());
-	}
-
-	/**
-	 */
-	public boolean isGlobalTag() {
-		return !hasPrefix();
-	}
-
-	/**
-	 */
-	public boolean isImplicitTag() {
-		if (hasStartTag() || hasEndTag())
-			return false;
-		// make sure this is in the document tree
-		// because if not in the document tree, no tags are generated yet
-		return (getContainerDocument() != null);
-	}
-
-	/**
-	 */
-	public boolean isJSPContainer() {
-		return (isJSPTag() && !isCommentTag() && isContainer());
-	}
-
-	/**
-	 * isJSPTag method
-	 * 
-	 * @return boolean
-	 */
-	public final boolean isJSPTag() {
-		return this.isJSPTag;
-	}
-
-	/**
-	 */
-	public boolean isStartTagClosed() {
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode == null)
-			return true; // will be generated
-		String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode);
-		if (isCommentTag()) {
-			return (isNestedClosedComment(regionType) || regionType == DOMRegionContext.XML_COMMENT_CLOSE);
-		}
-		if (isJSPTag()) {
-			if (isContainer())
-				return true; // start tag always has a single region
-			return isClosedNestedDirective(regionType);
-		}
-		return (regionType == DOMRegionContext.XML_TAG_CLOSE || regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE || regionType == DOMRegionContext.XML_DECLARATION_CLOSE);
-	}
-
-	protected boolean isClosedNestedDirective(String regionType) {
-		boolean result = false;
-		return result;
-	}
-
-	/**
-	 */
-	public final boolean isXMLTag() {
-		if (isJSPTag())
-			return false;
-		if (isCommentTag())
-			return false;
-		DocumentImpl document = (DocumentImpl) getOwnerDocument();
-		if (document != null && !document.isXMLType()) {
-			// even in non-XML document, if having prefix, it's XML tag
-			return hasPrefix();
-		}
-		return true;
-	}
-
-	/**
-	 */
-	protected boolean matchEndTag(Element element) {
-		if (element == null)
-			return false;
-		ElementImpl impl = (ElementImpl) element;
-		if (isJSPTag() && !isCommentTag()) {
-			return (impl.isJSPTag() && !impl.isCommentTag());
-		}
-		return matchTagName(element.getTagName());
-	}
-
-	/**
-	 * matchTagName method
-	 * 
-	 * @return boolean
-	 * @param tagName
-	 *            java.lang.String
-	 */
-	public boolean matchTagName(String tagName) {
-		if (tagName == null)
-			return (this.tagName == null);
-		if (this.tagName == null)
-			return false;
-		if (!ignoreCase())
-			return this.tagName.equals(tagName);
-		return this.tagName.equalsIgnoreCase(tagName);
-	}
-
-	/**
-	 * notifyAttrReplaced method
-	 * 
-	 * @param newAttr
-	 *            org.w3c.dom.Attr
-	 * @param oldAttr
-	 *            org.w3c.dom.Attr
-	 */
-	protected void notifyAttrReplaced(Attr newAttr, Attr oldAttr) {
-		DocumentImpl document = (DocumentImpl) getContainerDocument();
-		if (document == null)
-			return;
-		DOMModelImpl model = (DOMModelImpl) document.getModel();
-		if (model == null)
-			return;
-		model.attrReplaced(this, newAttr, oldAttr);
-	}
-
-	/**
-	 * notifyValueChanged method
-	 */
-	public void notifyEndTagChanged() {
-		DocumentImpl document = (DocumentImpl) getContainerDocument();
-		if (document == null)
-			return;
-		DOMModelImpl model = (DOMModelImpl) document.getModel();
-		if (model == null)
-			return;
-		model.endTagChanged(this);
-	}
-
-	/**
-	 */
-	public void notifyStartTagChanged() {
-		DocumentImpl document = (DocumentImpl) getContainerDocument();
-		if (document == null)
-			return;
-		DOMModelImpl model = (DOMModelImpl) document.getModel();
-		if (model == null)
-			return;
-		model.startTagChanged(this);
-	}
-
-	/**
-	 */
-	public boolean preferEmptyTag() {
-		if (hasChildNodes())
-			return false;
-		if (isJSPTag())
-			return false;
-		if (isCommentTag())
-			return false;
-		if (!isXMLTag())
-			return false;
-		CMElementDeclaration decl = getDeclaration();
-		if (decl == null)
-			return false;
-		return (decl.getContentType() == CMElementDeclaration.EMPTY);
-	}
-
-	/**
-	 * removeAttribute method
-	 * 
-	 * @param name
-	 *            java.lang.String
-	 */
-	public void removeAttribute(String name) throws DOMException {
-		removeAttributeNode(name);
-	}
-
-	/**
-	 * removeAttributeNode method
-	 * 
-	 * @return org.w3c.dom.Attr
-	 * @param oldAttr
-	 *            org.w3c.dom.Attr
-	 */
-	public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
-		if (oldAttr == null)
-			return null; // invalid parameter
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		if (this.attrNodes == null) { // no attribute
-			throw new DOMException(DOMException.NOT_FOUND_ERR, new String());
-		}
-
-		int length = this.attrNodes.getLength();
-		for (int i = 0; i < length; i++) {
-			AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
-			if (attr != oldAttr)
-				continue;
-
-			// found
-			this.attrNodes.removeNode(i);
-			attr.setOwnerElement(null);
-
-			notifyAttrReplaced(null, attr);
-			return attr;
-		}
-
-		// not found
-		throw new DOMException(DOMException.NOT_FOUND_ERR, new String());
-	}
-
-	/**
-	 * removeAttributeNode method
-	 * 
-	 * @return org.w3c.dom.Attr
-	 * @param name
-	 *            java.lang.String
-	 */
-	public Attr removeAttributeNode(String name) {
-		if (name == null)
-			return null; // invalid parameter
-		if (this.attrNodes == null)
-			return null; // no attribute
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		int length = this.attrNodes.getLength();
-		for (int i = 0; i < length; i++) {
-			AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
-			if (attr == null)
-				continue;
-			if (!attr.matchName(name))
-				continue;
-
-			// found
-			this.attrNodes.removeNode(i);
-			attr.setOwnerElement(null);
-
-			notifyAttrReplaced(null, attr);
-			return attr;
-		}
-
-		return null; // not found
-	}
-
-	/**
-	 */
-	public Attr removeAttributeNodeNS(String uri, String name) {
-		if (name == null)
-			return null; // invalid parameter
-		if (this.attrNodes == null)
-			return null; // no attribute
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		int length = this.attrNodes.getLength();
-		for (int i = 0; i < length; i++) {
-			AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
-			if (attr == null)
-				continue;
-			String localName = attr.getLocalName();
-			if (localName == null || !localName.equals(name))
-				continue;
-			String nsURI = attr.getNamespaceURI();
-			if (uri == null) {
-				if (nsURI != null)
-					continue;
-			}
-			else {
-				if (nsURI == null || !nsURI.equals(uri))
-					continue;
-			}
-
-			// found
-			this.attrNodes.removeNode(i);
-			attr.setOwnerElement(null);
-
-			notifyAttrReplaced(null, attr);
-			return attr;
-		}
-
-		return null; // not found
-	}
-
-	/**
-	 */
-	public void removeAttributeNS(String uri, String name) throws DOMException {
-		removeAttributeNodeNS(uri, name);
-	}
-
-	/**
-	 * removeAttributes method
-	 */
-	public void removeAttributes() {
-		if (this.attrNodes == null)
-			return;
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		int length = this.attrNodes.getLength();
-		for (int i = 0; i < length; i++) {
-			AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
-			if (attr != null) {
-				attr.setOwnerElement(null);
-				notifyAttrReplaced(null, attr);
-			}
-		}
-
-		this.attrNodes = null;
-	}
-
-	/**
-	 * removeEndTag method
-	 * 
-	 * @return org.w3c.dom.Element
-	 */
-	protected Element removeEndTag() {
-		if (!hasEndTag())
-			return null;
-		NodeListImpl attrNodes = this.attrNodes;
-		this.attrNodes = null; // not to copy attributes
-		ElementImpl end = (ElementImpl) cloneNode(false);
-		this.attrNodes = attrNodes;
-		if (end == null)
-			return null;
-
-		// move the end flat node to the end tag
-		IStructuredDocumentRegion flatNode = getEndStructuredDocumentRegion();
-		if (flatNode == null)
-			return null;
-		setEndStructuredDocumentRegion(null);
-		end.setEndStructuredDocumentRegion(flatNode);
-		return end;
-	}
-
-	/**
-	 */
-	protected void removeStartTag() {
-		removeAttributes();
-	}
-
-	/**
-	 * Resets attribute values from IStructuredDocumentRegion.
-	 */
-	void resetStructuredDocumentRegions() {
-		if (this.attrNodes != null) {
-			int length = this.attrNodes.getLength();
-			for (int i = 0; i < length; i++) {
-				AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
-				if (attr == null)
-					continue;
-				attr.resetRegions();
-			}
-		}
-
-		super.resetStructuredDocumentRegions(); // for children
-
-		this.endStructuredDocumentRegion = null;
-	}
-
-	/**
-	 * setAttribute method
-	 * 
-	 * @param name
-	 *            java.lang.String
-	 * @param value
-	 *            java.lang.String
-	 */
-	public void setAttribute(String name, String value) throws DOMException {
-		if (name == null)
-			return;
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		Attr attr = getAttributeNode(name);
-		if (attr != null) {
-			attr.setValue(value); // change value
-			return;
-		}
-
-		// new attribute
-		Document doc = getOwnerDocument();
-		if (doc == null)
-			return;
-		attr = doc.createAttribute(name);
-		if (attr == null)
-			return;
-		attr.setValue(value);
-		appendAttributeNode(attr);
-	}
-
-	/**
-	 * setAttributeNode method
-	 * 
-	 * @return org.w3c.dom.Attr
-	 * @param newAttr
-	 *            org.w3c.dom.Attr
-	 */
-	public Attr setAttributeNode(Attr newAttr) throws DOMException {
-		if (newAttr == null)
-			return null; // nothing to do
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		AttrImpl attr = (AttrImpl) newAttr;
-		Element owner = attr.getOwnerElement();
-		if (owner != null) {
-			if (owner == this)
-				return null; // nothing to do
-			throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, new String());
-		}
-
-		Attr oldAttr = removeAttributeNode(newAttr.getName());
-		appendAttributeNode(attr);
-		return oldAttr;
-	}
-
-	/**
-	 */
-	public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
-		if (newAttr == null)
-			return null; // nothing to do
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		AttrImpl attr = (AttrImpl) newAttr;
-		Element owner = attr.getOwnerElement();
-		if (owner != null) {
-			if (owner == this)
-				return null; // nothing to do
-			throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, new String());
-		}
-
-		String name = newAttr.getLocalName();
-		String uri = newAttr.getNamespaceURI();
-		Attr oldAttr = removeAttributeNodeNS(uri, name);
-		appendAttributeNode(attr);
-		return oldAttr;
-	}
-
-	/**
-	 * ISSUE: we should check for and throw NAMESPACE_ERR, according to spec. 
-	 */
-	public void setAttributeNS(String uri, String qualifiedName, String value) throws DOMException {
-		if (qualifiedName == null)
-			return;
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=139552
-		// fix provided by Valentin Baciu
-		int index = qualifiedName.indexOf(':');
-		String localName = index != -1 ? qualifiedName.substring(index + 1) : qualifiedName;
-
-		Attr attr = getAttributeNodeNS(uri, localName);
-		if (attr != null) {
-			attr.setValue(value); // change value
-		}
-		else {
-
-			// new attribute
-			Document doc = getOwnerDocument();
-			if (doc != null) {
-				attr = doc.createAttributeNS(uri, qualifiedName);
-				if (attr != null) {
-					attr.setValue(value);
-					appendAttributeNode(attr);
-				}
-			}
-		}
-	}
-
-	/**
-	 */
-	public void setCommentTag(boolean isCommentTag) {
-		IDOMNode parent = (IDOMNode) getParentNode();
-		if (parent != null && !parent.isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		this.isCommentTag = isCommentTag;
-	}
-
-	/**
-	 * setEmptyTag method
-	 * 
-	 * @param isEmptyTag
-	 *            boolean
-	 */
-	public void setEmptyTag(boolean isEmptyTag) {
-		IDOMNode parent = (IDOMNode) getParentNode();
-		if (parent != null && !parent.isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		this.isEmptyTag = isEmptyTag;
-	}
-
-	/**
-	 * setEndStructuredDocumentRegion method
-	 * 
-	 * @param flatNode
-	 */
-	void setEndStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		this.endStructuredDocumentRegion = flatNode;
-
-		NodeContainer parent = (NodeContainer) getParentNode();
-		if (parent != null) {
-			parent.syncChildEditableState(this);
-		}
-	}
-
-	/**
-	 * setJSPTag method
-	 * 
-	 * @param isJSPTag
-	 *            boolean
-	 */
-	public void setJSPTag(boolean isJSPTag) {
-		IDOMNode parent = (IDOMNode) getParentNode();
-		if (parent != null && !parent.isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		this.isJSPTag = isJSPTag;
-	}
-
-	/**
-	 */
-	protected void setNamespaceURI(String namespaceURI) {
-		this.namespaceURI = namespaceURI;
-	}
-
-	/**
-	 */
-	protected void setOwnerDocument(Document ownerDocument, boolean deep) {
-		super.setOwnerDocument(ownerDocument, deep);
-
-		if (this.attrNodes == null)
-			return;
-
-		int length = this.attrNodes.getLength();
-		for (int i = 0; i < length; i++) {
-			AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
-			if (attr == null)
-				continue;
-			attr.setOwnerDocument(ownerDocument);
-		}
-	}
-
-	/**
-	 */
-	public void setPrefix(String prefix) throws DOMException {
-		IDOMNode parent = (IDOMNode) getParentNode();
-		if (parent != null && !parent.isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		int prefixLength = (prefix != null ? prefix.length() : 0);
-		String localName = getLocalName();
-		if (prefixLength == 0) {
-			if (localName == null || localName.length() == 0) {
-				// invalid local name
-				return;
-			}
-			setTagName(localName);
-		}
-		else {
-			int localLength = (localName != null ? localName.length() : 0);
-			StringBuffer buffer = new StringBuffer(prefixLength + 1 + localLength);
-			buffer.append(prefix);
-			buffer.append(':');
-			if (localName != null)
-				buffer.append(localName);
-			setTagName(buffer.toString());
-		}
-
-		boolean changeEndTag = hasEndTag();
-		notifyStartTagChanged();
-		if (changeEndTag)
-			notifyEndTagChanged();
-	}
-
-	/**
-	 * setStartStructuredDocumentRegion method
-	 * 
-	 * @param flatNode
-	 */
-	void setStartStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		setStructuredDocumentRegion(flatNode);
-	}
-
-	/**
-	 * setTagName method
-	 * 
-	 * @param tagName
-	 *            java.lang.String
-	 */
-	protected void setTagName(String tagName) {
-		this.tagName = tagName;
-	}
-
-	/**
-	 * toString method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String toString() {
-		StringBuffer buffer = new StringBuffer();
-		String tagName = getTagName();
-		if (hasStartTag())
-			buffer.append(tagName);
-		if (isEmptyTag())
-			buffer.append('/');
-		if (hasEndTag()) {
-			buffer.append('/');
-			buffer.append(tagName);
-		}
-		if (buffer.length() == 0)
-			buffer.append(tagName);
-
-		IStructuredDocumentRegion startStructuredDocumentRegion = getStartStructuredDocumentRegion();
-		if (startStructuredDocumentRegion != null) {
-			buffer.append('@');
-			buffer.append(startStructuredDocumentRegion.toString());
-		}
-		IStructuredDocumentRegion endStructuredDocumentRegion = getEndStructuredDocumentRegion();
-		if (endStructuredDocumentRegion != null) {
-			buffer.append('@');
-			buffer.append(endStructuredDocumentRegion.toString());
-		}
-		return buffer.toString();
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public void setIdAttribute(String name, boolean isId) throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported in this version"); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported in this version"); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported in this version"); //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java
deleted file mode 100644
index 924546d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Entity;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * EntityImpl class
- */
-public class EntityImpl extends NodeImpl implements Entity {
-
-	private String name = null;
-	private String notationName = null;
-	private String publicId = null;
-	private String systemId = null;
-
-	/**
-	 * EntityImpl constructor
-	 */
-	protected EntityImpl() {
-		super();
-	}
-
-	/**
-	 * EntityImpl constructor
-	 * 
-	 * @param that
-	 *            EntityImpl
-	 */
-	protected EntityImpl(EntityImpl that) {
-		super(that);
-
-		if (that != null) {
-			this.name = that.name;
-			this.publicId = that.publicId;
-			this.systemId = that.systemId;
-			this.notationName = that.notationName;
-		}
-	}
-
-	/**
-	 * cloneNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param deep
-	 *            boolean
-	 */
-	public Node cloneNode(boolean deep) {
-		EntityImpl cloned = new EntityImpl(this);
-		notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
-		return cloned;
-	}
-
-	/**
-	 * <p>
-	 * EXPERIMENTAL! Based on the <a
-	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-	 * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
-	 * <p>
-	 * An attribute specifying, as part of the text declaration, the encoding
-	 * of this entity, when it is an external parsed entity. This is
-	 * <code>null</code> otherwise.
-	 * 
-	 * @see DOM Level 3
-	 */
-	public java.lang.String getEncoding() {
-		return null;
-	}
-
-	/**
-	 * getNodeName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		if (this.name == null)
-			return new String();
-		return this.name;
-	}
-
-	/**
-	 * getNodeType method
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return ENTITY_NODE;
-	}
-
-	/**
-	 * getNotationName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNotationName() {
-		return this.notationName;
-	}
-
-	/**
-	 * getPublicId method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getPublicId() {
-		return this.publicId;
-	}
-
-	/**
-	 * getSystemId method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getSystemId() {
-		return this.systemId;
-	}
-
-	/**
-	 * <p>
-	 * EXPERIMENTAL! Based on the <a
-	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-	 * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
-	 * <p>
-	 * An attribute specifying, as part of the text declaration, the version
-	 * number of this entity, when it is an external parsed entity. This is
-	 * <code>null</code> otherwise.
-	 * 
-	 * @see DOM Level 3
-	 */
-	public java.lang.String getVersion() {
-		return null;
-	}
-
-	/**
-	 * <p>
-	 * EXPERIMENTAL! Based on the <a
-	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-	 * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
-	 * <p>
-	 * An attribute specifying, as part of the text declaration, the encoding
-	 * of this entity, when it is an external parsed entity. This is
-	 * <code>null</code> otherwise.
-	 * 
-	 * @see DOM Level 3
-	 */
-	public void setEncoding(java.lang.String encoding) {
-	}
-
-	/**
-	 * setName method
-	 * 
-	 * @param name
-	 *            java.lang.String
-	 */
-	protected void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * setNotationName method
-	 * 
-	 * @param notationName
-	 *            java.lang.String
-	 */
-	public void setNotationName(String notationName) {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		this.notationName = notationName;
-	}
-
-	/**
-	 * setPublicId method
-	 * 
-	 * @param publicId
-	 *            java.lang.String
-	 */
-	public void setPublicId(String publicId) {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		this.publicId = publicId;
-	}
-
-	/**
-	 * setSystemId method
-	 * 
-	 * @param systemId
-	 *            java.lang.String
-	 */
-	public void setSystemId(String systemId) {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		this.systemId = systemId;
-	}
-
-	/**
-	 * <p>
-	 * EXPERIMENTAL! Based on the <a
-	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-	 * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
-	 * <p>
-	 * An attribute specifying, as part of the text declaration, the version
-	 * number of this entity, when it is an external parsed entity. This is
-	 * <code>null</code> otherwise.
-	 * 
-	 * @see DOM Level 3
-	 */
-	public void setVersion(java.lang.String version) {
-	}
-
-	public String getInputEncoding() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
-	}
-
-	public String getXmlEncoding() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
-	}
-
-
-	public String getXmlVersion() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityReferenceImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityReferenceImpl.java
deleted file mode 100644
index f8a8071..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityReferenceImpl.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * EntityReference class
- */
-public class EntityReferenceImpl extends NodeImpl implements EntityReference {
-
-	private String name = null;
-
-	/**
-	 * EntityReferenceImpl constructor
-	 */
-	protected EntityReferenceImpl() {
-		super();
-	}
-
-	/**
-	 * EntityReferenceImpl constructor
-	 * 
-	 * @param that
-	 *            EntityReferenceImpl
-	 */
-	protected EntityReferenceImpl(EntityReferenceImpl that) {
-		super(that);
-
-		if (that != null) {
-			this.name = that.name;
-		}
-	}
-
-	/**
-	 * cloneNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param deep
-	 *            boolean
-	 */
-	public Node cloneNode(boolean deep) {
-		EntityReferenceImpl cloned = new EntityReferenceImpl(this);
-		notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
-		return cloned;
-	}
-
-	/**
-	 * getNodeName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		if (this.name == null)
-			return new String();
-		return this.name;
-	}
-
-	/**
-	 * getNodeType method
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return ENTITY_REFERENCE_NODE;
-	}
-
-	/**
-	 * setName method
-	 * 
-	 * @param name
-	 *            java.lang.String
-	 */
-	protected void setName(String name) {
-		this.name = name;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/InvalidCharacterException.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/InvalidCharacterException.java
deleted file mode 100644
index 1a3a079..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/InvalidCharacterException.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-/**
- * Thrown an invalid character is specified in : XMLNode#setSource(String)
- */
-public class InvalidCharacterException extends Exception {
-
-	/**
-	 * Default <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-	private char invalidChar = 0;
-	private int offset = -1;
-
-	/**
-	 */
-	public InvalidCharacterException() {
-		super();
-	}
-
-	/**
-	 */
-	public InvalidCharacterException(String s) {
-		super(s);
-	}
-
-	/**
-	 */
-	public InvalidCharacterException(String s, char c) {
-		super(s);
-		this.invalidChar = c;
-	}
-
-	/**
-	 */
-	public InvalidCharacterException(String s, char c, int offset) {
-		super(s);
-		this.invalidChar = c;
-		this.offset = offset;
-	}
-
-	/**
-	 */
-	public char getInvalidChar() {
-		return this.invalidChar;
-	}
-
-	/**
-	 */
-	public int getOffset() {
-		return this.offset;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/JSPTag.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/JSPTag.java
deleted file mode 100644
index 6f2de44..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/JSPTag.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-/**
- * JSPTag interface
- */
-public interface JSPTag {
-	static final String COMMENT_CLOSE = "--%>";//$NON-NLS-1$
-	static final String COMMENT_OPEN = "<%--";//$NON-NLS-1$
-	static final String DECLARATION_TOKEN = "!";//$NON-NLS-1$
-	static final String DIRECTIVE_TOKEN = "@";//$NON-NLS-1$
-	static final String EXPRESSION_TOKEN = "=";//$NON-NLS-1$
-	static final String JSP_DECLARATION = "jsp:declaration";//$NON-NLS-1$
-	static final String JSP_DIRECTIVE = "jsp:directive";//$NON-NLS-1$
-	static final String JSP_EXPRESSION = "jsp:expression";//$NON-NLS-1$
-	static final String JSP_ROOT = "jsp:root";//$NON-NLS-1$
-
-	static final String JSP_SCRIPTLET = "jsp:scriptlet";//$NON-NLS-1$
-	static final String TAG_CLOSE = "%>";//$NON-NLS-1$
-	static final String TAG_OPEN = "<%";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ModelParserAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ModelParserAdapter.java
deleted file mode 100644
index 0b7e13d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ModelParserAdapter.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- */
-public interface ModelParserAdapter extends INodeAdapter {
-
-	/**
-	 */
-	public boolean canBeImplicitTag(Element element);
-
-	/**
-	 */
-	public boolean canBeImplicitTag(Element element, Node child);
-
-	/**
-	 */
-	public boolean canContain(Element element, Node child);
-
-	/**
-	 */
-	public Element createCommentElement(Document document, String data, boolean isJSPTag);
-
-	/**
-	 */
-	public Element createImplicitElement(Document document, Node parent, Node child);
-
-	/**
-	 */
-	public String getFindRootName(String tagName);
-
-	/**
-	 */
-	public boolean isEndTag(IDOMElement element);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeContainer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeContainer.java
deleted file mode 100644
index f653163..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeContainer.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/**
- * NodeContainer class
- */
-public abstract class NodeContainer extends NodeImpl implements Node, NodeList {
-
-	/**
-	 */
-	private class ChildNodesCache implements NodeList {
-		private Node curChild = null;
-		private int curIndex = -1;
-		private int length = 0;
-
-		ChildNodesCache() {
-			initializeCache();
-		}
-
-		public int getLength() {
-			// atomic
-			return this.length;
-		}
-
-		private void initializeCache() {
-			// note we use the outter objects lockobject
-			// (since we are using their "children".
-			synchronized (lockObject) {
-				for (Node child = firstChild; child != null; child = child.getNextSibling()) {
-					this.length++;
-				}
-			}
-		}
-
-		public Node item(int index) {
-			synchronized (lockObject) {
-				if (this.length == 0)
-					return null;
-				if (index < 0)
-					return null;
-				if (index >= this.length)
-					return null;
-
-				if (this.curIndex < 0) { // first time
-					if (index * 2 >= this.length) { // search from the last
-						this.curIndex = this.length - 1;
-						this.curChild = lastChild;
-					} else { // search from the first
-						this.curIndex = 0;
-						this.curChild = firstChild;
-					}
-				}
-
-				if (index == this.curIndex)
-					return this.curChild;
-
-				if (index > this.curIndex) {
-					while (index > this.curIndex) {
-						this.curIndex++;
-						this.curChild = this.curChild.getNextSibling();
-					}
-				} else { // index < this.curIndex
-					while (index < this.curIndex) {
-						this.curIndex--;
-						this.curChild = this.curChild.getPreviousSibling();
-					}
-				}
-
-				return this.curChild;
-			}
-		}
-	}
-
-	private NodeList childNodesCache = null;
-
-	private boolean fChildEditable = true;
-	NodeImpl firstChild = null;
-	NodeImpl lastChild = null;
-
-	Object lockObject = new byte[0];
-
-	/**
-	 * NodeContainer constructor
-	 */
-	protected NodeContainer() {
-		super();
-	}
-
-	/**
-	 * NodeContainer constructor
-	 * 
-	 * @param that
-	 *            NodeContainer
-	 */
-	protected NodeContainer(NodeContainer that) {
-		super(that);
-	}
-
-	/**
-	 * appendChild method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param newChild
-	 *            org.w3c.dom.Node
-	 */
-	public Node appendChild(Node newChild) throws DOMException {
-		return insertBefore(newChild, null);
-	}
-
-	/**
-	 * cloneChildNodes method
-	 * 
-	 * @param container
-	 *            org.w3c.dom.Node
-	 * @param deep
-	 *            boolean
-	 */
-	protected void cloneChildNodes(Node newParent, boolean deep) {
-		if (newParent == null || newParent == this)
-			return;
-		if (!(newParent instanceof NodeContainer))
-			return;
-
-		NodeContainer container = (NodeContainer) newParent;
-		container.removeChildNodes();
-
-		for (Node child = getFirstChild(); child != null; child = child.getNextSibling()) {
-			Node cloned = child.cloneNode(deep);
-			if (cloned != null)
-				container.appendChild(cloned);
-		}
-	}
-
-	/**
-	 * getChildNodes method
-	 * 
-	 * @return org.w3c.dom.NodeList
-	 */
-	public NodeList getChildNodes() {
-		return this;
-	}
-
-	/**
-	 * getFirstChild method
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	public Node getFirstChild() {
-		return this.firstChild;
-	}
-
-	/**
-	 * getLastChild method
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	public Node getLastChild() {
-		return this.lastChild;
-	}
-
-	/**
-	 * getLength method
-	 * 
-	 * @return int
-	 */
-	public int getLength() {
-		if (this.firstChild == null)
-			return 0;
-		synchronized (lockObject) {
-			if (this.childNodesCache == null)
-				this.childNodesCache = new ChildNodesCache();
-			return this.childNodesCache.getLength();
-		}
-	}
-
-	/**
-	 */
-	public String getSource() {
-		StringBuffer buffer = new StringBuffer();
-
-		IStructuredDocumentRegion startStructuredDocumentRegion = getStartStructuredDocumentRegion();
-		if (startStructuredDocumentRegion != null) {
-			String source = startStructuredDocumentRegion.getText();
-			if (source != null)
-				buffer.append(source);
-		}
-
-		for (NodeImpl child = firstChild; child != null; child = (NodeImpl) child.getNextSibling()) {
-			String source = child.getSource();
-			if (source != null)
-				buffer.append(source);
-		}
-
-		IStructuredDocumentRegion endStructuredDocumentRegion = getEndStructuredDocumentRegion();
-		if (endStructuredDocumentRegion != null) {
-			String source = endStructuredDocumentRegion.getText();
-			if (source != null)
-				buffer.append(source);
-		}
-
-		return buffer.toString();
-	}
-
-	/**
-	 * hasChildNodes method
-	 * 
-	 * @return boolean
-	 */
-	public boolean hasChildNodes() {
-		return (this.firstChild != null);
-	}
-
-	/**
-	 * insertBefore method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param newChild
-	 *            org.w3c.dom.Node
-	 * @param refChild
-	 *            org.w3c.dom.Node
-	 */
-	public Node insertBefore(Node newChild, Node refChild) throws DOMException {
-		if (newChild == null)
-			return null; // nothing to do
-		if (refChild != null && refChild.getParentNode() != this) {
-			throw new DOMException(DOMException.NOT_FOUND_ERR, new String());
-		}
-		if (!isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-		if (newChild == refChild)
-			return newChild; // nothing to do
-
-		if (newChild.getNodeType() == DOCUMENT_FRAGMENT_NODE) {
-			// insert child nodes instead
-			for (Node child = newChild.getFirstChild(); child != null; child = newChild.getFirstChild()) {
-				newChild.removeChild(child);
-				insertBefore(child, refChild);
-			}
-			return newChild;
-		}
-		// synchronized in case another thread is getting item, or length
-		synchronized (lockObject) {
-			this.childNodesCache = null; // invalidate child nodes cache
-		}
-
-		NodeImpl child = (NodeImpl) newChild;
-		NodeImpl next = (NodeImpl) refChild;
-		NodeImpl prev = null;
-		Node oldParent = child.getParentNode();
-		if (oldParent != null)
-			oldParent.removeChild(child);
-		if (next == null) {
-			prev = this.lastChild;
-			this.lastChild = child;
-		} else {
-			prev = (NodeImpl) next.getPreviousSibling();
-			next.setPreviousSibling(child);
-		}
-		if (prev == null)
-			this.firstChild = child;
-		else
-			prev.setNextSibling(child);
-		child.setPreviousSibling(prev);
-		child.setNextSibling(next);
-		child.setParentNode(this);
-		// make sure having the same owner document
-		if (child.getOwnerDocument() == null) {
-			if (getNodeType() == DOCUMENT_NODE) {
-				child.setOwnerDocument((Document) this);
-			} else {
-				child.setOwnerDocument(getOwnerDocument());
-			}
-		}
-
-		notifyChildReplaced(child, null);
-
-		return child;
-	}
-
-	public boolean isChildEditable() {
-		if (!fChildEditable) {
-			DOMModelImpl model = (DOMModelImpl) getModel();
-			if (model != null && model.isReparsing()) {
-				return true;
-			}
-		}
-		return fChildEditable;
-	}
-
-	/**
-	 * isContainer method
-	 * 
-	 * @return boolean
-	 */
-	public boolean isContainer() {
-		return true;
-	}
-
-	/**
-	 * item method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param index
-	 *            int
-	 */
-	public Node item(int index) {
-		if (this.firstChild == null)
-			return null;
-		synchronized (lockObject) {
-			if (this.childNodesCache == null)
-				this.childNodesCache = new ChildNodesCache();
-			return this.childNodesCache.item(index);
-		}
-	}
-
-	/**
-	 * notifyChildReplaced method
-	 * 
-	 * @param newChild
-	 *            org.w3c.dom.Node
-	 * @param oldChild
-	 *            org.w3c.dom.Node
-	 */
-	protected void notifyChildReplaced(Node newChild, Node oldChild) {
-		DocumentImpl document = (DocumentImpl) getContainerDocument();
-		if (document == null)
-			return;
-
-		syncChildEditableState(newChild);
-
-		DOMModelImpl model = (DOMModelImpl) document.getModel();
-		if (model == null)
-			return;
-		model.childReplaced(this, newChild, oldChild);
-	}
-
-	/**
-	 * removeChild method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param oldChild
-	 *            org.w3c.dom.Node
-	 */
-	public Node removeChild(Node oldChild) throws DOMException {
-		if (oldChild == null)
-			return null;
-		if (oldChild.getParentNode() != this) {
-			throw new DOMException(DOMException.NOT_FOUND_ERR, new String());
-		}
-
-		if (!isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		// synchronized in case another thread is getting item, or length
-		synchronized (lockObject) {
-			this.childNodesCache = null; // invalidate child nodes cache
-		}
-
-		NodeImpl child = (NodeImpl) oldChild;
-		NodeImpl prev = (NodeImpl) child.getPreviousSibling();
-		NodeImpl next = (NodeImpl) child.getNextSibling();
-
-		child.setEditable(true, true); // clear ReadOnly flags
-
-		if (prev == null)
-			this.firstChild = next;
-		else
-			prev.setNextSibling(next);
-		if (next == null)
-			this.lastChild = prev;
-		else
-			next.setPreviousSibling(prev);
-		child.setPreviousSibling(null);
-		child.setNextSibling(null);
-		child.setParentNode(null);
-
-		notifyChildReplaced(null, child);
-
-		return child;
-	}
-
-	/**
-	 * removeChildNodes method
-	 */
-	public void removeChildNodes() {
-		if (!isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		Node nextChild = null;
-		for (Node child = getFirstChild(); child != null; child = nextChild) {
-			nextChild = child.getNextSibling();
-			removeChild(child);
-		}
-	}
-
-	/**
-	 * removeChildNodes method
-	 * 
-	 * @return org.w3c.dom.DocumentFragment
-	 * @param firstChild
-	 *            org.w3c.dom.Node
-	 * @param lastChild
-	 *            org.w3c.dom.Node
-	 */
-	public DocumentFragment removeChildNodes(Node firstChild, Node lastChild) {
-		if (!hasChildNodes())
-			return null;
-		if (!isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		Document document = null;
-		if (getNodeType() == DOCUMENT_NODE)
-			document = (Document) this;
-		else
-			document = getOwnerDocument();
-		if (document == null)
-			return null;
-		DocumentFragment fragment = document.createDocumentFragment();
-		if (fragment == null)
-			return null;
-
-		if (firstChild == null)
-			firstChild = getFirstChild();
-		if (lastChild == null)
-			lastChild = getLastChild();
-		Node nextChild = null;
-		for (Node child = firstChild; child != null; child = nextChild) {
-			nextChild = child.getNextSibling();
-			removeChild(child);
-			fragment.appendChild(child);
-			if (child == lastChild)
-				break;
-		}
-
-		return fragment;
-	}
-
-	/**
-	 * replaceChild method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param newChild
-	 *            org.w3c.dom.Node
-	 * @param oldChild
-	 *            org.w3c.dom.Node
-	 */
-	public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
-		if (!isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		if (oldChild == null)
-			return newChild;
-		if (newChild != null)
-			insertBefore(newChild, oldChild);
-		return removeChild(oldChild);
-	}
-
-	public void setChildEditable(boolean editable) {
-		if (fChildEditable == editable) {
-			return;
-		}
-
-		ReadOnlyController roc = ReadOnlyController.getInstance();
-		Node node;
-		if (editable) {
-			for (node = getFirstChild(); node != null; node = node.getNextSibling()) {
-				roc.unlockNode((IDOMNode) node);
-			}
-		} else {
-			for (node = getFirstChild(); node != null; node = node.getNextSibling()) {
-				roc.lockNode((IDOMNode) node);
-			}
-		}
-
-		fChildEditable = editable;
-		notifyEditableChanged();
-	}
-
-	protected void syncChildEditableState(Node child) {
-		ReadOnlyController roc = ReadOnlyController.getInstance();
-		if (fChildEditable) {
-			roc.unlockNode((NodeImpl) child);
-		} else {
-			roc.lockNode((NodeImpl) child);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeImpl.java
deleted file mode 100644
index a219cff..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeImpl.java
+++ /dev/null
@@ -1,1063 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-import org.w3c.dom.TypeInfo;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * NodeImpl class
- */
-public abstract class NodeImpl extends AbstractNotifier implements Node, IDOMNode {
-	// define one empty nodelist, for repeated use
-	private final static NodeList EMPTY_NODE_LIST = new NodeListImpl();
-
-	private boolean fDataEditable = true;
-	private IStructuredDocumentRegion flatNode = null;
-	private NodeImpl nextSibling = null;
-
-	private DocumentImpl ownerDocument = null;
-	private NodeImpl parentNode = null;
-	private NodeImpl previousSibling = null;
-	
-	private Hashtable userDataTable=null;
-
-	/**
-	 * NodeImpl constructor
-	 */
-	protected NodeImpl() {
-		super();
-	}
-
-	/**
-	 * NodeImpl constructor
-	 * 
-	 * @param that
-	 *            NodeImpl
-	 */
-	protected NodeImpl(NodeImpl that) {
-		if (that != null) {
-			this.ownerDocument = that.ownerDocument;
-		}
-	}
-
-	/**
-	 * appendChild method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param newChild
-	 *            org.w3c.dom.Node
-	 */
-	public Node appendChild(Node newChild) throws DOMException {
-		throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, new String());
-	}
-
-	/**
-	 * contains method
-	 * 
-	 * @return boolean
-	 * @param offset
-	 *            int
-	 */
-	public boolean contains(int offset) {
-		return (offset >= getStartOffset() && offset < getEndOffset());
-	}
-
-	/**
-	 * @param s
-	 * @param tagName
-	 * @return
-	 */
-	protected String createDOMExceptionMessage(short s, String tagName) {
-		String result = null;
-		// TODO: Should localize these messages, and provide /u escaped
-		// version of tagName
-		result = lookupMessage(s) + " " + tagName; //$NON-NLS-1$
-		return result;
-	}
-
-	/**
-	 * getAttributes method
-	 * 
-	 * @return org.w3c.dom.NamedNodeMap
-	 */
-	public NamedNodeMap getAttributes() {
-		return null;
-	}
-
-	/**
-	 */
-	protected String getCharValue(String name) {
-		DocumentImpl document = (DocumentImpl) getOwnerDocument();
-		if (document == null)
-			return null;
-		return document.getCharValue(name);
-	}
-
-	/**
-	 * getChildNodes method
-	 * 
-	 * @return org.w3c.dom.NodeList
-	 */
-	public NodeList getChildNodes() {
-		// As per DOM spec, correct behavior for getChildNodes is to return a
-		// zero length NodeList, not null, when there are no children.
-		// We'll use a common instance of an empty node list, just to prevent
-		// creating a trival object many many times.
-
-		return EMPTY_NODE_LIST;
-	}
-
-	/**
-	 * getCommonAncestor method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param node
-	 *            org.w3c.dom.Node
-	 */
-	public Node getCommonAncestor(Node node) {
-		if (node == null)
-			return null;
-
-		for (Node na = node; na != null; na = na.getParentNode()) {
-			for (Node ta = this; ta != null; ta = ta.getParentNode()) {
-				if (ta == na)
-					return ta;
-			}
-		}
-
-		return null; // not found
-	}
-
-	/**
-	 * getContainerDocument method
-	 * 
-	 * @return org.w3c.dom.Document
-	 */
-	public Document getContainerDocument() {
-		for (Node node = this; node != null; node = node.getParentNode()) {
-			if (node.getNodeType() == Node.DOCUMENT_NODE) {
-				return (Document) node;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * getEndOffset method
-	 * 
-	 * @return int
-	 */
-	public int getEndOffset() {
-		Node node = this;
-		while (node != null) {
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				ElementImpl element = (ElementImpl) node;
-				IStructuredDocumentRegion endStructuredDocumentRegion = element.getEndStructuredDocumentRegion();
-				if (endStructuredDocumentRegion != null)
-					return endStructuredDocumentRegion.getEnd();
-			}
-
-			Node last = node.getLastChild();
-			if (last != null) { // dig into the last
-				node = last;
-				continue;
-			}
-
-			IStructuredDocumentRegion lastStructuredDocumentRegion = ((NodeImpl) node).getStructuredDocumentRegion();
-			if (lastStructuredDocumentRegion != null)
-				return lastStructuredDocumentRegion.getEnd();
-
-			Node prev = node.getPreviousSibling();
-			if (prev != null) { // move to the previous
-				node = prev;
-				continue;
-			}
-
-			Node parent = node.getParentNode();
-			node = null;
-			while (parent != null) {
-				if (parent.getNodeType() == Node.ELEMENT_NODE) {
-					ElementImpl element = (ElementImpl) parent;
-					IStructuredDocumentRegion startStructuredDocumentRegion = element.getStartStructuredDocumentRegion();
-					if (startStructuredDocumentRegion != null)
-						return startStructuredDocumentRegion.getEnd();
-				}
-				Node parentPrev = parent.getPreviousSibling();
-				if (parentPrev != null) { // move to the previous
-					node = parentPrev;
-					break;
-				}
-				parent = parent.getParentNode();
-			}
-		}
-		return 0;
-	}
-
-	public IStructuredDocumentRegion getEndStructuredDocumentRegion() {
-		return null;
-	}
-
-	/**
-	 */
-	public FactoryRegistry getFactoryRegistry() {
-		IDOMModel model = getModel();
-		if (model != null) {
-			FactoryRegistry reg = model.getFactoryRegistry();
-			if (reg != null)
-				return reg;
-		}
-		return null;
-	}
-
-	/**
-	 * getFirstChild method
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	public Node getFirstChild() {
-		return null;
-	}
-
-	/**
-	 * getFirstStructuredDocumentRegion method
-	 * 
-	 */
-	public IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
-		return StructuredDocumentRegionUtil.getStructuredDocumentRegion(this.flatNode);
-	}
-
-	/**
-	 */
-	public int getIndex() {
-		Node parent = getParentNode();
-		if (parent == null)
-			return -1; // error
-		int index = 0;
-		for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
-			if (child == this)
-				return index;
-			index++;
-		}
-		return -1; // error
-	}
-
-	/**
-	 * getLastChild method
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	public Node getLastChild() {
-		return null;
-	}
-
-	/**
-	 * getLastStructuredDocumentRegion method
-	 * 
-	 */
-	public IStructuredDocumentRegion getLastStructuredDocumentRegion() {
-		return StructuredDocumentRegionUtil.getStructuredDocumentRegion(this.flatNode);
-	}
-
-	/**
-	 */
-	public String getLocalName() {
-		return null;
-	}
-
-	/**
-	 * the default implementation can just refer to the owning document
-	 */
-	public IDOMModel getModel() {
-		if (this.ownerDocument == null)
-			return null;
-		return this.ownerDocument.getModel();
-	}
-
-	/**
-	 * all but attr return null
-	 */
-	public ITextRegion getNameRegion() {
-		return null;
-	}
-
-	/**
-	 */
-	public String getNamespaceURI() {
-		return null;
-	}
-
-	/**
-	 * getNextSibling method
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	public Node getNextSibling() {
-		return this.nextSibling;
-	}
-
-	/**
-	 * getNodeAt method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param offset
-	 *            int
-	 */
-	Node getNodeAt(int offset) {
-		IDOMNode parent = this;
-		IDOMNode child = (IDOMNode) getFirstChild();
-		while (child != null) {
-			if (child.getEndOffset() <= offset) {
-				child = (IDOMNode) child.getNextSibling();
-				continue;
-			}
-			if (child.getStartOffset() > offset) {
-				break;
-			}
-
-			IStructuredDocumentRegion startStructuredDocumentRegion = child.getStartStructuredDocumentRegion();
-			if (startStructuredDocumentRegion != null) {
-				if (startStructuredDocumentRegion.getEnd() > offset)
-					return child;
-			}
-
-			// dig more
-			parent = child;
-			child = (IDOMNode) parent.getFirstChild();
-		}
-
-		return parent;
-	}
-
-	/**
-	 * getNodeValue method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeValue() throws DOMException {
-		return null;
-	}
-
-	/**
-	 * getOwnerDocument method
-	 * 
-	 * @return org.w3c.dom.Document
-	 */
-	public Document getOwnerDocument() {
-		return this.ownerDocument;
-	}
-
-	/**
-	 * getParentNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	public Node getParentNode() {
-		return this.parentNode;
-	}
-
-	/**
-	 */
-	public String getPrefix() {
-		return null;
-	}
-
-	/**
-	 * getPreviousSibling method
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	public Node getPreviousSibling() {
-		return this.previousSibling;
-	}
-
-	/**
-	 */
-	public String getSource() {
-		if (this.flatNode == null)
-			return new String();
-		return this.flatNode.getText();
-	}
-
-	/**
-	 * getStartOffset method
-	 * 
-	 * @return int
-	 */
-	public int getStartOffset() {
-		if (this.flatNode != null)
-			return this.flatNode.getStart();
-		NodeImpl prev = (NodeImpl) getPreviousSibling();
-		if (prev != null)
-			return prev.getEndOffset();
-		Node parent = getParentNode();
-		if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
-			ElementImpl element = (ElementImpl) parent;
-			if (element.hasStartTag())
-				return element.getStartEndOffset();
-			return element.getStartOffset();
-		}
-		// final fallback to look into first child
-		NodeImpl child = (NodeImpl) getFirstChild();
-		while (child != null) {
-			IStructuredDocumentRegion childStructuredDocumentRegion = child.getStructuredDocumentRegion();
-			if (childStructuredDocumentRegion != null)
-				return childStructuredDocumentRegion.getStart();
-			child = (NodeImpl) child.getFirstChild();
-		}
-		return 0;
-	}
-
-	public IStructuredDocumentRegion getStartStructuredDocumentRegion() {
-		return getFirstStructuredDocumentRegion();
-	}
-
-	/**
-	 * Every node (indirectly) knows its structuredDocument
-	 */
-	public IStructuredDocument getStructuredDocument() {
-		return getModel().getStructuredDocument();
-	}
-
-	/**
-	 */
-	IStructuredDocumentRegion getStructuredDocumentRegion() {
-		return this.flatNode;
-	}
-
-	/**
-	 * all but attr return null
-	 */
-	public ITextRegion getValueRegion() {
-		return null;
-	}
-
-	/**
-	 */
-	public String getValueSource() {
-		return getNodeValue();
-	}
-
-	/**
-	 */
-	public boolean hasAttributes() {
-		return false;
-	}
-
-	/**
-	 * hasChildNodes method
-	 * 
-	 * @return boolean
-	 */
-	public boolean hasChildNodes() {
-		return false;
-	}
-
-	/**
-	 * hasProperties method
-	 * 
-	 * @return boolean
-	 */
-	public boolean hasProperties() {
-		return false;
-	}
-
-	/**
-	 * insertBefore method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param newChild
-	 *            org.w3c.dom.Node
-	 * @param refChild
-	 *            org.w3c.dom.Node
-	 */
-	public Node insertBefore(Node newChild, Node refChild) throws DOMException {
-		throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, new String());
-	}
-
-	public boolean isChildEditable() {
-		return false;
-	}
-
-	/**
-	 */
-	public boolean isClosed() {
-		return true;
-	}
-
-	/**
-	 * isContainer method
-	 * 
-	 * @return boolean
-	 */
-	public boolean isContainer() {
-		return false;
-	}
-
-	public boolean isDataEditable() {
-		if (!fDataEditable) {
-			DOMModelImpl model = (DOMModelImpl) getModel();
-			if (model != null && model.isReparsing()) {
-				return true;
-			}
-		}
-		return fDataEditable;
-	}
-
-	/**
-	 */
-	public boolean isSupported(String feature, String version) {
-		if (this.ownerDocument == null)
-			return false;
-		DOMImplementation impl = this.ownerDocument.getImplementation();
-		if (impl == null)
-			return false;
-		return impl.hasFeature(feature, version);
-	}
-
-	/**
-	 * @param s
-	 * @return
-	 */
-	private String lookupMessage(short s) {
-		// TODO: make localized version
-		String result = null;
-		switch (s) {
-			case DOMException.INVALID_CHARACTER_ERR :
-				result = "INVALID_CHARACTER_ERR"; //$NON-NLS-1$
-				break;
-
-			default :
-				result = new String();
-				break;
-		}
-		return result;
-	}
-
-	/**
-	 * normalize method
-	 */
-	public void normalize() {
-		TextImpl prevText = null;
-		for (Node child = getFirstChild(); child != null; child = child.getNextSibling()) {
-			switch (child.getNodeType()) {
-				case TEXT_NODE : {
-					if (prevText == null) {
-						prevText = (TextImpl) child;
-						break;
-					}
-					Text text = (Text) child;
-					removeChild(text);
-					prevText.appendText(text);
-					child = prevText;
-					break;
-				}
-				case ELEMENT_NODE : {
-					Element element = (Element) child;
-					element.normalize();
-					prevText = null;
-					break;
-				}
-				default :
-					prevText = null;
-					break;
-			}
-		}
-	}
-
-	protected void notifyEditableChanged() {
-		DocumentImpl document = (DocumentImpl) getContainerDocument();
-		if (document == null)
-			return;
-		DOMModelImpl model = (DOMModelImpl) document.getModel();
-		if (model == null)
-			return;
-		model.editableChanged(this);
-	}
-
-	/**
-	 * notifyValueChanged method
-	 */
-	protected void notifyValueChanged() {
-		DocumentImpl document = (DocumentImpl) getContainerDocument();
-		if (document == null)
-			return;
-
-		syncDataEditableState();
-
-		DOMModelImpl model = (DOMModelImpl) document.getModel();
-		if (model == null)
-			return;
-		model.valueChanged(this);
-	}
-
-	/**
-	 * removeChild method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param oldChild
-	 *            org.w3c.dom.Node
-	 */
-	public Node removeChild(Node oldChild) throws DOMException {
-		throw new DOMException(DOMException.NOT_FOUND_ERR, new String());
-	}
-
-	/**
-	 * removeChildNodes method
-	 */
-	public void removeChildNodes() {
-	}
-
-	/**
-	 * removeChildNodes method
-	 * 
-	 * @return org.w3c.dom.DocumentFragment
-	 * @param firstChild
-	 *            org.w3c.dom.Node
-	 * @param lastChild
-	 *            org.w3c.dom.Node
-	 */
-	public DocumentFragment removeChildNodes(Node firstChild, Node lastChild) {
-		return null;
-	}
-
-	/**
-	 * replaceChild method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param newChild
-	 *            org.w3c.dom.Node
-	 * @param oldChild
-	 *            org.w3c.dom.Node
-	 */
-	public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
-		throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, new String());
-	}
-
-	/**
-	 * Resets children values from IStructuredDocumentRegion.
-	 */
-	void resetStructuredDocumentRegions() {
-		for (NodeImpl child = (NodeImpl) getFirstChild(); child != null; child = (NodeImpl) child.getNextSibling()) {
-			child.resetStructuredDocumentRegions();
-		}
-		this.flatNode = null;
-	}
-
-	public void setChildEditable(boolean editable) {
-		// nop
-	}
-
-	public void setDataEditable(boolean editable) {
-		if (fDataEditable == editable) {
-			return;
-		}
-
-		ReadOnlyController roc = ReadOnlyController.getInstance();
-		if (editable) {
-			roc.unlockData(this);
-		}
-		else {
-			roc.lockData(this);
-		}
-
-		fDataEditable = editable;
-
-		notifyEditableChanged();
-	}
-
-	public void setEditable(boolean editable, boolean deep) {
-		if (deep) {
-			IDOMNode node = (IDOMNode) getFirstChild();
-			while (node != null) {
-				node.setEditable(editable, deep);
-				node = (IDOMNode) node.getNextSibling();
-			}
-		}
-		setChildEditable(editable);
-		setDataEditable(editable);
-	}
-
-	/**
-	 * setNextSibling method
-	 * 
-	 * @param nextSibling
-	 *            org.w3c.dom.Node
-	 */
-	protected void setNextSibling(Node nextSibling) {
-		this.nextSibling = (NodeImpl) nextSibling;
-	}
-
-	/**
-	 * setNodeValue method
-	 * 
-	 * @param nodeValue
-	 *            java.lang.String
-	 */
-	public void setNodeValue(String nodeValue) throws DOMException {
-	}
-
-	/**
-	 * setOwnerDocument method
-	 * 
-	 * @param ownerDocument
-	 *            org.w3c.dom.Document
-	 */
-	protected void setOwnerDocument(Document ownerDocument) {
-		this.ownerDocument = (DocumentImpl) ownerDocument;
-	}
-
-	/**
-	 */
-	protected void setOwnerDocument(Document ownerDocument, boolean deep) {
-		this.ownerDocument = (DocumentImpl) ownerDocument;
-
-		if (deep) {
-			for (NodeImpl child = (NodeImpl) getFirstChild(); child != null; child = (NodeImpl) child.getNextSibling()) {
-				child.setOwnerDocument(ownerDocument, deep);
-			}
-		}
-	}
-
-	/**
-	 * setParentNode method
-	 * 
-	 * @param parentNode
-	 *            org.w3c.dom.Node
-	 */
-	protected void setParentNode(Node parentNode) {
-		this.parentNode = (NodeImpl) parentNode;
-	}
-
-	/**
-	 */
-	public void setPrefix(String prefix) throws DOMException {
-	}
-
-	/**
-	 * setPreviousSibling method
-	 * 
-	 * @param previousSibling
-	 *            org.w3c.dom.Node
-	 */
-	protected void setPreviousSibling(Node previousSibling) {
-		this.previousSibling = (NodeImpl) previousSibling;
-	}
-
-	/**
-	 */
-	public void setSource(String source) throws InvalidCharacterException {
-		// not supported
-	}
-
-	/**
-	 */
-	void setStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		this.flatNode = flatNode;
-	}
-
-	/**
-	 */
-	public void setValueSource(String source) {
-		setNodeValue(source);
-	}
-
-	protected void syncDataEditableState() {
-		ReadOnlyController roc = ReadOnlyController.getInstance();
-		if (fDataEditable) {
-			roc.unlockData(this);
-		}
-		else {
-			roc.lockData(this);
-		}
-	}
-
-	/**
-	 * toString method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String toString() {
-		return getNodeName();
-	}
-
-	public int getLength() {
-		int result = -1;
-		int start = getStartOffset();
-		if (start >= 0) {
-			int end = getEndOffset();
-			if (end >= 0) {
-				result = end - start;
-				if (result < -1) {
-					result = -1;
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public short compareDocumentPosition(Node other) throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public String getBaseURI() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public Object getFeature(String feature, String version) {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public String getTextContent() throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public boolean isDefaultNamespace(String namespaceURI) {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public boolean isEqualNode(Node arg) {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public boolean isSameNode(Node other) {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public String lookupNamespaceURI(String prefix) {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public String lookupPrefix(String namespaceURI) {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public void setTextContent(String textContent) throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public TypeInfo getSchemaTypeInfo() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
-	}
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public boolean isId() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
-	}
-	
-	/**
-	 * Retrieves the object for a node associated to a key.
-	 * 
-	 * @param key The key associated with the object.
-	 * @return object The object for this node, associated with the key passed
-	 * or null if there was none set.
-	 *
-	 * @since DOM Level 3
-	 */
-	public Object getUserData(String key) {
-		
-		if (key==null) return null;
-		
-		if (userDataTable!=null) {
-			UserDataAndHandler userDataAndHandler = (UserDataAndHandler) userDataTable.get(key);
-			if (userDataAndHandler!=null) {
-				return userDataAndHandler.getData();
-			} 
-		}
-		return null;	
-	}
-	
-	/**
-	 * Sets the user data and handler for a key
-	 * 
-	 * @param key The key associated with the object.
-	 * @param object The object for this node, associated with the key passed.
-	 * Null passed removes the existing association to the key.
-	 * @param handler UserDataHandler for the userdata associated with this key
-	 * @return Object The previous userdata object if set, null if it was none.  
-	 * 
-	 * @since DOM Level 3
-	 */
-	public Object setUserData(String key, Object data, UserDataHandler handler) {
-
-		UserDataAndHandler previousDataAndHandler=null;
-		
-		//return immediately for null keys
-		if (key ==null) return null;
-		
-		//remove association for the key if data is null
-		if (data==null) {
-			if (userDataTable==null) return null;
-			
-			//see if there is a previous value set
-			previousDataAndHandler = (UserDataAndHandler) userDataTable.get(key);
-			if (previousDataAndHandler!=null) {
-				userDataTable.remove(key);
-				return previousDataAndHandler.getData();
-			}
-			//there is no previous value found
-			return null;
-		}
-		
-		//if data passed is not null
-		//the first data in the hashtable
-		if (userDataTable==null) {
-			userDataTable=new Hashtable();
-			UserDataAndHandler userDataAndHandler=new UserDataAndHandler(data,handler);
-			userDataTable.put(key,userDataAndHandler);
-			return null;
-			//there is already data in the hashtable
-		} else {
-			UserDataAndHandler userDataAndHandler=new UserDataAndHandler(data,handler);
-			previousDataAndHandler=(UserDataAndHandler) userDataTable.put(key,userDataAndHandler);
-			
-			//if we replace a value
-			if (previousDataAndHandler!=null)
-				return previousDataAndHandler.getData();
-			else {
-				return null;
-			}
-		}
-	}
-	
-	/**
-	 * Notifies the UserDataHandlers of the node.
-	 * 
-	 * @param operation
-	 * @param destination
-	 */
-	protected void notifyUserDataHandlers(short operation, Node destination) {
-		
-		if (operation!=UserDataHandler.NODE_ADOPTED 
-				& operation!=UserDataHandler.NODE_CLONED
-				& operation!=UserDataHandler.NODE_DELETED
-				& operation!=UserDataHandler.NODE_IMPORTED
-				& operation!=UserDataHandler.NODE_RENAMED)
-			return; 
-			
-		if (userDataTable!=null) {
-			Enumeration keys=userDataTable.keys();
-			while (keys.hasMoreElements()) {
-				String key=(String) keys.nextElement(); //should always be a string
-				UserDataAndHandler dataAndHandler = (UserDataAndHandler) userDataTable.get(key);
-				if (dataAndHandler!=null) {
-					UserDataHandler dataHandler=dataAndHandler.getHandler();
-					if (dataHandler!=null) {
-						dataHandler.handle(operation, key, dataAndHandler.getData(), this, destination);
-					}
-				}
-			}
-		}
-	}
-	
-	/**
-	 * 
-	 * Class for user data and UserDataHandler
-	 */
-	protected class UserDataAndHandler implements Serializable {
-
-		/**
-		 * Generated Serial ID
-		 */
-		private static final long serialVersionUID = 4860521237315444840L;
-		/**
-		 * Generated serialization version
-		 */
-		
-		private Object data;
-		private UserDataHandler handler;
-		
-		public UserDataAndHandler(Object data, UserDataHandler handler)
-		{
-			this.data=data;
-			this.handler=handler;
-		}
-
-		public Object getData() {
-			return data;
-		}
-
-		public void setData(Object data) {
-			this.data = data;
-		}
-
-		public UserDataHandler getHandler() {
-			return handler;
-		}
-
-		public void setHandler(UserDataHandler handler) {
-			this.handler = handler;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeIteratorImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeIteratorImpl.java
deleted file mode 100644
index c4a278b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeIteratorImpl.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * NodeIteratorImpl class
- */
-public class NodeIteratorImpl implements NodeIterator {
-	private NodeFilter filter = null;
-	private Node nextNode = null;
-
-	private Node rootNode = null;
-	private int whatToShow = NodeFilter.SHOW_ALL;
-
-	/**
-	 * NodeIteratorImpl constructor
-	 * 
-	 * @param rootNode
-	 *            org.w3c.dom.Node
-	 */
-	NodeIteratorImpl(Node rootNode, int whatToShow, NodeFilter filter) {
-		this.rootNode = rootNode;
-		this.nextNode = rootNode;
-		this.whatToShow = whatToShow;
-		this.filter = filter;
-	}
-
-	/**
-	 */
-	private final boolean acceptNode(Node node) {
-		if (this.whatToShow != NodeFilter.SHOW_ALL) {
-			if (node == null)
-				return false;
-			short nodeType = node.getNodeType();
-			switch (this.whatToShow) {
-				case NodeFilter.SHOW_ELEMENT :
-					if (nodeType != Node.ELEMENT_NODE)
-						return false;
-					break;
-				case NodeFilter.SHOW_ATTRIBUTE :
-					if (nodeType != Node.ATTRIBUTE_NODE)
-						return false;
-					break;
-				case NodeFilter.SHOW_TEXT :
-					if (nodeType != Node.TEXT_NODE)
-						return false;
-					break;
-				case NodeFilter.SHOW_CDATA_SECTION :
-					if (nodeType != Node.CDATA_SECTION_NODE)
-						return false;
-					break;
-				case NodeFilter.SHOW_ENTITY_REFERENCE :
-					if (nodeType != Node.ENTITY_REFERENCE_NODE)
-						return false;
-					break;
-				case NodeFilter.SHOW_ENTITY :
-					if (nodeType != Node.ENTITY_NODE)
-						return false;
-					break;
-				case NodeFilter.SHOW_PROCESSING_INSTRUCTION :
-					if (nodeType != Node.PROCESSING_INSTRUCTION_NODE)
-						return false;
-					break;
-				case NodeFilter.SHOW_COMMENT :
-					if (nodeType != Node.COMMENT_NODE)
-						return false;
-					break;
-				case NodeFilter.SHOW_DOCUMENT :
-					if (nodeType != Node.DOCUMENT_NODE)
-						return false;
-					break;
-				case NodeFilter.SHOW_DOCUMENT_TYPE :
-					if (nodeType != Node.DOCUMENT_TYPE_NODE)
-						return false;
-					break;
-				case NodeFilter.SHOW_DOCUMENT_FRAGMENT :
-					if (nodeType != Node.DOCUMENT_FRAGMENT_NODE)
-						return false;
-					break;
-				case NodeFilter.SHOW_NOTATION :
-					if (nodeType != Node.NOTATION_NODE)
-						return false;
-					break;
-				default :
-					return false;
-			}
-		}
-		if (this.filter != null) {
-			return (this.filter.acceptNode(node) == NodeFilter.FILTER_ACCEPT);
-		}
-		return true;
-	}
-
-	/**
-	 * Detaches the <code>NodeIterator</code> from the set which it iterated
-	 * over, releasing any computational resources and placing the iterator in
-	 * the INVALID state. After <code>detach</code> has been invoked, calls
-	 * to <code>nextNode</code> or <code>previousNode</code> will raise
-	 * the exception INVALID_STATE_ERR.
-	 */
-	public void detach() {
-		this.rootNode = null;
-		this.nextNode = null;
-		this.filter = null;
-	}
-
-	/**
-	 * The value of this flag determines whether the children of entity
-	 * reference nodes are visible to the iterator. If false, they and their
-	 * descendants will be rejected. Note that this rejection takes precedence
-	 * over <code>whatToShow</code> and the filter. Also note that this is
-	 * currently the only situation where <code>NodeIterators</code> may
-	 * reject a complete subtree rather than skipping individual nodes. <br>
-	 * <br>
-	 * To produce a view of the document that has entity references expanded
-	 * and does not expose the entity reference node itself, use the
-	 * <code>whatToShow</code> flags to hide the entity reference node and
-	 * set <code>expandEntityReferences</code> to true when creating the
-	 * iterator. To produce a view of the document that has entity reference
-	 * nodes but no entity expansion, use the <code>whatToShow</code> flags
-	 * to show the entity reference node and set
-	 * <code>expandEntityReferences</code> to false.
-	 */
-	public boolean getExpandEntityReferences() {
-		// not supported
-		return false;
-	}
-
-	/**
-	 * The <code>NodeFilter</code> used to screen nodes.
-	 */
-	public NodeFilter getFilter() {
-		return this.filter;
-	}
-
-	/**
-	 */
-	private final Node getNextNode() {
-		if (this.nextNode == null)
-			return null;
-		Node oldNext = this.nextNode;
-		Node child = this.nextNode.getFirstChild();
-		if (child != null) {
-			this.nextNode = child;
-			return oldNext;
-		}
-		for (Node node = this.nextNode; node != null && node != this.rootNode; node = node.getParentNode()) {
-			Node next = node.getNextSibling();
-			if (next != null) {
-				this.nextNode = next;
-				return oldNext;
-			}
-		}
-		this.nextNode = null;
-		return oldNext;
-	}
-
-	/**
-	 */
-	private final Node getPreviousNode() {
-		if (this.nextNode == this.rootNode)
-			return null;
-		Node prev = null;
-		if (this.nextNode == null) {
-			prev = this.rootNode; // never null
-		} else {
-			prev = this.nextNode.getPreviousSibling();
-			if (prev == null) {
-				this.nextNode = this.nextNode.getParentNode();
-				return this.nextNode;
-			}
-		}
-		Node last = prev.getLastChild();
-		while (last != null) {
-			prev = last;
-			last = prev.getLastChild();
-		}
-		this.nextNode = prev;
-		return this.nextNode;
-	}
-
-	/**
-	 * The root node of the <code>NodeIterator</code>, as specified when it
-	 * was created.
-	 */
-	public Node getRoot() {
-		return this.rootNode;
-	}
-
-	/**
-	 * This attribute determines which node types are presented via the
-	 * iterator. The available set of constants is defined in the
-	 * <code>NodeFilter</code> interface. Nodes not accepted by
-	 * <code>whatToShow</code> will be skipped, but their children may still
-	 * be considered. Note that this skip takes precedence over the filter, if
-	 * any.
-	 */
-	public int getWhatToShow() {
-		return this.whatToShow;
-	}
-
-	/**
-	 * Returns the next node in the set and advances the position of the
-	 * iterator in the set. After a <code>NodeIterator</code> is created,
-	 * the first call to <code>nextNode()</code> returns the first node in
-	 * the set.
-	 * 
-	 * @return The next <code>Node</code> in the set being iterated over, or
-	 *         <code>null</code> if there are no more members in that set.
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if this method is called after
-	 *                the <code>detach</code> method was invoked.
-	 */
-	public Node nextNode() throws DOMException {
-		for (Node node = getNextNode(); node != null; node = getNextNode()) {
-			if (acceptNode(node))
-				return node;
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the previous node in the set and moves the position of the
-	 * <code>NodeIterator</code> backwards in the set.
-	 * 
-	 * @return The previous <code>Node</code> in the set being iterated
-	 *         over, or <code>null</code> if there are no more members in
-	 *         that set.
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if this method is called after
-	 *                the <code>detach</code> method was invoked.
-	 */
-	public Node previousNode() throws DOMException {
-		for (Node node = getPreviousNode(); node != null; node = getPreviousNode()) {
-			if (acceptNode(node))
-				return node;
-		}
-		return null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeListImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeListImpl.java
deleted file mode 100644
index 4bfed52..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeListImpl.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Vector;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * NodeListImpl class
- */
-public class NodeListImpl implements NodeList {
-
-	Object lockObject = new byte[0];
-
-	private Vector nodes = null;
-
-	/**
-	 * NodeListImpl constructor
-	 */
-	public NodeListImpl() {
-		super();
-	}
-
-	/**
-	 * appendNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param node
-	 *            org.w3c.dom.Node
-	 */
-	protected Node appendNode(Node node) {
-		if (node == null)
-			return null;
-		if (this.nodes == null)
-			this.nodes = new Vector();
-		this.nodes.addElement(node);
-		return node;
-	}
-
-	/**
-	 * getLength method
-	 * 
-	 * @return int
-	 */
-	public int getLength() {
-		synchronized (lockObject) {
-			if (this.nodes == null)
-				return 0;
-			return this.nodes.size();
-		}
-	}
-
-	/**
-	 */
-	protected Node insertNode(Node node, int index) {
-		if (node == null)
-			return null;
-		if (this.nodes == null || index >= this.nodes.size()) {
-			return appendNode(node);
-		}
-		this.nodes.insertElementAt(node, index);
-		return node;
-	}
-
-	/**
-	 * item method
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	public Node item(int index) {
-		synchronized (lockObject) {
-			if (this.nodes == null)
-				return null;
-			if (index < 0 || index >= this.nodes.size())
-				return null;
-			return (Node) this.nodes.elementAt(index);
-		}
-	}
-
-	/**
-	 * removeNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param index
-	 *            int
-	 */
-	protected Node removeNode(int index) {
-		if (this.nodes == null)
-			return null; // no node
-		if (index < 0 || index >= this.nodes.size())
-			return null; // invalid parameter
-
-		Node removed = (Node) this.nodes.elementAt(index);
-		this.nodes.removeElementAt(index);
-		return removed;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NotationImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NotationImpl.java
deleted file mode 100644
index 0dbbfe0..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NotationImpl.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.Notation;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * NotationImpl class
- */
-public class NotationImpl extends NodeImpl implements Notation {
-
-	private String name = null;
-	private String publicId = null;
-	private String systemId = null;
-
-	/**
-	 * NotationImpl constructor
-	 */
-	protected NotationImpl() {
-		super();
-	}
-
-	/**
-	 * NotationImpl constructor
-	 * 
-	 * @param that
-	 *            NotationImpl
-	 */
-	protected NotationImpl(NotationImpl that) {
-		super(that);
-
-		if (that != null) {
-			this.name = that.name;
-			this.publicId = that.publicId;
-			this.systemId = that.systemId;
-		}
-	}
-
-	/**
-	 * cloneNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param deep
-	 *            boolean
-	 */
-	public Node cloneNode(boolean deep) {
-		NotationImpl cloned = new NotationImpl(this);
-		notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
-		return cloned;
-	}
-
-	/**
-	 * getNodeName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		if (this.name == null)
-			return new String();
-		return this.name;
-	}
-
-	/**
-	 * getNodeType method
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return NOTATION_NODE;
-	}
-
-	/**
-	 * getPublicId method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getPublicId() {
-		return this.publicId;
-	}
-
-	/**
-	 * getSystemId method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getSystemId() {
-		return this.systemId;
-	}
-
-	/**
-	 * setName method
-	 * 
-	 * @param name
-	 *            java.lang.String
-	 */
-	protected void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * setPublicId method
-	 * 
-	 * @param publicId
-	 *            java.lang.String
-	 */
-	public void setPublicId(String publicId) {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-		this.publicId = publicId;
-	}
-
-	/**
-	 * setSystemId method
-	 * 
-	 * @param systemId
-	 *            java.lang.String
-	 */
-	public void setSystemId(String systemId) {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-		this.systemId = systemId;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ProcessingInstructionImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ProcessingInstructionImpl.java
deleted file mode 100644
index 7a1420b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ProcessingInstructionImpl.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.UserDataHandler;
-
-
-/**
- * ProcessingInstructionImpl class
- */
-public class ProcessingInstructionImpl extends NodeImpl implements ProcessingInstruction {
-	private String data = null;
-
-	private String target = null;
-
-	/**
-	 * ProcessingInstructionImpl constructor
-	 */
-	protected ProcessingInstructionImpl() {
-		super();
-	}
-
-	/**
-	 * ProcessingInstructionImpl constructor
-	 * 
-	 * @param that
-	 *            ProcessingInstructionImpl
-	 */
-	protected ProcessingInstructionImpl(ProcessingInstructionImpl that) {
-		super(that);
-
-		if (that != null) {
-			this.target = that.target;
-			this.data = that.getData();
-		}
-	}
-
-	/**
-	 * cloneNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param deep
-	 *            boolean
-	 */
-	public Node cloneNode(boolean deep) {
-		ProcessingInstructionImpl cloned = new ProcessingInstructionImpl(this);
-		notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
-		return cloned;
-	}
-
-	/**
-	 * getData method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getData() {
-		if (this.data != null)
-			return this.data;
-
-		IStructuredDocumentRegion flatNode = getFirstStructuredDocumentRegion();
-		if (flatNode == null)
-			return new String();
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return new String();
-
-		ITextRegion targetRegion = null;
-		ITextRegion dataRegion = null;
-		ITextRegion closeRegion = null;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_PI_OPEN)
-				continue;
-			if (regionType == DOMRegionContext.XML_PI_CLOSE) {
-				closeRegion = region;
-			}
-			else {
-				if (targetRegion == null)
-					targetRegion = region;
-				else if (dataRegion == null)
-					dataRegion = region;
-			}
-		}
-		if (dataRegion == null)
-			return new String();
-		int offset = dataRegion.getStart();
-		int end = flatNode.getLength();
-		if (closeRegion != null)
-			end = closeRegion.getStart();
-		String source = flatNode.getText();
-		return source.substring(offset, end);
-	}
-
-	/**
-	 * getNodeName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		return getTarget();
-	}
-
-	/**
-	 * getNodeType method
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return PROCESSING_INSTRUCTION_NODE;
-	}
-
-	/**
-	 * getNodeValue method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeValue() {
-		return getData();
-	}
-
-	/**
-	 * getTarget method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getTarget() {
-		if (this.target == null)
-			return new String();
-		return this.target;
-	}
-
-	/**
-	 */
-	public boolean isClosed() {
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode == null)
-			return true; // will be generated
-		String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode);
-		return (regionType == DOMRegionContext.XML_PI_CLOSE);
-	}
-
-	/**
-	 */
-	void resetStructuredDocumentRegions() {
-		this.data = getData();
-		setStructuredDocumentRegion(null);
-	}
-
-	/**
-	 * setData method
-	 * 
-	 * @param data
-	 *            java.lang.String
-	 */
-	public void setData(String data) throws DOMException {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		this.data = data;
-
-		notifyValueChanged();
-	}
-
-	/**
-	 * setNodeValue method
-	 * 
-	 * @param nodeValue
-	 *            java.lang.String
-	 */
-	public void setNodeValue(String nodeValue) throws DOMException {
-		setData(nodeValue);
-	}
-
-	/**
-	 */
-	void setStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		super.setStructuredDocumentRegion(flatNode);
-		if (flatNode != null)
-			this.data = null;
-	}
-
-	/**
-	 * setTarget method
-	 * 
-	 * @param target
-	 *            java.lang.String
-	 */
-	protected void setTarget(String target) {
-		this.target = target;
-	}
-
-	/**
-	 * toString method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String toString() {
-		StringBuffer buffer = new StringBuffer();
-		buffer.append(getTarget());
-		buffer.append('(');
-		buffer.append(getData());
-		buffer.append(')');
-		return buffer.toString();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/RangeImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/RangeImpl.java
deleted file mode 100644
index f60336e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/RangeImpl.java
+++ /dev/null
@@ -1,630 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-import org.w3c.dom.ranges.Range;
-import org.w3c.dom.ranges.RangeException;
-
-
-/**
- */
-public class RangeImpl implements Range {
-	private Node endContainer = null;
-	private int endOffset = 0;
-
-	private Node startContainer = null;
-	private int startOffset = 0;
-
-	/**
-	 */
-	protected RangeImpl() {
-		super();
-	}
-
-	/**
-	 */
-	protected RangeImpl(RangeImpl that) {
-		super();
-
-		if (that != null) {
-			this.startContainer = that.startContainer;
-			this.startOffset = that.startOffset;
-			this.endContainer = that.endContainer;
-			this.endOffset = that.endOffset;
-		}
-	}
-
-	/**
-	 * Duplicates the contents of a Range
-	 * 
-	 * @return A DocumentFragment that contains content equivalent to this
-	 *         Range.
-	 * @exception DOMException
-	 *                HIERARCHY_REQUEST_ERR: Raised if a DocumentType node
-	 *                would be extracted into the new DocumentFragment. <br>
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public DocumentFragment cloneContents() throws DOMException {
-		// not supported
-		return null;
-	}
-
-	/**
-	 * Produces a new Range whose boundary-points are equal to the
-	 * boundary-points of the Range.
-	 * 
-	 * @return The duplicated Range.
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public Range cloneRange() throws DOMException {
-		return new RangeImpl(this);
-	}
-
-	/**
-	 * Collapse a Range onto one of its boundary-points
-	 * 
-	 * @param toStartIf
-	 *            TRUE, collapses the Range onto its start; if FALSE,
-	 *            collapses it onto its end.
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public void collapse(boolean toStart) throws DOMException {
-		if (toStart) {
-			this.endContainer = this.startContainer;
-			this.endOffset = this.startOffset;
-		} else {
-			this.startContainer = this.endContainer;
-			this.startOffset = this.endOffset;
-		}
-	}
-
-	/**
-	 * Compare the boundary-points of two Ranges in a document.
-	 * 
-	 * @param howA
-	 *            code representing the type of comparison, as defined above.
-	 * @param sourceRangeThe
-	 *            <code>Range</code> on which this current
-	 *            <code>Range</code> is compared to.
-	 * @return -1, 0 or 1 depending on whether the corresponding
-	 *         boundary-point of the Range is respectively before, equal to,
-	 *         or after the corresponding boundary-point of
-	 *         <code>sourceRange</code>.
-	 * @exception DOMException
-	 *                WRONG_DOCUMENT_ERR: Raised if the two Ranges are not in
-	 *                the same Document or DocumentFragment. <br>
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public short compareBoundaryPoints(short how, Range sourceRange) throws DOMException {
-		if (sourceRange == null)
-			return (short) 0; // error
-
-		Node container1 = null;
-		int offset1 = 0;
-		Node container2 = null;
-		int offset2 = 0;
-
-		switch (how) {
-			case START_TO_START :
-				container1 = this.startContainer;
-				offset1 = this.startOffset;
-				container2 = sourceRange.getStartContainer();
-				offset2 = sourceRange.getStartOffset();
-				break;
-			case START_TO_END :
-				container1 = this.startContainer;
-				offset1 = this.startOffset;
-				container2 = sourceRange.getEndContainer();
-				offset2 = sourceRange.getEndOffset();
-				break;
-			case END_TO_END :
-				container1 = this.endContainer;
-				offset1 = this.endOffset;
-				container2 = sourceRange.getEndContainer();
-				offset2 = sourceRange.getEndOffset();
-				break;
-			case END_TO_START :
-				container1 = this.endContainer;
-				offset1 = this.endOffset;
-				container2 = sourceRange.getStartContainer();
-				offset2 = sourceRange.getStartOffset();
-				break;
-			default :
-				return (short) 0; // error
-		}
-
-		return comparePoints(container1, offset1, container2, offset2);
-	}
-
-	/*
-	 */
-	protected short comparePoints(Node container1, int offset1, Node container2, int offset2) {
-		if (container1 == null || container2 == null)
-			return (short) 0; // error
-
-		if (container1 == container2) {
-			if (offset1 > offset2)
-				return (short) 1;
-			if (offset1 < offset2)
-				return (short) -1;
-			return 0;
-		}
-
-		// get node offsets
-		IDOMNode node1 = null;
-		if (container1.hasChildNodes()) {
-			Node child = container1.getFirstChild();
-			for (int i = 0; i < offset1; i++) {
-				Node next = child.getNextSibling();
-				if (next == null)
-					break;
-				child = next;
-			}
-			node1 = (IDOMNode) child;
-			offset1 = 0;
-		} else {
-			node1 = (IDOMNode) container1;
-		}
-		int nodeOffset1 = node1.getStartOffset();
-		IDOMNode node2 = null;
-		if (container2.hasChildNodes()) {
-			Node child = container2.getFirstChild();
-			for (int i = 0; i < offset2; i++) {
-				Node next = child.getNextSibling();
-				if (next == null)
-					break;
-				child = next;
-			}
-			node2 = (IDOMNode) child;
-			offset2 = 0;
-		} else {
-			node2 = (IDOMNode) container1;
-		}
-		int nodeOffset2 = node2.getStartOffset();
-
-		if (nodeOffset1 > nodeOffset2)
-			return (short) 1;
-		if (nodeOffset1 < nodeOffset2)
-			return (short) -1;
-		if (offset1 > offset2)
-			return (short) 1;
-		if (offset1 < offset2)
-			return (short) -1;
-		return (short) 0;
-	}
-
-	/**
-	 * Removes the contents of a Range from the containing document or
-	 * document fragment without returning a reference to the removed content.
-	 * 
-	 * @exception DOMException
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of
-	 *                the content of the Range is read-only or any of the
-	 *                nodes that contain any of the content of the Range are
-	 *                read-only. <br>
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public void deleteContents() throws DOMException {
-		// not supported
-	}
-
-	/**
-	 * Called to indicate that the Range is no longer in use and that the
-	 * implementation may relinquish any resources associated with this Range.
-	 * Subsequent calls to any methods or attribute getters on this Range will
-	 * result in a <code>DOMException</code> being thrown with an error code
-	 * of <code>INVALID_STATE_ERR</code>.
-	 * 
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public void detach() throws DOMException {
-		this.startContainer = null;
-		this.startOffset = 0;
-		this.endContainer = null;
-		this.endOffset = 0;
-	}
-
-	/**
-	 * Moves the contents of a Range from the containing document or document
-	 * fragment to a new DocumentFragment.
-	 * 
-	 * @return A DocumentFragment containing the extracted contents.
-	 * @exception DOMException
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of
-	 *                the content of the Range is read-only or any of the
-	 *                nodes which contain any of the content of the Range are
-	 *                read-only. <br>
-	 *                HIERARCHY_REQUEST_ERR: Raised if a DocumentType node
-	 *                would be extracted into the new DocumentFragment. <br>
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public DocumentFragment extractContents() throws DOMException {
-		// not supported
-		return null;
-	}
-
-	/**
-	 * TRUE if the Range is collapsed
-	 * 
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public boolean getCollapsed() throws DOMException {
-		if (this.startContainer == this.endContainer && this.startOffset == this.endOffset)
-			return true;
-		return false;
-	}
-
-	/**
-	 * The deepest common ancestor container of the Range's two
-	 * boundary-points.
-	 * 
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public Node getCommonAncestorContainer() throws DOMException {
-		if (this.startContainer == null)
-			return null;
-		return ((NodeImpl) this.startContainer).getCommonAncestor(this.endContainer);
-	}
-
-	/**
-	 * Node within which the Range ends
-	 * 
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public Node getEndContainer() throws DOMException {
-		return this.endContainer;
-	}
-
-	/**
-	 * Offset within the ending node of the Range.
-	 * 
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public int getEndOffset() throws DOMException {
-		return this.endOffset;
-	}
-
-	/**
-	 * Node within which the Range begins
-	 * 
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public Node getStartContainer() throws DOMException {
-		return this.startContainer;
-	}
-
-	/**
-	 * Offset within the starting node of the Range.
-	 * 
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public int getStartOffset() throws DOMException {
-		return this.startOffset;
-	}
-
-	/**
-	 * Inserts a node into the Document or DocumentFragment at the start of
-	 * the Range. If the container is a Text node, this will be split at the
-	 * start of the Range (as if the Text node's splitText method was
-	 * performed at the insertion point) and the insertion will occur between
-	 * the two resulting Text nodes. Adjacent Text nodes will not be
-	 * automatically merged. If the node to be inserted is a DocumentFragment
-	 * node, the children will be inserted rather than the DocumentFragment
-	 * node itself.
-	 * 
-	 * @param newNodeThe
-	 *            node to insert at the start of the Range
-	 * @exception DOMException
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor
-	 *                container of the start of the Range is read-only. <br>
-	 *                WRONG_DOCUMENT_ERR: Raised if <code>newNode</code> and
-	 *                the container of the start of the Range were not created
-	 *                from the same document. <br>
-	 *                HIERARCHY_REQUEST_ERR: Raised if the container of the
-	 *                start of the Range is of a type that does not allow
-	 *                children of the type of <code>newNode</code> or if
-	 *                <code>newNode</code> is an ancestor of the container.
-	 *                <br>
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 * @exception RangeException
-	 *                INVALID_NODE_TYPE_ERR: Raised if <code>newNode</code>
-	 *                is an Attr, Entity, Notation, or Document node.
-	 */
-	public void insertNode(Node newNode) throws RangeException, DOMException {
-		// not supported
-	}
-
-	/**
-	 * Select a node and its contents
-	 * 
-	 * @param refNodeThe
-	 *            node to select.
-	 * @exception RangeException
-	 *                INVALID_NODE_TYPE_ERR: Raised if an ancestor of
-	 *                <code>refNode</code> is an Entity, Notation or
-	 *                DocumentType node or if <code>refNode</code> is a
-	 *                Document, DocumentFragment, Attr, Entity, or Notation
-	 *                node.
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public void selectNode(Node refNode) throws RangeException, DOMException {
-		if (refNode == null)
-			return;
-		Node parent = refNode.getParentNode();
-		if (parent == null)
-			return;
-		int index = ((NodeImpl) refNode).getIndex();
-		if (index < 0)
-			return;
-		setStart(parent, index);
-		setEnd(parent, index + 1);
-	}
-
-	/**
-	 * Select the contents within a node
-	 * 
-	 * @param refNodeNode
-	 *            to select from
-	 * @exception RangeException
-	 *                INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code>
-	 *                or an ancestor of <code>refNode</code> is an Entity,
-	 *                Notation or DocumentType node.
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public void selectNodeContents(Node refNode) throws RangeException, DOMException {
-		if (refNode == null)
-			return;
-		if (refNode.getNodeType() == Node.TEXT_NODE) {
-			Text text = (Text) refNode;
-			setStart(refNode, 0);
-			setEnd(refNode, text.getLength());
-		} else {
-			NodeList childNodes = refNode.getChildNodes();
-			int length = (childNodes != null ? childNodes.getLength() : 0);
-			setStart(refNode, 0);
-			setEnd(refNode, length);
-		}
-	}
-
-	/**
-	 * Sets the attributes describing the end of a Range.
-	 * 
-	 * @param refNodeThe
-	 *            <code>refNode</code> value. This parameter must be
-	 *            different from <code>null</code>.
-	 * @param offsetThe
-	 *            <code>endOffset</code> value.
-	 * @exception RangeException
-	 *                INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code>
-	 *                or an ancestor of <code>refNode</code> is an Entity,
-	 *                Notation, or DocumentType node.
-	 * @exception DOMException
-	 *                INDEX_SIZE_ERR: Raised if <code>offset</code> is
-	 *                negative or greater than the number of child units in
-	 *                <code>refNode</code>. Child units are 16-bit units if
-	 *                <code>refNode</code> is a type of CharacterData node
-	 *                (e.g., a Text or Comment node) or a
-	 *                ProcessingInstruction node. Child units are Nodes in all
-	 *                other cases. <br>
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public void setEnd(Node refNode, int offset) throws RangeException, DOMException {
-		this.endContainer = refNode;
-		this.endOffset = offset;
-	}
-
-	/**
-	 * Sets the end of a Range to be after a node
-	 * 
-	 * @param refNodeRange
-	 *            ends after <code>refNode</code>.
-	 * @exception RangeException
-	 *                INVALID_NODE_TYPE_ERR: Raised if the root container of
-	 *                <code>refNode</code> is not an Attr, Document or
-	 *                DocumentFragment node or if <code>refNode</code> is a
-	 *                Document, DocumentFragment, Attr, Entity, or Notation
-	 *                node.
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public void setEndAfter(Node refNode) throws RangeException, DOMException {
-		if (refNode == null)
-			return;
-		Node parent = refNode.getParentNode();
-		if (parent == null)
-			return;
-		int index = ((NodeImpl) refNode).getIndex();
-		if (index < 0)
-			return;
-		setEnd(parent, index + 1);
-	}
-
-	/**
-	 * Sets the end position to be before a node.
-	 * 
-	 * @param refNodeRange
-	 *            ends before <code>refNode</code>
-	 * @exception RangeException
-	 *                INVALID_NODE_TYPE_ERR: Raised if the root container of
-	 *                <code>refNode</code> is not an Attr, Document, or
-	 *                DocumentFragment node or if <code>refNode</code> is a
-	 *                Document, DocumentFragment, Attr, Entity, or Notation
-	 *                node.
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public void setEndBefore(Node refNode) throws RangeException, DOMException {
-		if (refNode == null)
-			return;
-		Node parent = refNode.getParentNode();
-		if (parent == null)
-			return;
-		int index = ((NodeImpl) refNode).getIndex();
-		if (index < 0)
-			return;
-		setEnd(parent, index);
-	}
-
-	/**
-	 * Sets the attributes describing the start of the Range.
-	 * 
-	 * @param refNodeThe
-	 *            <code>refNode</code> value. This parameter must be
-	 *            different from <code>null</code>.
-	 * @param offsetThe
-	 *            <code>startOffset</code> value.
-	 * @exception RangeException
-	 *                INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code>
-	 *                or an ancestor of <code>refNode</code> is an Entity,
-	 *                Notation, or DocumentType node.
-	 * @exception DOMException
-	 *                INDEX_SIZE_ERR: Raised if <code>offset</code> is
-	 *                negative or greater than the number of child units in
-	 *                <code>refNode</code>. Child units are 16-bit units if
-	 *                <code>refNode</code> is a type of CharacterData node
-	 *                (e.g., a Text or Comment node) or a
-	 *                ProcessingInstruction node. Child units are Nodes in all
-	 *                other cases. <br>
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public void setStart(Node refNode, int offset) throws RangeException, DOMException {
-		this.startContainer = refNode;
-		this.startOffset = offset;
-	}
-
-	/**
-	 * Sets the start position to be after a node
-	 * 
-	 * @param refNodeRange
-	 *            starts after <code>refNode</code>
-	 * @exception RangeException
-	 *                INVALID_NODE_TYPE_ERR: Raised if the root container of
-	 *                <code>refNode</code> is not an Attr, Document, or
-	 *                DocumentFragment node or if <code>refNode</code> is a
-	 *                Document, DocumentFragment, Attr, Entity, or Notation
-	 *                node.
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public void setStartAfter(Node refNode) throws RangeException, DOMException {
-		if (refNode == null)
-			return;
-		Node parent = refNode.getParentNode();
-		if (parent == null)
-			return;
-		int index = ((NodeImpl) refNode).getIndex();
-		if (index < 0)
-			return;
-		setStart(parent, index + 1);
-	}
-
-	/**
-	 * Sets the start position to be before a node
-	 * 
-	 * @param refNodeRange
-	 *            starts before <code>refNode</code>
-	 * @exception RangeException
-	 *                INVALID_NODE_TYPE_ERR: Raised if the root container of
-	 *                <code>refNode</code> is not an Attr, Document, or
-	 *                DocumentFragment node or if <code>refNode</code> is a
-	 *                Document, DocumentFragment, Attr, Entity, or Notation
-	 *                node.
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public void setStartBefore(Node refNode) throws RangeException, DOMException {
-		if (refNode == null)
-			return;
-		Node parent = refNode.getParentNode();
-		if (parent == null)
-			return;
-		int index = ((NodeImpl) refNode).getIndex();
-		if (index < 0)
-			return;
-		setStart(parent, index);
-	}
-
-	/**
-	 * Reparents the contents of the Range to the given node and inserts the
-	 * node at the position of the start of the Range.
-	 * 
-	 * @param newParentThe
-	 *            node to surround the contents with.
-	 * @exception DOMException
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor
-	 *                container of either boundary-point of the Range is
-	 *                read-only. <br>
-	 *                WRONG_DOCUMENT_ERR: Raised if <code> newParent</code>
-	 *                and the container of the start of the Range were not
-	 *                created from the same document. <br>
-	 *                HIERARCHY_REQUEST_ERR: Raised if the container of the
-	 *                start of the Range is of a type that does not allow
-	 *                children of the type of <code>newParent</code> or if
-	 *                <code>newParent</code> is an ancestor of the container
-	 *                or if <code>node</code> would end up with a child node
-	 *                of a type not allowed by the type of <code>node</code>.
-	 *                <br>
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 * @exception RangeException
-	 *                BAD_BOUNDARYPOINTS_ERR: Raised if the Range partially
-	 *                selects a non-text node. <br>
-	 *                INVALID_NODE_TYPE_ERR: Raised if <code> node</code> is
-	 *                an Attr, Entity, DocumentType, Notation, Document, or
-	 *                DocumentFragment node.
-	 */
-	public void surroundContents(Node newParent) throws RangeException, DOMException {
-		// not supported
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ReadOnlyController.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ReadOnlyController.java
deleted file mode 100644
index f80e718..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ReadOnlyController.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Node;
-
-
-class ReadOnlyController {
-
-	class Span {
-		int length;
-		int offset;
-
-		Span(int offset, int length) {
-			this.offset = offset;
-			this.length = length;
-		}
-	}
-
-	private static ReadOnlyController fInstance;
-
-	static synchronized ReadOnlyController getInstance() {
-		if (fInstance == null) {
-			fInstance = new ReadOnlyController();
-		}
-		return fInstance;
-	}
-
-	static private void lock(IStructuredDocument doc, int offset, int length, boolean canInsertBefore, boolean canInsertAfter) {
-		if (doc == null) {
-			return;
-		}
-		if (doc instanceof BasicStructuredDocument) {
-			((BasicStructuredDocument)doc).makeReadOnly(offset, length, canInsertBefore, canInsertAfter);
-		} else {
-			doc.makeReadOnly(offset, length);
-		}
-	}
-
-	static private void lock(IStructuredDocumentRegion node, boolean canInsertBefore, boolean canInsertAfter) {
-		if (node == null) {
-			return;
-		}
-		IStructuredDocument doc = node.getParentDocument();
-		if (doc == null) {
-			return;
-		}
-		if (doc instanceof BasicStructuredDocument) {
-			((BasicStructuredDocument)doc).makeReadOnly(node.getStart(), node.getLength(), canInsertBefore, canInsertAfter);
-		} else {
-			doc.makeReadOnly(node.getStart(), node.getLength());
-		}
-	}
-
-	static private void unlock(IStructuredDocumentRegion node) {
-		if (node == null) {
-			return;
-		}
-		IStructuredDocument doc = node.getParentDocument();
-		if (doc == null) {
-			return;
-		}
-		doc.clearReadOnly(node.getStart(), node.getLength());
-	}
-
-	private ReadOnlyController() {
-		super();
-	}
-
-	private Span getDataSpan(IDOMNode node) {
-		switch (node.getNodeType()) {
-			case Node.ELEMENT_NODE :
-				return getDataSpanForElement((IDOMElement) node);
-			case Node.TEXT_NODE :
-				return getDataSpanForText((IDOMText) node);
-			default :
-				return new Span(0, -1);
-		}
-	}
-
-	private Span getDataSpanForElement(IDOMElement node) {
-		IStructuredDocumentRegion docRegion = node.getStartStructuredDocumentRegion();
-		if (docRegion == null) {
-			return new Span(0, -1);
-		}
-
-		ITextRegionList regions = docRegion.getRegions();
-		if (regions == null) {
-			return new Span(0, -1);
-		}
-
-		String startType;
-		String endType;
-		if (node.isCommentTag()) {
-			startType = DOMRegionContext.XML_COMMENT_OPEN;
-			endType = DOMRegionContext.XML_COMMENT_CLOSE;
-		} else {
-			startType = DOMRegionContext.XML_TAG_NAME;
-			endType = DOMRegionContext.XML_TAG_CLOSE;
-		}
-
-		int startOffset = -1;
-		int endOffset = -1;
-		ITextRegion prevRegion = null;
-		ITextRegion region;
-		for (int i = 0; i < regions.size(); i++) {
-			region = regions.get(i);
-			String type = region.getType();
-			if (type == startType) {
-				startOffset = region.getEnd();
-			} else if (type == endType && prevRegion != null) {
-				endOffset = prevRegion.getTextEnd();
-			}
-			prevRegion = region;
-		}
-
-		if (0 <= startOffset && 0 <= endOffset) {
-			return new Span(startOffset, endOffset - startOffset);
-		} else {
-			return new Span(0, -1);
-		}
-	}
-
-	private Span getDataSpanForText(IDOMText node) {
-		IStructuredDocumentRegion docRegion = ((NodeImpl) node).getStructuredDocumentRegion();
-		if (docRegion == null) {
-			return new Span(0, -1);
-		}
-		return new Span(0, docRegion.getLength());
-	}
-
-	/**
-	 * This method is used from parent's setChildEditable()
-	 * 
-	 * case 1:<parent><node attr="value"/> <node2></parent>
-	 * x####################x case 2:<parent><node attr="value"> <child>
-	 * </child> </node> </parent> x###################? ?#######x (? :
-	 * editable if node.isEditable() == true)
-	 */
-	void lockBoth(IDOMNode node) {
-		if (node == null) {
-			return;
-		}
-
-		IStructuredDocumentRegion flatNode;
-		boolean canInsert = false;
-
-		// end node (element)
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			flatNode = node.getEndStructuredDocumentRegion();
-			if (flatNode != null) {
-				canInsert = node.isChildEditable();
-				lock(flatNode, canInsert, false);
-			}
-		}
-		// start node
-		flatNode = node.getStartStructuredDocumentRegion();
-		if (flatNode != null) {
-			lock(flatNode, false, canInsert);
-		}
-	}
-
-	void lockData(IDOMNode node) {
-		if (node == null) {
-			return;
-		}
-
-		Span span = getDataSpan(node);
-		if (0 <= span.length) {
-			lock(node.getModel().getStructuredDocument(), node.getStartOffset() + span.offset, span.length, false, false);
-		}
-	}
-
-	/**
-	 * lock itself and all descendants
-	 */
-	void lockDeep(IDOMNode node) {
-		if (node == null) {
-			return;
-		}
-
-		int offset = node.getStartOffset();
-		int length = node.getEndOffset() - offset;
-
-		boolean canInsert = true;
-		IDOMNode parent = (IDOMNode) node.getParentNode();
-		if (parent != null && !parent.isChildEditable()) {
-			canInsert = false;
-		}
-		lock(node.getStructuredDocument(), offset, length, canInsert, canInsert);
-	}
-
-	/**
-	 * This method is used from parent's setChildEditable()
-	 * 
-	 * case 1:<parent><node attr="value"/> <node2></parent> x######x x##x
-	 * case 2:<parent><node attr="value"> <child></child> </node> </parent>
-	 * x######x x#? ?#######x (? : editable if node.isEditable() == true)
-	 */
-	void lockNode(IDOMNode node) {
-		if (node == null) {
-			return;
-		}
-		if (!node.isDataEditable()) {
-			lockBoth(node);
-			return;
-		}
-
-		IStructuredDocumentRegion flatNode;
-		boolean canInsert = false;
-
-		// end node (element)
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			flatNode = node.getEndStructuredDocumentRegion();
-			if (flatNode != null) {
-				canInsert = node.isChildEditable();
-				lock(flatNode, canInsert, false);
-			}
-		}
-		// start node
-		flatNode = node.getStartStructuredDocumentRegion();
-		if (flatNode != null) {
-			Span span = getDataSpan(node);
-			if (0 <= span.length) {
-				IStructuredDocument structuredDocument = flatNode.getParentDocument();
-				int offset, length;
-				offset = flatNode.getStart();
-				length = span.offset;
-				lock(structuredDocument, offset, length, false, false);
-				offset = offset + span.offset + span.length;
-				length = flatNode.getEnd() - offset;
-				lock(structuredDocument, offset, length, canInsert, false);
-			} else {
-				lock(flatNode, false, canInsert);
-			}
-		}
-	}
-
-	private void unlock(IStructuredDocument doc, int offset, int length) {
-		if (doc == null) {
-			return;
-		}
-		doc.clearReadOnly(offset, length);
-	}
-
-	void unlockBoth(IDOMNode node) {
-		if (node == null) {
-			return;
-		}
-
-		IStructuredDocumentRegion flatNode;
-		// start node
-		flatNode = node.getStartStructuredDocumentRegion();
-		if (flatNode != null) {
-			unlock(flatNode);
-		}
-		// end node
-		flatNode = node.getEndStructuredDocumentRegion();
-		if (flatNode != null) {
-			unlock(flatNode);
-		}
-	}
-
-	void unlockData(IDOMNode node) {
-		if (node == null) {
-			return;
-		}
-
-		Span span = getDataSpan(node);
-		if (0 <= span.length) {
-			unlock(node.getModel().getStructuredDocument(), span.offset, span.length);
-		}
-	}
-
-	void unlockDeep(IDOMNode node) {
-		if (node == null) {
-			return;
-		}
-
-		int offset = node.getStartOffset();
-		int length = node.getEndOffset() - offset;
-
-		unlock(node.getStructuredDocument(), offset, length);
-	}
-
-	void unlockNode(IDOMNode node) {
-		if (node == null) {
-			return;
-		}
-
-		IStructuredDocumentRegion flatNode;
-		// end node
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			flatNode = node.getEndStructuredDocumentRegion();
-			if (flatNode != null) {
-				unlock(flatNode);
-			}
-		}
-
-		// start node
-		flatNode = node.getStartStructuredDocumentRegion();
-		if (flatNode != null) {
-			if (node.isDataEditable()) {
-				unlock(flatNode);
-			} else {
-				Span span = getDataSpan(node);
-				if (span.length <= 0) {
-					unlock(flatNode);
-				} else {
-					IStructuredDocument structuredDocument = flatNode.getParentDocument();
-					int offset, length;
-					offset = flatNode.getStart();
-					length = span.offset - offset;
-					unlock(structuredDocument, offset, length);
-					offset = span.offset + span.length;
-					length = flatNode.getEnd() - span.offset;
-					unlock(structuredDocument, offset, length);
-				}
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/SourceValidator.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/SourceValidator.java
deleted file mode 100644
index 66dd565..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/SourceValidator.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLCharEntity;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-/**
- */
-public class SourceValidator {
-
-	private NodeImpl node = null;
-
-	/**
-	 */
-	public SourceValidator(Node node) {
-		super();
-
-		if (node != null) {
-			this.node = (NodeImpl) node;
-		}
-	}
-
-	/**
-	 */
-	public String convertSource(String source) {
-		if (source == null)
-			return null;
-		if (this.node == null)
-			return null; // error
-
-		// setup conversion conditions
-		boolean acceptTag = false;
-		boolean acceptClose = false;
-		boolean acceptQuote = false;
-		boolean acceptAmpersand = false;
-		boolean acceptEntityRef = true;
-		boolean acceptJSPEnd = true;
-		String endTagName = null;
-		if (this.node.getNodeType() == Node.ATTRIBUTE_NODE) {
-			IDOMDocument document = (IDOMDocument) this.node.getOwnerDocument();
-			if (document != null && document.isJSPType())
-				acceptTag = true;
-			if (acceptTag) {
-				Attr attr = (Attr) this.node;
-				ElementImpl element = (ElementImpl) attr.getOwnerElement();
-				if (element != null && element.isJSPTag())
-					acceptTag = false;
-			}
-			// if the source does not include single quote,
-			// double quote is valid
-			acceptQuote = (source.indexOf('\'') < 0);
-		} else if (this.node.getNodeType() == Node.TEXT_NODE) {
-			TextImpl text = (TextImpl) this.node;
-			if (text.isJSPContent()) {
-				int index = source.indexOf(JSPTag.TAG_CLOSE);
-				if (index < 0)
-					return source;
-				acceptTag = true;
-				acceptClose = true;
-				acceptQuote = true;
-				acceptAmpersand = true;
-				acceptJSPEnd = false;
-			} else if (text.isCDATAContent()) {
-				endTagName = text.getParentNode().getNodeName();
-				if (endTagName == null)
-					return null; // error
-				acceptTag = true;
-				acceptClose = true;
-				acceptQuote = true;
-				acceptAmpersand = true;
-			}
-		} else {
-			IDOMDocument document = null;
-			if (this.node.getNodeType() == Node.DOCUMENT_NODE) {
-				document = (IDOMDocument) this.node;
-			} else {
-				document = (IDOMDocument) this.node.getOwnerDocument();
-			}
-			if (document != null && document.isJSPType())
-				acceptTag = true;
-		}
-
-		StringBuffer buffer = null;
-		int copiedLength = 0;
-		int length = source.length();
-		for (int i = 0; i < length; i++) {
-			String ref = null;
-			char c = source.charAt(i);
-			switch (c) {
-				case '<' :
-					if (acceptTag) {
-						if (endTagName != null) {
-							if (!matchEndTag(source, i + 1, endTagName))
-								continue;
-						} else {
-							int skip = skipTag(source, i + 1);
-							if (skip >= 0) {
-								i += skip;
-								continue;
-							}
-						}
-						// invalid JSP tag
-					}
-					ref = IXMLCharEntity.LT_REF;
-					break;
-				case '>' :
-					if (acceptClose)
-						continue;
-					ref = IXMLCharEntity.GT_REF;
-					break;
-				case '&' :
-					if (acceptAmpersand)
-						continue;
-					if (acceptEntityRef) {
-						int skip = skipEntityRef(source, i + 1);
-						if (skip >= 0) {
-							i += skip;
-							continue;
-						}
-					}
-					ref = IXMLCharEntity.AMP_REF;
-					break;
-				case '"' :
-					if (acceptQuote)
-						continue;
-					ref = IXMLCharEntity.QUOT_REF;
-					break;
-				case '%' :
-					if (acceptJSPEnd)
-						continue;
-					if (source.charAt(i + 1) != '>')
-						continue;
-					i++;
-					ref = IXMLCharEntity.GT_REF;
-					break;
-				default :
-					continue;
-			}
-
-			if (ref != null) {
-				if (buffer == null) {
-					buffer = new StringBuffer(length + 8);
-				}
-				if (i > copiedLength) {
-					buffer.append(source.substring(copiedLength, i));
-				}
-				buffer.append(ref);
-				copiedLength = i + 1; // skip this character
-			}
-		}
-
-		if (buffer != null) {
-			if (copiedLength < length) {
-				buffer.append(source.substring(copiedLength, length));
-			}
-			return buffer.toString();
-		}
-		return source;
-	}
-
-	/**
-	 */
-	private final boolean matchEndTag(String source, int offset, String endTagName) {
-		if (source == null || endTagName == null)
-			return false;
-		int length = source.length();
-		if (offset < 0 || offset >= length)
-			return false;
-		if (source.charAt(offset) != '/')
-			return false;
-		offset++;
-		int end = offset + endTagName.length();
-		if (end > length)
-			return false;
-		return endTagName.equalsIgnoreCase(source.substring(offset, end));
-	}
-
-	/**
-	 */
-	private final int skipEntityRef(String source, int offset) {
-		if (source == null)
-			return -1;
-		if (offset < 0 || offset >= source.length())
-			return -1;
-		DocumentImpl document = (DocumentImpl) this.node.getOwnerDocument();
-		if (document == null)
-			return -1; // error
-
-		int end = source.indexOf(';', offset);
-		if (end < 0 || end == offset)
-			return -1;
-		String name = source.substring(offset, end);
-		if (name == null || document.getCharValue(name) == null)
-			return -1;
-		return (end + 1 - offset);
-	}
-
-	/**
-	 */
-	private final int skipTag(String source, int offset) {
-		if (source == null)
-			return -1;
-		if (offset < 0 || offset >= source.length())
-			return -1;
-
-		int end = offset;
-		if (source.charAt(offset) == '%') {
-			// JSP tag
-			int found = source.indexOf(JSPTag.TAG_CLOSE, offset + 1);
-			if (found < 0)
-				return -1; // invalid JSP tag
-			end = found + 2;
-		} else {
-			// normal tag
-			int found = source.indexOf('>', offset);
-			if (found < 0)
-				return -1; // invalid tag
-			end = found + 1;
-		}
-		return (end - offset);
-	}
-
-	/**
-	 */
-	public boolean validateSource(String source) throws InvalidCharacterException {
-		if (source == null)
-			return true;
-		if (this.node == null)
-			return false; // error
-		String message = null;
-
-		// setup validation conditions
-		boolean acceptTag = false;
-		boolean acceptClose = false;
-		boolean acceptQuote = true;
-		boolean acceptEntityRef = true;
-		String endTagName = null;
-		if (this.node.getNodeType() == Node.ATTRIBUTE_NODE) {
-			IDOMDocument document = (IDOMDocument) this.node.getOwnerDocument();
-			if (document != null && document.isJSPType())
-				acceptTag = true;
-			if (acceptTag) {
-				Attr attr = (Attr) this.node;
-				ElementImpl element = (ElementImpl) attr.getOwnerElement();
-				if (element != null && element.isJSPTag())
-					acceptTag = false;
-			}
-			// if the source does not include single quote,
-			// double quote is valid
-			acceptQuote = (source.indexOf('\'') < 0);
-		} else if (this.node.getNodeType() == Node.TEXT_NODE) {
-			TextImpl text = (TextImpl) this.node;
-			if (text.isJSPContent()) {
-				int index = source.indexOf(JSPTag.TAG_CLOSE);
-				if (index < 0)
-					return true;
-				message = XMLCoreMessages.Invalid_character_gt_fo_ERROR_;
-				throw new InvalidCharacterException(message, '>', index + 1);
-			} else if (text.isCDATAContent()) {
-				endTagName = text.getParentNode().getNodeName();
-				if (endTagName == null)
-					return false; // error
-				acceptTag = true;
-				acceptClose = true;
-			}
-		} else {
-			IDOMDocument document = null;
-			if (this.node.getNodeType() == Node.DOCUMENT_NODE) {
-				document = (IDOMDocument) this.node;
-			} else {
-				document = (IDOMDocument) this.node.getOwnerDocument();
-			}
-			if (document != null && document.isJSPType())
-				acceptTag = true;
-		}
-
-		char c = 0;
-		int length = source.length();
-		for (int i = 0; i < length; i++) {
-			c = source.charAt(i);
-			switch (c) {
-				case '<' :
-					if (acceptTag) {
-						if (endTagName != null) {
-							if (!matchEndTag(source, i + 1, endTagName))
-								continue;
-						} else {
-							int skip = skipTag(source, i + 1);
-							if (skip >= 0) {
-								i += skip;
-								continue;
-							}
-						}
-						// invalid tag
-					}
-					message = XMLCoreMessages.Invalid_character_lt_fo_ERROR_;
-					break;
-				case '>' :
-					if (acceptClose)
-						continue;
-					message = XMLCoreMessages.Invalid_character_gt_fo_ERROR_;
-					break;
-				case '&' :
-					if (acceptEntityRef) {
-						if (endTagName != null)
-							continue;
-						int skip = skipEntityRef(source, i + 1);
-						if (skip >= 0) {
-							i += skip;
-							continue;
-						}
-						// invalid entity reference
-					}
-					message = XMLCoreMessages.Invalid_character_amp_fo_ERROR_;
-					break;
-				case '"' :
-					if (acceptQuote)
-						continue;
-					message = XMLCoreMessages.Invalid_character__f_EXC_;
-					break;
-				default :
-					continue;
-			}
-
-			if (message != null) {
-				throw new InvalidCharacterException(message, c, i);
-			}
-		}
-
-		return true;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionChecker.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionChecker.java
deleted file mode 100644
index 547c8f3..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionChecker.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.io.IOException;
-import java.io.Writer;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Node;
-
-
-/**
- * This class is only for debug purpose.
- */
-public class StructuredDocumentRegionChecker {
-	String EOL = System.getProperty("line.separator"); //$NON-NLS-1$
-
-	private int offset = 0;
-	Writer testWriter = null;
-
-	/**
-	 */
-	public StructuredDocumentRegionChecker() {
-		super();
-	}
-
-	public StructuredDocumentRegionChecker(Writer writer) {
-		super();
-		testWriter = writer;
-	}
-
-	/**
-	 */
-	private void checkChildNodes(Node node) {
-		for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
-			checkNode(child);
-		}
-	}
-
-	/**
-	 */
-	public void checkModel(IDOMModel model) {
-		checkChildNodes(model.getDocument());
-	}
-
-	/**
-	 */
-	private void checkNode(Node node) {
-		checkStructuredDocumentRegion(((NodeImpl) node).getStructuredDocumentRegion());
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			checkChildNodes(node);
-			checkStructuredDocumentRegion(((ElementImpl) node).getEndStructuredDocumentRegion());
-		}
-	}
-
-	/**
-	 */
-	private void checkStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return;
-
-		if (flatNode instanceof StructuredDocumentRegionContainer) {
-			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
-			int n = container.getStructuredDocumentRegionCount();
-			for (int i = 0; i < n; i++) {
-				IStructuredDocumentRegion c = container.getStructuredDocumentRegion(i);
-				if (c == null) {
-					reportError("null"); //$NON-NLS-1$
-					continue;
-				}
-				checkStructuredDocumentRegion(c);
-			}
-			return;
-		}
-
-		int start = flatNode.getStart();
-		if (start < this.offset)
-			reportError("overwrap"); //$NON-NLS-1$
-		if (start > this.offset)
-			reportError("gap"); //$NON-NLS-1$
-		int end = flatNode.getEnd();
-		this.offset = end;
-
-		if (flatNode instanceof StructuredDocumentRegionProxy) {
-			StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
-			IStructuredDocumentRegion p = proxy.getStructuredDocumentRegion();
-			if (p == null) {
-				reportError("null"); //$NON-NLS-1$
-				return;
-			}
-			int s = p.getStart();
-			int e = p.getEnd();
-			if (s > start || e < end)
-				reportError("out"); //$NON-NLS-1$
-			if (s == start && e == end)
-				reportWarning("vain"); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 */
-	private void reportError(String message) {
-		String msg = "StructuredDocumentRegionChecker : error : " + message; //$NON-NLS-1$
-		if (testWriter != null) {
-			try {
-				testWriter.write(msg + EOL);
-			} catch (IOException e) {
-				e.printStackTrace();
-			}
-		} else {
-			System.out.println(msg);
-		}
-		throw new StructuredDocumentRegionManagementException();
-	}
-
-	/**
-	 */
-	private void reportWarning(String message) {
-		String msg = "StructuredDocumentRegionChecker : warning : " + message; //$NON-NLS-1$
-		if (testWriter != null) {
-			try {
-				testWriter.write(msg + EOL);
-			} catch (IOException e) {
-				e.printStackTrace();
-			}
-		} else {
-			System.out.println(msg);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionContainer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionContainer.java
deleted file mode 100644
index 1a53784..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionContainer.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Vector;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-
-
-class StructuredDocumentRegionContainer implements IStructuredDocumentRegion {
-
-	private Vector flatNodes = new Vector(2);
-
-	/**
-	 */
-	StructuredDocumentRegionContainer() {
-		super();
-	}
-
-
-	public void addRegion(ITextRegion aRegion) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
-	}
-
-	public void adjust(int i) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
-	}
-
-	public void adjustLength(int i) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
-	}
-
-	public void adjustStart(int i) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
-	}
-
-	public void adjustTextLength(int i) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
-	}
-
-	/**
-	 */
-	void appendStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return;
-		if (flatNode instanceof StructuredDocumentRegionContainer) {
-			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
-			if (container.getStructuredDocumentRegionCount() > 0) {
-				this.flatNodes.addAll(container.flatNodes);
-			}
-		}
-		else {
-			this.flatNodes.addElement(flatNode);
-		}
-	}
-
-	public boolean containsOffset(int i) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public boolean containsOffset(ITextRegion region, int i) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public void equatePositions(ITextRegion region) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
-	}
-
-	public ITextRegion getDeepestRegionAtCharacterOffset(int offset) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public int getEnd() {
-		IStructuredDocumentRegion last = getLastStructuredDocumentRegion();
-		if (last == null)
-			return 0;
-		return last.getEnd();
-	}
-
-	/**
-	 */
-	public int getEndOffset() {
-		return getEnd();
-	}
-
-	public int getEndOffset(ITextRegion containedRegion) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public ITextRegion getFirstRegion() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
-		if (this.flatNodes.isEmpty())
-			return null;
-		return (IStructuredDocumentRegion) this.flatNodes.elementAt(0);
-	}
-
-	/**
-	 */
-	public String getFullText() {
-		return getText();
-	}
-
-	/**
-	 */
-	public String getFullText(ITextRegion aRegion) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public String getFullText(String context) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public ITextRegion getLastRegion() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	IStructuredDocumentRegion getLastStructuredDocumentRegion() {
-		int size = this.flatNodes.size();
-		if (size == 0)
-			return null;
-		return (IStructuredDocumentRegion) this.flatNodes.elementAt(size - 1);
-	}
-
-	/** 
-	 */
-	public int getLength() {
-		return (getEnd() - getStart());
-	}
-
-	public IStructuredDocumentRegion getNext() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public int getNumberOfRegions() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public ITextRegionContainer getParent() {
-		return null;
-	}
-
-	public IStructuredDocument getParentDocument() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public IStructuredDocumentRegion getPrevious() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public ITextRegion getRegionAtCharacterOffset(int offset) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public ITextRegionList getRegions() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public int getStart() {
-		IStructuredDocumentRegion first = getFirstStructuredDocumentRegion();
-		if (first == null)
-			return 0;
-		return first.getStart();
-	}
-
-	/**
-	 */
-	public int getStartOffset() {
-		return getStart();
-	}
-
-	public int getStartOffset(ITextRegion containedRegion) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public IStructuredDocument getStructuredDocument() {
-		IStructuredDocumentRegion first = getFirstStructuredDocumentRegion();
-		if (first == null)
-			return null;
-		return first.getParentDocument();
-	}
-
-	/**
-	 */
-	IStructuredDocumentRegion getStructuredDocumentRegion(int index) {
-		if (index < 0 || index >= this.flatNodes.size())
-			return null;
-		return (IStructuredDocumentRegion) this.flatNodes.elementAt(index);
-	}
-
-	/**
-	 */
-	int getStructuredDocumentRegionCount() {
-		return this.flatNodes.size();
-	}
-
-	/**
-	 */
-	public String getText() {
-		int size = this.flatNodes.size();
-		if (size == 0)
-			return new String();
-		StringBuffer buffer = new StringBuffer();
-		for (int i = 0; i < size; i++) {
-			IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) this.flatNodes.elementAt(i);
-			if (flatNode == null)
-				continue;
-			buffer.append(flatNode.getText());
-		}
-		return buffer.toString();
-	}
-
-	/**
-	 */
-	public String getText(ITextRegion aRegion) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public String getText(String context) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public int getTextEnd() {
-		return getEnd();
-	}
-
-	/**
-	 */
-	public int getTextEndOffset() {
-		return getTextEnd();
-	}
-
-	public int getTextEndOffset(ITextRegion containedRegion) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 * The text length is equal to length if there is no white space at the
-	 * end of a region. Otherwise it is smaller than length.
-	 */
-	public int getTextLength() {
-		return (getTextEnd() - getStart());
-	}
-
-	/**
-	 */
-	public String getType() {
-		return "StructuredDocumentRegionContainer";//$NON-NLS-1$
-	}
-
-	/**
-	 */
-	void insertStructuredDocumentRegion(IStructuredDocumentRegion flatNode, int index) {
-		if (flatNode == null)
-			return;
-		if (index < 0)
-			return;
-		int size = this.flatNodes.size();
-		if (index > size)
-			return;
-		if (index == size) {
-			appendStructuredDocumentRegion(flatNode);
-			return;
-		}
-		this.flatNodes.insertElementAt(flatNode, index);
-	}
-
-	public boolean isEnded() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	IStructuredDocumentRegion removeStructuredDocumentRegion(int index) {
-		if (index < 0 || index >= this.flatNodes.size())
-			return null;
-		IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) this.flatNodes.elementAt(index);
-		this.flatNodes.removeElementAt(index);
-		return flatNode;
-	}
-
-	/**
-	 */
-	IStructuredDocumentRegion removeStructuredDocumentRegion(IStructuredDocumentRegion oldStructuredDocumentRegion) {
-		if (oldStructuredDocumentRegion == null)
-			return null;
-		int size = this.flatNodes.size();
-		for (int i = 0; i < size; i++) {
-			IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) this.flatNodes.elementAt(i);
-			if (flatNode == oldStructuredDocumentRegion) {
-				this.flatNodes.removeElementAt(i);
-				return flatNode;
-			}
-		}
-		return null; // not found
-	}
-
-	/**
-	 */
-	IStructuredDocumentRegion replaceStructuredDocumentRegion(IStructuredDocumentRegion flatNode, int index) {
-		if (flatNode == null)
-			return removeStructuredDocumentRegion(index);
-		if (index < 0 || index >= this.flatNodes.size())
-			return null;
-		IStructuredDocumentRegion oldStructuredDocumentRegion = (IStructuredDocumentRegion) this.flatNodes.elementAt(index);
-		this.flatNodes.setElementAt(flatNode, index);
-		return oldStructuredDocumentRegion;
-	}
-
-	public boolean sameAs(IStructuredDocumentRegion region, int shift) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public boolean sameAs(ITextRegion region, int shift) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public boolean sameAs(ITextRegion oldRegion, IStructuredDocumentRegion documentRegion, ITextRegion newRegion, int shift) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public void setEnded(boolean hasEnd) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public void setLength(int newLength) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public void setNext(IStructuredDocumentRegion newNext) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public void setParentDocument(IStructuredDocument document) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public void setPrevious(IStructuredDocumentRegion newPrevious) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public void setRegions(ITextRegionList embeddedRegions) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public void setStart(int newStart) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 * toString method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String toString() {
-		StringBuffer buffer = new StringBuffer();
-		buffer.append('{');
-		int count = getStructuredDocumentRegionCount();
-		for (int i = 0; i < count; i++) {
-			if (i != 0)
-				buffer.append(',');
-			IStructuredDocumentRegion flatNode = getStructuredDocumentRegion(i);
-			if (flatNode == null)
-				buffer.append("null");//$NON-NLS-1$
-			else
-				buffer.append(flatNode.toString());
-		}
-		buffer.append('}');
-		return buffer.toString();
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion flatnode, String changes, int start, int end) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-
-	public boolean isDeleted() {
-		// if someone "gets" these temp regions by
-		// accident, we'll always return "deleted".
-		return true;
-	}
-
-
-	public void setDeleted(boolean deleted) {
-		// do nothing
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionManagementException.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionManagementException.java
deleted file mode 100644
index 90fecbe..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionManagementException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-
-/**
- */
-public class StructuredDocumentRegionManagementException extends RuntimeException {
-
-	/**
-	 * Default <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * StructuredDocumentRegionManagementException constructor
-	 */
-	public StructuredDocumentRegionManagementException() {
-		super("IStructuredDocumentRegion management failed.");//$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionProxy.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionProxy.java
deleted file mode 100644
index cd11447..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionProxy.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-
-
-class StructuredDocumentRegionProxy implements IStructuredDocumentRegion {
-	private IStructuredDocumentRegion flatNode = null;
-	private int length = 0;
-
-	private int offset = 0;
-
-	/**
-	 */
-	StructuredDocumentRegionProxy() {
-		super();
-	}
-
-	/**
-	 */
-	StructuredDocumentRegionProxy(int offset, int length) {
-		super();
-
-		this.offset = offset;
-		this.length = length;
-	}
-
-	/**
-	 */
-	StructuredDocumentRegionProxy(int offset, int length, IStructuredDocumentRegion flatNode) {
-		super();
-
-		this.offset = offset;
-		this.length = length;
-		this.flatNode = flatNode;
-		if (this.flatNode != null)
-			this.offset -= this.flatNode.getStart();
-	}
-
-	public void addRegion(ITextRegion aRegion) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
-	}
-
-	public void adjust(int i) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
-	}
-
-	public void adjustLength(int i) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
-	}
-
-	public void adjustStart(int i) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
-	}
-
-	public void adjustTextLength(int i) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
-	}
-
-	public boolean containsOffset(int i) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public boolean containsOffset(ITextRegion region, int i) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public void equatePositions(ITextRegion region) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
-	}
-
-	public ITextRegion getDeepestRegionAtCharacterOffset(int offset) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public int getEnd() {
-		int flatNodeOffset = 0;
-		if (this.flatNode != null)
-			flatNodeOffset = this.flatNode.getStart();
-		return flatNodeOffset + this.offset + this.length;
-	}
-
-	public int getEndOffset() {
-		return getEnd();
-	}
-
-	public int getEndOffset(ITextRegion containedRegion) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public ITextRegion getFirstRegion() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public String getFullText() {
-		return getText();
-	}
-
-	public String getFullText(ITextRegion aRegion) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public String getFullText(String context) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public ITextRegion getLastRegion() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public int getLength() {
-		return this.length;
-	}
-
-	public IStructuredDocumentRegion getNext() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public int getNumberOfRegions() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	int getOffset() {
-		int flatNodeOffset = 0;
-		if (this.flatNode != null)
-			flatNodeOffset = this.flatNode.getStart();
-		return flatNodeOffset + this.offset;
-	}
-
-	/**
-	 */
-	public ITextRegionContainer getParent() {
-		return null;
-	}
-
-	public IStructuredDocument getParentDocument() {
-		return null;
-		// throw new Error("intentionally not implemented since should never
-		// be called");
-	}
-
-	public IStructuredDocumentRegion getPrevious() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public ITextRegion getRegionAtCharacterOffset(int offset) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public ITextRegionList getRegions() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public int getStart() {
-		int flatNodeOffset = 0;
-		if (this.flatNode != null)
-			flatNodeOffset = this.flatNode.getStart();
-		return flatNodeOffset + this.offset;
-	}
-
-	/**
-	 */
-	public int getStartOffset() {
-		return getStart();
-	}
-
-	public int getStartOffset(ITextRegion containedRegion) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public IStructuredDocument getStructuredDocument() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/** 
-	 */
-	IStructuredDocumentRegion getStructuredDocumentRegion() {
-		return this.flatNode;
-	}
-
-	/**
-	 */
-	public String getText() {
-		if (this.flatNode == null)
-			return new String();
-		String text = this.flatNode.getText();
-		if (text == null)
-			return new String();
-		int end = this.offset + this.length;
-		return text.substring(this.offset, end);
-	}
-
-	/**
-	 */
-	public String getText(ITextRegion aRegion) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public String getText(String context) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public int getTextEnd() {
-		return getEnd();
-	}
-
-	/**
-	 */
-	public int getTextEndOffset() {
-		return getTextEnd();
-	}
-
-	public int getTextEndOffset(ITextRegion containedRegion) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 * The text length is equal to length if there is no white space at the
-	 * end of a region. Otherwise it is smaller than length.
-	 */
-	public int getTextLength() {
-		return getLength();
-	}
-
-	/**
-	 */
-	public String getType() {
-		return "StructuredDocumentRegionProxy";//$NON-NLS-1$
-	}
-
-	public boolean isDeleted() {
-		// I'll assume never really needed here
-		return true;
-	}
-
-	public boolean isEnded() {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public boolean sameAs(IStructuredDocumentRegion region, int shift) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	public boolean sameAs(ITextRegion region, int shift) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public boolean sameAs(ITextRegion oldRegion, IStructuredDocumentRegion documentRegion, ITextRegion newRegion, int shift) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public void setDeleted(boolean deleted) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public void setEnded(boolean hasEnd) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 * had to make public, due to API transition.
-	 */
-	public void setLength(int length) {
-		this.length = length;
-	}
-
-	public void setNext(IStructuredDocumentRegion newNext) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	void setOffset(int offset) {
-		this.offset = offset;
-		if (this.flatNode != null)
-			this.offset -= this.flatNode.getStart();
-	}
-
-	public void setParentDocument(IStructuredDocument document) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public void setPrevious(IStructuredDocumentRegion newPrevious) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public void setRegions(ITextRegionList embeddedRegions) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	public void setStart(int newStart) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-
-	/**
-	 */
-	void setStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		if (this.flatNode != null)
-			this.offset += this.flatNode.getStart();
-		this.flatNode = flatNode;
-		if (this.flatNode != null)
-			this.offset -= flatNode.getStart();
-	}
-
-	/**
-	 * toString method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String toString() {
-		StringBuffer buffer = new StringBuffer();
-		buffer.append('[');
-		buffer.append(getStart());
-		buffer.append(',');
-		buffer.append(getEnd());
-		buffer.append(']');
-		buffer.append('(');
-		if (this.flatNode != null)
-			buffer.append(this.flatNode.toString());
-		else
-			buffer.append("null");//$NON-NLS-1$
-		buffer.append(')');
-		return buffer.toString();
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion flatnode, String changes, int start, int end) {
-		throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionUtil.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionUtil.java
deleted file mode 100644
index 4bd9b81..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionUtil.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- * Provides convenient functions to handle IStructuredDocumentRegion and
- * ITextRegion.
- */
-class StructuredDocumentRegionUtil {
-
-	/**
-	 * Extracts contents enclosed with quotes. Quotes may be double or single.
-	 */
-	static String getAttrValue(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		if (region == null)
-			return null;
-		if (flatNode == null)
-			return null;
-		String value = flatNode.getText(region);
-		if (value == null)
-			return null;
-		int length = value.length();
-		if (length == 0)
-			return value;
-		char firstChar = value.charAt(0);
-		if (firstChar == '"' || firstChar == '\'') {
-			if (length == 1)
-				return null;
-			if (value.charAt(length - 1) == firstChar)
-				length--;
-			return value.substring(1, length);
-		}
-		return value;
-	}
-
-	/**
-	 * Extracts the name without heading '&' and tailing ';'.
-	 */
-	static String getEntityRefName(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		if (region == null)
-			return null;
-		String ref = flatNode.getText(region);
-		int length = ref.length();
-		if (length == 0)
-			return ref;
-		int offset = 0;
-		if (ref.charAt(0) == '&')
-			offset = 1;
-		if (ref.charAt(length - 1) == ';')
-			length--;
-		if (offset >= length)
-			return null;
-		return ref.substring(offset, length);
-	}
-
-	/**
-	 * Returns the first region.
-	 */
-	static ITextRegion getFirstRegion(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return null;
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null || regions.size() == 0)
-			return null;
-		return regions.get(0);
-	}
-
-	/**
-	 * Returns the type of the first region.
-	 */
-	static String getFirstRegionType(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return DOMRegionContext.UNDEFINED;
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null || regions.size() == 0)
-			return DOMRegionContext.UNDEFINED;
-		ITextRegion region = regions.get(0);
-		return region.getType();
-	}
-
-	/**
-	 */
-	static IStructuredDocumentRegion getFirstStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return null;
-		if (flatNode instanceof StructuredDocumentRegionContainer) {
-			flatNode = ((StructuredDocumentRegionContainer) flatNode).getFirstStructuredDocumentRegion();
-		}
-		if (flatNode instanceof StructuredDocumentRegionProxy) {
-			flatNode = ((StructuredDocumentRegionProxy) flatNode).getStructuredDocumentRegion();
-		}
-		return flatNode;
-	}
-
-	/**
-	 * Returns the last region.
-	 */
-	static ITextRegion getLastRegion(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return null;
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null || regions.size() == 0)
-			return null;
-		return regions.get(regions.size() - 1);
-	}
-
-	/**
-	 * Returns the type of the first region.
-	 */
-	static String getLastRegionType(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return DOMRegionContext.UNDEFINED;
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null || regions.size() == 0)
-			return DOMRegionContext.UNDEFINED;
-		ITextRegion region = regions.get(regions.size() - 1);
-		return region.getType();
-	}
-
-	/**
-	 */
-	static IStructuredDocumentRegion getLastStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return null;
-		if (flatNode instanceof StructuredDocumentRegionContainer) {
-			flatNode = ((StructuredDocumentRegionContainer) flatNode).getLastStructuredDocumentRegion();
-		}
-		if (flatNode instanceof StructuredDocumentRegionProxy) {
-			flatNode = ((StructuredDocumentRegionProxy) flatNode).getStructuredDocumentRegion();
-		}
-		return flatNode;
-	}
-
-	/**
-	 */
-	static IStructuredDocumentRegion getStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return null;
-		if (flatNode instanceof StructuredDocumentRegionProxy) {
-			flatNode = ((StructuredDocumentRegionProxy) flatNode).getStructuredDocumentRegion();
-		}
-		return flatNode;
-	}
-
-	StructuredDocumentRegionUtil() {
-		super();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TagAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TagAdapter.java
deleted file mode 100644
index f49ff7b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TagAdapter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- */
-public interface TagAdapter extends INodeAdapter {
-
-	/**
-	 */
-	String getEndTag(IDOMElement element);
-
-	/**
-	 */
-	String getStartTag(IDOMElement element);
-
-	/**
-	 */
-	boolean isEndTag();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TextImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TextImpl.java
deleted file mode 100644
index d386910..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TextImpl.java
+++ /dev/null
@@ -1,1182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.w3c.dom.UserDataHandler;
-
-
-/**
- * TextImpl class
- */
-public class TextImpl extends CharacterDataImpl implements IDOMText {
-
-	/**
-	 */
-	private class StringPair {
-		private String fFirst = null;
-		private String fSecond = null;
-
-		StringPair(String first, String second) {
-			this.fFirst = first;
-			this.fSecond = second;
-		}
-
-		String getFirst() {
-			return this.fFirst;
-		}
-
-		String getSecond() {
-			return this.fSecond;
-		}
-	}
-
-	private String fSource = null;
-
-	/**
-	 * TextImpl constructor
-	 */
-	protected TextImpl() {
-		super();
-	}
-
-	/**
-	 * TextImpl constructor
-	 * 
-	 * @param that
-	 *            TextImpl
-	 */
-	protected TextImpl(TextImpl that) {
-		super(that);
-
-		if (that != null) {
-			this.fSource = that.getSource();
-		}
-	}
-
-	/**
-	 * appendData method
-	 * 
-	 * @param arg
-	 *            java.lang.String
-	 */
-	public void appendData(String arg) throws DOMException {
-		if (arg == null || arg.length() == 0)
-			return;
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		String newSource = getSource(arg);
-		if (newSource == null)
-			return;
-		String source = getSource();
-		if (source != null)
-			setTextSource(source + newSource);
-		else
-			setTextSource(newSource);
-	}
-
-	/**
-	 */
-	IStructuredDocumentRegion appendStructuredDocumentRegion(IStructuredDocumentRegion newStructuredDocumentRegion) {
-		if (newStructuredDocumentRegion == null)
-			return null;
-
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode == null) {
-			setStructuredDocumentRegion(newStructuredDocumentRegion);
-			return newStructuredDocumentRegion;
-		}
-
-		if (flatNode instanceof StructuredDocumentRegionContainer) {
-			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
-			container.appendStructuredDocumentRegion(newStructuredDocumentRegion);
-		}
-		else {
-			StructuredDocumentRegionContainer container = new StructuredDocumentRegionContainer();
-			container.appendStructuredDocumentRegion(flatNode);
-			container.appendStructuredDocumentRegion(newStructuredDocumentRegion);
-			setStructuredDocumentRegion(container);
-		}
-
-		return newStructuredDocumentRegion;
-	}
-
-	/**
-	 * appendText method
-	 * 
-	 * @param text
-	 *            org.w3c.dom.Text
-	 */
-	public void appendText(Text newText) {
-		if (newText == null)
-			return;
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		TextImpl text = (TextImpl) newText;
-		String newSource = text.getSource();
-		if (newSource == null || newSource.length() == 0)
-			return;
-		String source = getSource();
-		if (source != null)
-			setTextSource(source + newSource);
-		else
-			setTextSource(newSource);
-	}
-
-	/**
-	 * cloneNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param deep
-	 *            boolean
-	 */
-	public Node cloneNode(boolean deep) {
-		TextImpl cloned = new TextImpl(this);
-		notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
-		return cloned;
-	}
-
-	/**
-	 * deleteData method
-	 * 
-	 * @param offset
-	 *            int
-	 * @param count
-	 *            int
-	 */
-	public void deleteData(int offset, int count) throws DOMException {
-		if (count == 0)
-			return;
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-		if (count < 0 || offset < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-
-		String source = getSource();
-		if (source == null || source.length() == 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-		StringPair pair = substringSourceExcluded(source, offset, count);
-		if (pair == null)
-			return;
-		source = null;
-		String first = pair.getFirst();
-		if (first != null)
-			source = first;
-		String second = pair.getSecond();
-		if (second != null) {
-			if (source != null)
-				source += second;
-			else
-				source = second;
-		}
-		if (source == null)
-			source = new String(); // delete all
-		setTextSource(source);
-	}
-
-	/**
-	 * getData method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getData() throws DOMException {
-		if (this.fSource != null)
-			return getData(this.fSource);
-		String data = super.getData();
-		if (data != null)
-			return data;
-		return getData(getStructuredDocumentRegion());
-	}
-
-	/**
-	 */
-	private String getData(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return new String();
-
-		if (flatNode instanceof StructuredDocumentRegionContainer) {
-			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
-			int length = container.getLength();
-			if (length < 16)
-				length = 16; // default
-			StringBuffer buffer = new StringBuffer(length);
-			int count = container.getStructuredDocumentRegionCount();
-			for (int i = 0; i < count; i++) {
-				IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
-				String data = getData(content);
-				if (data == null)
-					continue;
-				buffer.append(data);
-			}
-			return buffer.toString();
-		}
-
-		if (flatNode instanceof StructuredDocumentRegionProxy) {
-			return flatNode.getText();
-		}
-
-		ITextRegion region = StructuredDocumentRegionUtil.getFirstRegion(flatNode);
-		if (region != null) {
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_ENTITY_REFERENCE || regionType == DOMRegionContext.XML_CHAR_REFERENCE) {
-				String name = StructuredDocumentRegionUtil.getEntityRefName(flatNode, region);
-				if (name != null) {
-					DocumentImpl document = (DocumentImpl) getOwnerDocument();
-					if (document != null) {
-						String value = document.getCharValue(name);
-						if (value != null)
-							return value;
-					}
-				}
-			}
-		}
-
-		return flatNode.getText();
-	}
-
-	/**
-	 * Returns data for the source
-	 */
-	private String getData(String source) {
-		if (source == null)
-			return null;
-		StringBuffer buffer = null;
-		int offset = 0;
-		int length = source.length();
-		int ref = source.indexOf('&');
-		while (ref >= 0) {
-			int end = source.indexOf(';', ref + 1);
-			if (end > ref + 1) {
-				String name = source.substring(ref + 1, end);
-				String value = getCharValue(name);
-				if (value != null) {
-					if (buffer == null)
-						buffer = new StringBuffer(length);
-					if (ref > offset)
-						buffer.append(source.substring(offset, ref));
-					buffer.append(value);
-					offset = end + 1;
-					ref = end;
-				}
-			}
-			ref = source.indexOf('&', ref + 1);
-		}
-		if (buffer == null)
-			return source;
-		if (length > offset)
-			buffer.append(source.substring(offset));
-		return buffer.toString();
-	}
-
-	/**
-	 * getFirstStructuredDocumentRegion method
-	 * 
-	 */
-	public IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
-		return StructuredDocumentRegionUtil.getFirstStructuredDocumentRegion(getStructuredDocumentRegion());
-	}
-
-	/**
-	 * getLastStructuredDocumentRegion method
-	 * 
-	 */
-	public IStructuredDocumentRegion getLastStructuredDocumentRegion() {
-		return StructuredDocumentRegionUtil.getLastStructuredDocumentRegion(getStructuredDocumentRegion());
-	}
-
-	/**
-	 * getNodeName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		return "#text";//$NON-NLS-1$
-	}
-
-	/**
-	 * getNodeType method
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return TEXT_NODE;
-	}
-
-	/**
-	 */
-	public String getSource() {
-		if (this.fSource != null)
-			return this.fSource;
-		String data = super.getData();
-		if (data != null && data.length() > 0) {
-			String source = getSource(data);
-			if (source != null)
-				return source;
-		}
-		return super.getSource();
-	}
-
-	/**
-	 * Returns source for the data
-	 */
-	private String getSource(String data) {
-		if (data == null)
-			return null;
-		IDOMModel model = getModel();
-		if (model == null)
-			return null; // error
-		ISourceGenerator generator = model.getGenerator();
-		if (generator == null)
-			return null; // error
-		return generator.generateTextData(this, data);
-	}
-
-	/**
-	 */
-	String getTextSource() {
-		return this.fSource;
-	}
-
-	/**
-	 */
-	public String getValueSource() {
-		return getSource();
-	}
-
-	/**
-	 */
-	boolean hasStructuredDocumentRegion(IStructuredDocumentRegion askedStructuredDocumentRegion) {
-		if (askedStructuredDocumentRegion == null)
-			return false;
-
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode == null)
-			return false;
-
-		if (flatNode == askedStructuredDocumentRegion)
-			return true;
-
-		if (flatNode instanceof StructuredDocumentRegionProxy) {
-			StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
-			if (proxy.getStructuredDocumentRegion() == askedStructuredDocumentRegion)
-				return true;
-			return false;
-		}
-
-		if (flatNode instanceof StructuredDocumentRegionContainer) {
-			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
-			int count = container.getStructuredDocumentRegionCount();
-			for (int i = 0; i < count; i++) {
-				IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
-				if (content == null)
-					continue;
-				if (content == askedStructuredDocumentRegion)
-					return true;
-				if (content instanceof StructuredDocumentRegionProxy) {
-					StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
-					if (proxy.getStructuredDocumentRegion() == askedStructuredDocumentRegion)
-						return true;
-				}
-			}
-			return false;
-		}
-
-		return false;
-	}
-
-	/**
-	 * insertData method
-	 * 
-	 * @param offset
-	 *            int
-	 * @param arg
-	 *            java.lang.String
-	 */
-	public void insertData(int offset, String arg) throws DOMException {
-		if (arg == null || arg.length() == 0)
-			return;
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-		if (offset < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-
-		String source = getSource();
-		if (source == null || source.length() == 0) {
-			if (offset > 0) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-			}
-			source = getSource(arg);
-			if (source != null)
-				setTextSource(source);
-			return;
-		}
-
-		StringPair pair = substringSourceExcluded(source, offset, 0);
-		if (pair == null)
-			return; // error
-		StringBuffer buffer = new StringBuffer(source.length() + arg.length());
-		String first = pair.getFirst();
-		if (first != null)
-			buffer.append(first);
-		source = getSource(arg);
-		if (source != null)
-			buffer.append(source);
-		String second = pair.getSecond();
-		if (second != null)
-			buffer.append(second);
-		setTextSource(buffer.toString());
-	}
-
-	/**
-	 */
-	IStructuredDocumentRegion insertStructuredDocumentRegion(IStructuredDocumentRegion newStructuredDocumentRegion, IStructuredDocumentRegion nextStructuredDocumentRegion) {
-		if (newStructuredDocumentRegion == null)
-			return null;
-		if (nextStructuredDocumentRegion == null)
-			return appendStructuredDocumentRegion(newStructuredDocumentRegion);
-
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode == null)
-			return null; // error
-
-		if (flatNode == nextStructuredDocumentRegion) {
-			StructuredDocumentRegionContainer container = new StructuredDocumentRegionContainer();
-			container.appendStructuredDocumentRegion(newStructuredDocumentRegion);
-			container.appendStructuredDocumentRegion(flatNode);
-			setStructuredDocumentRegion(container);
-			return newStructuredDocumentRegion;
-		}
-
-		if (flatNode instanceof StructuredDocumentRegionContainer) {
-			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
-			int count = container.getStructuredDocumentRegionCount();
-			for (int i = 0; i < count; i++) {
-				IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
-				if (content == nextStructuredDocumentRegion) {
-					container.insertStructuredDocumentRegion(newStructuredDocumentRegion, i);
-					return newStructuredDocumentRegion;
-				}
-			}
-			return null; // error
-		}
-
-		return null; // error
-	}
-
-	/**
-	 * insertText method
-	 * 
-	 * @param text
-	 *            org.w3c.dom.Text
-	 * @param offset
-	 *            int
-	 */
-	public void insertText(Text newText, int offset) throws DOMException {
-		if (newText == null)
-			return;
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-		TextImpl text = (TextImpl) newText;
-		String newSource = text.getSource();
-		if (newSource == null && newSource.length() == 0)
-			return;
-		if (offset < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-
-		String source = getSource();
-		if (source == null || source.length() == 0) {
-			if (offset > 0) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-			}
-			setTextSource(newSource);
-			return;
-		}
-
-		StringPair pair = substringSourceExcluded(source, offset, 0);
-		if (pair == null)
-			return; // error
-		StringBuffer buffer = new StringBuffer(source.length() + newSource.length());
-		String first = pair.getFirst();
-		if (first != null)
-			buffer.append(first);
-		buffer.append(newSource);
-		String second = pair.getSecond();
-		if (second != null)
-			buffer.append(second);
-		setTextSource(buffer.toString());
-	}
-
-	/**
-	 * isCDATAContent method
-	 * 
-	 * @return boolean
-	 */
-	public boolean isCDATAContent() {
-		Node parent = getParentNode();
-		if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE)
-			return false;
-		ElementImpl element = (ElementImpl) parent;
-		return element.isCDATAContainer();
-	}
-
-	/**
-	 */
-	public boolean isInvalid() {
-		return isInvalid(getStructuredDocumentRegion());
-	}
-
-	/**
-	 */
-	private boolean isInvalid(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return false;
-
-		if (flatNode instanceof StructuredDocumentRegionContainer) {
-			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
-			int count = container.getStructuredDocumentRegionCount();
-			for (int i = 0; i < count; i++) {
-				IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
-				if (isInvalid(content))
-					return true;
-			}
-			return false;
-		}
-
-		if (flatNode instanceof StructuredDocumentRegionProxy) {
-			StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
-			return isInvalid(proxy.getStructuredDocumentRegion());
-		}
-
-		String regionType = StructuredDocumentRegionUtil.getFirstRegionType(flatNode);
-		if (regionType != DOMRegionContext.XML_CONTENT && isNotNestedContent(regionType) && regionType != DOMRegionContext.XML_ENTITY_REFERENCE && regionType != DOMRegionContext.XML_CHAR_REFERENCE && regionType != DOMRegionContext.BLOCK_TEXT && regionType != DOMRegionContext.WHITE_SPACE) {
-			return true;
-		}
-
-		return false;
-	}
-
-	protected boolean isNotNestedContent(String regionType) {
-		boolean result = true;
-		return result;
-	}
-
-	/**
-	 */
-	boolean isSharingStructuredDocumentRegion(IStructuredDocumentRegion sharedStructuredDocumentRegion) {
-		if (sharedStructuredDocumentRegion == null)
-			return false;
-
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode == null)
-			return false;
-
-		if (flatNode == sharedStructuredDocumentRegion)
-			return false;
-
-		if (flatNode instanceof StructuredDocumentRegionProxy) {
-			StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
-			if (proxy.getStructuredDocumentRegion() == sharedStructuredDocumentRegion)
-				return true;
-			return false;
-		}
-
-		if (flatNode instanceof StructuredDocumentRegionContainer) {
-			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
-			int count = container.getStructuredDocumentRegionCount();
-			for (int i = 0; i < count; i++) {
-				IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
-				if (content == null)
-					continue;
-				if (content == sharedStructuredDocumentRegion)
-					return false;
-				if (content instanceof StructuredDocumentRegionProxy) {
-					StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
-					if (proxy.getStructuredDocumentRegion() == sharedStructuredDocumentRegion)
-						return true;
-				}
-			}
-			return false;
-		}
-
-		return false;
-	}
-
-	/**
-	 * Returns whether this text node contains <a
-	 * href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204#infoitem.character'>
-	 * element content whitespace</a>, often abusively called "ignorable
-	 * whitespace". The text node is determined to contain whitespace in
-	 * element content during the load of the document or if validation occurs
-	 * while using <code>Document.normalizeDocument()</code>.
-	 * 
-	 * @see DOM Level 3
-	 */
-	public boolean isElementContentWhitespace() {
-		return isWhitespace();
-	}
-
-	/**
-	 */
-	public boolean isWhitespace() {
-		String data = getData();
-		if (data == null)
-			return true;
-		int length = data.length();
-		for (int i = 0; i < length; i++) {
-			if (!Character.isWhitespace(data.charAt(i)))
-				return false;
-		}
-		return true;
-	}
-
-	/**
-	 */
-	IStructuredDocumentRegion removeStructuredDocumentRegion(IStructuredDocumentRegion oldStructuredDocumentRegion) {
-		if (oldStructuredDocumentRegion == null)
-			return null;
-
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode == null)
-			return null; // error
-
-		if (flatNode == oldStructuredDocumentRegion) {
-			setStructuredDocumentRegion(null);
-			return oldStructuredDocumentRegion;
-		}
-
-		if (flatNode instanceof StructuredDocumentRegionProxy) {
-			StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
-			if (proxy.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
-				// removed with proxy
-				setStructuredDocumentRegion(null);
-				return oldStructuredDocumentRegion;
-			}
-			return null; // error
-		}
-
-		if (flatNode instanceof StructuredDocumentRegionContainer) {
-			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
-			int count = container.getStructuredDocumentRegionCount();
-			for (int i = 0; i < count; i++) {
-				IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
-				if (content == oldStructuredDocumentRegion) {
-					container.removeStructuredDocumentRegion(i);
-					if (container.getStructuredDocumentRegionCount() == 1) {
-						// get back to single IStructuredDocumentRegion
-						setStructuredDocumentRegion(container.getStructuredDocumentRegion(0));
-					}
-					return oldStructuredDocumentRegion;
-				}
-
-				if (content instanceof StructuredDocumentRegionProxy) {
-					StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
-					if (proxy.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
-						// removed with proxy
-						container.removeStructuredDocumentRegion(i);
-						if (container.getStructuredDocumentRegionCount() == 1) {
-							// get back to single IStructuredDocumentRegion
-							setStructuredDocumentRegion(container.getStructuredDocumentRegion(0));
-						}
-						return oldStructuredDocumentRegion;
-					}
-				}
-			}
-			return null; // error
-		}
-
-		return null; // error
-	}
-
-	/**
-	 * replaceData method
-	 * 
-	 * @param offset
-	 *            int
-	 * @param count
-	 *            int
-	 * @param arg
-	 *            java.lang.String
-	 */
-	public void replaceData(int offset, int count, String arg) throws DOMException {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-		if (arg == null || arg.length() == 0) {
-			deleteData(offset, count);
-			return;
-		}
-		if (count == 0) {
-			insertData(offset, arg);
-			return;
-		}
-		if (offset < 0 || count < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-
-		String source = getSource();
-		if (source == null || source.length() == 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-
-		StringPair pair = substringSourceExcluded(source, offset, count);
-		if (pair == null)
-			return; // error
-		StringBuffer buffer = new StringBuffer(source.length() + arg.length());
-		String first = pair.getFirst();
-		if (first != null)
-			buffer.append(first);
-		source = getSource(arg);
-		if (source != null)
-			buffer.append(source);
-		String second = pair.getSecond();
-		if (second != null)
-			buffer.append(second);
-		setTextSource(buffer.toString());
-	}
-
-	/**
-	 */
-	IStructuredDocumentRegion replaceStructuredDocumentRegion(IStructuredDocumentRegion newStructuredDocumentRegion, IStructuredDocumentRegion oldStructuredDocumentRegion) {
-		if (oldStructuredDocumentRegion == null)
-			return null;
-		if (newStructuredDocumentRegion == null)
-			return removeStructuredDocumentRegion(oldStructuredDocumentRegion);
-
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode == null)
-			return null; // error
-
-		if (flatNode == oldStructuredDocumentRegion) {
-			setStructuredDocumentRegion(newStructuredDocumentRegion);
-			return oldStructuredDocumentRegion;
-		}
-
-		if (flatNode instanceof StructuredDocumentRegionProxy) {
-			StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
-			if (proxy.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
-				if (newStructuredDocumentRegion instanceof StructuredDocumentRegionProxy) {
-					// proxy must not be nested
-					setStructuredDocumentRegion(newStructuredDocumentRegion);
-				}
-				else {
-					proxy.setStructuredDocumentRegion(newStructuredDocumentRegion);
-				}
-				return oldStructuredDocumentRegion;
-			}
-			return null; // error
-		}
-
-		if (flatNode instanceof StructuredDocumentRegionContainer) {
-			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
-			int count = container.getStructuredDocumentRegionCount();
-			for (int i = 0; i < count; i++) {
-				IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
-				if (content == null)
-					continue; // error
-				if (content == oldStructuredDocumentRegion) {
-					container.replaceStructuredDocumentRegion(newStructuredDocumentRegion, i);
-					return oldStructuredDocumentRegion;
-				}
-
-				if (content instanceof StructuredDocumentRegionProxy) {
-					StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
-					if (proxy.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
-						if (newStructuredDocumentRegion instanceof StructuredDocumentRegionProxy) {
-							// proxy must not be nested
-							container.replaceStructuredDocumentRegion(newStructuredDocumentRegion, i);
-						}
-						else {
-							proxy.setStructuredDocumentRegion(newStructuredDocumentRegion);
-						}
-						return oldStructuredDocumentRegion;
-					}
-				}
-			}
-			return null; // error
-		}
-
-		return null; // error
-	}
-
-	/**
-	 */
-	void resetStructuredDocumentRegions() {
-		String source = getSource();
-		if (source != null && source.length() > 0)
-			this.fSource = source;
-		super.resetStructuredDocumentRegions();
-	}
-
-	/**
-	 * getData method
-	 * 
-	 * @return java.lang.String
-	 */
-	public void setData(String data) throws DOMException {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		this.fSource = null;
-		super.setData(data);
-	}
-
-	/**
-	 */
-	public void setSource(String source) throws InvalidCharacterException {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		SourceValidator validator = new SourceValidator(this);
-		if (validator.validateSource(source))
-			setTextSource(source);
-	}
-
-	/**
-	 */
-	void setStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		super.setStructuredDocumentRegion(flatNode);
-		if (flatNode != null)
-			this.fSource = null;
-	}
-
-	/**
-	 */
-	public void setTextSource(String source) {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		this.fSource = source;
-
-		notifyValueChanged();
-	}
-
-	/**
-	 */
-	public void setValueSource(String source) {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		SourceValidator validator = new SourceValidator(this);
-		setTextSource(validator.convertSource(source));
-	}
-
-	/**
-	 * splitText method
-	 * 
-	 * @return org.w3c.dom.Text
-	 * @param offset
-	 *            int
-	 */
-	public Text splitText(int offset) throws DOMException {
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-		if (offset < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-		int length = getLength();
-		if (offset > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-		Document document = getOwnerDocument();
-		if (document == null)
-			return null;
-
-		String source = null;
-		if (offset < length) {
-			int count = length - offset;
-			source = substringSource(offset, count);
-			deleteData(offset, count);
-		}
-		TextImpl text = (TextImpl) document.createTextNode(null);
-		if (source != null)
-			text.setTextSource(source);
-
-		Node parent = getParentNode();
-		if (parent != null)
-			parent.insertBefore(text, getNextSibling());
-
-		return text;
-	}
-
-	/**
-	 */
-	Text splitText(IStructuredDocumentRegion nextStructuredDocumentRegion) {
-		if (nextStructuredDocumentRegion == null)
-			return null;
-
-		IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
-		if (flatNode == null || !(flatNode instanceof StructuredDocumentRegionContainer))
-			return null; // error
-
-		StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
-		int count = container.getStructuredDocumentRegionCount();
-		int index = 0;
-		for (; index < count; index++) {
-			if (container.getStructuredDocumentRegion(index) == nextStructuredDocumentRegion)
-				break;
-		}
-		if (index >= count) {
-			// this is the case nextStructuredDocumentRegion is a new
-			// IStructuredDocumentRegion
-			// search gap by offset
-			int offset = nextStructuredDocumentRegion.getStart();
-			for (index = 0; index < count; index++) {
-				IStructuredDocumentRegion content = container.getStructuredDocumentRegion(index);
-				if (content == null)
-					continue; // error
-				if (content.getStart() >= offset)
-					break;
-			}
-			if (index >= count)
-				return null; // error
-		}
-		if (index == 0)
-			return this; // nothing to do
-
-		Document document = getOwnerDocument();
-		if (document == null)
-			return null; // error
-		Node parent = getParentNode();
-		if (parent == null)
-			return null; // error
-		TextImpl nextText = (TextImpl) document.createTextNode(null);
-		if (nextText == null)
-			return null; // error
-
-		for (; index < count; count--) {
-			nextText.appendStructuredDocumentRegion(container.removeStructuredDocumentRegion(index));
-		}
-
-		// normalize IStructuredDocumentRegion
-		if (index == 1) {
-			setStructuredDocumentRegion(container.getStructuredDocumentRegion(0));
-		}
-
-		parent.insertBefore(nextText, getNextSibling());
-		return nextText;
-	}
-
-	/**
-	 * Retruns data for the range
-	 */
-	private String substringData(String data, int offset, int count) throws DOMException {
-		// sure offset and count are non-negative
-		if (count == 0)
-			return new String();
-		if (data == null) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-		int length = data.length();
-		if (offset > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-		int end = offset + count;
-		if (end > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-		return data.substring(offset, end);
-	}
-
-	/**
-	 * Returns source for the range specified by: offset: data offset count:
-	 * data count
-	 */
-	private String substringSource(int offset, int count) throws DOMException {
-		// sure offset and count are non-negative
-		if (this.fSource != null)
-			return substringSource(this.fSource, offset, count);
-
-		String data = super.getData();
-		if (data != null && data.length() > 0) {
-			data = substringData(data, offset, count);
-			if (data == null)
-				return new String();
-			String source = getSource(data);
-			if (source != null)
-				return source;
-		}
-
-		return substringSource(getSource(), offset, count);
-	}
-
-	/**
-	 * Returns source for the range specified by: offset: data offset count:
-	 * data count
-	 */
-	private String substringSource(String source, int offset, int count) throws DOMException {
-		// sure offset and count are non-negative
-		if (count == 0)
-			return new String();
-		if (source == null) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-
-		int length = source.length();
-		int end = offset + count;
-
-		// find character reference
-		int ref = source.indexOf('&');
-		while (ref >= 0) {
-			if (ref >= end)
-				break;
-			int refEnd = source.indexOf(';', ref + 1);
-			if (refEnd > ref + 1) {
-				String name = source.substring(ref + 1, refEnd);
-				if (getCharValue(name) != null) {
-					// found, shift for source offsets
-					int refCount = refEnd - ref;
-					if (ref < offset)
-						offset += refCount;
-					if (ref < end)
-						end += refCount;
-					ref = refEnd;
-				}
-			}
-			ref = source.indexOf('&', ref + 1);
-		}
-
-		if (offset > length || end > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-
-		return source.substring(offset, end);
-	}
-
-	/**
-	 * Returns sources before and after the range specified by: offset: data
-	 * offset count: data count
-	 */
-	private StringPair substringSourceExcluded(String source, int offset, int count) throws DOMException {
-		// sure offset and count are non-negative
-		if (source == null) {
-			if (offset == 0 && count == 0)
-				return new StringPair(null, null);
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-
-		int length = source.length();
-		int end = offset + count;
-
-		// find character reference
-		int ref = source.indexOf('&');
-		while (ref >= 0) {
-			if (ref >= end)
-				break;
-			int refEnd = source.indexOf(';', ref + 1);
-			if (refEnd > ref + 1) {
-				String name = source.substring(ref + 1, refEnd);
-				if (getCharValue(name) != null) {
-					// found, shift for source offsets
-					int refCount = refEnd - ref;
-					if (ref < offset)
-						offset += refCount;
-					if (ref < end)
-						end += refCount;
-					ref = refEnd;
-				}
-			}
-			ref = source.indexOf('&', ref + 1);
-		}
-
-		if (offset > length || end > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
-		}
-
-		String first = (offset > 0 ? source.substring(0, offset) : null);
-		String second = (end < length ? source.substring(end, length) : null);
-		return new StringPair(first, second);
-	}
-
-	public String getWholeText() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Implemented in this version."); //$NON-NLS-1$
-	}
-    /**
-	 * Replaces the text of the current node and all logically-adjacent text
-	 * nodes with the specified text. All logically-adjacent text nodes are
-	 * removed including the current node unless it was the recipient of the
-	 * replacement text. <br>
-	 * This method returns the node which received the replacement text. The
-	 * returned node is:
-	 * <ul>
-	 * <li><code>null</code>, when the replacement text is the empty
-	 * string; </li>
-	 * <li>the current node, except when the current node is read-only; </li>
-	 * <li> a new <code>Text</code> node of the same type (
-	 * <code>Text</code> or <code>CDATASection</code>) as the current
-	 * node inserted at the location of the replacement. </li>
-	 * </ul>
-	 * <br>
-	 * For instance, in the above example calling
-	 * <code>replaceWholeText</code> on the <code>Text</code> node that
-	 * contains "bar" with "yo" in argument results in the following: <br>
-	 * Where the nodes to be removed are read-only descendants of an
-	 * <code>EntityReference</code>, the <code>EntityReference</code>
-	 * must be removed instead of the read-only nodes. If any
-	 * <code>EntityReference</code> to be removed has descendants that are
-	 * not <code>EntityReference</code>, <code>Text</code>, or
-	 * <code>CDATASection</code> nodes, the <code>replaceWholeText</code>
-	 * method must fail before performing any modification of the document,
-	 * raising a <code>DOMException</code> with the code
-	 * <code>NO_MODIFICATION_ALLOWED_ERR</code>. <br>
-	 * For instance, in the example below calling
-	 * <code>replaceWholeText</code> on the <code>Text</code> node that
-	 * contains "bar" fails, because the <code>EntityReference</code> node
-	 * "ent" contains an <code>Element</code> node which cannot be removed.
-	 * 
-	 * @param content
-	 *            The content of the replacing <code>Text</code> node.
-	 * @return The <code>Text</code> node created with the specified
-	 *         content.
-	 * @exception DOMException
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if one of the
-	 *                <code>Text</code> nodes being replaced is readonly.
-	 * @see DOM Level 3
-	 */
-    public Text replaceWholeText(String content)
-                                 throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented"); //$NON-NLS-1$
-    }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLGeneratorImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLGeneratorImpl.java
deleted file mode 100644
index 17c7eb9..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLGeneratorImpl.java
+++ /dev/null
@@ -1,735 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.xml.core.internal.commentelement.impl.CommentElementRegistry;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLCharEntity;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-
-/** 
- */
-public class XMLGeneratorImpl implements ISourceGenerator {
-	private static final String CDATA_CLOSE = "]]>";//$NON-NLS-1$
-	private static final String CDATA_OPEN = "<![CDATA[";//$NON-NLS-1$
-	private static final String COMMENT_CLOSE = "-->";//$NON-NLS-1$
-	private static final String COMMENT_OPEN = "<!--";//$NON-NLS-1$
-	private static final String DOCTYPE_OPEN = "<!DOCTYPE";//$NON-NLS-1$
-	private static final String EMPTY_CLOSE = " />";//$NON-NLS-1$
-	private static final String END_OPEN = "</";//$NON-NLS-1$
-
-	private static XMLGeneratorImpl instance = null;
-	private static final String PI_CLOSE = "?>";//$NON-NLS-1$
-	private static final String PI_OPEN = "<?";//$NON-NLS-1$
-	private static final String PUBLIC_ID = "PUBLIC";//$NON-NLS-1$
-	private static final String SSI_PREFIX = "ssi";//$NON-NLS-1$
-	//private static final String SSI_FEATURE = "SSI";//$NON-NLS-1$
-	private static final String SSI_TOKEN = "#";//$NON-NLS-1$
-	private static final String SYSTEM_ID = "SYSTEM";//$NON-NLS-1$
-	private static final String TAG_CLOSE = ">";//$NON-NLS-1$
-
-	/**
-	 */
-	public synchronized static ISourceGenerator getInstance() {
-		if (instance == null)
-			instance = new XMLGeneratorImpl();
-		return instance;
-	}
-
-	/**
-	 */
-	//private boolean isCommentTag(XMLElement element) {
-	//	if (element == null) return false;
-	//	DocumentImpl document = (DocumentImpl)element.getOwnerDocument();
-	//	if (document == null) return false;
-	//	DocumentTypeAdapter adapter = document.getDocumentTypeAdapter();
-	//	if (adapter == null) return false;
-	//	if (!adapter.hasFeature(SSI_FEATURE)) return false;
-	//	String prefix = element.getPrefix();
-	//	return (prefix != null && prefix.equals(SSI_PREFIX));
-	//}
-	/**
-	 * Helper to modify the tag name in sub-classes
-	 */
-	private static void setTagName(Element element, String tagName) {
-		if (element == null || tagName == null)
-			return;
-		((ElementImpl) element).setTagName(tagName);
-	}
-
-	/**
-	 * XMLModelGenerator constructor
-	 */
-	private XMLGeneratorImpl() {
-		super();
-	}
-
-	/**
-	 */
-	public String generateAttrName(Attr attr) {
-		if (attr == null)
-			return null;
-		String attrName = attr.getName();
-		if (attrName == null)
-			return null;
-		if (attrName.startsWith(JSPTag.TAG_OPEN)) {
-			if (!attrName.endsWith(JSPTag.TAG_CLOSE)) {
-				// close JSP
-				return (attrName + JSPTag.TAG_CLOSE);
-			}
-		}
-		if (((IDOMAttr) attr).isGlobalAttr() && CMNodeUtil.getAttributeDeclaration(attr) != null) {
-			switch (getAttrNameCase(attr)) {
-				case DocumentTypeAdapter.UPPER_CASE :
-					attrName = attrName.toUpperCase();
-					break;
-				case DocumentTypeAdapter.LOWER_CASE :
-					attrName = attrName.toLowerCase();
-					break;
-				default :
-					// ASIS_CASE
-					break;
-			}
-		}
-		return attrName;
-	}
-
-	/**
-	 */
-	public String generateAttrValue(Attr attr) {
-		return generateAttrValue(attr, (char) 0); // no quote preference
-	}
-
-	/**
-	 */
-	public String generateAttrValue(Attr attr, char quote) {
-		if (attr == null)
-			return null;
-		String name = attr.getName();
-		SourceValidator validator = new SourceValidator(attr);
-		String value = validator.convertSource(((IDOMNode) attr).getValueSource());
-		if (value == null || value.length() == 0) {
-			if (name != null && name.startsWith(JSPTag.TAG_OPEN))
-				return null;
-			if (isBooleanAttr(attr)) {
-				if (((AttrImpl) attr).isXMLAttr()) {
-					// generate the name as value
-					value = attr.getName();
-				} else {
-					// not to generate '=' and value for HTML boolean
-					return null;
-				}
-			}
-		}
-		return generateAttrValue(value, quote);
-	}
-
-	/**
-	 */
-	public String generateAttrValue(String value, char quote) {
-		// assume the valid is already validated not to include both quotes
-		if (quote == '"') {
-			if ((value != null) && (value.indexOf('"') >= 0))
-				quote = '\''; // force
-		} else if (quote == '\'') {
-			if ((value != null) && (value.indexOf('\'') >= 0))
-				quote = '"'; // force
-		} else { // no preference
-			if ((value != null) && (value.indexOf('"') < 0))
-				quote = '"';
-			else
-				quote = '\'';
-		}
-
-		int length = (value == null ? 0 : value.length());
-		StringBuffer buffer = new StringBuffer(length + 2);
-		buffer.append(quote);
-		if (value != null)
-			buffer.append(value);
-		buffer.append(quote);
-		return buffer.toString();
-	}
-
-	/**
-	 * generateCDATASection method
-	 * 
-	 * @return java.lang.String
-	 * @param comment
-	 *            org.w3c.dom.CDATASection
-	 */
-	public String generateCDATASection(CDATASection cdata) {
-		if (cdata == null)
-			return null;
-
-		String data = cdata.getData();
-		int length = (data != null ? data.length() : 0);
-		StringBuffer buffer = new StringBuffer(length + 16);
-		buffer.append(CDATA_OPEN);
-		if (data != null)
-			buffer.append(data);
-		buffer.append(CDATA_CLOSE);
-		return buffer.toString();
-	}
-
-	/**
-	 * generateChild method
-	 * 
-	 * @return java.lang.String
-	 * @param org.w3c.dom.Node
-	 */
-	public String generateChild(Node parentNode) {
-		if (parentNode == null)
-			return null;
-		if (!parentNode.hasChildNodes())
-			return null;
-
-		StringBuffer buffer = new StringBuffer();
-		for (Node child = parentNode.getFirstChild(); child != null; child = child.getNextSibling()) {
-			String childSource = generateSource(child);
-			if (childSource != null)
-				buffer.append(childSource);
-		}
-		return buffer.toString();
-	}
-
-	/**
-	 */
-	public String generateCloseTag(Node node) {
-		if (node == null)
-			return null;
-
-		switch (node.getNodeType()) {
-			case Node.ELEMENT_NODE : {
-				ElementImpl element = (ElementImpl) node;
-				if (element.isCommentTag()) {
-					if (element.isJSPTag())
-						return JSPTag.COMMENT_CLOSE;
-					return COMMENT_CLOSE;
-				}
-				if (element.isJSPTag())
-					return JSPTag.TAG_CLOSE;
-				if (element.isEmptyTag())
-					return EMPTY_CLOSE;
-				return TAG_CLOSE;
-			}
-			case Node.COMMENT_NODE : {
-				CommentImpl comment = (CommentImpl) node;
-				if (comment.isJSPTag())
-					return JSPTag.COMMENT_CLOSE;
-				return COMMENT_CLOSE;
-			}
-			case Node.DOCUMENT_TYPE_NODE :
-				return TAG_CLOSE;
-			case Node.PROCESSING_INSTRUCTION_NODE :
-				return PI_CLOSE;
-			case Node.CDATA_SECTION_NODE :
-				return CDATA_CLOSE;
-			default :
-				break;
-		}
-
-		return null;
-	}
-
-	/**
-	 * generateComment method
-	 * 
-	 * @return java.lang.String
-	 * @param comment
-	 *            org.w3c.dom.Comment
-	 */
-	public String generateComment(Comment comment) {
-		if (comment == null)
-			return null;
-
-		String data = comment.getData();
-		int length = (data != null ? data.length() : 0);
-		StringBuffer buffer = new StringBuffer(length + 8);
-		CommentImpl impl = (CommentImpl) comment;
-		if (!impl.isJSPTag())
-			buffer.append(COMMENT_OPEN);
-		else
-			buffer.append(JSPTag.COMMENT_OPEN);
-		if (data != null)
-			buffer.append(data);
-		if (!impl.isJSPTag())
-			buffer.append(COMMENT_CLOSE);
-		else
-			buffer.append(JSPTag.COMMENT_CLOSE);
-		return buffer.toString();
-	}
-
-	/**
-	 * generateDoctype method
-	 * 
-	 * @return java.lang.String
-	 * @param docType
-	 *            org.w3c.dom.DocumentType
-	 */
-	public String generateDoctype(DocumentType docType) {
-		if (docType == null)
-			return null;
-
-		String name = docType.getName();
-		int length = (name != null ? name.length() : 0);
-		StringBuffer buffer = new StringBuffer(length + 16);
-		buffer.append(DOCTYPE_OPEN);
-		buffer.append(' ');
-		if (name != null)
-			buffer.append(name);
-		DocumentTypeImpl dt = (DocumentTypeImpl) docType;
-		String publicID = dt.getPublicId();
-		String systemID = dt.getSystemId();
-		if (publicID != null) {
-			buffer.append(' ');
-			buffer.append(PUBLIC_ID);
-			buffer.append(' ');
-			buffer.append('"');
-			buffer.append(publicID);
-			buffer.append('"');
-			if (systemID != null) {
-				buffer.append(' ');
-				buffer.append('"');
-				buffer.append(systemID);
-				buffer.append('"');
-			}
-		} else {
-			if (systemID != null) {
-				buffer.append(' ');
-				buffer.append(SYSTEM_ID);
-				buffer.append(' ');
-				buffer.append('"');
-				buffer.append(systemID);
-				buffer.append('"');
-			}
-		}
-		buffer.append('>');
-		return buffer.toString();
-	}
-
-	/**
-	 * generateElement method
-	 * 
-	 * @return java.lang.String
-	 * @param element
-	 *            Element
-	 */
-	public String generateElement(Element element) {
-		if (element == null)
-			return null;
-
-		// if empty tag is preferrable, generate as empty tag
-		ElementImpl impl = (ElementImpl) element;
-		if (impl.preferEmptyTag())
-			impl.setEmptyTag(true);
-
-		StringBuffer buffer = new StringBuffer();
-		String startTag = generateStartTag(element);
-		if (startTag != null)
-			buffer.append(startTag);
-		String child = generateChild(element);
-		if (child != null)
-			buffer.append(child);
-		String endTag = generateEndTag(element);
-		if (endTag != null)
-			buffer.append(endTag);
-		return buffer.toString();
-	}
-
-	/**
-	 * generateEndTag method
-	 * 
-	 * @return java.lang.String
-	 * @param element
-	 *            org.w3c.dom.Element
-	 */
-	public String generateEndTag(Element element) {
-		if (element == null)
-			return null;
-
-		ElementImpl impl = (ElementImpl) element;
-
-		// first check if tag adapter exists
-		TagAdapter adapter = (TagAdapter) impl.getExistingAdapter(TagAdapter.class);
-		if (adapter != null) {
-			String endTag = adapter.getEndTag(impl);
-			if (endTag != null)
-				return endTag;
-		}
-
-		if (impl.isEmptyTag())
-			return null;
-		if (!impl.isContainer())
-			return null;
-		if (impl.isJSPTag())
-			return JSPTag.TAG_CLOSE;
-
-		String tagName = generateTagName(element);
-		int length = (tagName != null ? tagName.length() : 0);
-		StringBuffer buffer = new StringBuffer(length + 4);
-		buffer.append(END_OPEN);
-		if (tagName != null)
-			buffer.append(tagName);
-		buffer.append('>');
-		return buffer.toString();
-	}
-
-	/**
-	 * generateEntityRef method
-	 * 
-	 * @return java.lang.String
-	 * @param entityRef
-	 *            org.w3c.dom.EntityReference
-	 */
-	public String generateEntityRef(EntityReference entityRef) {
-		if (entityRef == null)
-			return null;
-
-		String name = entityRef.getNodeName();
-		int length = (name != null ? name.length() : 0);
-		StringBuffer buffer = new StringBuffer(length + 4);
-		buffer.append('&');
-		if (name != null)
-			buffer.append(name);
-		buffer.append(';');
-		return buffer.toString();
-	}
-
-	/**
-	 * generatePI method
-	 * 
-	 * @return java.lang.String
-	 * @param pi
-	 *            org.w3c.dom.ProcessingInstruction
-	 */
-	public String generatePI(ProcessingInstruction pi) {
-		if (pi == null)
-			return null;
-
-		String target = pi.getTarget();
-		String data = pi.getData();
-		int length = (target != null ? target.length() : 0);
-		if (data != null)
-			length += data.length();
-		StringBuffer buffer = new StringBuffer(length + 8);
-		buffer.append(PI_OPEN);
-		if (target != null)
-			buffer.append(target);
-		buffer.append(' ');
-		if (data != null)
-			buffer.append(data);
-		buffer.append(PI_CLOSE);
-		return buffer.toString();
-	}
-
-	/**
-	 * generateSource method
-	 * 
-	 * @return java.lang.String
-	 * @param node
-	 *            org.w3c.dom.Node
-	 */
-	public String generateSource(Node node) {
-		switch (node.getNodeType()) {
-			case Node.ELEMENT_NODE :
-				return generateElement((Element) node);
-			case Node.TEXT_NODE :
-				return generateText((Text) node);
-			case Node.COMMENT_NODE :
-				return generateComment((Comment) node);
-			case Node.DOCUMENT_TYPE_NODE :
-				return generateDoctype((DocumentType) node);
-			case Node.PROCESSING_INSTRUCTION_NODE :
-				return generatePI((ProcessingInstruction) node);
-			case Node.CDATA_SECTION_NODE :
-				return generateCDATASection((CDATASection) node);
-			case Node.ENTITY_REFERENCE_NODE :
-				return generateEntityRef((EntityReference) node);
-			default :
-				// DOCUMENT
-				break;
-		}
-		return generateChild(node);
-	}
-
-	/**
-	 * generateStartTag method
-	 * 
-	 * @return java.lang.String
-	 * @param element
-	 *            Element
-	 */
-	public String generateStartTag(Element element) {
-		if (element == null)
-			return null;
-
-		ElementImpl impl = (ElementImpl) element;
-
-		if (impl.isJSPTag()) {
-			// check if JSP content type and JSP Document
-			IDOMDocument document = (IDOMDocument) element.getOwnerDocument();
-			if (document != null && document.isJSPType()) {
-				if (document.isJSPDocument() && !impl.hasChildNodes()) {
-					impl.setJSPTag(false);
-				}
-			} else {
-				impl.setJSPTag(false);
-			}
-		}
-		if (impl.isCommentTag() && impl.getExistingAdapter(TagAdapter.class) == null) {
-			CommentElementRegistry registry = CommentElementRegistry.getInstance();
-			registry.setupCommentElement(impl);
-		}
-
-		// first check if tag adapter exists
-		TagAdapter adapter = (TagAdapter) impl.getExistingAdapter(TagAdapter.class);
-		if (adapter != null) {
-			String startTag = adapter.getStartTag(impl);
-			if (startTag != null)
-				return startTag;
-		}
-
-		StringBuffer buffer = new StringBuffer();
-
-		if (impl.isCommentTag()) {
-			if (impl.isJSPTag())
-				buffer.append(JSPTag.COMMENT_OPEN);
-			else
-				buffer.append(COMMENT_OPEN);
-			String tagName = generateTagName(element);
-			if (tagName != null)
-				buffer.append(tagName);
-		} else if (impl.isJSPTag()) {
-			buffer.append(JSPTag.TAG_OPEN);
-			String tagName = generateTagName(element);
-			if (tagName != null)
-				buffer.append(tagName);
-			if (impl.isContainer())
-				return buffer.toString(); // JSP container
-		} else {
-			buffer.append('<');
-			String tagName = generateTagName(element);
-			if (tagName != null)
-				buffer.append(tagName);
-		}
-
-		NamedNodeMap attributes = element.getAttributes();
-		int length = attributes.getLength();
-		for (int i = 0; i < length; i++) {
-			AttrImpl attr = (AttrImpl) attributes.item(i);
-			if (attr == null)
-				continue;
-			buffer.append(' ');
-			String attrName = generateAttrName(attr);
-			if (attrName != null)
-				buffer.append(attrName);
-			String attrValue = generateAttrValue(attr);
-			if (attrValue != null) {
-				// attr name only for HTML boolean and JSP
-				buffer.append('=');
-				buffer.append(attrValue);
-			}
-		}
-
-		String closeTag = generateCloseTag(element);
-		if (closeTag != null)
-			buffer.append(closeTag);
-
-		return buffer.toString();
-	}
-
-	/**
-	 */
-	public String generateTagName(Element element) {
-		if (element == null)
-			return null;
-		IDOMElement xe = (IDOMElement) element;
-		String tagName = element.getTagName();
-		if (tagName == null)
-			return null;
-		if (xe.isJSPTag()) {
-			if (tagName.equals(JSPTag.JSP_EXPRESSION))
-				return JSPTag.EXPRESSION_TOKEN;
-			if (tagName.equals(JSPTag.JSP_DECLARATION))
-				return JSPTag.DECLARATION_TOKEN;
-			if (tagName.equals(JSPTag.JSP_DIRECTIVE))
-				return JSPTag.DIRECTIVE_TOKEN;
-			if (tagName.startsWith(JSPTag.JSP_DIRECTIVE)) {
-				int offset = JSPTag.JSP_DIRECTIVE.length() + 1; // after '.'
-				return (JSPTag.DIRECTIVE_TOKEN + tagName.substring(offset));
-			}
-			return (xe.isCommentTag()) ? tagName : null;
-		} else if (tagName.startsWith(JSPTag.TAG_OPEN)) {
-			if (!tagName.endsWith(JSPTag.TAG_CLOSE)) {
-				// close JSP
-				return (tagName + JSPTag.TAG_CLOSE);
-			}
-		} else if (xe.isCommentTag()) {
-			String prefix = element.getPrefix();
-			if (prefix.equals(SSI_PREFIX)) {
-				return (SSI_TOKEN + element.getLocalName());
-			}
-		} else {
-			if (!xe.isJSPTag() && xe.isGlobalTag() && // global tag
-						CMNodeUtil.getElementDeclaration(xe) != null) {
-				String newName = tagName;
-				switch (getTagNameCase(xe)) {
-					case DocumentTypeAdapter.UPPER_CASE :
-						newName = tagName.toUpperCase();
-						break;
-					case DocumentTypeAdapter.LOWER_CASE :
-						newName = tagName.toLowerCase();
-						break;
-				}
-				if (newName != tagName) {
-					tagName = newName;
-					setTagName(element, tagName);
-				}
-			}
-		}
-		return tagName;
-	}
-
-	/**
-	 * generateText method
-	 * 
-	 * @return java.lang.String
-	 * @param text
-	 *            org.w3c.dom.Text
-	 */
-	public String generateText(Text text) {
-		if (text == null)
-			return null;
-		TextImpl impl = (TextImpl) text;
-		String source = impl.getTextSource();
-		if (source != null)
-			return source;
-		return generateTextData(text, impl.getData());
-	}
-
-	/**
-	 */
-	public String generateTextData(Text text, String data) {
-		if (data == null)
-			return null;
-		if (text == null)
-			return null;
-		TextImpl impl = (TextImpl) text;
-		if (impl.isJSPContent() || impl.isCDATAContent()) {
-			return new SourceValidator(impl).convertSource(data);
-		}
-		String source = data;
-
-		// convert special characters to character entities
-		StringBuffer buffer = null;
-		int offset = 0;
-		int length = data.length();
-		for (int i = 0; i < length; i++) {
-			String name = getCharName(data.charAt(i));
-			if (name == null)
-				continue;
-			if (buffer == null)
-				buffer = new StringBuffer(length + 8);
-			if (i > offset)
-				buffer.append(data.substring(offset, i));
-			buffer.append('&');
-			buffer.append(name);
-			buffer.append(';');
-			offset = i + 1;
-		}
-		if (buffer != null) {
-			if (length > offset)
-				buffer.append(data.substring(offset));
-			source = buffer.toString();
-		}
-
-		if (source == null || source.length() == 0)
-			return null;
-		return source;
-	}
-
-	/**
-	 */
-	private int getAttrNameCase(Attr attr) {
-		DocumentImpl document = (DocumentImpl) attr.getOwnerDocument();
-		if (document == null)
-			return DocumentTypeAdapter.STRICT_CASE;
-		DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
-		if (adapter == null)
-			return DocumentTypeAdapter.STRICT_CASE;
-		return adapter.getAttrNameCase();
-	}
-
-	/**
-	 */
-	private String getCharName(char c) {
-		switch (c) {
-			case '<' :
-				return IXMLCharEntity.LT_NAME;
-			case '>' :
-				return IXMLCharEntity.GT_NAME;
-			case '&' :
-				return IXMLCharEntity.AMP_NAME;
-			case '"' :
-				return IXMLCharEntity.QUOT_NAME;
-		}
-		return null;
-	}
-
-	/**
-	 */
-	private int getTagNameCase(Element element) {
-		DocumentImpl document = (DocumentImpl) element.getOwnerDocument();
-		if (document == null)
-			return DocumentTypeAdapter.STRICT_CASE;
-		DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
-		if (adapter == null)
-			return DocumentTypeAdapter.STRICT_CASE;
-		return adapter.getTagNameCase();
-	}
-
-	/**
-	 */
-	private boolean isBooleanAttr(Attr attr) {
-		if (attr == null)
-			return false;
-		CMAttributeDeclaration decl = CMNodeUtil.getAttributeDeclaration(attr);
-		if (decl == null)
-			return false;
-		CMDataType type = decl.getAttrType();
-		if (type == null)
-			return false;
-		String values[] = type.getEnumeratedValues();
-		if (values == null)
-			return false;
-		return (values.length == 1 && values[0].equals(decl.getAttrName()));
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelContext.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelContext.java
deleted file mode 100644
index 6a799f7..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelContext.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * XMLModelContext class
- */
-class XMLModelContext {
-	private Node nextNode = null;
-	private Node parentNode = null;
-
-	//	private XMLModelImpl model = null;
-	private Node rootNode = null;
-
-	/**
-	 * XMLModelContext constructor
-	 * 
-	 * @param rootNode
-	 *            org.w3c.dom.Node
-	 */
-	XMLModelContext(Node rootNode) {
-		super();
-
-		this.rootNode = rootNode;
-	}
-
-	/**
-	 * findEndTag method
-	 * 
-	 * @return org.w3c.dom.Element
-	 * @param tagName
-	 *            java.lang.String
-	 */
-	Element findEndTag(String tagName) {
-		if (tagName == null)
-			return null;
-		if (this.parentNode == null)
-			return null;
-
-		for (Node parent = this.parentNode.getParentNode(); parent != null; parent = parent.getParentNode()) {
-			if (parent.getNodeType() != Node.ELEMENT_NODE)
-				break;
-			ElementImpl element = (ElementImpl) parent;
-			if (element.hasEndTag()) {
-				if (element.matchTagName(tagName))
-					return element;
-				// if ancestor element has end tag stop search
-				break;
-			}
-			if (element.getNextSibling() != null)
-				break;
-		}
-
-		return null;
-	}
-
-	/**
-	 */
-	Text findNextText() {
-		Node node = this.nextNode;
-		while (node != null) {
-			if (node != this.nextNode && node.getNodeType() == Node.TEXT_NODE) {
-				TextImpl text = (TextImpl) node;
-				// skip empty text
-				if (text.getStructuredDocumentRegion() != null)
-					return text;
-			}
-			Node child = node.getFirstChild();
-			if (child != null) {
-				node = child;
-				continue;
-			}
-			while (node != null) {
-				Node next = node.getNextSibling();
-				if (next != null) {
-					node = next;
-					break;
-				}
-				node = node.getParentNode();
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * findPreviousText method
-	 * 
-	 * @return org.w3c.dom.Text
-	 */
-	Text findPreviousText() {
-		if (this.parentNode == null)
-			return null;
-		Node node = null;
-		if (this.nextNode != null)
-			node = this.nextNode.getPreviousSibling();
-		else
-			node = this.parentNode.getLastChild();
-		if (node == null || node.getNodeType() != Node.TEXT_NODE)
-			return null;
-		return (Text) node;
-	}
-
-	/**
-	 * findStartTag method
-	 * 
-	 * @return org.w3c.dom.Element
-	 * @param tagName
-	 *            java.lang.String
-	 */
-	Element findStartTag(String tagName, String rootName) {
-		if (tagName == null)
-			return null;
-
-		// check previous for empty content element
-		Node prev = null;
-		if (this.nextNode != null)
-			prev = this.nextNode.getPreviousSibling();
-		else if (this.parentNode != null)
-			prev = this.parentNode.getLastChild();
-		if (prev != null && prev.getNodeType() == Node.ELEMENT_NODE) {
-			ElementImpl element = (ElementImpl) prev;
-			if (!element.hasEndTag() && !element.isEmptyTag() && element.matchTagName(tagName))
-				return element;
-		}
-
-		for (Node parent = this.parentNode; parent != null; parent = parent.getParentNode()) {
-			if (parent.getNodeType() != Node.ELEMENT_NODE)
-				break;
-			ElementImpl element = (ElementImpl) parent;
-			if (element.matchTagName(tagName))
-				return element;
-			if (rootName != null && element.matchTagName(rootName))
-				break;
-		}
-
-		return null;
-	}
-
-	/**
-	 * getNextNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	Node getNextNode() {
-		return this.nextNode;
-	}
-
-	/**
-	 * getParentNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	Node getParentNode() {
-		return this.parentNode;
-	}
-
-	/**
-	 * getRootNode method
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	Node getRootNode() {
-		return this.rootNode;
-	}
-
-	/**
-	 * setLast method
-	 */
-	void setLast() {
-		if (this.parentNode == null)
-			return;
-		if (this.nextNode != null) {
-			Node prev = this.nextNode.getPreviousSibling();
-			if (prev == null || prev.getNodeType() != Node.ELEMENT_NODE)
-				return;
-			ElementImpl element = (ElementImpl) prev;
-			if (element.hasEndTag() || !element.isContainer() || element.isEmptyTag())
-				return;
-			setParentNode(prev);
-		}
-
-		// find last open parent
-		Node parent = this.parentNode;
-		Node last = parent.getLastChild();
-		while (last != null) {
-			if (last.getNodeType() != Node.ELEMENT_NODE)
-				break;
-			ElementImpl element = (ElementImpl) last;
-			if (element.hasEndTag() || !element.isContainer() || element.isEmptyTag())
-				break;
-			parent = element;
-			last = parent.getLastChild();
-		}
-		if (parent != this.parentNode)
-			setParentNode(parent);
-	}
-
-	/**
-	 * setNextNode method
-	 * 
-	 * @param nextNode
-	 *            org.w3c.dom.Node
-	 */
-	void setNextNode(Node nextNode) {
-		this.nextNode = nextNode;
-		if (nextNode == null)
-			return;
-		this.parentNode = nextNode.getParentNode();
-	}
-
-	/**
-	 * setParentNode method
-	 * 
-	 * @param parentNode
-	 *            org.w3c.dom.Node
-	 */
-	void setParentNode(Node parentNode) {
-		this.parentNode = parentNode;
-		this.nextNode = null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifier.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifier.java
deleted file mode 100644
index 9a3e255..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifier.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * 
- * XMLModelNotifier manages the notification process. Clients should not use
- * extend or reference.
- * 
- * ISSUE: should be internalized.
- */
-
-public interface XMLModelNotifier {
-
-	/**
-	 * attrReplaced method
-	 * 
-	 * @param element
-	 *            org.w3c.dom.Element
-	 * @param newAttr
-	 *            org.w3c.dom.Attr
-	 * @param oldAttr
-	 *            org.w3c.dom.Attr
-	 */
-	void attrReplaced(Element element, Attr newAttr, Attr oldAttr);
-
-	/**
-	 * Signal that changing is starting.
-	 * 
-	 */
-	void beginChanging();
-
-	/**
-	 * Signal that changing is starting with a brand new model.
-	 * 
-	 */
-	void beginChanging(boolean newModel);
-
-	/**
-	 * Cancel pending notifications. This is called in the context of
-	 * "reinitialization" so is assumed ALL notifications can be safely
-	 * canceled, assuming that once factories and adapters are re-initialized
-	 * they will be re-notified as text is set in model, if still appropriate.
-	 */
-	void cancelPending();
-
-	/**
-	 * childReplaced method
-	 * 
-	 * @param parentNode
-	 *            org.w3c.dom.Node
-	 * @param newChild
-	 *            org.w3c.dom.Node
-	 * @param oldChild
-	 *            org.w3c.dom.Node
-	 */
-	void childReplaced(Node parentNode, Node newChild, Node oldChild);
-
-	/**
-	 * Editable state changed for node.
-	 * 
-	 */
-	void editableChanged(Node node);
-
-	/**
-	 * Signal changing is finished.
-	 * 
-	 */
-	void endChanging();
-
-	/**
-	 * Signal end tag changed.
-	 * 
-	 * @param element
-	 * 
-	 */
-	void endTagChanged(Element element);
-
-	/**
-	 * Used to reflect state of model.
-	 * 
-	 * @return true if model had changed.
-	 * 
-	 */
-	boolean hasChanged();
-
-	/**
-	 * Used to reflect state of parsing process.
-	 * 
-	 * @return true if model is currently changing.
-	 */
-	boolean isChanging();
-
-	/**
-	 * signal property changed
-	 * 
-	 * @param node
-	 */
-	void propertyChanged(Node node);
-
-	/**
-	 * signal start tag changed
-	 * 
-	 * @param element
-	 */
-	void startTagChanged(Element element);
-
-	/**
-	 * signal structured changed.
-	 * 
-	 * @param node
-	 */
-	void structureChanged(Node node);
-
-	/**
-	 * valueChanged method
-	 * 
-	 * @param node
-	 *            org.w3c.dom.Node
-	 */
-	void valueChanged(Node node);
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifierImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifierImpl.java
deleted file mode 100644
index a518f84..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifierImpl.java
+++ /dev/null
@@ -1,496 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class XMLModelNotifierImpl implements XMLModelNotifier {
-
-	/* end: for debugging only */
-	private class NotifyEvent {
-		Object changedFeature;
-		boolean discarded;
-		Object newValue;
-		// note: don't initialize instance variables, since
-		// that causes double assignments, and lots of these are created.
-		INodeNotifier notifier;
-		Object oldValue;
-		int pos;
-		String reason;
-		int type;
-		int index;
-
-		NotifyEvent(INodeNotifier notifier, int type, Object changedFeature, Object oldValue, Object newValue, int pos) {
-			this.notifier = notifier;
-			this.type = type;
-			this.changedFeature = changedFeature;
-			this.oldValue = oldValue;
-			this.newValue = newValue;
-			this.pos = pos;
-			this.reason = ""; //$NON-NLS-1$
-		}
-	}
-
-	private final static String ADDED_THEN_REMOVED = "Discard: Added then removed rule"; //$NON-NLS-1$
-	private final static boolean fOptimizeDeferred = true;
-	private final static boolean fOptimizeDeferredAccordingToParentAdded = true;
-	private final static boolean fOptimizeDeferredAccordingToParentRemoved = true;
-	private final static String PARENT_IS_ADDED = "Disarded: Parent has just been added"; //$NON-NLS-1$
-	/* start: for debugging only */
-	private final static String PARENT_IS_REMOVED_TOO = "Discard: Parent was removed too"; //$NON-NLS-1$
-	private final static String PARENT_IS_REPARENTED = "Not Discard: Parent was removed so this implies reparenting"; //$NON-NLS-1$
-	private Node changedRoot = null;
-
-	private boolean changing = false;
-	private boolean doingNewModel = false;
-	private Vector events = null;
-	private boolean flushing = false;
-
-	/**
-	 */
-	public XMLModelNotifierImpl() {
-		super();
-	}
-
-	/**
-	 * attrReplaced method
-	 * 
-	 * @param element
-	 *            org.w3c.dom.Element
-	 * @param newAttr
-	 *            org.w3c.dom.Attr
-	 * @param oldAttr
-	 *            org.w3c.dom.Attr
-	 */
-	public void attrReplaced(Element element, Attr newAttr, Attr oldAttr) {
-		if (element == null)
-			return;
-		Attr attr = null;
-		String oldValue = null;
-		String newValue = null;
-		if (oldAttr != null) {
-			attr = oldAttr;
-			oldValue = oldAttr.getValue();
-		}
-		if (newAttr != null) {
-			attr = newAttr;
-			newValue = newAttr.getValue();
-		}
-		IDOMNode notifier = (IDOMNode) element;
-		int offset = notifier.getStartOffset();
-		notify(notifier, INodeNotifier.CHANGE, attr, oldValue, newValue, offset);
-		propertyChanged(notifier);
-	}
-
-	/**
-	 */
-	public void beginChanging() {
-		this.changing = true;
-	}
-
-	/**
-	 */
-	public void beginChanging(boolean newModel) {
-		beginChanging();
-		this.doingNewModel = newModel;
-	}
-
-	public void cancelPending() {
-		// we don't want to change the size of this array, since
-		// the array may be being processed, in the defferred notification
-		// loop, but we can signal that all
-		// should be discarded, so any remaining ones will be ignored.
-		if (this.events != null) {
-			Iterator iterator = this.events.iterator();
-			while (iterator.hasNext()) {
-				NotifyEvent event = (NotifyEvent) iterator.next();
-				event.discarded = true;
-			}
-		}
-		// this cancel is presumably being called as a function of
-		// "reinitiailization" so we can ignore changes to the
-		// old root, and changes to the new one will be triggered during
-		// reinitialization.
-		changedRoot = null;
-	}
-
-	/**
-	 * childReplaced method
-	 * 
-	 * @param parentNode
-	 *            org.w3c.dom.Node
-	 * @param newChild
-	 *            org.w3c.dom.Node
-	 * @param oldChild
-	 *            org.w3c.dom.Node
-	 */
-	public void childReplaced(Node parentNode, Node newChild, Node oldChild) {
-		if (parentNode == null)
-			return;
-		IDOMNode notifier = (IDOMNode) parentNode;
-		int type = INodeNotifier.CHANGE;
-		if (newChild == null)
-			type = INodeNotifier.REMOVE;
-		else if (oldChild == null)
-			type = INodeNotifier.ADD;
-		int offset = notifier.getStartOffset();
-		notify(notifier, type, oldChild, oldChild, newChild, offset);
-		structureChanged(notifier);
-	}
-
-	public void editableChanged(Node node) {
-		if (node == null)
-			return;
-		IDOMNode notifier = (IDOMNode) node;
-		int offset = notifier.getStartOffset();
-		notify(notifier, INodeNotifier.CHANGE, null, null, null, offset);
-		propertyChanged(notifier);
-	}
-
-	/**
-	 */
-	public void endChanging() {
-		this.doingNewModel = false;
-		if (!this.changing)
-			return; // avoid nesting calls
-		notifyDeferred();
-		if (this.changedRoot != null) {
-			notifyStructureChanged(this.changedRoot);
-			if (Debug.debugNotifyDeferred) {
-				String p = this.changedRoot.getNodeName();
-				System.out.println("Deferred STRUCUTRE_CHANGED: " + p); //$NON-NLS-1$
-			}
-			this.changedRoot = null;
-		}
-		this.changing = false;
-	}
-
-	/**
-	 */
-	public void endTagChanged(Element element) {
-		if (element == null)
-			return;
-		IDOMNode notifier = (IDOMNode) element;
-		int offset = notifier.getStartOffset();
-		notify(notifier, INodeNotifier.CHANGE, null, null, null, offset);
-		propertyChanged(element);
-	}
-
-	/**
-	 */
-	public boolean hasChanged() {
-		return (this.events != null);
-	}
-
-	/**
-	 */
-	public boolean isChanging() {
-		return this.changing;
-	}
-
-	/**
-	 */
-	private void notify(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		if (notifier == null)
-			return;
-		if (this.changing && !this.flushing) {
-			// defer notification
-			if (this.events == null)
-				this.events = new Vector();
-			// we do not defer anything if we are doing a new Model,
-			// except for the document event, since all others are
-			// trivial and not needed at that initial point.
-			// But even for that one document event, in the new model case,
-			// it is still important to defer it.
-			if ((!doingNewModel) || (((Node) notifier).getNodeType() == Node.DOCUMENT_NODE)) {
-				this.events.addElement(new NotifyEvent(notifier, eventType, changedFeature, oldValue, newValue, pos));
-			}
-			return;
-		}
-		try {
-			// Its important to "keep going" if exception occurs, since this
-			// notification
-			// comes in between "about to change" and "changed" events. We do
-			// log, however,
-			// since would indicate a program error.
-			notifier.notify(eventType, changedFeature, oldValue, newValue, pos);
-		} catch (Exception e) {
-			Logger.logException("A structured model client threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[eventType] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-
-	/**
-	 */
-	private void notifyDeferred() {
-		if (this.events == null)
-			return;
-		if (this.flushing)
-			return;
-		this.flushing = true; // force notification
-		int count = this.events.size();
-		if (!doingNewModel && fOptimizeDeferred) {
-			Map values = new HashMap();
-			for (int i = 0; i < count; i++) {
-				NotifyEvent event = (NotifyEvent) this.events.elementAt(i);
-				if (event == null)
-					continue; // error
-				event.index = i;
-				if(event.type == INodeNotifier.REMOVE) {
-					addToMap(event.oldValue, event, values);
-				}
-				if(event.type == INodeNotifier.ADD) {
-					addToMap(event.newValue, event, values);
-				}
-			}
-			Iterator it = values.keySet().iterator();
-			while(it.hasNext()) {
-				Object value = it.next();
-				NotifyEvent[] es = (NotifyEvent[])values.get(value);
-				for (int i = 0; i < es.length - 1; i++) {
-					NotifyEvent event = es[i];
-					if(es[i].discarded) continue;
-					NotifyEvent next = es[i + 1];
-					if(es[i].type == INodeNotifier.ADD && next.type == INodeNotifier.REMOVE) {
-						// Added then removed later, discard both
-						event.discarded = true;
-						next.discarded = true;
-						if (Debug.debugNotifyDeferred) {
-							event.reason = event.reason + ADDED_THEN_REMOVED + "(see " + next.index + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-							next.reason = next.reason + ADDED_THEN_REMOVED + "(see " + event.index + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-						}
-					}
-				}
-			}
-			for (int i = 0; i < count; i++) {
-				NotifyEvent event = (NotifyEvent) this.events.elementAt(i);
-				if (event == null)
-					continue; // error
-				if(event.discarded) continue;
-				if (event.notifier != null && fOptimizeDeferredAccordingToParentAdded) {
-					if (event.type == INodeNotifier.ADD) {
-						NotifyEvent[] es = (NotifyEvent[])values.get(event.notifier);
-						if(es != null) for (int p = 0; p < es.length && es[p].index < event.index; p++) {
-							NotifyEvent prev = es[p];
-							if (prev.type == INodeNotifier.REMOVE && prev.oldValue == event.notifier) {
-								// parent is reparented, do not discard
-								if (Debug.debugNotifyDeferred) {
-									event.reason = event.reason + PARENT_IS_REPARENTED + "(see " + prev.index + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-								}
-								break;
-							} else if (prev.type == INodeNotifier.ADD && prev.newValue == event.notifier) {
-								// parent has been added, discard this
-								event.discarded = true;
-								if (Debug.debugNotifyDeferred) {
-									event.reason = event.reason + PARENT_IS_ADDED + "(see " + prev.index + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-								}
-								break;
-							}
-						}							
-					}						
-				}
-				if(event.discarded) continue;
-				if (event.notifier != null && fOptimizeDeferredAccordingToParentRemoved) {
-					if (event.type == INodeNotifier.REMOVE) {
-						NotifyEvent[] es = (NotifyEvent[])values.get(event.notifier);
-						if(es != null) for (int n = 0; n < es.length; n++) {
-							NotifyEvent next = es[n];
-							if(next.index > event.index && next.type == INodeNotifier.REMOVE) {
-								if (next.oldValue == event.notifier) {
-									// parent will be removed, discard this
-									event.discarded = true;
-									if (Debug.debugNotifyDeferred) {
-										event.reason = event.reason + PARENT_IS_REMOVED_TOO + "(see " + next.index + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-									}
-									break;
-								}
-							}
-						}
-					}						
-				}
-				if(event.discarded) continue;
-			}
-		}
-		for (int i = 0; i < count; i++) {
-			NotifyEvent event = (NotifyEvent) this.events.elementAt(i);
-			if (event == null)
-				continue; // error
-			if(event.discarded) continue;
-			notify(event.notifier, event.type, event.changedFeature, event.oldValue, event.newValue, event.pos);
-		}
-		if (Debug.debugNotifyDeferred) {
-			for (int l = 0; l < count; l++) {
-				NotifyEvent event = (NotifyEvent) this.events.elementAt(l);
-				Object o = null;
-				String t = null;
-				if (event.type == INodeNotifier.ADD) {
-					o = event.newValue;
-					t = " + "; //$NON-NLS-1$
-				} else if (event.type == INodeNotifier.REMOVE) {
-					o = event.oldValue;
-					t = " - "; //$NON-NLS-1$
-				}
-				if (o instanceof Element) {
-					String p = ((Node) event.notifier).getNodeName();
-					String c = ((Node) o).getNodeName();
-					String d = (event.discarded ? "! " : "  "); //$NON-NLS-1$ //$NON-NLS-2$
-					System.out.println(d + p + t + c);
-				}
-			}
-		}
-		this.flushing = false;
-		this.events = null;
-	}
-
-	void addToMap(Object o, NotifyEvent event, Map map) {
-		if(o == null) return;
-		Object x = map.get(o);
-		if(x == null) {
-			map.put(o, new NotifyEvent[]{event});
-		} else {
-			NotifyEvent[] es = (NotifyEvent[])x;
-			NotifyEvent[] es2 = new NotifyEvent[es.length + 1];
-			System.arraycopy(es, 0, es2, 0, es.length);
-			es2[es.length] = event;
-			map.put(o, es2);
-		}
-	}
-
-	/**
-	 */
-	private void notifyStructureChanged(Node root) {
-		if (root == null)
-			return;
-		INodeNotifier notifier = (INodeNotifier) root;
-		try {
-			// Its important to "keep going" if exception occurs, since this
-			// notification
-			// comes in between "about to change" and "changed" events. We do
-			// log, however,
-			// since would indicate a program error.
-			notifier.notify(INodeNotifier.STRUCTURE_CHANGED, null, null, null, -1);
-		} catch (Exception e) {
-			Logger.logException("A structured model client threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[INodeNotifier.STRUCTURE_CHANGED] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-	}
-
-	/**
-	 */
-	public void propertyChanged(Node node) {
-	}
-
-	/**
-	 * @param node
-	 */
-	private void setCommonRootIfNeeded(Node node) {
-		// defer notification
-		if (this.changedRoot == null) {
-			this.changedRoot = node;
-		} else {
-			// tiny optimization: if previous commonAncestor (changedRoot) is
-			// already 'document',
-			// or if already equal to this 'node',
-			// then no need to re-calculate
-			if (changedRoot.getNodeType() != Node.DOCUMENT_NODE && changedRoot != node) {
-				Node common = ((NodeImpl) this.changedRoot).getCommonAncestor(node);
-				if (common != null)
-					this.changedRoot = common;
-				else
-					this.changedRoot = node;
-			}
-		}
-	}
-
-	/**
-	 */
-	public void startTagChanged(Element element) {
-		if (element == null)
-			return;
-		IDOMNode notifier = (IDOMNode) element;
-		int offset = notifier.getStartOffset();
-		notify(notifier, INodeNotifier.CHANGE, null, null, null, offset);
-		propertyChanged(element);
-	}
-
-	/**
-	 */
-	public void structureChanged(Node node) {
-		if (node == null)
-			return;
-		if (isChanging()) {
-			setCommonRootIfNeeded(node);
-			if (Debug.debugNotifyDeferred) {
-				String p = this.changedRoot.getNodeName();
-				System.out.println("requested STRUCUTRE_CHANGED: " + p); //$NON-NLS-1$
-			}
-			return;
-		}
-		if (Debug.debugNotifyDeferred) {
-			String p = node.getNodeName();
-			System.out.println("STRUCUTRE_CHANGED: " + p); //$NON-NLS-1$
-		}
-		notifyStructureChanged(node);
-	}
-
-	/**
-	 * valueChanged method
-	 * 
-	 * @param node
-	 *            org.w3c.dom.Node
-	 */
-	public void valueChanged(Node node) {
-		if (node == null)
-			return;
-		IDOMNode notifier = null;
-		if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
-			Attr attr = (Attr) node;
-			notifier = (IDOMNode) attr.getOwnerElement();
-			// TODO_dmw: experimental: changed 06/29/2004 to send "strucuture
-			// changed" even for attribute value changes
-			// there are pros and cons to considering attribute value
-			// "structure changed". Will (re)consider
-			// setCommonRootIfNeeded(notifier);
-			if (notifier == null)
-				return;
-			String value = attr.getValue();
-			int offset = notifier.getStartOffset();
-			notify(notifier, INodeNotifier.CHANGE, attr, null, value, offset);
-		} else {
-			// note: we do not send structured changed event for content
-			// changed
-			notifier = (IDOMNode) node;
-			String value = node.getNodeValue();
-			int offset = notifier.getStartOffset();
-			notify(notifier, INodeNotifier.CHANGE, null, null, value, offset);
-			if (node.getNodeType() != Node.ELEMENT_NODE) {
-				IDOMNode parent = (IDOMNode) node.getParentNode();
-				if (parent != null) {
-					notify(parent, INodeNotifier.CONTENT_CHANGED, node, null, value, offset);
-				}
-			}
-		}
-		propertyChanged(notifier);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelParser.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelParser.java
deleted file mode 100644
index 06d25f8..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelParser.java
+++ /dev/null
@@ -1,2424 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.commentelement.impl.CommentElementConfiguration;
-import org.eclipse.wst.xml.core.internal.commentelement.impl.CommentElementRegistry;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-/**
- * XMLModelParser
- */
-public class XMLModelParser {
-	private XMLModelContext context = null;
-	private DOMModelImpl model = null;
-
-	/**
-	 */
-	protected XMLModelParser(DOMModelImpl model) {
-		super();
-
-		if (model != null) {
-			this.model = model;
-		}
-	}
-
-	/**
-	 */
-	protected boolean canBeImplicitTag(Element element) {
-		ModelParserAdapter adapter = getParserAdapter();
-		if (adapter != null) {
-			return adapter.canBeImplicitTag(element);
-		}
-		return false;
-	}
-
-	/**
-	 */
-	protected boolean canBeImplicitTag(Element element, Node child) {
-		ModelParserAdapter adapter = getParserAdapter();
-		if (adapter != null) {
-			return adapter.canBeImplicitTag(element, child);
-		}
-		return false;
-	}
-
-	/**
-	 */
-	protected boolean canContain(Element element, Node child) {
-		if (element == null || child == null)
-			return false;
-		ElementImpl impl = (ElementImpl) element;
-		if (impl.isEndTag())
-			return false; // invalid (floating) end tag
-		if (!impl.isContainer())
-			return false;
-		if (child.getNodeType() != Node.TEXT_NODE) {
-			if (impl.isJSPContainer() || impl.isCDATAContainer()) {
-				// accepts only Text child
-				return false;
-			}
-		}
-		ModelParserAdapter adapter = getParserAdapter();
-		if (adapter != null) {
-			return adapter.canContain(element, child);
-		}
-		return true;
-	}
-
-	/**
-	 */
-	private void changeAttrEqual(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		int offset = flatNode.getStart();
-		if (offset < 0)
-			return;
-		NodeImpl root = (NodeImpl) this.context.getRootNode();
-		if (root == null)
-			return;
-		Node node = root.getNodeAt(offset);
-		if (node == null)
-			return;
-		if (node.getNodeType() != Node.ELEMENT_NODE) {
-			if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
-				// just notify the change instead of setting data
-				ProcessingInstructionImpl pi = (ProcessingInstructionImpl) node;
-				pi.notifyValueChanged();
-			}
-			return;
-		}
-		// actually, do nothing
-	}
-
-	/**
-	 * changeAttrName method
-	 * 
-	 */
-	private void changeAttrName(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		int offset = flatNode.getStart();
-		if (offset < 0)
-			return;
-		NodeImpl root = (NodeImpl) this.context.getRootNode();
-		if (root == null)
-			return;
-		Node node = root.getNodeAt(offset);
-		if (node == null)
-			return;
-		if (node.getNodeType() != Node.ELEMENT_NODE) {
-			if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
-				// just notify the change instead of setting data
-				ProcessingInstructionImpl pi = (ProcessingInstructionImpl) node;
-				pi.notifyValueChanged();
-			}
-			return;
-		}
-
-		ElementImpl element = (ElementImpl) node;
-		NamedNodeMap attributes = element.getAttributes();
-		if (attributes == null)
-			return;
-		int length = attributes.getLength();
-		for (int i = 0; i < length; i++) {
-			AttrImpl attr = (AttrImpl) attributes.item(i);
-			if (attr == null)
-				continue;
-			if (attr.getNameRegion() != region)
-				continue;
-
-			String name = flatNode.getText(region);
-			attr.setName(name);
-			break;
-		}
-	}
-
-	/**
-	 * changeAttrValue method
-	 * 
-	 */
-	private void changeAttrValue(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		int offset = flatNode.getStart();
-		if (offset < 0)
-			return;
-		NodeImpl root = (NodeImpl) this.context.getRootNode();
-		if (root == null)
-			return;
-		Node node = root.getNodeAt(offset);
-		if (node == null)
-			return;
-		if (node.getNodeType() != Node.ELEMENT_NODE) {
-			if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
-				// just notify the change instead of setting data
-				ProcessingInstructionImpl pi = (ProcessingInstructionImpl) node;
-				pi.notifyValueChanged();
-			}
-			return;
-		}
-
-		ElementImpl element = (ElementImpl) node;
-		NamedNodeMap attributes = element.getAttributes();
-		if (attributes == null)
-			return;
-		int length = attributes.getLength();
-		for (int i = 0; i < length; i++) {
-			AttrImpl attr = (AttrImpl) attributes.item(i);
-			if (attr == null)
-				continue;
-			if (attr.getValueRegion() != region)
-				continue;
-			// just notify the change instead of setting value
-			attr.notifyValueChanged();
-			break;
-		}
-	}
-
-	/**
-	 * changeData method
-	 * 
-	 */
-	private void changeData(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		int offset = flatNode.getStart();
-		if (offset < 0)
-			return;
-		NodeImpl root = (NodeImpl) this.context.getRootNode();
-		if (root == null)
-			return;
-		Node node = root.getNodeAt(offset);
-		if (node == null)
-			return;
-		switch (node.getNodeType()) {
-			case Node.TEXT_NODE : {
-				TextImpl text = (TextImpl) node;
-				if (text.isSharingStructuredDocumentRegion(flatNode)) {
-					// has consecutive text sharing IStructuredDocumentRegion
-					changeStructuredDocumentRegion(flatNode);
-					return;
-				}
-				this.context.setNextNode(node);
-				cleanupText();
-				break;
-			}
-			case Node.CDATA_SECTION_NODE :
-			case Node.PROCESSING_INSTRUCTION_NODE :
-				break;
-			case Node.COMMENT_NODE :
-			case Node.ELEMENT_NODE :
-				// comment tag
-				changeStructuredDocumentRegion(flatNode);
-				return;
-			default :
-				return;
-		}
-
-		// just notify the change instead of setting data
-		NodeImpl impl = (NodeImpl) node;
-		impl.notifyValueChanged();
-	}
-
-	/**
-	 */
-	private void changeEndTag(IStructuredDocumentRegion flatNode, ITextRegionList newRegions, ITextRegionList oldRegions) {
-		int offset = flatNode.getStart();
-		if (offset < 0)
-			return; // error
-		NodeImpl root = (NodeImpl) this.context.getRootNode();
-		if (root == null)
-			return; // error
-		Node node = root.getNodeAt(offset);
-		if (node == null)
-			return; // error
-
-		if (node.getNodeType() != Node.ELEMENT_NODE) {
-			changeStructuredDocumentRegion(flatNode);
-			return;
-		}
-
-		// check if change is only for close tag
-		if (newRegions != null) {
-			Iterator e = newRegions.iterator();
-			while (e.hasNext()) {
-				ITextRegion region = (ITextRegion) e.next();
-				String regionType = region.getType();
-				if (regionType == DOMRegionContext.XML_TAG_CLOSE)
-					continue;
-
-				// other region has changed
-				changeStructuredDocumentRegion(flatNode);
-				return;
-			}
-		}
-		if (oldRegions != null) {
-			Iterator e = oldRegions.iterator();
-			while (e.hasNext()) {
-				ITextRegion region = (ITextRegion) e.next();
-				String regionType = region.getType();
-				if (regionType == DOMRegionContext.XML_TAG_CLOSE)
-					continue;
-
-				// other region has changed
-				changeStructuredDocumentRegion(flatNode);
-				return;
-			}
-		}
-
-		// change for close tag has no impact
-		// do nothing
-	}
-
-	/**
-	 * changeRegion method
-	 * 
-	 */
-	void changeRegion(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		if (flatNode == null || region == null)
-			return;
-		if (this.model.getDocument() == null)
-			return;
-		this.context = new XMLModelContext(this.model.getDocument());
-
-		// optimize typical cases
-		String regionType = region.getType();
-		if (regionType == DOMRegionContext.XML_CONTENT || regionType == DOMRegionContext.XML_COMMENT_TEXT || regionType == DOMRegionContext.XML_CDATA_TEXT || regionType == DOMRegionContext.BLOCK_TEXT || isNestedContent(regionType)) {
-			changeData(flatNode, region);
-		}
-		else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-			changeAttrName(flatNode, region);
-		}
-		else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-			changeAttrValue(flatNode, region);
-		}
-		else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
-			changeAttrEqual(flatNode, region);
-		}
-		else if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTagName(regionType)) {
-			changeTagName(flatNode, region);
-		}
-		else {
-			changeStructuredDocumentRegion(flatNode);
-		}
-	}
-
-
-
-	/**
-	 */
-	private void changeStartTag(IStructuredDocumentRegion flatNode, ITextRegionList newRegions, ITextRegionList oldRegions) {
-		int offset = flatNode.getStart();
-		if (offset < 0)
-			return; // error
-		NodeImpl root = (NodeImpl) this.context.getRootNode();
-		if (root == null)
-			return; // error
-		Node node = root.getNodeAt(offset);
-		if (node == null)
-			return; // error
-
-		if (node.getNodeType() != Node.ELEMENT_NODE) {
-			changeStructuredDocumentRegion(flatNode);
-			return;
-		}
-		ElementImpl element = (ElementImpl) node;
-
-		// check if changes are only for attributes and close tag
-		boolean tagNameUnchanged = false;
-		if (newRegions != null) {
-			Iterator e = newRegions.iterator();
-			while (e.hasNext()) {
-				ITextRegion region = (ITextRegion) e.next();
-				String regionType = region.getType();
-				if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS || regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
-					continue;
-				if (regionType == DOMRegionContext.XML_TAG_CLOSE) {
-					// change from empty tag may have impact on structure
-					if (!element.isEmptyTag())
-						continue;
-				}
-				else if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTagName(regionType)) {
-					String oldTagName = element.getTagName();
-					String newTagName = flatNode.getText(region);
-					if (oldTagName != null && newTagName != null && oldTagName.equals(newTagName)) {
-						// the tag name is unchanged
-						tagNameUnchanged = true;
-						continue;
-					}
-				}
-
-				// other region has changed
-				changeStructuredDocumentRegion(flatNode);
-				return;
-			}
-		}
-		if (oldRegions != null) {
-			Iterator e = oldRegions.iterator();
-			while (e.hasNext()) {
-				ITextRegion region = (ITextRegion) e.next();
-				String regionType = region.getType();
-				if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS || regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
-					continue;
-				if (regionType == DOMRegionContext.XML_TAG_CLOSE) {
-					// change from empty tag may have impact on structure
-					if (!element.isEmptyTag())
-						continue;
-				}
-				else if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTagName(regionType)) {
-					// if new tag name is unchanged, it's OK
-					if (tagNameUnchanged)
-						continue;
-				}
-
-				// other region has changed
-				changeStructuredDocumentRegion(flatNode);
-				return;
-			}
-		}
-
-		// update attributes
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return; // error
-		NamedNodeMap attributes = element.getAttributes();
-		if (attributes == null)
-			return; // error
-
-		// first remove attributes
-		int regionIndex = 0;
-		int attrIndex = 0;
-		AttrImpl attr = null;
-		while (attrIndex < attributes.getLength()) {
-			attr = (AttrImpl) attributes.item(attrIndex);
-			if (attr == null) { // error
-				attrIndex++;
-				continue;
-			}
-			ITextRegion nameRegion = attr.getNameRegion();
-			if (nameRegion == null) { // error
-				element.removeAttributeNode(attr);
-				continue;
-			}
-			boolean found = false;
-			for (int i = regionIndex; i < regions.size(); i++) {
-				ITextRegion region = regions.get(i);
-				if (region == nameRegion) {
-					regionIndex = i + 1; // next region
-					found = true;
-					break;
-				}
-			}
-			if (found) {
-				attrIndex++;
-			}
-			else {
-				element.removeAttributeNode(attr);
-			}
-		}
-
-		// insert or update attributes
-		attrIndex = 0; // reset to first
-		AttrImpl newAttr = null;
-		ITextRegion oldValueRegion = null;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-				if (newAttr != null) {
-					// insert deferred new attribute
-					element.insertAttributeNode(newAttr, attrIndex++);
-					newAttr = null;
-				}
-				else if (attr != null && oldValueRegion != null) {
-					// notify existing attribute value removal
-					attr.notifyValueChanged();
-				}
-
-				oldValueRegion = null;
-				attr = (AttrImpl) attributes.item(attrIndex);
-				if (attr != null && attr.getNameRegion() == region) {
-					// existing attribute
-					attrIndex++;
-					// clear other regions
-					oldValueRegion = attr.getValueRegion();
-					attr.setEqualRegion(null);
-					attr.setValueRegion(null);
-				}
-				else {
-					String name = flatNode.getText(region);
-					attr = (AttrImpl) this.model.getDocument().createAttribute(name);
-					if (attr != null)
-						attr.setNameRegion(region);
-					// defer insertion of new attribute
-					newAttr = attr;
-				}
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
-				if (attr != null) {
-					attr.setEqualRegion(region);
-				}
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-				if (attr != null) {
-					attr.setValueRegion(region);
-					if (attr != newAttr && oldValueRegion != region) {
-						// notify existing attribute value changed
-						attr.notifyValueChanged();
-					}
-					oldValueRegion = null;
-					attr = null;
-				}
-			}
-		}
-
-		if (newAttr != null) {
-			// insert deferred new attribute
-			element.appendAttributeNode(newAttr);
-		}
-		else if (attr != null && oldValueRegion != null) {
-			// notify existing attribute value removal
-			attr.notifyValueChanged();
-		}
-	}
-
-	/**
-	 * changeStructuredDocumentRegion method
-	 * 
-	 */
-	private void changeStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return;
-		if (this.model.getDocument() == null)
-			return;
-
-		setupContext(flatNode);
-
-		removeStructuredDocumentRegion(flatNode);
-		// make sure the parent is set to deepest level
-		// when end tag has been removed
-		this.context.setLast();
-		insertStructuredDocumentRegion(flatNode);
-
-		cleanupText();
-		cleanupEndTag();
-	}
-
-	/**
-	 */
-	private void changeTagName(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		int offset = flatNode.getStart();
-		if (offset < 0)
-			return; // error
-		NodeImpl root = (NodeImpl) this.context.getRootNode();
-		if (root == null)
-			return; // error
-		Node node = root.getNodeAt(offset);
-		if (node == null)
-			return; // error
-
-		if (node.getNodeType() != Node.ELEMENT_NODE) {
-			changeStructuredDocumentRegion(flatNode);
-			return;
-		}
-
-		ElementImpl element = (ElementImpl) node;
-		String newTagName = flatNode.getText(region);
-		if (newTagName == null || !element.matchTagName(newTagName)) {
-			// the tag name is changed
-			changeStructuredDocumentRegion(flatNode);
-			return;
-		}
-
-		// the tag name is unchanged
-		// this happens when typing spaces after the tag name
-		// do nothing, but...
-		// if it's not a change in the end tag of an element with the start
-		// tag,
-		// and case has been changed, set to element and notify
-		if (!element.hasStartTag() || StructuredDocumentRegionUtil.getFirstRegionType(flatNode) != DOMRegionContext.XML_END_TAG_OPEN) {
-			String tagName = element.getTagName();
-			if (tagName == null || !tagName.equals(newTagName)) {
-				element.setTagName(newTagName);
-				element.notifyValueChanged();
-			}
-		}
-	}
-
-	/**
-	 * cleanupContext method
-	 */
-	private void cleanupEndTag() {
-		Node parent = this.context.getParentNode();
-		Node next = this.context.getNextNode();
-		while (parent != null) {
-			while (next != null) {
-				if (next.getNodeType() == Node.ELEMENT_NODE) {
-					ElementImpl element = (ElementImpl) next;
-					if (element.isEndTag()) {
-						// floating end tag
-						String tagName = element.getTagName();
-						String rootName = getFindRootName(tagName);
-						ElementImpl start = (ElementImpl) this.context.findStartTag(tagName, rootName);
-						if (start != null) {
-							insertEndTag(start);
-							// move the end tag from 'element' to 'start'
-							start.addEndTag(element);
-							removeNode(element);
-							parent = this.context.getParentNode();
-							next = this.context.getNextNode();
-							continue;
-						}
-					}
-				}
-
-				Node first = next.getFirstChild();
-				if (first != null) {
-					parent = next;
-					next = first;
-					this.context.setNextNode(next);
-				}
-				else {
-					next = next.getNextSibling();
-					this.context.setNextNode(next);
-				}
-			}
-
-			if (parent.getNodeType() == Node.ELEMENT_NODE) {
-				ElementImpl element = (ElementImpl) parent;
-				if (!element.hasEndTag() && element.hasStartTag() && element.getNextSibling() == null) {
-					String tagName = element.getTagName();
-					ElementImpl end = (ElementImpl) this.context.findEndTag(tagName);
-					if (end != null) {
-						// move the end tag from 'end' to 'element'
-						element.addEndTag(end);
-						removeEndTag(end);
-						this.context.setParentNode(parent); // reset context
-						continue;
-					}
-				}
-			}
-
-			next = parent.getNextSibling();
-			parent = parent.getParentNode();
-			if (next != null) {
-				this.context.setNextNode(next);
-			}
-			else {
-				this.context.setParentNode(parent);
-			}
-		}
-	}
-
-	/**
-	 */
-	private void cleanupText() {
-		Node parent = this.context.getParentNode();
-		if (parent == null)
-			return; // error
-		Node next = this.context.getNextNode();
-		Node prev = (next == null ? parent.getLastChild() : next.getPreviousSibling());
-
-		TextImpl nextText = null;
-		TextImpl prevText = null;
-		if (next != null && next.getNodeType() == Node.TEXT_NODE) {
-			nextText = (TextImpl) next;
-		}
-		if (prev != null && prev.getNodeType() == Node.TEXT_NODE) {
-			prevText = (TextImpl) prev;
-		}
-		if (nextText == null && prevText == null)
-			return;
-		if (nextText != null && prevText != null) {
-			// consecutive Text nodes created by setupContext(),
-			// concat them
-			IStructuredDocumentRegion flatNode = nextText.getStructuredDocumentRegion();
-			if (flatNode != null)
-				prevText.appendStructuredDocumentRegion(flatNode);
-			Node newNext = next.getNextSibling();
-			parent.removeChild(next);
-			next = null;
-			this.context.setNextNode(newNext);
-		}
-
-		TextImpl childText = (prevText != null ? prevText : nextText);
-		if (childText.getNextSibling() == null && childText.getPreviousSibling() == null) {
-			if (parent.getNodeType() == Node.ELEMENT_NODE) {
-				ElementImpl parentElement = (ElementImpl) parent;
-				if (!parentElement.hasStartTag() && !parentElement.hasEndTag()) {
-					if (childText.isWhitespace() || childText.isInvalid()) {
-						// implicit parent is not required
-						Node newParent = parent.getParentNode();
-						if (newParent != null) {
-							Node newNext = parent.getNextSibling();
-							newParent.removeChild(parent);
-							parent.removeChild(childText);
-							newParent.insertBefore(childText, newNext);
-							if (childText == next) {
-								this.context.setNextNode(childText);
-							}
-							else if (newNext != null) {
-								this.context.setNextNode(newNext);
-							}
-							else {
-								this.context.setParentNode(newParent);
-							}
-							// try again
-							cleanupText();
-						}
-					}
-				}
-			}
-		}
-	}
-
-	/**
-	 * This routine create an Element from comment data for comment style
-	 * elements, such as SSI and METADATA
-	 */
-	protected Element createCommentElement(String data, boolean isJSPTag) {
-		String trimmedData = data.trim();
-		CommentElementConfiguration[] configs = CommentElementRegistry.getInstance().getConfigurations();
-		for (int iConfig = 0; iConfig < configs.length; iConfig++) {
-			CommentElementConfiguration config = configs[iConfig];
-			if ((isJSPTag && !config.acceptJSPComment()) || (!isJSPTag && !config.acceptXMLComment())) {
-				continue;
-			}
-			String[] prefixes = config.getPrefix();
-			for (int iPrefix = 0; iPrefix < prefixes.length; iPrefix++) {
-				if (trimmedData.startsWith(prefixes[iPrefix])) {
-					return config.createElement(this.model.getDocument(), data, isJSPTag);
-				}
-			}
-		}
-		ModelParserAdapter adapter = getParserAdapter();
-		if (adapter != null) {
-			return adapter.createCommentElement(this.model.getDocument(), data, isJSPTag);
-		}
-		return null;
-	}
-
-	/**
-	 * This routine create an implicit Element for given parent and child,
-	 * such as HTML, BODY, HEAD, and TBODY for HTML document.
-	 */
-	protected Element createImplicitElement(Node parent, Node child) {
-		ModelParserAdapter adapter = getParserAdapter();
-		if (adapter != null) {
-			return adapter.createImplicitElement(this.model.getDocument(), parent, child);
-		}
-		return null;
-	}
-
-	/**
-	 */
-	private void demoteNodes(Node root, Node newParent, Node oldParent, Node next) {
-		if (newParent.getNodeType() != Node.ELEMENT_NODE)
-			return;
-		ElementImpl newElement = (ElementImpl) newParent;
-
-		// find next
-		while (next == null) {
-			if (oldParent.getNodeType() != Node.ELEMENT_NODE)
-				return;
-			ElementImpl oldElement = (ElementImpl) oldParent;
-			if (oldElement.hasEndTag())
-				return;
-			oldParent = oldElement.getParentNode();
-			if (oldParent == null)
-				return; // error
-			next = oldElement.getNextSibling();
-		}
-
-		while (next != null) {
-			boolean done = false;
-			if (next.getNodeType() == Node.ELEMENT_NODE) {
-				ElementImpl nextElement = (ElementImpl) next;
-				if (!nextElement.hasStartTag()) {
-					Node nextChild = nextElement.getFirstChild();
-					if (nextChild != null) {
-						// demote children
-						next = nextChild;
-						oldParent = nextElement;
-						continue;
-					}
-
-					if (nextElement.hasEndTag()) {
-						if (nextElement.matchEndTag(newElement)) {
-							// stop at the matched invalid end tag
-							next = nextElement.getNextSibling();
-							oldParent.removeChild(nextElement);
-							newElement.addEndTag(nextElement);
-
-							if (newElement == root)
-								return;
-							Node p = newElement.getParentNode();
-							// check if reached to top
-							if (p == null || p == oldParent || p.getNodeType() != Node.ELEMENT_NODE)
-								return;
-							newElement = (ElementImpl) p;
-							done = true;
-						}
-					}
-					else {
-						// remove implicit element
-						next = nextElement.getNextSibling();
-						oldParent.removeChild(nextElement);
-						done = true;
-					}
-				}
-			}
-
-			if (!done) {
-				if (!canContain(newElement, next)) {
-					if (newElement == root)
-						return;
-					Node p = newElement.getParentNode();
-					// check if reached to top
-					if (p == null || p == oldParent || p.getNodeType() != Node.ELEMENT_NODE)
-						return;
-					newElement = (ElementImpl) p;
-					continue;
-				}
-
-				Node child = next;
-				next = next.getNextSibling();
-				oldParent.removeChild(child);
-				insertNode(newElement, child, null);
-				Node childParent = child.getParentNode();
-				if (childParent != newElement) {
-					newElement = (ElementImpl) childParent;
-				}
-			}
-
-			// find next parent and sibling
-			while (next == null) {
-				if (oldParent.getNodeType() != Node.ELEMENT_NODE)
-					return;
-				ElementImpl oldElement = (ElementImpl) oldParent;
-
-				// dug parent must not have children at this point
-				if (!oldElement.hasChildNodes() && !oldElement.hasStartTag()) {
-					oldParent = oldElement.getParentNode();
-					if (oldParent == null)
-						return; // error
-					next = oldElement;
-					break;
-				}
-
-				if (oldElement.hasEndTag())
-					return;
-				oldParent = oldElement.getParentNode();
-				if (oldParent == null)
-					return; // error
-				next = oldElement.getNextSibling();
-			}
-		}
-	}
-
-	private ModelParserAdapter getParserAdapter() {
-		return (ModelParserAdapter) this.model.getDocument().getAdapterFor(ModelParserAdapter.class);
-	}
-	
-	/**
-	 */
-	protected String getFindRootName(String tagName) {
-		ModelParserAdapter adapter = getParserAdapter();
-		if (adapter != null) {
-			return adapter.getFindRootName(tagName);
-		}
-		return null;
-	}
-
-	/**
-	 */
-	protected final IDOMModel getModel() {
-		return this.model;
-	}
-
-	/**
-	 * insertCDATASection method
-	 * 
-	 */
-	private void insertCDATASection(IStructuredDocumentRegion flatNode) {
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return;
-
-		CDATASectionImpl cdata = null;
-		try {
-			cdata = (CDATASectionImpl) this.model.getDocument().createCDATASection(null);
-		}
-		catch (DOMException ex) {
-		}
-		if (cdata == null) { // CDATA section might not be supported
-			insertInvalidDecl(flatNode); // regard as invalid decl
-			return;
-		}
-
-		cdata.setStructuredDocumentRegion(flatNode);
-		insertNode(cdata);
-	}
-
-	/**
-	 * insertComment method
-	 * 
-	 */
-	private void insertComment(IStructuredDocumentRegion flatNode) {
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return;
-
-		String data = null;
-		boolean isJSPTag = false;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (isNestedCommentOpen(regionType)) {
-				isJSPTag = true;
-			}
-			else if (regionType == DOMRegionContext.XML_COMMENT_TEXT || isNestedCommentText(regionType)) {
-				if (data == null) {
-					data = flatNode.getText(region);
-				}
-			}
-		}
-
-		if (data != null) {
-			ElementImpl element = (ElementImpl) createCommentElement(data, isJSPTag);
-			if (element != null) {
-				if (!isEndTag(element)) {
-					element.setStartStructuredDocumentRegion(flatNode);
-					insertStartTag(element);
-					return;
-				}
-
-				// end tag
-				element.setEndStructuredDocumentRegion(flatNode);
-
-				String tagName = element.getTagName();
-				String rootName = getFindRootName(tagName);
-				ElementImpl start = (ElementImpl) this.context.findStartTag(tagName, rootName);
-				if (start != null) { // start tag found
-					insertEndTag(start);
-					start.addEndTag(element);
-					return;
-				}
-
-				// invalid end tag
-				insertNode(element);
-				return;
-			}
-		}
-
-		CommentImpl comment = (CommentImpl) this.model.getDocument().createComment(null);
-		if (comment == null)
-			return;
-		if (isJSPTag)
-			comment.setJSPTag(true);
-		comment.setStructuredDocumentRegion(flatNode);
-		insertNode(comment);
-	}
-
-	/**
-	 * insertDecl method
-	 * 
-	 */
-	private void insertDecl(IStructuredDocumentRegion flatNode) {
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return;
-
-		boolean isDocType = false;
-		String name = null;
-		String publicId = null;
-		String systemId = null;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_DOCTYPE_DECLARATION) {
-				isDocType = true;
-			}
-			else if (regionType == DOMRegionContext.XML_DOCTYPE_NAME) {
-				if (name == null)
-					name = flatNode.getText(region);
-			}
-			else if (regionType == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF) {
-				if (publicId == null)
-					publicId = StructuredDocumentRegionUtil.getAttrValue(flatNode, region);
-			}
-			else if (regionType == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF) {
-				if (systemId == null)
-					systemId = StructuredDocumentRegionUtil.getAttrValue(flatNode, region);
-			}
-		}
-
-		// invalid declaration
-		if (!isDocType) {
-			insertInvalidDecl(flatNode);
-			return;
-		}
-
-		DocumentTypeImpl docType = (DocumentTypeImpl) this.model.getDocument().createDoctype(name);
-		if (docType == null)
-			return;
-		if (publicId != null)
-			docType.setPublicId(publicId);
-		if (systemId != null)
-			docType.setSystemId(systemId);
-		docType.setStructuredDocumentRegion(flatNode);
-		insertNode(docType);
-	}
-
-	/**
-	 * insertEndTag method can be used by subclasses, but not overrided.
-	 * 
-	 * @param element
-	 *            org.w3c.dom.Element
-	 */
-	protected void insertEndTag(Element element) {
-		if (element == null)
-			return;
-
-		Node newParent = element.getParentNode();
-		if (newParent == null)
-			return; // error
-
-		if (!((ElementImpl) element).isContainer()) {
-			// just update context
-			Node elementNext = element.getNextSibling();
-			if (elementNext != null)
-				this.context.setNextNode(elementNext);
-			else
-				this.context.setParentNode(newParent);
-			return;
-		}
-
-		// promote children
-		Node newNext = element.getNextSibling();
-		Node oldParent = this.context.getParentNode();
-		if (oldParent == null)
-			return; // error
-		Node oldNext = this.context.getNextNode();
-		promoteNodes(element, newParent, newNext, oldParent, oldNext);
-
-		// update context
-		// re-check the next sibling
-		newNext = element.getNextSibling();
-		if (newNext != null)
-			this.context.setNextNode(newNext);
-		else
-			this.context.setParentNode(newParent);
-	}
-
-	/**
-	 * insertEndTag method
-	 * 
-	 */
-	private void insertEndTag(IStructuredDocumentRegion flatNode) {
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return;
-
-		String tagName = null;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTagName(regionType)) {
-				if (tagName == null)
-					tagName = flatNode.getText(region);
-			}
-		}
-
-		if (tagName == null) { // invalid end tag
-			insertText(flatNode); // regard as invalid text
-			return;
-		}
-
-		String rootName = getFindRootName(tagName);
-		ElementImpl start = (ElementImpl) this.context.findStartTag(tagName, rootName);
-		if (start != null) { // start tag found
-			insertEndTag(start);
-			start.setEndStructuredDocumentRegion(flatNode);
-			return;
-		}
-
-		// invalid end tag
-		ElementImpl end = null;
-		try {
-			end = (ElementImpl) this.model.getDocument().createElement(tagName);
-		}
-		catch (DOMException ex) {
-		}
-		if (end == null) { // invalid end tag
-			insertText(flatNode); // regard as invalid text
-			return;
-		}
-		end.setEndStructuredDocumentRegion(flatNode);
-		insertNode(end);
-	}
-
-	/**
-	 * insertEntityRef method
-	 * 
-	 */
-	private void insertEntityRef(IStructuredDocumentRegion flatNode) {
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return;
-
-		String name = null;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_ENTITY_REFERENCE || regionType == DOMRegionContext.XML_CHAR_REFERENCE) {
-				if (name == null)
-					name = StructuredDocumentRegionUtil.getEntityRefName(flatNode, region);
-			}
-		}
-
-		if (name == null) { // invalid entity
-			insertText(flatNode);
-			return;
-		}
-
-		// ISSUE: avoid this cast
-		String value = ((DocumentImpl)this.model.getDocument()).getCharValue(name);
-		if (value != null) { // character entity
-			TextImpl text = (TextImpl) this.context.findPreviousText();
-			if (text != null) { // existing text found
-				// do not append data
-				text.appendStructuredDocumentRegion(flatNode);
-				// notify the change
-				text.notifyValueChanged();
-				return;
-			}
-
-			// new text
-			text = (TextImpl) this.model.getDocument().createTextNode(null);
-			if (text == null)
-				return;
-			text.setStructuredDocumentRegion(flatNode);
-			insertNode(text);
-			return;
-		}
-
-		// general entity reference
-		EntityReferenceImpl ref = null;
-		try {
-			ref = (EntityReferenceImpl) this.model.getDocument().createEntityReference(name);
-		}
-		catch (DOMException ex) {
-		}
-		if (ref == null) { // entity reference might not be supported
-			insertText(flatNode); // regard as invalid text
-			return;
-		}
-
-		ref.setStructuredDocumentRegion(flatNode);
-		insertNode(ref);
-	}
-
-	/**
-	 * insertInvalidDecl method
-	 * 
-	 */
-	private void insertInvalidDecl(IStructuredDocumentRegion flatNode) {
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return;
-
-		ElementImpl element = null;
-		try {
-			element = (ElementImpl) this.model.getDocument().createElement("!");//$NON-NLS-1$
-		}
-		catch (DOMException ex) {
-		}
-		if (element == null) { // invalid tag
-			insertText(flatNode); // regard as invalid text
-			return;
-		}
-		element.setEmptyTag(true);
-		element.setStartStructuredDocumentRegion(flatNode);
-		insertNode(element);
-	}
-
-	/**
-	 * insertJSPTag method
-	 * 
-	 */
-	private void insertNestedTag(IStructuredDocumentRegion flatNode) {
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return;
-
-		String tagName = null;
-		AttrImpl attr = null;
-		Vector attrNodes = null;
-		boolean isCloseTag = false;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (isNestedTagOpen(regionType) || isNestedTagName(regionType)) {
-				tagName = computeNestedTag(regionType, tagName, flatNode, region);
-			}
-			else if (isNestedTagClose(regionType)) {
-				isCloseTag = true;
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-				String name = flatNode.getText(region);
-				attr = (AttrImpl) this.model.getDocument().createAttribute(name);
-				if (attr != null) {
-					attr.setNameRegion(region);
-					if (attrNodes == null)
-						attrNodes = new Vector();
-					attrNodes.addElement(attr);
-				}
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
-				if (attr != null) {
-					attr.setEqualRegion(region);
-				}
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-				if (attr != null) {
-					attr.setValueRegion(region);
-					attr = null;
-				}
-			}
-		}
-
-		if (tagName == null) {
-			if (isCloseTag) {
-				// close JSP tag
-				Node parent = this.context.getParentNode();
-				if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
-					ElementImpl start = (ElementImpl) parent;
-					if (start.isJSPContainer()) {
-						insertEndTag(start);
-						start.setEndStructuredDocumentRegion(flatNode);
-						return;
-					}
-				}
-			}
-			// invalid JSP tag
-			insertText(flatNode); // regard as invalid text
-			return;
-		}
-
-		ElementImpl element = null;
-		try {
-			element = (ElementImpl) this.model.getDocument().createElement(tagName);
-		}
-		catch (DOMException ex) {
-		}
-		if (element == null) { // invalid tag
-			insertText(flatNode); // regard as invalid text
-			return;
-		}
-		if (attrNodes != null) {
-			Enumeration ae = attrNodes.elements();
-			while (ae.hasMoreElements()) {
-				Attr a = (Attr) ae.nextElement();
-				if (a == null)
-					continue;
-				element.appendAttributeNode(a);
-			}
-		}
-		element.setJSPTag(true);
-		element.setStartStructuredDocumentRegion(flatNode);
-		insertStartTag(element);
-	}
-
-	protected boolean isNestedTagClose(String regionType) {
-		boolean result = false;
-		return result;
-	}
-
-	protected boolean isNestedTagOpen(String regionType) {
-		boolean result = false;
-		return result;
-	}
-
-	protected String computeNestedTag(String regionType, String tagName, IStructuredDocumentRegion structuredDocumentRegion, ITextRegion region) {
-		return tagName;
-	}
-
-	/**
-	 * insertNode method
-	 * 
-	 * @param child
-	 *            org.w3c.dom.Node
-	 */
-	private void insertNode(Node node) {
-		if (node == null)
-			return;
-		if (this.context == null)
-			return;
-
-		Node parent = this.context.getParentNode();
-		if (parent == null)
-			return;
-		Node next = this.context.getNextNode();
-		while (parent.getNodeType() == Node.ELEMENT_NODE) {
-			ElementImpl element = (ElementImpl) parent;
-			if (canContain(element, node)) {
-				if (!element.hasStartTag() && next == element.getFirstChild()) {
-					// first child of implicit tag
-					// deletege to the parent
-					parent = element.getParentNode();
-					if (parent == null)
-						return;
-					next = element;
-					this.context.setNextNode(next);
-					continue;
-				}
-				break;
-			}
-			parent = element.getParentNode();
-			if (parent == null)
-				return;
-
-			// promote siblings
-			Node newNext = element.getNextSibling();
-			Node child = next;
-			while (child != null) {
-				Node nextChild = child.getNextSibling();
-				element.removeChild(child);
-				parent.insertBefore(child, newNext);
-				child = nextChild;
-			}
-
-			// leave the old end tag where it is
-			if (element.hasEndTag()) {
-				Element end = element.removeEndTag();
-				if (end != null) {
-					parent.insertBefore(end, newNext);
-					if (next == null)
-						next = end;
-				}
-			}
-			if (!element.hasStartTag()) {
-				// implicit element
-				if (!element.hasChildNodes()) {
-					parent.removeChild(element);
-				}
-			}
-
-			// update context
-			if (next == null)
-				next = newNext;
-			if (next != null)
-				this.context.setNextNode(next);
-			else
-				this.context.setParentNode(parent);
-		}
-
-		insertNode(parent, node, next);
-		next = node.getNextSibling();
-		if (next != null)
-			this.context.setNextNode(next);
-		else
-			this.context.setParentNode(node.getParentNode());
-	}
-
-	/**
-	 */
-	private void insertNode(Node parent, Node node, Node next) {
-		while (next != null && next.getNodeType() == Node.ELEMENT_NODE) {
-			ElementImpl nextElement = (ElementImpl) next;
-			if (nextElement.hasStartTag())
-				break;
-			if (!canBeImplicitTag(nextElement, node))
-				break;
-			parent = nextElement;
-			next = nextElement.getFirstChild();
-		}
-		Element implicitElement = createImplicitElement(parent, node);
-		if (implicitElement != null)
-			node = implicitElement;
-		parent.insertBefore(node, next);
-	}
-
-	/**
-	 * insertPI method
-	 * 
-	 */
-	private void insertPI(IStructuredDocumentRegion flatNode) {
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return;
-
-		String target = null;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_PI_OPEN || regionType == DOMRegionContext.XML_PI_CLOSE)
-				continue;
-			if (target == null)
-				target = flatNode.getText(region);
-		}
-
-		ProcessingInstructionImpl pi = (ProcessingInstructionImpl) this.model.getDocument().createProcessingInstruction(target, null);
-		if (pi == null)
-			return;
-		pi.setStructuredDocumentRegion(flatNode);
-		insertNode(pi);
-	}
-
-	/**
-	 * insertStartTag method can be used by subclasses, but not overridden.
-	 * 
-	 * @param element
-	 *            org.w3c.dom.Element
-	 */
-	protected void insertStartTag(Element element) {
-		if (element == null)
-			return;
-		if (this.context == null)
-			return;
-
-		insertNode(element);
-
-		ElementImpl newElement = (ElementImpl) element;
-		if (newElement.isEmptyTag() || !newElement.isContainer())
-			return;
-
-		// demote siblings
-		Node parent = this.context.getParentNode();
-		if (parent == null)
-			return; // error
-		Node next = this.context.getNextNode();
-		demoteNodes(element, element, parent, next);
-
-		// update context
-		Node firstChild = element.getFirstChild();
-		if (firstChild != null)
-			this.context.setNextNode(firstChild);
-		else
-			this.context.setParentNode(element);
-	}
-
-	/**
-	 * insertStartTag method
-	 * 
-	 */
-	private void insertStartTag(IStructuredDocumentRegion flatNode) {
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return;
-
-		String tagName = null;
-		boolean isEmptyTag = false;
-		AttrImpl attr = null;
-		Vector attrNodes = null;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTagName(regionType)) {
-				if (tagName == null)
-					tagName = flatNode.getText(region);
-			}
-			else if (regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-				isEmptyTag = true;
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-				String name = flatNode.getText(region);
-				attr = (AttrImpl) this.model.getDocument().createAttribute(name);
-				if (attr != null) {
-					attr.setNameRegion(region);
-					if (attrNodes == null)
-						attrNodes = new Vector();
-					attrNodes.addElement(attr);
-				}
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
-				if (attr != null) {
-					attr.setEqualRegion(region);
-				}
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-				if (attr != null) {
-					attr.setValueRegion(region);
-					attr = null;
-				}
-			}
-		}
-
-		if (tagName == null) { // invalid start tag
-			insertText(flatNode); // regard as invalid text
-			return;
-		}
-
-		ElementImpl element = null;
-		try {
-			element = (ElementImpl) this.model.getDocument().createElement(tagName);
-		}
-		catch (DOMException ex) {
-			// typically invalid name
-		}
-		if (element == null) { // invalid tag
-			insertText(flatNode); // regard as invalid text
-			return;
-		}
-		if (attrNodes != null) {
-			Enumeration ae = attrNodes.elements();
-			while (ae.hasMoreElements()) {
-				Attr a = (Attr) ae.nextElement();
-				if (a == null)
-					continue;
-				element.appendAttributeNode(a);
-			}
-		}
-		if (isEmptyTag)
-			element.setEmptyTag(true);
-		element.setStartStructuredDocumentRegion(flatNode);
-		insertStartTag(element);
-	}
-
-	/**
-	 * insertStructuredDocumentRegion method
-	 * 
-	 */
-	protected void insertStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		String regionType = StructuredDocumentRegionUtil.getFirstRegionType(flatNode);
-		if (regionType == DOMRegionContext.XML_TAG_OPEN) {
-			insertStartTag(flatNode);
-		}
-		else if (regionType == DOMRegionContext.XML_END_TAG_OPEN) {
-			insertEndTag(flatNode);
-		}
-		else if (regionType == DOMRegionContext.XML_COMMENT_OPEN || isNestedCommentOpen(regionType)) {
-			insertComment(flatNode);
-		}
-		else if (regionType == DOMRegionContext.XML_ENTITY_REFERENCE || regionType == DOMRegionContext.XML_CHAR_REFERENCE) {
-			insertEntityRef(flatNode);
-		}
-		else if (regionType == DOMRegionContext.XML_DECLARATION_OPEN) {
-			insertDecl(flatNode);
-		}
-		else if (regionType == DOMRegionContext.XML_PI_OPEN) {
-			insertPI(flatNode);
-		}
-		else if (regionType == DOMRegionContext.XML_CDATA_OPEN) {
-			insertCDATASection(flatNode);
-		}
-		else if (isNestedTag(regionType)) {
-			insertNestedTag(flatNode);
-		}
-		else {
-			insertText(flatNode);
-		}
-	}
-
-	protected boolean isNestedTag(String regionType) {
-		boolean result = false;
-		return result;
-	}
-
-	protected boolean isNestedCommentText(String regionType) {
-		boolean result = false;
-		return result;
-	}
-
-
-	protected boolean isNestedCommentOpen(String regionType) {
-		boolean result = false;
-		return result;
-	}
-
-	protected boolean isNestedTagName(String regionType) {
-		boolean result = false;
-		return result;
-	}
-
-	protected boolean isNestedContent(String regionType) {
-		boolean result = false;
-		return result;
-	}
-
-	/**
-	 * insertText method Can be called from subclasses, not to be overrided or
-	 * re-implemented.
-	 * 
-	 */
-	protected void insertText(IStructuredDocumentRegion flatNode) {
-		TextImpl text = (TextImpl) this.context.findPreviousText();
-		if (text != null) { // existing text found
-			text.appendStructuredDocumentRegion(flatNode);
-			// notify the change
-			text.notifyValueChanged();
-			return;
-		}
-
-		// new text
-		text = (TextImpl) this.model.getDocument().createTextNode(null);
-		if (text == null)
-			return;
-		text.setStructuredDocumentRegion(flatNode);
-		insertNode(text);
-	}
-
-	/**
-	 */
-	protected boolean isEndTag(IDOMElement element) {
-		ModelParserAdapter adapter = getParserAdapter();
-		if (adapter != null) {
-			return adapter.isEndTag(element);
-		}
-		return element.isEndTag();
-	}
-
-	/**
-	 */
-	private void promoteNodes(Node root, Node newParent, Node newNext, Node oldParent, Node next) {
-		ElementImpl newElement = null;
-		if (newParent.getNodeType() == Node.ELEMENT_NODE) {
-			newElement = (ElementImpl) newParent;
-		}
-
-		Node rootParent = root.getParentNode();
-		while (oldParent != rootParent) {
-			while (next != null) {
-				boolean done = false;
-				boolean endTag = false;
-				if (next.getNodeType() == Node.ELEMENT_NODE) {
-					ElementImpl nextElement = (ElementImpl) next;
-					if (!nextElement.hasStartTag()) {
-						Node nextChild = nextElement.getFirstChild();
-						if (nextChild != null) {
-							// promote children
-							next = nextChild;
-							oldParent = nextElement;
-							continue;
-						}
-
-						if (nextElement.hasEndTag()) {
-							if (nextElement.matchEndTag(newElement)) {
-								endTag = true;
-							}
-						}
-						else {
-							// remove implicit element
-							next = nextElement.getNextSibling();
-							oldParent.removeChild(nextElement);
-							done = true;
-						}
-					}
-				}
-
-				if (!done) {
-					if (!endTag && newElement != null && !canContain(newElement, next)) {
-						newParent = newElement.getParentNode();
-						if (newParent == null)
-							return; // error
-						Node elementNext = newElement.getNextSibling();
-						// promote siblings
-						promoteNodes(newElement, newParent, elementNext, newElement, newNext);
-						newNext = newElement.getNextSibling();
-						if (newParent.getNodeType() == Node.ELEMENT_NODE) {
-							newElement = (ElementImpl) newParent;
-						}
-						else {
-							newElement = null;
-						}
-						continue;
-					}
-
-					Node child = next;
-					next = next.getNextSibling();
-					oldParent.removeChild(child);
-					insertNode(newParent, child, newNext);
-					Node childParent = child.getParentNode();
-					if (childParent != newParent) {
-						newParent = childParent;
-						newElement = (ElementImpl) newParent;
-						newNext = child.getNextSibling();
-					}
-				}
-			}
-
-			if (oldParent.getNodeType() != Node.ELEMENT_NODE)
-				return;
-			ElementImpl oldElement = (ElementImpl) oldParent;
-			oldParent = oldElement.getParentNode();
-			if (oldParent == null)
-				return; // error
-			next = oldElement.getNextSibling();
-
-			if (oldElement.hasEndTag()) {
-				Element end = null;
-				if (!oldElement.hasChildNodes() && !oldElement.hasStartTag()) {
-					oldParent.removeChild(oldElement);
-					end = oldElement;
-				}
-				else {
-					end = oldElement.removeEndTag();
-				}
-				if (end != null) {
-					insertNode(newParent, end, newNext);
-					Node endParent = end.getParentNode();
-					if (endParent != newParent) {
-						newParent = endParent;
-						newElement = (ElementImpl) newParent;
-						newNext = end.getNextSibling();
-					}
-				}
-			}
-		}
-	}
-
-	/**
-	 * removeEndTag method
-	 * 
-	 * @param element
-	 *            org.w3c.dom.Element
-	 */
-	private void removeEndTag(Element element) {
-		if (element == null)
-			return;
-		if (this.context == null)
-			return;
-
-		Node parent = element.getParentNode();
-		if (parent == null)
-			return; // error
-
-		if (!((ElementImpl) element).isContainer()) {
-			// just update context
-			Node elementNext = element.getNextSibling();
-			if (elementNext != null)
-				this.context.setNextNode(elementNext);
-			else
-				this.context.setParentNode(parent);
-			return;
-		}
-
-		// demote siblings
-		Node next = element.getNextSibling();
-		ElementImpl newElement = (ElementImpl) element;
-		// find new parent
-		for (Node last = newElement.getLastChild(); last != null; last = last.getLastChild()) {
-			if (last.getNodeType() != Node.ELEMENT_NODE)
-				break;
-			ElementImpl lastElement = (ElementImpl) last;
-			if (lastElement.hasEndTag() || lastElement.isEmptyTag() || !lastElement.isContainer())
-				break;
-			newElement = lastElement;
-		}
-		Node lastChild = newElement.getLastChild();
-		demoteNodes(element, newElement, parent, next);
-
-		// update context
-		Node newNext = null;
-		if (lastChild != null)
-			newNext = lastChild.getNextSibling();
-		else
-			newNext = newElement.getFirstChild();
-		if (newNext != null)
-			this.context.setNextNode(newNext);
-		else
-			this.context.setParentNode(newElement);
-	}
-
-	/**
-	 * Remove the specified node if it is no longer required implicit tag with
-	 * remaining child nodes promoted.
-	 */
-	private Element removeImplicitElement(Node parent) {
-		if (parent == null)
-			return null;
-		if (parent.getNodeType() != Node.ELEMENT_NODE)
-			return null;
-		ElementImpl element = (ElementImpl) parent;
-		if (!element.isImplicitTag())
-			return null;
-		if (canBeImplicitTag(element))
-			return null;
-
-		Node elementParent = element.getParentNode();
-		if (elementParent == null)
-			return null; // error
-		Node firstChild = element.getFirstChild();
-		Node child = firstChild;
-		Node elementNext = element.getNextSibling();
-		while (child != null) {
-			Node nextChild = child.getNextSibling();
-			element.removeChild(child);
-			elementParent.insertBefore(child, elementNext);
-			child = nextChild;
-		}
-
-		// reset context
-		if (this.context.getParentNode() == element) {
-			Node oldNext = this.context.getNextNode();
-			if (oldNext != null) {
-				this.context.setNextNode(oldNext);
-			}
-			else {
-				if (elementNext != null) {
-					this.context.setNextNode(elementNext);
-				}
-				else {
-					this.context.setParentNode(elementParent);
-				}
-			}
-		}
-		else if (this.context.getNextNode() == element) {
-			if (firstChild != null) {
-				this.context.setNextNode(firstChild);
-			}
-			else {
-				if (elementNext != null) {
-					this.context.setNextNode(elementNext);
-				}
-				else {
-					this.context.setParentNode(elementParent);
-				}
-			}
-		}
-
-		removeNode(element);
-		return element;
-	}
-
-	/**
-	 * removeNode method
-	 * 
-	 * @param node
-	 *            org.w3c.dom.Node
-	 */
-	private void removeNode(Node node) {
-		if (node == null)
-			return;
-		if (this.context == null)
-			return;
-
-		Node parent = node.getParentNode();
-		if (parent == null)
-			return;
-		Node next = node.getNextSibling();
-		Node prev = node.getPreviousSibling();
-
-		// update context
-		Node oldParent = this.context.getParentNode();
-		if (node == oldParent) {
-			if (next != null)
-				this.context.setNextNode(next);
-			else
-				this.context.setParentNode(parent);
-		}
-		else {
-			Node oldNext = this.context.getNextNode();
-			if (node == oldNext) {
-				this.context.setNextNode(next);
-			}
-		}
-
-		parent.removeChild(node);
-
-		if (removeImplicitElement(parent) != null)
-			return;
-
-		// demote sibling
-		if (prev != null && prev.getNodeType() == Node.ELEMENT_NODE) {
-			ElementImpl newElement = (ElementImpl) prev;
-			if (!newElement.hasEndTag() && !newElement.isEmptyTag() && newElement.isContainer()) {
-				// find new parent
-				for (Node last = newElement.getLastChild(); last != null; last = last.getLastChild()) {
-					if (last.getNodeType() != Node.ELEMENT_NODE)
-						break;
-					ElementImpl lastElement = (ElementImpl) last;
-					if (lastElement.hasEndTag() || lastElement.isEmptyTag() || !lastElement.isContainer())
-						break;
-					newElement = lastElement;
-				}
-				Node lastChild = newElement.getLastChild();
-				demoteNodes(prev, newElement, parent, next);
-
-				// update context
-				Node newNext = null;
-				if (lastChild != null)
-					newNext = lastChild.getNextSibling();
-				else
-					newNext = newElement.getFirstChild();
-				if (newNext != null)
-					this.context.setNextNode(newNext);
-				else
-					this.context.setParentNode(newElement);
-			}
-		}
-	}
-
-	/**
-	 * removeStartTag method
-	 * 
-	 * @param element
-	 *            org.w3c.dom.Element
-	 */
-	private void removeStartTag(Element element) {
-		if (element == null)
-			return;
-		if (this.context == null)
-			return;
-
-		// for implicit tag
-		ElementImpl oldElement = (ElementImpl) element;
-		if (canBeImplicitTag(oldElement)) {
-			Node newParent = null;
-			Node prev = oldElement.getPreviousSibling();
-			if (prev != null && prev.getNodeType() == Node.ELEMENT_NODE) {
-				ElementImpl prevElement = (ElementImpl) prev;
-				if (!prevElement.hasEndTag()) {
-					if (prevElement.hasStartTag() || prevElement.matchTagName(oldElement.getTagName())) {
-						newParent = prevElement;
-					}
-				}
-			}
-			if (newParent == null) {
-				// this element should stay as implicit tag
-				// just remove all attributes
-				oldElement.removeStartTag();
-
-				// update context
-				Node child = oldElement.getFirstChild();
-				if (child != null) {
-					this.context.setNextNode(child);
-				}
-				else if (oldElement.hasEndTag()) {
-					this.context.setParentNode(oldElement);
-				}
-				return;
-			}
-		}
-		// for comment tag
-		if (oldElement.isCommentTag())
-			oldElement.removeStartTag();
-
-		// promote children
-		Node elementParent = element.getParentNode();
-		Node parent = elementParent;
-		if (parent == null)
-			return;
-		Node first = element.getFirstChild();
-		Node firstElement = null; // for the case first is removed as end
-		// tag
-		if (first != null) {
-			// find new parent for children
-			ElementImpl newElement = null;
-			for (Node last = element.getPreviousSibling(); last != null; last = last.getLastChild()) {
-				if (last.getNodeType() != Node.ELEMENT_NODE)
-					break;
-				ElementImpl lastElement = (ElementImpl) last;
-				if (lastElement.hasEndTag() || lastElement.isEmptyTag() || !lastElement.isContainer())
-					break;
-				newElement = lastElement;
-			}
-			Node next = first;
-			if (newElement != null) {
-				while (next != null) {
-					if (!newElement.hasEndTag() && newElement.hasStartTag() && next.getNodeType() == Node.ELEMENT_NODE) {
-						ElementImpl nextElement = (ElementImpl) next;
-						if (!nextElement.hasStartTag() && nextElement.hasEndTag() && nextElement.matchEndTag(newElement)) {
-							// stop at the matched invalid end tag
-							Node elementChild = nextElement.getFirstChild();
-							while (elementChild != null) {
-								Node nextChild = elementChild.getNextSibling();
-								nextElement.removeChild(elementChild);
-								newElement.appendChild(elementChild);
-								elementChild = nextChild;
-							}
-
-							next = nextElement.getNextSibling();
-							element.removeChild(nextElement);
-							newElement.addEndTag(nextElement);
-							if (nextElement == first)
-								firstElement = newElement;
-
-							Node newParent = newElement.getParentNode();
-							if (newParent == parent)
-								break;
-							if (newParent == null || newParent.getNodeType() != Node.ELEMENT_NODE)
-								break; // error
-							newElement = (ElementImpl) newParent;
-							continue;
-						}
-					}
-					if (!canContain(newElement, next)) {
-						Node newParent = newElement.getParentNode();
-						if (newParent == parent)
-							break;
-						if (newParent == null || newParent.getNodeType() != Node.ELEMENT_NODE)
-							break; // error
-						newElement = (ElementImpl) newParent;
-						continue;
-					}
-					Node child = next;
-					next = next.getNextSibling();
-					element.removeChild(child);
-					newElement.appendChild(child);
-				}
-				newElement = null;
-			}
-			if (parent.getNodeType() == Node.ELEMENT_NODE) {
-				newElement = (ElementImpl) parent;
-			}
-			while (next != null) {
-				if (newElement == null || canContain(newElement, next)) {
-					Node child = next;
-					next = next.getNextSibling();
-					element.removeChild(child);
-					parent.insertBefore(child, element);
-					continue;
-				}
-
-				parent = newElement.getParentNode();
-				if (parent == null)
-					return;
-
-				// promote siblings
-				Node newNext = newElement.getNextSibling();
-				Node child = element;
-				while (child != null) {
-					Node nextChild = child.getNextSibling();
-					newElement.removeChild(child);
-					parent.insertBefore(child, newNext);
-					child = nextChild;
-				}
-
-				// leave the old end tag where it is
-				if (newElement.hasEndTag()) {
-					Element end = newElement.removeEndTag();
-					if (end != null) {
-						parent.insertBefore(end, newNext);
-					}
-				}
-				if (!newElement.hasStartTag()) {
-					// implicit element
-					if (!newElement.hasChildNodes()) {
-						parent.removeChild(newElement);
-					}
-				}
-
-				if (parent.getNodeType() == Node.ELEMENT_NODE) {
-					newElement = (ElementImpl) parent;
-				}
-				else {
-					newElement = null;
-				}
-			}
-		}
-
-		Node newNext = element;
-		Node startElement = null; // for the case element is removed as end
-		// tag
-		if (oldElement.hasEndTag()) {
-			// find new parent for invalid end tag and siblings
-			ElementImpl newElement = null;
-			for (Node last = element.getPreviousSibling(); last != null; last = last.getLastChild()) {
-				if (last.getNodeType() != Node.ELEMENT_NODE)
-					break;
-				ElementImpl lastElement = (ElementImpl) last;
-				if (lastElement.hasEndTag() || lastElement.isEmptyTag() || !lastElement.isContainer())
-					break;
-				newElement = lastElement;
-			}
-			if (newElement != null) {
-				// demote invalid end tag and sibling
-				Node next = element;
-				while (next != null) {
-					if (!newElement.hasEndTag() && newElement.hasStartTag() && next.getNodeType() == Node.ELEMENT_NODE) {
-						ElementImpl nextElement = (ElementImpl) next;
-						if (!nextElement.hasStartTag() && nextElement.hasEndTag() && nextElement.matchEndTag(newElement)) {
-							// stop at the matched invalid end tag
-							Node elementChild = nextElement.getFirstChild();
-							while (elementChild != null) {
-								Node nextChild = elementChild.getNextSibling();
-								nextElement.removeChild(elementChild);
-								newElement.appendChild(elementChild);
-								elementChild = nextChild;
-							}
-
-							next = nextElement.getNextSibling();
-							parent.removeChild(nextElement);
-							newElement.addEndTag(nextElement);
-							if (nextElement == newNext)
-								startElement = newElement;
-
-							Node newParent = newElement.getParentNode();
-							if (newParent == parent)
-								break;
-							if (newParent == null || newParent.getNodeType() != Node.ELEMENT_NODE)
-								break; // error
-							newElement = (ElementImpl) newParent;
-							continue;
-						}
-					}
-					if (!canContain(newElement, next)) {
-						Node newParent = newElement.getParentNode();
-						if (newParent == parent)
-							break;
-						if (newParent == null || newParent.getNodeType() != Node.ELEMENT_NODE)
-							break; // error
-						newElement = (ElementImpl) newParent;
-						continue;
-					}
-					Node child = next;
-					next = next.getNextSibling();
-					parent.removeChild(child);
-					if (child == oldElement) {
-						if (!oldElement.isCommentTag()) {
-							// clone (re-create) end tag
-							Element end = oldElement.removeEndTag();
-							if (end != null) {
-								child = end;
-								newNext = end;
-							}
-						}
-					}
-					newElement.appendChild(child);
-				}
-			}
-			else {
-				if (!oldElement.isCommentTag()) {
-					// clone (re-create) end tag
-					Element end = oldElement.removeEndTag();
-					if (end != null) {
-						parent.insertBefore(end, oldElement);
-						parent.removeChild(oldElement);
-						newNext = end;
-					}
-				}
-			}
-		}
-		else {
-			newNext = oldElement.getNextSibling();
-			parent.removeChild(oldElement);
-		}
-
-		// update context
-		Node oldParent = this.context.getParentNode();
-		Node oldNext = this.context.getNextNode();
-		if (element == oldParent) {
-			if (oldNext != null) {
-				this.context.setNextNode(oldNext); // reset for new parent
-			}
-			else if (newNext != null) {
-				this.context.setNextNode(newNext);
-			}
-			else {
-				this.context.setParentNode(parent);
-			}
-		}
-		else if (element == oldNext) {
-			if (firstElement != null) {
-				this.context.setParentNode(firstElement);
-			}
-			else if (first != null) {
-				this.context.setNextNode(first);
-			}
-			else if (startElement != null) {
-				this.context.setParentNode(startElement);
-			}
-			else {
-				this.context.setNextNode(newNext);
-			}
-		}
-
-		removeImplicitElement(elementParent);
-	}
-
-	/**
-	 * removeStructuredDocumentRegion method
-	 * 
-	 */
-	private void removeStructuredDocumentRegion(IStructuredDocumentRegion oldStructuredDocumentRegion) {
-		NodeImpl next = (NodeImpl) this.context.getNextNode();
-		if (next != null) {
-			short nodeType = next.getNodeType();
-			if (nodeType != Node.ELEMENT_NODE) {
-				IStructuredDocumentRegion flatNode = next.getStructuredDocumentRegion();
-				if (flatNode == oldStructuredDocumentRegion) {
-					removeNode(next);
-					return;
-				}
-				if (nodeType != Node.TEXT_NODE) {
-					throw new StructuredDocumentRegionManagementException();
-				}
-				if (flatNode == null) {
-					// this is the case for empty Text
-					// remove and continue
-					removeNode(next);
-					removeStructuredDocumentRegion(oldStructuredDocumentRegion);
-					return;
-				}
-				TextImpl text = (TextImpl) next;
-				boolean isShared = text.isSharingStructuredDocumentRegion(oldStructuredDocumentRegion);
-				if (isShared) {
-					// make sure there is next Text node sharing this
-					TextImpl nextText = (TextImpl) this.context.findNextText();
-					if (nextText == null || !nextText.hasStructuredDocumentRegion(oldStructuredDocumentRegion)) {
-						isShared = false;
-					}
-				}
-				oldStructuredDocumentRegion = text.removeStructuredDocumentRegion(oldStructuredDocumentRegion);
-				if (oldStructuredDocumentRegion == null) {
-					throw new StructuredDocumentRegionManagementException();
-				}
-				if (text.getStructuredDocumentRegion() == null) {
-					// this is the case partial IStructuredDocumentRegion is
-					// removed
-					removeNode(text);
-				}
-				else {
-					// notify the change
-					text.notifyValueChanged();
-				}
-				// if shared, continue to remove IStructuredDocumentRegion
-				// from them
-				if (isShared)
-					removeStructuredDocumentRegion(oldStructuredDocumentRegion);
-				return;
-			}
-
-			ElementImpl element = (ElementImpl) next;
-			if (element.hasStartTag()) {
-				IStructuredDocumentRegion flatNode = element.getStartStructuredDocumentRegion();
-				if (flatNode != oldStructuredDocumentRegion) {
-					throw new StructuredDocumentRegionManagementException();
-				}
-				if (element.hasEndTag() || element.hasChildNodes()) {
-					element.setStartStructuredDocumentRegion(null);
-					removeStartTag(element);
-				}
-				else {
-					removeNode(element);
-				}
-			}
-			else {
-				Node child = element.getFirstChild();
-				if (child != null) {
-					this.context.setNextNode(child);
-					removeStructuredDocumentRegion(oldStructuredDocumentRegion);
-					return;
-				}
-
-				if (!element.hasEndTag()) {
-					// implicit element
-					removeNode(element);
-					removeStructuredDocumentRegion(oldStructuredDocumentRegion);
-					return;
-				}
-
-				IStructuredDocumentRegion flatNode = element.getEndStructuredDocumentRegion();
-				if (flatNode != oldStructuredDocumentRegion) {
-					throw new StructuredDocumentRegionManagementException();
-				}
-				removeNode(element);
-			}
-			return;
-		}
-
-		Node parent = this.context.getParentNode();
-		if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE) {
-			throw new StructuredDocumentRegionManagementException();
-		}
-
-		ElementImpl end = (ElementImpl) parent;
-		if (end.hasEndTag()) {
-			IStructuredDocumentRegion flatNode = end.getEndStructuredDocumentRegion();
-			if (flatNode != oldStructuredDocumentRegion) {
-				throw new StructuredDocumentRegionManagementException();
-			}
-			if (!end.hasStartTag() && !end.hasChildNodes()) {
-				this.context.setNextNode(end);
-				removeNode(end);
-			}
-			else {
-				end.setEndStructuredDocumentRegion(null);
-				removeEndTag(end);
-			}
-			return;
-		}
-
-		next = (NodeImpl) end.getNextSibling();
-		if (next != null) {
-			this.context.setNextNode(next);
-			removeStructuredDocumentRegion(oldStructuredDocumentRegion);
-			return;
-		}
-
-		parent = end.getParentNode();
-		if (parent != null) {
-			this.context.setParentNode(parent);
-			removeStructuredDocumentRegion(oldStructuredDocumentRegion);
-			return;
-		}
-	}
-
-	/**
-	 * replaceRegions method
-	 * 
-	 * @param newRegions
-	 *            java.util.Vector
-	 * @param oldRegions
-	 *            java.util.Vector
-	 */
-	void replaceRegions(IStructuredDocumentRegion flatNode, ITextRegionList newRegions, ITextRegionList oldRegions) {
-		if (flatNode == null)
-			return;
-		if (this.model.getDocument() == null)
-			return;
-		this.context = new XMLModelContext(this.model.getDocument());
-
-		// optimize typical cases
-		String regionType = StructuredDocumentRegionUtil.getFirstRegionType(flatNode);
-		if (regionType == DOMRegionContext.XML_TAG_OPEN) {
-			changeStartTag(flatNode, newRegions, oldRegions);
-		}
-		else if (regionType == DOMRegionContext.XML_END_TAG_OPEN) {
-			changeEndTag(flatNode, newRegions, oldRegions);
-		}
-		else {
-			changeStructuredDocumentRegion(flatNode);
-		}
-	}
-
-	/**
-	 * replaceStructuredDocumentRegions method
-	 * 
-	 */
-	void replaceStructuredDocumentRegions(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
-		if (this.model.getDocument() == null)
-			return;
-		this.context = new XMLModelContext(this.model.getDocument());
-
-		int newCount = (newStructuredDocumentRegions != null ? newStructuredDocumentRegions.getLength() : 0);
-		int oldCount = (oldStructuredDocumentRegions != null ? oldStructuredDocumentRegions.getLength() : 0);
-
-		if (oldCount > 0) {
-			setupContext(oldStructuredDocumentRegions.item(0));
-			// Node startParent = this.context.getParentNode();
-
-			Enumeration e = oldStructuredDocumentRegions.elements();
-			while (e.hasMoreElements()) {
-				IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
-				if (flatNode == null)
-					continue;
-				removeStructuredDocumentRegion(flatNode);
-			}
-		}
-		else {
-			if (newCount == 0)
-				return;
-			setupContext(newStructuredDocumentRegions.item(0));
-		}
-		// make sure the parent is set to deepest level
-		// when end tag has been removed
-		this.context.setLast();
-
-		if (newCount > 0) {
-			Enumeration e = newStructuredDocumentRegions.elements();
-			while (e.hasMoreElements()) {
-				IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
-				if (flatNode == null)
-					continue;
-				insertStructuredDocumentRegion(flatNode);
-			}
-		}
-
-		cleanupText();
-		cleanupEndTag();
-	}
-
-	/**
-	 * setupContext method
-	 * 
-	 */
-	private void setupContext(IStructuredDocumentRegion startStructuredDocumentRegion) {
-		int offset = startStructuredDocumentRegion.getStart();
-		if (offset < 0)
-			return;
-		NodeImpl root = (NodeImpl) this.context.getRootNode();
-		if (root == null)
-			return;
-
-		if (offset == 0) {
-			// at the beggining of document
-			Node child = root.getFirstChild();
-			if (child != null)
-				this.context.setNextNode(child);
-			else
-				this.context.setParentNode(root);
-			return;
-		}
-
-		NodeImpl node = (NodeImpl) root.getNodeAt(offset);
-		if (node == null) {
-			// might be at the end of document
-			this.context.setParentNode(root);
-			this.context.setLast();
-			return;
-		}
-
-		if (offset == node.getStartOffset()) {
-			this.context.setNextNode(node);
-			return;
-		}
-
-		if (node.getNodeType() == Node.TEXT_NODE) {
-			TextImpl text = (TextImpl) node;
-			Text nextText = text.splitText(startStructuredDocumentRegion);
-			// notify the change
-			text.notifyValueChanged();
-			if (nextText == null)
-				return; // error
-			this.context.setNextNode(nextText);
-			return;
-		}
-
-		for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
-			if (offset >= ((NodeImpl) child).getEndOffset())
-				continue;
-			this.context.setNextNode(child);
-			return;
-		}
-		this.context.setParentNode(node);
-		this.context.setLast();
-	}
-
-	protected XMLModelContext getContext() {
-		return context;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelUpdater.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelUpdater.java
deleted file mode 100644
index a4efc2d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelUpdater.java
+++ /dev/null
@@ -1,1700 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-/**
- * XMLModelUpdater class
- */
-public class XMLModelUpdater {
-	private int diff = 0;
-	private int gapLength = 0;
-	private int gapOffset = 0;
-	private IStructuredDocumentRegion gapStructuredDocumentRegion = null;
-	private ISourceGenerator generator = null;
-	private DOMModelImpl model = null;
-	private NodeImpl nextNode = null;
-	private NodeImpl parentNode = null;
-
-	protected XMLModelUpdater(DOMModelImpl model) {
-		super();
-
-		if (model != null) {
-			this.model = model;
-			this.generator = model.getGenerator();
-		}
-	}
-
-	/**
-	 * changeAttrValue method
-	 * 
-	 * @param attrNode
-	 *            org.w3c.dom.Attr
-	 */
-	private void changeAttrName(Attr attrNode) {
-		if (attrNode == null)
-			return;
-
-		AttrImpl attr = (AttrImpl) attrNode;
-		ElementImpl element = (ElementImpl) attr.getOwnerElement();
-		if (element == null)
-			return;
-
-		if (element.isCommentTag()) {
-			changeStartTag(element);
-			return;
-		}
-
-		int offset = element.getStartOffset();
-		int start = offset;
-		int end = offset;
-
-		String name = attr.getName();
-		if (name == null)
-			name = new String();
-		ITextRegion nameRegion = attr.getNameRegion();
-		if (nameRegion == null)
-			return; // error
-		start += nameRegion.getStart();
-		// use getTextEnd() because getEnd() may include the tailing spaces
-		end += nameRegion.getTextEnd();
-
-		replaceSource(name, start, end);
-	}
-
-	/**
-	 * changeAttrValue method
-	 * 
-	 * @param attrNode
-	 *            org.w3c.dom.Attr
-	 */
-	private void changeAttrValue(Attr attrNode) {
-		if (attrNode == null)
-			return;
-
-		AttrImpl attr = (AttrImpl) attrNode;
-		ElementImpl element = (ElementImpl) attr.getOwnerElement();
-		if (element == null)
-			return;
-
-		if (element.isCommentTag()) {
-			changeStartTag(element);
-			return;
-		}
-
-		int offset = element.getStartOffset();
-		int start = offset;
-		int end = offset;
-
-		String value = null;
-		ITextRegion valueRegion = attr.getValueRegion();
-		if (valueRegion != null) {
-			char quote = 0; // no quote preference
-			// DW: 4/16/2003 due to change in structuredDocument ... we need a
-			// flatnode to
-			// get at region values. For now I'll assume this is always the
-			// first
-			// flatnode .. may need to make smarter later (e.g. to search for
-			// the flatnode that this.valueRegion belongs to.
-			IStructuredDocumentRegion documentRegion = element.getFirstStructuredDocumentRegion();
-			String oldValue = documentRegion.getText(valueRegion);
-			if (oldValue != null && oldValue.length() > 0) {
-				char firstChar = oldValue.charAt(0);
-				if (firstChar == '"' || firstChar == '\'') {
-					quote = firstChar;
-				}
-			}
-
-			ITextRegion startRegion = valueRegion;
-
-			value = this.generator.generateAttrValue(attr, quote);
-			if (value == null) {
-				value = new String();
-				// remove equal too
-				ITextRegion equalRegion = attr.getEqualRegion();
-				if (equalRegion != null)
-					startRegion = equalRegion;
-			}
-			attr.setValueRegion(valueRegion); // reset value
-
-			start += startRegion.getStart();
-			// use getTextEnd() because getEnd() may include the tailing
-			// spaces
-			end += valueRegion.getTextEnd();
-		}
-		else {
-			ITextRegion equalRegion = attr.getEqualRegion();
-
-			value = this.generator.generateAttrValue(attr);
-			if (value == null) {
-				if (equalRegion == null)
-					return; // nothng to do
-				value = new String();
-				// remove equal
-				start += equalRegion.getStart();
-				end += equalRegion.getTextEnd();
-			}
-			else {
-				if (equalRegion != null) {
-					// use getTextEnd() because getEnd() may include the
-					// tailing spaces
-					start += equalRegion.getTextEnd();
-				}
-				else {
-					ITextRegion nameRegion = attr.getNameRegion();
-					if (nameRegion == null)
-						return; // must never happen
-					// use getTextEnd() because getEnd() may include the
-					// tailing spaces
-					start += nameRegion.getTextEnd();
-					value = '=' + value;
-				}
-				end = start;
-			}
-		}
-
-		replaceSource(value, start, end);
-	}
-
-	/**
-	 */
-	void changeEndTag(Element element) {
-		String source = this.generator.generateEndTag(element);
-		if (source == null)
-			return;
-		int length = source.length();
-		if (length == 0)
-			return;
-
-		ElementImpl impl = (ElementImpl) element;
-		int offset = impl.getEndStartOffset();
-		int start = offset;
-		int end = offset;
-		if (impl.hasEndTag()) {
-			end = impl.getEndOffset();
-			this.gapStructuredDocumentRegion = impl.getEndStructuredDocumentRegion();
-			impl.setEndStructuredDocumentRegion(new StructuredDocumentRegionProxy(offset, length));
-		}
-
-		replaceSource(source, start, end);
-	}
-
-	/**
-	 * changeName method
-	 * 
-	 * @param node
-	 *            org.w3c.dom.Node
-	 */
-	void changeName(Node node) {
-		if (node == null)
-			return;
-		if (getStructuredDocument() == null)
-			return;
-
-		// support changing name of attribute for setPrefix()
-		short nodeType = node.getNodeType();
-		if (nodeType == Node.ATTRIBUTE_NODE) {
-			changeAttrName((Attr) node);
-			return;
-		}
-
-		// not supported
-		return;
-	}
-
-	void changeRegion(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		// future_TODO: optimize
-
-		NodeImpl root = (NodeImpl) this.model.getDocument();
-		this.parentNode = root;
-		this.nextNode = (NodeImpl) root.getFirstChild();
-
-		removeGapStructuredDocumentRegion(flatNode);
-		insertGapStructuredDocumentRegionBefore(flatNode.getStart());
-		changeStructuredDocumentRegion(flatNode);
-		insertGapStructuredDocumentRegionAfter(flatNode.getEnd());
-	}
-
-	/**
-	 * This is a fallback method to regenerate the start tag.
-	 */
-	void changeStartTag(Element element) {
-		if (element == null)
-			return;
-		ElementImpl impl = (ElementImpl) element;
-
-		if (!impl.hasStartTag() && !impl.hasEndTag()) {
-			// need to generate the start and the end tags
-			Node parent = element.getParentNode();
-			if (parent != null) {
-				replaceChild(parent, element, element);
-				return;
-			}
-			// else error
-		}
-
-		String source = this.generator.generateStartTag(element);
-		if (source == null)
-			return;
-		int length = source.length();
-		if (length == 0)
-			return;
-
-		int offset = impl.getStartOffset();
-		int start = offset;
-		int end = offset;
-		if (impl.hasStartTag()) {
-			end = impl.getStartEndOffset();
-			this.gapStructuredDocumentRegion = impl.getStartStructuredDocumentRegion();
-		}
-		impl.setStartStructuredDocumentRegion(new StructuredDocumentRegionProxy(offset, length));
-
-		replaceSource(source, start, end);
-	}
-
-	private void changeStructuredDocumentRegion(IStructuredDocumentRegion oldStructuredDocumentRegion) {
-		if (oldStructuredDocumentRegion == null)
-			return; // error
-		if (this.parentNode == null)
-			return; // error
-
-		int oldOffset = oldStructuredDocumentRegion.getStart();
-		int oldEnd = oldStructuredDocumentRegion.getEnd();
-		boolean isEndTag = false;
-
-		// find owner node
-		NodeImpl ownerNode = null;
-		while (this.parentNode != null) {
-			if (this.nextNode != null) {
-				IStructuredDocumentRegion nextStructuredDocumentRegion = this.nextNode.getStructuredDocumentRegion();
-				if (nextStructuredDocumentRegion != null) {
-					if (nextStructuredDocumentRegion == oldStructuredDocumentRegion) {
-						ownerNode = this.nextNode;
-						break;
-					}
-					int nextOffset = nextStructuredDocumentRegion.getStart();
-					if (nextOffset == oldOffset) { // found
-						ownerNode = this.nextNode;
-						break;
-					}
-					if (this.nextNode.getNodeType() == Node.TEXT_NODE) {
-						TextImpl text = (TextImpl) this.nextNode;
-						if (text.hasStructuredDocumentRegion(oldStructuredDocumentRegion)) {
-							ownerNode = this.nextNode;
-							break;
-						}
-						int nextEnd = nextStructuredDocumentRegion.getEnd();
-						if (nextOffset < oldEnd && nextEnd > oldOffset) {
-							ownerNode = this.nextNode;
-							break;
-						}
-					}
-				}
-
-				Node child = this.nextNode.getFirstChild();
-				if (child != null) {
-					this.parentNode = this.nextNode;
-					this.nextNode = (NodeImpl) child;
-					continue;
-				}
-
-				if (this.nextNode.getNodeType() == Node.ELEMENT_NODE) {
-					this.parentNode = this.nextNode;
-					this.nextNode = null;
-					continue;
-				}
-
-				this.nextNode = (NodeImpl) this.nextNode.getNextSibling();
-				if (this.nextNode != null)
-					continue;
-			}
-
-			if (this.parentNode.getNodeType() == Node.ELEMENT_NODE) {
-				ElementImpl element = (ElementImpl) this.parentNode;
-				IStructuredDocumentRegion endStructuredDocumentRegion = element.getEndStructuredDocumentRegion();
-				if (endStructuredDocumentRegion != null) {
-					if (endStructuredDocumentRegion == oldStructuredDocumentRegion) {
-						ownerNode = this.parentNode;
-						isEndTag = true;
-						break;
-					}
-					int endOffset = endStructuredDocumentRegion.getStart();
-					if (endOffset == oldOffset) { // found
-						ownerNode = this.parentNode;
-						isEndTag = true;
-						break;
-					}
-				}
-			}
-
-			this.nextNode = (NodeImpl) this.parentNode.getNextSibling();
-			this.parentNode = (NodeImpl) this.parentNode.getParentNode();
-		}
-		if (ownerNode == null)
-			throw new StructuredDocumentRegionManagementException();
-
-		short nodeType = ownerNode.getNodeType();
-		if (nodeType == Node.ELEMENT_NODE) {
-			ElementImpl element = (ElementImpl) ownerNode;
-			if (isEndTag) {
-				element.setEndStructuredDocumentRegion(oldStructuredDocumentRegion);
-			}
-			else {
-				element.setStartStructuredDocumentRegion(oldStructuredDocumentRegion);
-				updateAttrRegions(element, oldStructuredDocumentRegion);
-			}
-		}
-		else if (nodeType == Node.TEXT_NODE) {
-			TextImpl text = (TextImpl) ownerNode;
-
-			IStructuredDocumentRegion flatNode = text.getStructuredDocumentRegion();
-			if (flatNode == oldStructuredDocumentRegion) {
-				int newOffset = oldOffset;
-				int newEnd = oldEnd;
-				if (oldOffset == this.gapOffset) {
-					newOffset += this.diff;
-				}
-				else {
-					newEnd = this.gapOffset;
-				}
-				int newLength = newEnd - newOffset;
-				IStructuredDocumentRegion newStructuredDocumentRegion = new StructuredDocumentRegionProxy(newOffset, newLength, oldStructuredDocumentRegion);
-				text.setStructuredDocumentRegion(newStructuredDocumentRegion);
-
-				if (oldEnd > newEnd) {
-					this.nextNode = (NodeImpl) text.getNextSibling();
-					changeStructuredDocumentRegion(oldStructuredDocumentRegion);
-				}
-				return;
-			}
-
-			if (flatNode instanceof StructuredDocumentRegionProxy) {
-				StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
-				int offset = proxy.getOffset();
-				int end = offset + proxy.getLength();
-				if (proxy.getStructuredDocumentRegion() == null) {
-					if (offset == oldOffset && end == oldEnd) {
-						text.setStructuredDocumentRegion(oldStructuredDocumentRegion);
-					}
-					else {
-						if (end > oldEnd) {
-							StructuredDocumentRegionContainer container = new StructuredDocumentRegionContainer();
-							container.appendStructuredDocumentRegion(oldStructuredDocumentRegion);
-							proxy.setOffset(oldEnd);
-							proxy.setLength(end - oldEnd);
-							container.appendStructuredDocumentRegion(proxy);
-							text.setStructuredDocumentRegion(container);
-						}
-						else {
-							proxy.setStructuredDocumentRegion(oldStructuredDocumentRegion);
-
-							if (end < oldEnd) { // to be shared
-								this.nextNode = (NodeImpl) text.getNextSibling();
-								changeStructuredDocumentRegion(oldStructuredDocumentRegion);
-							}
-						}
-					}
-					return;
-				}
-
-				if (offset >= this.gapOffset) {
-					proxy.setOffset(offset + this.diff);
-					end += this.diff;
-				}
-				if (end < oldEnd) { // to be shared
-					this.nextNode = (NodeImpl) text.getNextSibling();
-					changeStructuredDocumentRegion(oldStructuredDocumentRegion);
-					return;
-				}
-			}
-			else if (flatNode instanceof StructuredDocumentRegionContainer) {
-				StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
-				int count = container.getStructuredDocumentRegionCount();
-				for (int i = 0; i < count; i++) {
-					IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
-					if (content == null)
-						continue; // error
-					if (content == oldStructuredDocumentRegion) {
-						int newOffset = oldOffset;
-						int newEnd = oldEnd;
-						if (oldOffset == this.gapOffset) {
-							newOffset += this.diff;
-						}
-						else {
-							newEnd = this.gapOffset;
-						}
-						int newLength = newEnd - newOffset;
-						IStructuredDocumentRegion newStructuredDocumentRegion = new StructuredDocumentRegionProxy(newOffset, newLength, oldStructuredDocumentRegion);
-						container.replaceStructuredDocumentRegion(newStructuredDocumentRegion, i);
-
-						if (oldEnd > newEnd) { // to be shared
-							this.nextNode = (NodeImpl) text.getNextSibling();
-							changeStructuredDocumentRegion(oldStructuredDocumentRegion);
-						}
-						return;
-					}
-
-					if (content instanceof StructuredDocumentRegionProxy) {
-						StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
-						int offset = proxy.getOffset();
-						int end = offset + proxy.getLength();
-						if (end <= oldOffset)
-							continue;
-						if (proxy.getStructuredDocumentRegion() == null) {
-							if (offset == oldOffset && end == oldEnd) {
-								container.replaceStructuredDocumentRegion(oldStructuredDocumentRegion, i);
-							}
-							else {
-								if (end > oldEnd) {
-									container.insertStructuredDocumentRegion(oldStructuredDocumentRegion, i);
-									proxy.setOffset(oldEnd);
-									proxy.setLength(end - oldEnd);
-								}
-								else {
-									proxy.setStructuredDocumentRegion(oldStructuredDocumentRegion);
-
-									if (end < oldEnd) { // to be shared
-										this.nextNode = (NodeImpl) text.getNextSibling();
-										changeStructuredDocumentRegion(oldStructuredDocumentRegion);
-									}
-								}
-							}
-							return;
-						}
-
-						if (offset >= this.gapOffset) {
-							proxy.setOffset(offset + this.diff);
-							end += this.diff;
-						}
-						if (end < oldEnd) { // to be shared
-							this.nextNode = (NodeImpl) text.getNextSibling();
-							changeStructuredDocumentRegion(oldStructuredDocumentRegion);
-							return;
-						}
-					}
-				}
-			}
-			else {
-				throw new StructuredDocumentRegionManagementException();
-			}
-		}
-		else {
-			ownerNode.setStructuredDocumentRegion(oldStructuredDocumentRegion);
-		}
-	}
-
-	/**
-	 */
-	private void changeTextData(Text text) {
-		if (text == null)
-			return;
-
-		String source = this.generator.generateSource(text);
-		if (source == null)
-			source = new String();
-		int length = source.length();
-
-		TextImpl impl = (TextImpl) text;
-		int start = impl.getStartOffset();
-		int end = impl.getEndOffset();
-		int offset = start;
-
-		// make sure previous tag is closed
-		Node prev = text.getPreviousSibling();
-		if (prev != null) {
-			String preTag = getCloseTag((IDOMNode) prev);
-			if (preTag != null && preTag.length() > 0) {
-				offset += preTag.length();
-				source = preTag + source;
-			}
-		}
-		else {
-			Node parent = text.getParentNode();
-			if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
-				ElementImpl element = (ElementImpl) parent;
-				String preTag = getStartCloseTag(element);
-				if (preTag != null && preTag.length() > 0) {
-					offset += preTag.length();
-					StringBuffer buffer = new StringBuffer();
-					buffer.append(preTag);
-					buffer.append(source);
-					if (text.getNextSibling() == null && !element.hasEndTag() && (element.isJSPContainer() || element.isCDATAContainer())) {
-						// need to generate the end tag
-						String postTag = this.generator.generateEndTag(element);
-						if (postTag != null) {
-							int postLength = postTag.length();
-							if (postLength > 0) {
-								buffer.append(postTag);
-								int postOffset = offset + length;
-								IStructuredDocumentRegion flatNode = new StructuredDocumentRegionProxy(postOffset, postLength);
-								element.setEndStructuredDocumentRegion(flatNode);
-							}
-						}
-					}
-					source = buffer.toString();
-				}
-			}
-		}
-
-		this.gapStructuredDocumentRegion = impl.getStructuredDocumentRegion();
-		IStructuredDocumentRegion newStructuredDocumentRegion = null;
-		if (length > 0)
-			newStructuredDocumentRegion = new StructuredDocumentRegionProxy(offset, length);
-		impl.setStructuredDocumentRegion(newStructuredDocumentRegion);
-
-		replaceSource(source, start, end);
-	}
-
-	/**
-	 * changeValue method
-	 * 
-	 * @param node
-	 *            org.w3c.dom.Node
-	 */
-	void changeValue(Node node) {
-		if (node == null)
-			return;
-		if (getStructuredDocument() == null)
-			return;
-
-		short nodeType = node.getNodeType();
-		if (nodeType == Node.TEXT_NODE) {
-			changeTextData((Text) node);
-			return;
-		}
-		if (nodeType == Node.ATTRIBUTE_NODE) {
-			changeAttrValue((Attr) node);
-			return;
-		}
-		if (nodeType == Node.ELEMENT_NODE) {
-			changeStartTag((Element) node);
-			return;
-		}
-
-		String source = this.generator.generateSource(node);
-		if (source == null)
-			source = new String();
-		int length = source.length();
-
-		NodeImpl impl = (NodeImpl) node;
-		int start = impl.getStartOffset();
-		int end = impl.getEndOffset();
-
-		this.gapStructuredDocumentRegion = impl.getStructuredDocumentRegion();
-		IStructuredDocumentRegion flatNode = null;
-		if (length > 0)
-			flatNode = new StructuredDocumentRegionProxy(start, length);
-		impl.setStructuredDocumentRegion(flatNode);
-
-		replaceSource(source, start, end);
-	}
-
-	/**
-	 */
-	private String getAttrValueClose(IDOMElement element) {
-		if (element == null)
-			return null;
-
-		IStructuredDocumentRegion flatNode = element.getStartStructuredDocumentRegion();
-		if (flatNode == null)
-			return null;
-		ITextRegion region = StructuredDocumentRegionUtil.getLastRegion(flatNode);
-		if (region == null || region.getType() != DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
-			return null;
-		String value = flatNode.getText(region);
-		if (value == null)
-			return null;
-		int length = value.length();
-		if (length == 0)
-			return null;
-
-		// check open JSP tag
-		boolean closeJSPTag = false;
-		int offset = value.indexOf(JSPTag.TAG_OPEN);
-		while (offset >= 0) {
-			offset = value.indexOf(JSPTag.TAG_CLOSE, offset + 2);
-			if (offset < 0) {
-				closeJSPTag = true;
-				break;
-			}
-			offset = value.indexOf(JSPTag.TAG_OPEN, offset + 2);
-		}
-
-		// check quote
-		boolean closeQuote = false;
-		char firstChar = value.charAt(0);
-		if (firstChar == '"' || firstChar == '\'') {
-			if (closeJSPTag || length == 1 || value.charAt(length - 1) != firstChar) {
-				closeQuote = true;
-			}
-		}
-
-		if (!closeJSPTag && !closeQuote)
-			return null;
-
-		StringBuffer buffer = new StringBuffer();
-		if (closeJSPTag)
-			buffer.append(JSPTag.TAG_CLOSE);
-		if (closeQuote)
-			buffer.append(firstChar);
-		return buffer.toString();
-	}
-
-	/**
-	 * Gather close tags recursively.
-	 */
-	private String getCloseTag(IDOMNode node) {
-		if (node == null || node.isClosed())
-			return null;
-
-		if (node.getNodeType() != Node.ELEMENT_NODE) {
-			return this.generator.generateCloseTag(node);
-		}
-
-		ElementImpl element = (ElementImpl) node;
-		if (element.hasEndTag()) {
-			// end tag is not closed
-			return this.generator.generateCloseTag(element);
-		}
-
-		// no end tag
-		int offset = element.getEndOffset();
-		StringBuffer buffer = new StringBuffer();
-
-		IDOMNode lastChild = (IDOMNode) element.getLastChild();
-		if (lastChild == null) {
-			if (!element.isStartTagClosed()) {
-				if (element.preferEmptyTag())
-					element.setEmptyTag(true);
-				String closeTag = getStartCloseTag(element);
-				if (closeTag != null) {
-					int length = closeTag.length();
-					if (length > 0) {
-						buffer.append(closeTag);
-						offset += length;
-					}
-				}
-			}
-		}
-		else {
-			String closeTag = getCloseTag(lastChild);
-			if (closeTag != null) {
-				int length = closeTag.length();
-				if (length > 0) {
-					buffer.append(closeTag);
-					offset += length;
-				}
-			}
-		}
-
-		String endTag = this.generator.generateEndTag(element);
-		if (endTag != null) {
-			int length = endTag.length();
-			if (length > 0) {
-				buffer.append(endTag);
-				IStructuredDocumentRegion flatNode = new StructuredDocumentRegionProxy(offset, length);
-				element.setEndStructuredDocumentRegion(flatNode);
-			}
-		}
-
-		return buffer.toString();
-	}
-
-	/**
-	 */
-	private String getStartCloseTag(IDOMElement element) {
-		if (element == null || element.isStartTagClosed())
-			return null;
-
-		StringBuffer buffer = new StringBuffer();
-		String attrValueClose = getAttrValueClose(element);
-		if (attrValueClose != null)
-			buffer.append(attrValueClose);
-		String closeTag = this.generator.generateCloseTag(element);
-		if (closeTag != null)
-			buffer.append(closeTag);
-		return buffer.toString();
-	}
-
-	private IStructuredDocument getStructuredDocument() {
-		if (model == null)
-			return null;
-		return model.getStructuredDocument();
-	}
-
-	/**
-	 */
-	void initialize() {
-		this.gapStructuredDocumentRegion = null;
-		this.gapOffset = 0;
-		this.gapLength = 0;
-		this.diff = 0;
-		this.parentNode = null;
-		this.nextNode = null;
-	}
-
-	private void insertGapStructuredDocumentRegionAfter(int endOffset) {
-		if (this.gapStructuredDocumentRegion == null)
-			return;
-
-		if (this.gapStructuredDocumentRegion instanceof StructuredDocumentRegionProxy) {
-			StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) this.gapStructuredDocumentRegion;
-			IStructuredDocumentRegion flatNode = proxy.getStructuredDocumentRegion();
-			if (flatNode != null)
-				insertStructuredDocumentRegion(flatNode);
-		}
-		else if (this.gapStructuredDocumentRegion instanceof StructuredDocumentRegionContainer) {
-			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) this.gapStructuredDocumentRegion;
-			int count = container.getStructuredDocumentRegionCount();
-			for (int i = 0; i < count; i++) {
-				IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
-				if (content == null)
-					continue;
-				if (content.getStart() < endOffset)
-					continue;
-				if (content instanceof StructuredDocumentRegionProxy) {
-					StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
-					IStructuredDocumentRegion flatNode = proxy.getStructuredDocumentRegion();
-					if (flatNode != null)
-						insertStructuredDocumentRegion(flatNode);
-				}
-				else {
-					insertStructuredDocumentRegion(content);
-				}
-			}
-		}
-		else {
-			insertStructuredDocumentRegion(this.gapStructuredDocumentRegion);
-		}
-	}
-
-	private void insertGapStructuredDocumentRegionBefore(int startOffset) {
-		if (this.gapStructuredDocumentRegion == null)
-			return;
-
-		if (this.gapStructuredDocumentRegion instanceof StructuredDocumentRegionProxy) {
-			StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) this.gapStructuredDocumentRegion;
-			IStructuredDocumentRegion flatNode = proxy.getStructuredDocumentRegion();
-			if (flatNode != null)
-				insertStructuredDocumentRegion(flatNode);
-		}
-		else if (this.gapStructuredDocumentRegion instanceof StructuredDocumentRegionContainer) {
-			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) this.gapStructuredDocumentRegion;
-			int count = container.getStructuredDocumentRegionCount();
-			for (int i = 0; i < count; i++) {
-				IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
-				if (content == null)
-					continue;
-				if (content.getStart() >= startOffset)
-					return;
-				if (content instanceof StructuredDocumentRegionProxy) {
-					StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
-					IStructuredDocumentRegion flatNode = proxy.getStructuredDocumentRegion();
-					if (flatNode != null)
-						insertStructuredDocumentRegion(flatNode);
-				}
-				else {
-					insertStructuredDocumentRegion(content);
-				}
-			}
-		}
-		else {
-			insertStructuredDocumentRegion(this.gapStructuredDocumentRegion);
-		}
-	}
-
-	/**
-	 */
-	private void insertStructuredDocumentRegion(IStructuredDocumentRegion newStructuredDocumentRegion) {
-		if (newStructuredDocumentRegion == null)
-			return; // error
-		if (this.parentNode == null)
-			return; // error
-
-		int newOffset = newStructuredDocumentRegion.getStart();
-		int newEnd = newStructuredDocumentRegion.getEnd();
-		boolean isEndTag = false;
-
-		// find owner node
-		NodeImpl ownerNode = null;
-		while (this.parentNode != null) {
-			if (this.nextNode != null) {
-				IStructuredDocumentRegion nextStructuredDocumentRegion = this.nextNode.getStructuredDocumentRegion();
-				if (nextStructuredDocumentRegion != null) {
-					int nextOffset = nextStructuredDocumentRegion.getStart();
-					if (nextOffset == newOffset) { // found
-						ownerNode = this.nextNode;
-						break;
-					}
-					if (this.nextNode.getNodeType() == Node.TEXT_NODE) {
-						int nextEnd = nextStructuredDocumentRegion.getEnd();
-						if (nextOffset < newEnd && nextEnd > newOffset) {
-							ownerNode = this.nextNode;
-							break;
-						}
-					}
-				}
-
-				Node child = this.nextNode.getFirstChild();
-				if (child != null) {
-					this.parentNode = this.nextNode;
-					this.nextNode = (NodeImpl) child;
-					continue;
-				}
-
-				if (this.nextNode.getNodeType() == Node.ELEMENT_NODE) {
-					this.parentNode = this.nextNode;
-					this.nextNode = null;
-					continue;
-				}
-
-				this.nextNode = (NodeImpl) this.nextNode.getNextSibling();
-				if (this.nextNode != null)
-					continue;
-			}
-
-			if (this.parentNode.getNodeType() == Node.ELEMENT_NODE) {
-				ElementImpl element = (ElementImpl) this.parentNode;
-				IStructuredDocumentRegion endStructuredDocumentRegion = element.getEndStructuredDocumentRegion();
-				if (endStructuredDocumentRegion != null) {
-					int endOffset = endStructuredDocumentRegion.getStart();
-					if (endOffset == newOffset) { // found
-						ownerNode = this.parentNode;
-						isEndTag = true;
-						break;
-					}
-				}
-			}
-
-			this.nextNode = (NodeImpl) this.parentNode.getNextSibling();
-			this.parentNode = (NodeImpl) this.parentNode.getParentNode();
-		}
-		if (ownerNode == null)
-			throw new StructuredDocumentRegionManagementException();
-
-		short nodeType = ownerNode.getNodeType();
-		if (nodeType == Node.ELEMENT_NODE) {
-			ElementImpl element = (ElementImpl) ownerNode;
-			if (isEndTag) {
-				element.setEndStructuredDocumentRegion(newStructuredDocumentRegion);
-			}
-			else {
-				element.setStartStructuredDocumentRegion(newStructuredDocumentRegion);
-				updateAttrRegions(element, newStructuredDocumentRegion);
-			}
-		}
-		else if (nodeType == Node.TEXT_NODE) {
-			TextImpl text = (TextImpl) ownerNode;
-			IStructuredDocumentRegion oldStructuredDocumentRegion = text.getStructuredDocumentRegion();
-			if (oldStructuredDocumentRegion == null) {
-				throw new StructuredDocumentRegionManagementException();
-			}
-			int oldOffset = oldStructuredDocumentRegion.getStart();
-			int oldEnd = oldStructuredDocumentRegion.getEnd();
-			if (oldOffset == newOffset && oldEnd == newEnd) {
-				text.setStructuredDocumentRegion(newStructuredDocumentRegion);
-				return;
-			}
-
-			if (oldStructuredDocumentRegion instanceof StructuredDocumentRegionProxy) {
-				StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) oldStructuredDocumentRegion;
-				if (oldEnd > newEnd) {
-					StructuredDocumentRegionContainer container = new StructuredDocumentRegionContainer();
-					if (oldOffset == newOffset) {
-						container.appendStructuredDocumentRegion(newStructuredDocumentRegion);
-					}
-					else {
-						StructuredDocumentRegionProxy newProxy = new StructuredDocumentRegionProxy();
-						newProxy.setOffset(oldOffset);
-						newProxy.setLength(newEnd - oldOffset);
-						newProxy.setStructuredDocumentRegion(newStructuredDocumentRegion);
-						container.appendStructuredDocumentRegion(newProxy);
-					}
-					proxy.setOffset(newEnd);
-					proxy.setLength(oldEnd - newEnd);
-					container.appendStructuredDocumentRegion(proxy);
-					text.setStructuredDocumentRegion(container);
-				}
-				else {
-					proxy.setStructuredDocumentRegion(newStructuredDocumentRegion);
-
-					if (oldEnd < newEnd) { // to be shared
-						this.nextNode = (NodeImpl) text.getNextSibling();
-						insertStructuredDocumentRegion(newStructuredDocumentRegion);
-					}
-				}
-				return;
-			}
-
-			if (oldStructuredDocumentRegion instanceof StructuredDocumentRegionContainer) {
-				StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) oldStructuredDocumentRegion;
-				int count = container.getStructuredDocumentRegionCount();
-				for (int i = 0; i < count; i++) {
-					IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
-					if (content == null)
-						continue; // error
-					int offset = content.getStart();
-					int end = content.getEnd();
-					if (end <= newOffset)
-						continue;
-					if (offset == newOffset && end == newEnd) {
-						container.replaceStructuredDocumentRegion(newStructuredDocumentRegion, i);
-						return;
-					}
-
-					if (content instanceof StructuredDocumentRegionProxy) {
-						StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
-						if (end > newEnd) {
-							if (offset == newOffset) {
-								container.insertStructuredDocumentRegion(newStructuredDocumentRegion, i);
-							}
-							else {
-								StructuredDocumentRegionProxy newProxy = new StructuredDocumentRegionProxy();
-								newProxy.setOffset(offset);
-								newProxy.setLength(newEnd - offset);
-								newProxy.setStructuredDocumentRegion(newStructuredDocumentRegion);
-								container.insertStructuredDocumentRegion(newProxy, i);
-							}
-							proxy.setOffset(newEnd);
-							proxy.setLength(end - newEnd);
-							return;
-						}
-						else {
-							proxy.setStructuredDocumentRegion(newStructuredDocumentRegion);
-							if (end == newEnd)
-								return;
-						}
-					}
-				}
-
-				if (oldEnd < newEnd) { // to be shared
-					this.nextNode = (NodeImpl) text.getNextSibling();
-					insertStructuredDocumentRegion(newStructuredDocumentRegion);
-				}
-				return;
-			}
-			else {
-				throw new StructuredDocumentRegionManagementException();
-			}
-		}
-		else {
-			ownerNode.setStructuredDocumentRegion(newStructuredDocumentRegion);
-		}
-	}
-
-	private void removeGapStructuredDocumentRegion(IStructuredDocumentRegion oldStructuredDocumentRegion) {
-		if (this.gapStructuredDocumentRegion == null)
-			return;
-
-		if (this.gapStructuredDocumentRegion == oldStructuredDocumentRegion) {
-			this.gapStructuredDocumentRegion = null;
-			return;
-		}
-
-		if (this.gapStructuredDocumentRegion instanceof StructuredDocumentRegionProxy) {
-			StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) this.gapStructuredDocumentRegion;
-			IStructuredDocumentRegion flatNode = proxy.getStructuredDocumentRegion();
-			if (flatNode == oldStructuredDocumentRegion)
-				this.gapStructuredDocumentRegion = null;
-		}
-		else if (this.gapStructuredDocumentRegion instanceof StructuredDocumentRegionContainer) {
-			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) this.gapStructuredDocumentRegion;
-			int count = container.getStructuredDocumentRegionCount();
-			for (int i = 0; i < count; i++) {
-				IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
-				if (content == null)
-					continue;
-				if (content == oldStructuredDocumentRegion) {
-					if (count > 1)
-						container.removeStructuredDocumentRegion(i);
-					else
-						this.gapStructuredDocumentRegion = null;
-					return;
-				}
-				if (content instanceof StructuredDocumentRegionProxy) {
-					StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
-					if (proxy.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
-						if (count > 1)
-							container.removeStructuredDocumentRegion(i);
-						else
-							this.gapStructuredDocumentRegion = null;
-						return;
-					}
-				}
-			}
-		}
-	}
-
-	private void removeStructuredDocumentRegion(IStructuredDocumentRegion oldStructuredDocumentRegion) {
-		if (oldStructuredDocumentRegion == null)
-			return; // error
-		if (this.parentNode == null)
-			return; // error
-
-		int gapEnd = this.gapOffset + this.gapLength;
-		int oldOffset = oldStructuredDocumentRegion.getStart();
-		int oldEnd = oldStructuredDocumentRegion.getEnd();
-		if (oldOffset >= this.gapOffset && oldEnd <= gapEnd)
-			return; // do nothing
-		int oldLength = oldEnd - oldOffset;
-		if (oldOffset >= gapEnd)
-			oldOffset += this.diff;
-
-		// find owner node
-		NodeImpl ownerNode = null;
-		ElementImpl ownerEndTag = null;
-		TextImpl ownerText = null;
-		while (this.parentNode != null) {
-			if (this.nextNode != null) {
-				if (this.nextNode.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
-					ownerNode = this.nextNode;
-					break;
-				}
-				if (this.nextNode.getNodeType() == Node.TEXT_NODE) {
-					TextImpl text = (TextImpl) this.nextNode;
-					if (text.hasStructuredDocumentRegion(oldStructuredDocumentRegion)) {
-						ownerNode = this.nextNode;
-						ownerText = text;
-						break;
-					}
-				}
-
-				Node child = this.nextNode.getFirstChild();
-				if (child != null) {
-					this.parentNode = this.nextNode;
-					this.nextNode = (NodeImpl) child;
-					continue;
-				}
-
-				if (this.nextNode.getNodeType() == Node.ELEMENT_NODE) {
-					this.parentNode = this.nextNode;
-					this.nextNode = null;
-					continue;
-				}
-
-				this.nextNode = (NodeImpl) this.nextNode.getNextSibling();
-				if (this.nextNode != null)
-					continue;
-			}
-
-			if (this.parentNode.getNodeType() == Node.ELEMENT_NODE) {
-				ElementImpl element = (ElementImpl) this.parentNode;
-				if (element.getEndStructuredDocumentRegion() == oldStructuredDocumentRegion) {
-					ownerNode = this.parentNode;
-					ownerEndTag = element;
-					break;
-				}
-			}
-
-			this.nextNode = (NodeImpl) this.parentNode.getNextSibling();
-			this.parentNode = (NodeImpl) this.parentNode.getParentNode();
-		}
-		if (ownerNode == null)
-			throw new StructuredDocumentRegionManagementException();
-
-		if (ownerText != null) {
-			IStructuredDocumentRegion flatNode = ownerText.getStructuredDocumentRegion();
-			if (flatNode == oldStructuredDocumentRegion) {
-				IStructuredDocumentRegion newStructuredDocumentRegion = new StructuredDocumentRegionProxy(oldOffset, oldLength);
-				ownerText.setStructuredDocumentRegion(newStructuredDocumentRegion);
-				return;
-			}
-
-			if (flatNode instanceof StructuredDocumentRegionProxy) {
-				StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
-				if (proxy.getStructuredDocumentRegion() != oldStructuredDocumentRegion) {
-					throw new StructuredDocumentRegionManagementException();
-				}
-				int offset = proxy.getOffset();
-				int end = offset + proxy.getLength();
-				if (offset >= this.gapOffset) {
-					proxy.setOffset(offset + this.diff);
-				}
-				proxy.setStructuredDocumentRegion(null);
-				if (end < oldEnd && (end < this.gapOffset || oldEnd > gapEnd)) { // has
-					// shared
-					removeStructuredDocumentRegion(oldStructuredDocumentRegion);
-					return;
-				}
-			}
-			else if (flatNode instanceof StructuredDocumentRegionContainer) {
-				StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
-				int count = container.getStructuredDocumentRegionCount();
-				for (int i = 0; i < count; i++) {
-					IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
-					if (content == null)
-						continue; // error
-					if (content == oldStructuredDocumentRegion) {
-						IStructuredDocumentRegion newStructuredDocumentRegion = new StructuredDocumentRegionProxy(oldOffset, oldLength);
-						container.replaceStructuredDocumentRegion(newStructuredDocumentRegion, i);
-						return;
-					}
-
-					if (content instanceof StructuredDocumentRegionProxy) {
-						StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
-						if (proxy.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
-							int offset = proxy.getOffset();
-							int end = offset + proxy.getLength();
-							if (offset >= this.gapOffset) {
-								proxy.setOffset(offset + this.diff);
-							}
-							proxy.setStructuredDocumentRegion(null);
-							if (end < oldEnd && (end < this.gapOffset || oldEnd > gapEnd)) { // has
-								// shared
-								removeStructuredDocumentRegion(oldStructuredDocumentRegion);
-								return;
-							}
-						}
-					}
-				}
-			}
-			else {
-				throw new StructuredDocumentRegionManagementException();
-			}
-		}
-		else {
-			IStructuredDocumentRegion newStructuredDocumentRegion = new StructuredDocumentRegionProxy(oldOffset, oldLength);
-			if (ownerEndTag != null) {
-				ownerEndTag.setEndStructuredDocumentRegion(newStructuredDocumentRegion);
-			}
-			else {
-				ownerNode.setStructuredDocumentRegion(newStructuredDocumentRegion);
-			}
-		}
-	}
-
-	/**
-	 * replaceAttr method
-	 * 
-	 * @param ownerElement
-	 *            org.w3c.dom.Element
-	 * @param newAttr
-	 *            org.w3c.dom.Attr
-	 * @param oldAttr
-	 *            org.w3c.dom.Attr
-	 */
-	void replaceAttr(Element ownerElement, Attr newAttr, Attr oldAttr) {
-		if (ownerElement == null)
-			return;
-		if (getStructuredDocument() == null)
-			return;
-
-		ElementImpl element = (ElementImpl) ownerElement;
-		if (!element.hasStartTag()) {
-			changeStartTag(element);
-			return;
-		}
-		if (element.isCommentTag()) {
-			changeStartTag(element);
-			return;
-		}
-
-		int offset = element.getStartOffset();
-		int start = offset;
-		int end = offset;
-
-		boolean insertSpace = false;
-		String attrValueClose = null;
-		if (oldAttr != null) {
-			AttrImpl impl = (AttrImpl) oldAttr;
-			ITextRegion nameRegion = impl.getNameRegion();
-			if (nameRegion == null)
-				return; // must never happen
-			ITextRegion lastRegion = impl.getValueRegion();
-			if (lastRegion != null) {
-				end += lastRegion.getEnd();
-			}
-			else {
-				lastRegion = impl.getEqualRegion();
-				if (lastRegion != null) {
-					end += lastRegion.getEnd();
-				}
-				else {
-					end += nameRegion.getEnd();
-					lastRegion = nameRegion;
-				}
-			}
-			// check there are extra space before the last attribute
-			IStructuredDocumentRegion flatNode = element.getStartStructuredDocumentRegion();
-			if (flatNode == null)
-				return; // must never happen
-			ITextRegionList regions = flatNode.getRegions();
-			if (regions == null)
-				return; // must never happen
-			ITextRegion prevRegion = null;
-			ITextRegion nextRegion = null;
-			for (int i = 0; i < regions.size(); i++) {
-				ITextRegion region = regions.get(i);
-				if (region == nameRegion) {
-					if (i > 0) {
-						prevRegion = regions.get(i - 1);
-					}
-				}
-				if (region == lastRegion) {
-					if (i + 1 < regions.size()) {
-						nextRegion = regions.get(i + 1);
-					}
-					break;
-				}
-			}
-			boolean isLastAttr = false;
-			if (nextRegion != null) {
-				String regionType = nextRegion.getType();
-				if (regionType == DOMRegionContext.XML_TAG_CLOSE || regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE || isNestedTagClose(regionType)) {
-					isLastAttr = true;
-				}
-			}
-			if (isLastAttr && prevRegion != null) {
-				start += prevRegion.getTextEnd();
-			}
-			else {
-				start += nameRegion.getStart();
-			}
-
-			// impl.resetRegions(ownerElement);
-			impl.resetRegions(element);
-		}
-		else { // append attribute
-			IStructuredDocumentRegion flatNode = element.getStartStructuredDocumentRegion();
-			if (flatNode == null)
-				return; // must never happen
-
-			attrValueClose = getAttrValueClose(element);
-			if (attrValueClose != null && attrValueClose.length() > 0) {
-				insertSpace = true;
-				start = flatNode.getEndOffset();
-				end = start;
-			}
-			else {
-				ITextRegionList regions = flatNode.getRegions();
-				if (regions == null)
-					return; // must never happen
-				int attrStart = 0;
-				for (int i = regions.size() - 1; i >= 0; i--) {
-					ITextRegion region = regions.get(i);
-					String regionType = region.getType();
-					if (regionType == DOMRegionContext.XML_TAG_CLOSE || regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE || isNestedTagClose(regionType))
-						continue;
-					int regionEnd = region.getEnd();
-					if (regionEnd == region.getTextEnd())
-						insertSpace = true;
-					attrStart = regionEnd;
-					break;
-				}
-				if (attrStart == 0)
-					return; // not found, must never happen
-				start += attrStart;
-				end = start;
-			}
-		}
-
-		String source = null;
-		if (newAttr != null) {
-			int size = 2;
-			if (attrValueClose != null)
-				size += attrValueClose.length();
-			String name = this.generator.generateAttrName(newAttr);
-			if (name != null)
-				size += name.length();
-			String value = this.generator.generateAttrValue(newAttr);
-			if (value != null)
-				size += value.length();
-			StringBuffer buffer = new StringBuffer(size);
-			if (attrValueClose != null)
-				buffer.append(attrValueClose);
-			if (insertSpace)
-				buffer.append(' ');
-			buffer.append(name);
-			if (value != null) {
-				buffer.append('=');
-				buffer.append(value);
-			}
-			source = buffer.toString();
-		}
-
-		replaceSource(source, start, end);
-	}
-
-	protected boolean isNestedTagClose(String regionType) {
-		boolean result = false;
-		return result;
-	}
-
-	/**
-	 * replaceChild method
-	 * 
-	 * @param parentNode
-	 *            org.w3c.dom.Node
-	 * @param newChild
-	 *            org.w3c.dom.Node
-	 * @param oldChild
-	 *            org.w3c.dom.Node
-	 */
-	void replaceChild(Node parentNode, Node newChild, Node oldChild) {
-		if (parentNode == null)
-			return;
-		if (newChild == null && oldChild == null)
-			return;
-		if (getStructuredDocument() == null)
-			return;
-
-		int start = 0;
-		int end = 0;
-		String preTag = null;
-		String postTag = null;
-		ElementImpl postElement = null;
-		if (oldChild != null) {
-			NodeImpl node = (NodeImpl) oldChild;
-			start = node.getStartOffset();
-			end = node.getEndOffset();
-			if (oldChild.getNodeType() == Node.TEXT_NODE) {
-				this.gapStructuredDocumentRegion = node.getStructuredDocumentRegion();
-			}
-			node.resetStructuredDocumentRegions(); // reset values from
-			// IStructuredDocumentRegion
-		}
-		else {
-			NodeImpl prev = (NodeImpl) newChild.getPreviousSibling();
-			if (prev != null) {
-				start = prev.getEndOffset();
-				end = start;
-				preTag = getCloseTag(prev);
-			}
-			else {
-				// first child
-				NodeImpl next = (NodeImpl) newChild.getNextSibling();
-				if (next != null) {
-					start = next.getStartOffset();
-					end = start;
-					if (parentNode.getNodeType() == Node.ELEMENT_NODE) {
-						preTag = getStartCloseTag((IDOMElement) parentNode);
-					}
-				}
-				else {
-					// newly having a child
-					if (parentNode.getNodeType() == Node.ELEMENT_NODE) {
-						ElementImpl element = (ElementImpl) parentNode;
-						if (element.isEmptyTag()) { // empty tag format
-							// need to generate the start and the end tags
-							end = element.getEndOffset();
-							start = end - 2; // for "/>"
-							element.setEmptyTag(false);
-							preTag = this.generator.generateCloseTag(element);
-							postTag = this.generator.generateEndTag(element);
-							postElement = element;
-						}
-						else if (!element.hasStartTag()) {
-							start = element.getStartOffset();
-							end = start;
-							// invalid end tag or implicit tag
-							// need to generate the start tag
-							preTag = this.generator.generateStartTag(element);
-							if (preTag != null) {
-								int length = preTag.length();
-								if (length > 0) {
-									IStructuredDocumentRegion flatNode = new StructuredDocumentRegionProxy(start, length);
-									element.setStartStructuredDocumentRegion(flatNode);
-								}
-							}
-							if (!element.hasEndTag()) {
-								// implicit tag
-								// need to generate the end tags
-								postTag = this.generator.generateEndTag(element);
-								postElement = element;
-							}
-						}
-						else {
-							start = element.getStartEndOffset();
-							end = start;
-							preTag = getStartCloseTag(element);
-							if (preTag != null && preTag.length() > 0) {
-								if (!element.hasEndTag() && (element.isJSPContainer() || element.isCDATAContainer())) {
-									// need to generate the end tag
-									postTag = this.generator.generateEndTag(element);
-									postElement = element;
-								}
-							}
-						}
-					}
-					// else might DOCUMENT_NODE, start and end are 0
-				}
-			}
-		}
-
-		String source = null;
-		if (newChild != null) {
-			StringBuffer buffer = new StringBuffer();
-			int offset = start;
-			if (preTag != null) {
-				int length = preTag.length();
-				if (length > 0) {
-					offset += length;
-					buffer.append(preTag);
-				}
-			}
-
-			NodeImpl node = (NodeImpl) newChild;
-			while (node != null) {
-				if (node.getNodeType() == Node.ELEMENT_NODE) {
-					ElementImpl element = (ElementImpl) node;
-					if (element.preferEmptyTag())
-						element.setEmptyTag(true);
-					IStructuredDocumentRegion flatNode = null;
-					String startTag = this.generator.generateStartTag(element);
-					if (startTag != null) {
-						int length = startTag.length();
-						if (length > 0) {
-							buffer.append(startTag);
-							flatNode = new StructuredDocumentRegionProxy(offset, length);
-							offset += length;
-						}
-					}
-					element.setStartStructuredDocumentRegion(flatNode);
-				}
-				else {
-					String content = this.generator.generateSource(node);
-					if (content == null)
-						content = new String();
-					int length = content.length();
-					IStructuredDocumentRegion flatNode = null;
-					if (length > 0) {
-						buffer.append(content);
-						flatNode = new StructuredDocumentRegionProxy(offset, length);
-						offset += length;
-					}
-					node.setStructuredDocumentRegion(flatNode);
-				}
-
-				NodeImpl child = (NodeImpl) node.getFirstChild();
-				if (child != null) {
-					node = child;
-					continue;
-				}
-
-				if (node.getNodeType() == Node.ELEMENT_NODE) {
-					ElementImpl element = (ElementImpl) node;
-					IStructuredDocumentRegion flatNode = null;
-					String endTag = this.generator.generateEndTag(element);
-					if (endTag != null) {
-						int length = endTag.length();
-						if (length > 0) {
-							buffer.append(endTag);
-							flatNode = new StructuredDocumentRegionProxy(offset, length);
-							offset += length;
-						}
-					}
-					element.setEndStructuredDocumentRegion(flatNode);
-				}
-
-				while (node != null) {
-					if (node == newChild) {
-						node = null;
-						break;
-					}
-					NodeImpl next = (NodeImpl) node.getNextSibling();
-					if (next != null) {
-						node = next;
-						break;
-					}
-
-					node = (NodeImpl) node.getParentNode();
-					if (node.getNodeType() != Node.ELEMENT_NODE)
-						continue;
-					ElementImpl element = (ElementImpl) node;
-					IStructuredDocumentRegion flatNode = null;
-					String endTag = this.generator.generateEndTag(element);
-					if (endTag != null) {
-						int length = endTag.length();
-						if (length > 0) {
-							buffer.append(endTag);
-							flatNode = new StructuredDocumentRegionProxy(offset, length);
-							offset += length;
-						}
-					}
-					element.setEndStructuredDocumentRegion(flatNode);
-				}
-			}
-
-			if (postTag != null) {
-				int length = postTag.length();
-				if (length > 0) {
-					buffer.append(postTag);
-					if (postElement != null) {
-						IStructuredDocumentRegion flatNode = new StructuredDocumentRegionProxy(offset, length);
-						postElement.setEndStructuredDocumentRegion(flatNode);
-					}
-				}
-			}
-			source = buffer.toString();
-		}
-
-		if (start == end && (source == null || source.length() == 0)) {
-			// no thing changed
-			return;
-		}
-
-		replaceSource(source, start, end);
-	}
-
-	void replaceRegions(IStructuredDocumentRegion flatNode, ITextRegionList newRegions, ITextRegionList oldRegions) {
-		// future_TODO: optimize
-
-		NodeImpl root = (NodeImpl) this.model.getDocument();
-		this.parentNode = root;
-		this.nextNode = (NodeImpl) root.getFirstChild();
-
-		removeGapStructuredDocumentRegion(flatNode);
-		insertGapStructuredDocumentRegionBefore(flatNode.getStart());
-		changeStructuredDocumentRegion(flatNode);
-		insertGapStructuredDocumentRegionAfter(flatNode.getEnd());
-	}
-
-	/**
-	 * Wraps IStructuredDocumentRegion.replaceText() and sets contextual
-	 * information.
-	 */
-	private void replaceSource(String source, int start, int end) {
-		int inserted = 0;
-		if (source == null)
-			source = new String();
-		else
-			inserted = source.length();
-		int removed = end - start;
-		if (inserted == 0 && removed == 0)
-			return;
-
-		this.gapOffset = start;
-		this.gapLength = removed;
-		this.diff = inserted - removed;
-		// Note: due to bug
-		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3619
-		// for now assume "ignore readonly" region is ok -- assume DOM itself
-		// checks if
-		// ok to insert or not. In reality, we may have to make or "contains"
-		// method more
-		// better. Or, we may have to "perculate up" the parameter for clients
-		// to tell us programatically
-		// that its ok to insert/format in a read-only region.
-		getStructuredDocument().replaceText(this.model, this.gapOffset, this.gapLength, source, true);
-	}
-
-	void replaceStructuredDocumentRegions(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
-		NodeImpl root = (NodeImpl) this.model.getDocument();
-
-		if (oldStructuredDocumentRegions != null) {
-			this.parentNode = root;
-			this.nextNode = (NodeImpl) root.getFirstChild();
-
-			Enumeration e = oldStructuredDocumentRegions.elements();
-			while (e.hasMoreElements()) {
-				IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
-				if (flatNode == null)
-					continue;
-				removeStructuredDocumentRegion(flatNode);
-				removeGapStructuredDocumentRegion(flatNode);
-			}
-		}
-
-		if (newStructuredDocumentRegions != null) {
-			this.parentNode = root;
-			this.nextNode = (NodeImpl) root.getFirstChild();
-
-			IStructuredDocumentRegion lastStructuredDocumentRegion = null;
-			Enumeration e = newStructuredDocumentRegions.elements();
-			while (e.hasMoreElements()) {
-				IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
-				if (flatNode == null)
-					continue;
-				if (lastStructuredDocumentRegion == null)
-					insertGapStructuredDocumentRegionBefore(flatNode.getStart());
-				insertStructuredDocumentRegion(flatNode);
-				lastStructuredDocumentRegion = flatNode;
-			}
-			if (lastStructuredDocumentRegion != null) {
-				insertGapStructuredDocumentRegionAfter(lastStructuredDocumentRegion.getEnd());
-			}
-			else {
-				insertGapStructuredDocumentRegionBefore(this.gapOffset);
-				// make sure to restore all backuped StructuredDocumentRegions
-				insertGapStructuredDocumentRegionAfter(this.gapOffset);
-			}
-		}
-		else {
-			this.parentNode = root;
-			this.nextNode = (NodeImpl) root.getFirstChild();
-
-			insertGapStructuredDocumentRegionBefore(this.gapOffset);
-			// make sure to restore all backuped StructuredDocumentRegions
-			insertGapStructuredDocumentRegionAfter(this.gapOffset);
-		}
-	}
-
-	/**
-	 */
-	private void updateAttrRegions(Element element, IStructuredDocumentRegion flatNode) {
-
-		// update attributes
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return;
-		NamedNodeMap attributes = element.getAttributes();
-		if (attributes == null)
-			return;
-		int index = -1;
-		AttrImpl attr = null;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-				attr = (AttrImpl) attributes.item(++index);
-				if (attr != null) {
-					attr.setNameRegion(region);
-					// reset other regions
-					attr.setEqualRegion(null);
-					attr.setValueRegion(null);
-				}
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
-				if (attr != null)
-					attr.setEqualRegion(region);
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-				if (attr != null) {
-					attr.setValueRegion(region);
-					attr = null;
-				}
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentCharsetDetector.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentCharsetDetector.java
deleted file mode 100644
index 697f649..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentCharsetDetector.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.encoding;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLResourceEncodingDetector;
-
-
-/**
- * This class reads and parses first of XML file to get encoding.
- *  
- */
-public class XMLDocumentCharsetDetector extends XMLResourceEncodingDetector implements IDocumentCharsetDetector {
-
-	/**
-	 * XMLLoader constructor comment.
-	 */
-	public XMLDocumentCharsetDetector() {
-		super();
-	}
-
-	public void set(IDocument document) {
-		set(new DocumentReader(document, 0));
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentLoader.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentLoader.java
deleted file mode 100644
index 2316b34..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentLoader.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.encoding;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.sse.core.internal.document.AbstractDocumentLoader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.document.StructuredDocumentFactory;
-import org.eclipse.wst.sse.core.internal.encoding.ContentTypeEncodingPreferences;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
-import org.eclipse.wst.xml.core.internal.parser.XMLStructuredDocumentReParser;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
-
-
-/**
- * This class reads an XML file and creates an XML Structured Model.
- * 
- */
-public class XMLDocumentLoader extends AbstractDocumentLoader {
-
-	public XMLDocumentLoader() {
-		super();
-	}
-
-	public IDocumentPartitioner getDefaultDocumentPartitioner() {
-		return new StructuredTextPartitionerForXML();
-	}
-
-	public IDocumentCharsetDetector getDocumentEncodingDetector() {
-		if (fDocumentEncodingDetector == null) {
-			fDocumentEncodingDetector = new XMLDocumentCharsetDetector();
-		}
-		return fDocumentEncodingDetector;
-	}
-
-	public RegionParser getParser() {
-		return new XMLSourceParser();
-	}
-
-	protected String getPreferredNewLineDelimiter(IFile file) {
-		String delimiter = ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(ContentTypeIdForXML.ContentTypeID_XML);
-		if (delimiter == null)
-			delimiter = super.getPreferredNewLineDelimiter(file);
-		return delimiter;
-	}
-
-	protected String getSpecDefaultEncoding() {
-		// by default, UTF-8 as per XML spec
-		final String enc = "UTF-8"; //$NON-NLS-1$
-		return enc;
-	}
-
-	protected IEncodedDocument newEncodedDocument() {
-		IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
-		if (structuredDocument instanceof BasicStructuredDocument) {
-			((BasicStructuredDocument) structuredDocument).setReParser(new XMLStructuredDocumentReParser());
-		}
-		return structuredDocument;
-	}
-
-	public IDocumentLoader newInstance() {
-		return new XMLDocumentLoader();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java
deleted file mode 100644
index a3785cf..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java
+++ /dev/null
@@ -1,1683 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.formatter;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.text.edits.DeleteEdit;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class DefaultXMLPartitionFormatter {
-	/**
-	 * Just a small container class that holds a DOMNode & documentRegion that
-	 * should represent each other.
-	 */
-	protected class DOMRegion {
-		public IDOMNode domNode;
-		public IStructuredDocumentRegion documentRegion;
-	}
-
-	static private final String PRESERVE = "preserve";//$NON-NLS-1$
-	static private final String COLLAPSE = "collapse";//$NON-NLS-1$
-	static private final String REPLACE = "replace";//$NON-NLS-1$
-	static private final String PRESERVE_QUOTED = "\"preserve\"";//$NON-NLS-1$
-	static private final String XML_SPACE = "xml:space";//$NON-NLS-1$
-	static private final String XSL_NAMESPACE = "http://www.w3.org/1999/XSL/Transform"; //$NON-NLS-1$
-	static private final String XSL_ATTRIBUTE = "attribute"; //$NON-NLS-1$
-	static private final String XSL_TEXT = "text"; //$NON-NLS-1$
-	static private final String SPACE = " "; //$NON-NLS-1$
-	static private final String PROPERTY_WHITESPACE_FACET = "org.eclipse.wst.xsd.cm.properties/whitespace"; //$NON-NLS-1$
-
-	private XMLFormattingPreferences fPreferences = null;
-	private IProgressMonitor fProgressMonitor;
-
-	private int replaceSpaces(TextEdit textEdit, int spaceStartOffset, int availableLineWidth, String whitespaceRun) {
-		StringBuffer buff = new StringBuffer(whitespaceRun);
-		for(int i = 0; i < buff.length(); i++) {
-			buff.setCharAt(i, ' '); //$NON-NLS-1$
-		}
-		String replacementString = buff.toString();
-		if (!replacementString.equals(whitespaceRun)) {
-			ReplaceEdit replaceEdit = new ReplaceEdit(spaceStartOffset, whitespaceRun.length(), replacementString);
-			textEdit.addChild(replaceEdit);
-		}
-		return availableLineWidth;
-	}
-	
-	private int collapseSpaces(TextEdit textEdit, int spaceStartOffset, int availableLineWidth, String whitespaceRun) {
-		// prefer to use use existing whitespace
-		int existingWhitespaceOffset = whitespaceRun.indexOf(' ');
-		if (existingWhitespaceOffset > -1) {
-			// delete whitespaces before and after existing whitespace
-			if (existingWhitespaceOffset > 0) {
-				DeleteEdit deleteEdit = new DeleteEdit(spaceStartOffset, existingWhitespaceOffset);
-				textEdit.addChild(deleteEdit);
-			}
-			if (existingWhitespaceOffset < whitespaceRun.length() - 1) {
-				int nextOffset = existingWhitespaceOffset + 1;
-				DeleteEdit deleteEdit = new DeleteEdit(spaceStartOffset + nextOffset, whitespaceRun.length() - nextOffset);
-				textEdit.addChild(deleteEdit);
-			}
-		}
-		else {
-			// delete all whitespace and insert new one
-			// collapse whitespace by deleting whitespace
-			DeleteEdit deleteEdit = new DeleteEdit(spaceStartOffset, whitespaceRun.length());
-			textEdit.addChild(deleteEdit);
-			// then insert one space
-			InsertEdit insertEdit = new InsertEdit(spaceStartOffset, SPACE);
-			textEdit.addChild(insertEdit);
-		}
-		// remember to account for space added
-		--availableLineWidth;
-		return availableLineWidth;
-	}
-	
-	private int collapseAndIndent(TextEdit textEdit, int spaceStartOffset, int availableLineWidth, int indentLevel, String whitespaceRun, IStructuredDocumentRegion currentRegion) {
-		// Need to keep blank lines, but still collapse the whitespace
-		String lineDelimiters = null;
-		if (!getFormattingPreferences().getClearAllBlankLines()) {
-			lineDelimiters = extractLineDelimiters(whitespaceRun, currentRegion);
-			String formattedLine = lineDelimiters + getIndentString(indentLevel);
-			if(lineDelimiters.length() > 0 && !formattedLine.equals(whitespaceRun)) {
-				textEdit.addChild(new ReplaceEdit(spaceStartOffset, whitespaceRun.length(), formattedLine));
-				availableLineWidth = getFormattingPreferences().getMaxLineWidth() - indentLevel;
-			}
-		}
-		if (lineDelimiters == null || lineDelimiters.length() == 0) {
-			availableLineWidth = collapseSpaces(textEdit, spaceStartOffset, availableLineWidth, whitespaceRun);
-		}
-		return availableLineWidth;
-	}
-
-	private void deleteTrailingSpaces(TextEdit textEdit, ITextRegion currentTextRegion, IStructuredDocumentRegion currentDocumentRegion) {
-		int textEnd = currentTextRegion.getTextEnd();
-		int textEndOffset = currentDocumentRegion.getStartOffset() + textEnd;
-		int difference = currentTextRegion.getEnd() - textEnd;
-		DeleteEdit deleteEdit = new DeleteEdit(textEndOffset, difference);
-		textEdit.addChild(deleteEdit);
-	}
-
-	public TextEdit format(IDocument document, int start, int length) {
-		return format(document, start, length, new XMLFormattingPreferences());
-	}
-
-	public TextEdit format(IDocument document, int start, int length, XMLFormattingPreferences preferences) {
-		TextEdit edit = null;
-		if (document instanceof IStructuredDocument) {
-			IStructuredModel model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) document);
-			if (model != null) {
-				try {
-					edit = format(model, start, length, preferences);
-				}
-				finally {
-					model.releaseFromEdit();
-				}
-			}
-		}
-		return edit;
-	}
-
-	public TextEdit format(IStructuredModel model, int start, int length) {
-		return format(model, start, length, new XMLFormattingPreferences());
-	}
-
-	public TextEdit format(IStructuredModel model, int start, int length, XMLFormattingPreferences preferences) {
-		setFormattingPreferences(preferences);
-
-		TextEdit edit = new MultiTextEdit();
-		IStructuredDocument document = model.getStructuredDocument();
-		// get initial document region
-		IStructuredDocumentRegion currentRegion = document.getRegionAtCharacterOffset(start);
-		if (currentRegion != null) {
-			int startOffset = currentRegion.getStartOffset();
-
-			// get initial dom node
-			IndexedRegion currentIndexedRegion = model.getIndexedRegion(startOffset);
-			if (currentIndexedRegion instanceof IDOMNode) {
-				// set up domRegion which will contain current region to be
-				// formatted
-				IDOMNode currentDOMNode = (IDOMNode) currentIndexedRegion;
-				DOMRegion domRegion = new DOMRegion();
-				domRegion.documentRegion = currentRegion;
-				domRegion.domNode = currentDOMNode;
-				
-				XMLFormattingConstraints parentConstraints = getRegionConstraints(currentDOMNode);
-				
-				/* if the whitespace strategy is declared as default, get it from the preferences */
-				if(parentConstraints.getWhitespaceStrategy() == XMLFormattingConstraints.DEFAULT)
-					parentConstraints.setWhitespaceStrategy(preferences.getElementWhitespaceStrategy());
-				
-				// TODO: initialize indentLevel
-				// initialize available line width
-				int lineWidth = getFormattingPreferences().getMaxLineWidth();
-				try {
-					IRegion lineInfo = document.getLineInformationOfOffset(startOffset);
-					lineWidth = lineWidth - (startOffset - lineInfo.getOffset());
-				}
-				catch (BadLocationException e) {
-					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-				}
-				parentConstraints.setAvailableLineWidth(lineWidth);
-
-				// format all siblings (and their children) as long they
-				// overlap with start/length
-				Position formatRange = new Position(start, length);
-				formatSiblings(edit, domRegion, parentConstraints, formatRange);
-			}
-		}
-		return edit;
-	}
-
-	/**
-	 * Determines the formatting constraints for a specified node based on
-	 * its ancestors' formatting. In particular, if any ancestor node either
-	 * explicitly defines whitespace preservation or ignorance, that
-	 * whitespace strategy should be used for <code>currentNode</code> and 
-	 * all of its descendants.
-	 * 
-	 * @param currentNode the node to investigate the ancestry of to determine
-	 * formatting constraints
-	 * 
-	 * @return formatting constraints defined by an ancestor
-	 */
-	private XMLFormattingConstraints getRegionConstraints(IDOMNode currentNode) {
-		IDOMNode iterator = currentNode;
-		XMLFormattingConstraints result = new XMLFormattingConstraints();
-		DOMRegion region = new DOMRegion();
-		XMLFormattingConstraints parentConstraints = new XMLFormattingConstraints();
-		boolean parent = true;
-		
-		/* Iterate through the ancestry to find if any explicit whitespace strategy has
-		 * been defined
-		 */
-		while(iterator != null && iterator.getNodeType() != Node.DOCUMENT_NODE) {
-			iterator = (IDOMNode) iterator.getParentNode();
-			region.domNode = iterator;
-			region.documentRegion = iterator.getFirstStructuredDocumentRegion();
-			
-			updateFormattingConstraints(null, null, result, region);
-			
-			/* If this is the parent of the current node, keep the constraints
-			 * in case no other constraints are identified
-			 */
-			if(parent) {
-				parentConstraints.copyConstraints(result);
-				parent = false;
-			}
-			
-			/* A parent who has defined a specific whitespace strategy was found */
-			if(XMLFormattingConstraints.PRESERVE == result.getWhitespaceStrategy() || XMLFormattingConstraints.DEFAULT == result.getWhitespaceStrategy())
-				return result;
-		}
-		
-		return parentConstraints;
-	}
-//	private XMLFormattingConstraints getRegionConstraints(IDOMNode currentNode) {
-//		IDOMNode iterator = (IDOMNode) currentNode.getParentNode();
-//		XMLFormattingConstraints result = new XMLFormattingConstraints();
-//		DOMRegion region = new DOMRegion();
-//		
-//		/* Iterate through the ancestry to find if any explicit whitespace strategy has
-//		 * been defined
-//		 */
-//		while(iterator != null && iterator.getNodeType() != Node.DOCUMENT_NODE) {
-
-//			region.domNode = iterator;
-//			region.documentRegion = iterator.getFirstStructuredDocumentRegion();
-//			
-//			updateFormattingConstraints(null, null, result, region);
-//			
-//			/* A parent who has defined a specific whitespace strategy was found */
-//			if(XMLFormattingConstraints.PRESERVE == result.getWhitespaceStrategy() || XMLFormattingConstraints.DEFAULT == result.getWhitespaceStrategy())
-//				return result;
-//			
-//			iterator = (IDOMNode) iterator.getParentNode();
-//		}
-//		
-//		return null;
-//	}
-	
-	/**
-	 * Formats the given xml content region
-	 * 
-	 * @param textEdit
-	 * @param formatRange
-	 * @param parentConstraints
-	 * @param currentDOMRegion
-	 * @param previousRegion
-	 */
-	private void formatContent(TextEdit textEdit, Position formatRange, XMLFormattingConstraints parentConstraints, DOMRegion currentDOMRegion, IStructuredDocumentRegion previousRegion) {
-		IStructuredDocumentRegion currentRegion = currentDOMRegion.documentRegion;
-		String fullText = currentRegion.getFullText();
-
-		// check if in preserve space mode, if so, don't touch anything but
-		// make sure to update available line width
-		String whitespaceMode = parentConstraints.getWhitespaceStrategy();
-		if (whitespaceMode == XMLFormattingConstraints.PRESERVE) {
-			int availableLineWidth = parentConstraints.getAvailableLineWidth();
-			availableLineWidth = updateLineWidthWithLastLine(fullText, availableLineWidth);
-
-			// update available line width in constraints
-			parentConstraints.setAvailableLineWidth(availableLineWidth);
-			return;
-		}
-
-		// if content is just whitespace and there's something after it
-		// just skip over this region because region will take care of it
-		boolean isAllWhitespace = ((IDOMText) currentDOMRegion.domNode).isElementContentWhitespace();
-		IStructuredDocumentRegion nextDocumentRegion = null;
-		if (isAllWhitespace) {
-			parentConstraints.setAvailableLineWidth(fPreferences.getMaxLineWidth());
-			nextDocumentRegion = currentRegion.getNext();
-			if (nextDocumentRegion != null)
-				return;
-		}
-
-		// special handling if text follows an entity or cdata region
-		if (whitespaceMode != XMLFormattingConstraints.COLLAPSE && previousRegion != null) {
-			String previouRegionType = previousRegion.getType();
-			if (previouRegionType == DOMRegionContext.XML_ENTITY_REFERENCE || previouRegionType == DOMRegionContext.XML_CDATA_TEXT)
-				whitespaceMode = XMLFormattingConstraints.COLLAPSE;
-		}
-		// also, special handling if text is before an entity or cdata region
-		if (whitespaceMode != XMLFormattingConstraints.COLLAPSE) {
-			// get next document region if dont already have it
-			if (nextDocumentRegion == null)
-				nextDocumentRegion = currentRegion.getNext();
-			if (nextDocumentRegion != null) {
-				String nextRegionType = nextDocumentRegion.getType();
-				if (nextRegionType == DOMRegionContext.XML_ENTITY_REFERENCE || nextRegionType == DOMRegionContext.XML_CDATA_TEXT)
-					whitespaceMode = XMLFormattingConstraints.COLLAPSE;
-			}
-		}
-		formatTextInContent(textEdit, parentConstraints, currentRegion, fullText, whitespaceMode);
-	}
-
-	private void formatEmptyStartTagWithNoAttr(TextEdit textEdit, XMLFormattingConstraints constraints, IStructuredDocumentRegion currentDocumentRegion, IStructuredDocumentRegion previousDocumentRegion, int availableLineWidth, String indentStrategy, String whitespaceStrategy, ITextRegion currentTextRegion) {
-		// get preference if there should be a space or not between tag
-		// name and empty tag close
-		// <tagName />
-		boolean oneSpaceInTagName = getFormattingPreferences().getSpaceBeforeEmptyCloseTag();
-
-		// calculate available line width
-		int tagNameLineWidth = currentTextRegion.getTextLength() + 3;
-		if (oneSpaceInTagName) {
-			// add one more to account for space before empty tag close
-			++tagNameLineWidth;
-		}
-		availableLineWidth -= tagNameLineWidth;
-
-		if (indentStrategy == XMLFormattingConstraints.INLINE) {
-			// if was inlining, need to check if out of available line
-			// width
-			if (availableLineWidth < 0) {
-				// need to indent if possible
-				int lineWidth = indentIfPossible(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, true);
-				// update available line width
-				if (lineWidth > 0)
-					availableLineWidth = lineWidth - tagNameLineWidth;
-				else
-					availableLineWidth -= tagNameLineWidth;
-			}
-			else {
-				// no need to indent
-				// just make sure to delete previous whitespace if
-				// needed
-				if ((previousDocumentRegion.getType() == DOMRegionContext.XML_CONTENT) && (previousDocumentRegion.getFullText().trim().length() == 0)) {
-					availableLineWidth = collapseSpaces(textEdit, previousDocumentRegion.getStartOffset(), availableLineWidth, previousDocumentRegion.getFullText());
-				}
-			}
-		}
-
-		// delete any trail spaces after tag name
-		int textLength = currentTextRegion.getTextLength();
-		int regionLength = currentTextRegion.getLength();
-
-		boolean thereAreSpaces = textLength < regionLength;
-		if (!oneSpaceInTagName && thereAreSpaces) {
-			deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
-		}
-		else if(oneSpaceInTagName) {
-			insertSpaceAndCollapse(textEdit, currentDocumentRegion, availableLineWidth, currentTextRegion);
-		}
-		constraints.setAvailableLineWidth(availableLineWidth);
-	}
-
-	/**
-	 * Formats an end tag
-	 * 
-	 * @param textEdit
-	 * @param currentRegion
-	 * @param textRegions
-	 */
-	private void formatEndTag(TextEdit textEdit, Position formatRange, XMLFormattingConstraints constraints, DOMRegion currentDOMRegion, IStructuredDocumentRegion previousDocumentRegion) {
-		IStructuredDocumentRegion currentDocumentRegion = currentDOMRegion.documentRegion;
-
-		String whitespaceStrategy = constraints.getWhitespaceStrategy();
-		String indentStrategy = constraints.getIndentStrategy();
-
-		// do not format space before start tag if preserving spaces
-		if (whitespaceStrategy != XMLFormattingConstraints.PRESERVE) {
-			// format like indent strategy says
-			if (indentStrategy == XMLFormattingConstraints.INDENT || indentStrategy == XMLFormattingConstraints.NEW_LINE) {
-				int availableLineWidth = indentIfPossible(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, false);
-				constraints.setAvailableLineWidth(availableLineWidth);
-			}
-		}
-		// format the end tag itself
-		formatWithinEndTag(textEdit, constraints, currentDocumentRegion, previousDocumentRegion);
-	}
-
-	/**
-	 * Formats the given region (and all its children) contained in domRegion.
-	 * 
-	 * @param edit
-	 *            edits required to format
-	 * @param formatRange
-	 *            document range to format (only format content within this
-	 *            range)
-	 * @param parentConstraints
-	 * @param domRegion
-	 *            assumes dom node & region are not null
-	 * @param previousRegion
-	 *            could be null
-	 * @return Returns the last region formatted
-	 */
-	private DOMRegion formatRegion(TextEdit edit, Position formatRange, XMLFormattingConstraints parentConstraints, DOMRegion domRegion, IStructuredDocumentRegion previousRegion) {
-		IStructuredDocumentRegion currentRegion = domRegion.documentRegion;
-		String regionType = currentRegion.getType();
-		if (regionType == DOMRegionContext.XML_TAG_NAME) {
-			ITextRegion textRegion = currentRegion.getFirstRegion();
-			String textRegionType = textRegion.getType();
-			if (textRegionType == DOMRegionContext.XML_TAG_OPEN) {
-				domRegion = formatStartTag(edit, formatRange, parentConstraints, domRegion, previousRegion);
-			}
-			else if (textRegionType == DOMRegionContext.XML_END_TAG_OPEN) {
-				formatEndTag(edit, formatRange, parentConstraints, domRegion, previousRegion);
-			}
-		}
-		else if (regionType == DOMRegionContext.XML_CONTENT) {
-			formatContent(edit, formatRange, parentConstraints, domRegion, previousRegion);
-		}
-		else if (regionType == DOMRegionContext.XML_COMMENT_TEXT) {
-			formatComment(edit, formatRange, parentConstraints, domRegion, previousRegion);
-		}
-		else {
-			// unknown, so just leave alone for now but make sure to update
-			// available line width
-			String fullText = currentRegion.getFullText();
-			int width = updateLineWidthWithLastLine(fullText, parentConstraints.getAvailableLineWidth());
-			parentConstraints.setAvailableLineWidth(width);
-		}
-		return domRegion;
-	}
-
-	/**
-	 * Formats the domRegion and all of its children and siblings
-	 * 
-	 * @param edit
-	 * @param domRegion
-	 * @param parentConstraints
-	 * @param formatRange
-	 */
-	private void formatSiblings(TextEdit edit, DOMRegion domRegion, XMLFormattingConstraints parentConstraints, Position formatRange) {
-		IStructuredDocumentRegion previousRegion = null;
-		IStructuredDocumentRegion currentRegion = domRegion.documentRegion;
-		IDOMNode currentDOMNode = domRegion.domNode;
-		while (currentDOMNode != null && currentRegion != null && formatRange.overlapsWith(currentRegion.getStartOffset(), currentRegion.getLength()) && (fProgressMonitor == null || !fProgressMonitor.isCanceled())) {
-			domRegion.documentRegion = currentRegion;
-			domRegion.domNode = currentDOMNode;
-
-			// need to make sure current document region and current
-			// dom node match up
-			if (currentRegion == currentDOMNode.getFirstStructuredDocumentRegion()) {
-				// format this document region/node, formatRegion will
-				// return the last node/region formatted
-				domRegion = formatRegion(edit, formatRange, parentConstraints, domRegion, previousRegion);
-			}
-			else {
-				// TODO: need to figure out what to do if they don't
-				// match up
-			}
-			previousRegion = domRegion.documentRegion;
-			// get the next sibling information
-			if (domRegion.domNode != null)
-				currentDOMNode = (IDOMNode) domRegion.domNode.getNextSibling();
-			else
-				currentDOMNode = null;
-			currentRegion = previousRegion.getNext();
-		}
-	}
-
-	/**
-	 * Formats a start tag
-	 * 
-	 * @param textEdit
-	 * @param currentRegion
-	 * @param textRegions
-	 */
-	private DOMRegion formatStartTag(TextEdit textEdit, Position formatRange, XMLFormattingConstraints parentConstraints, DOMRegion currentDOMRegion, IStructuredDocumentRegion previousDocumentRegion) {
-		// determine proper indent by referring to parent constraints,
-		// previous node, and current node
-		IStructuredDocumentRegion currentDocumentRegion = currentDOMRegion.documentRegion;
-		IDOMNode currentDOMNode = currentDOMRegion.domNode;
-
-		// create a constraint for this tag
-		XMLFormattingConstraints thisConstraints = new XMLFormattingConstraints();
-		XMLFormattingConstraints childrenConstraints = new XMLFormattingConstraints();
-		updateFormattingConstraints(parentConstraints, thisConstraints, childrenConstraints, currentDOMRegion);
-
-		if(childrenConstraints.getWhitespaceStrategy() == XMLFormattingConstraints.DEFAULT)
-			childrenConstraints.setWhitespaceStrategy((new XMLFormattingPreferences()).getElementWhitespaceStrategy());
-			
-		String whitespaceStrategy = thisConstraints.getWhitespaceStrategy();
-		String indentStrategy = thisConstraints.getIndentStrategy();
-		int availableLineWidth = thisConstraints.getAvailableLineWidth();
-
-		// format space before start tag
-		// do not format space before start tag if preserving spaces
-		if (whitespaceStrategy != XMLFormattingConstraints.PRESERVE) {
-			// format like indent strategy says
-			if (indentStrategy == XMLFormattingConstraints.INDENT || indentStrategy == XMLFormattingConstraints.NEW_LINE) {
-				availableLineWidth = indentIfPossible(textEdit, thisConstraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, true);
-				if (availableLineWidth > 0)
-					thisConstraints.setAvailableLineWidth(availableLineWidth);
-			}
-		}
-		// format the start tag itself
-		boolean tagEnded = formatWithinTag(textEdit, thisConstraints, currentDocumentRegion, previousDocumentRegion);
-
-		// format children
-		if (!tagEnded) {
-			// update childConstraints with thisConstraint's indentLevel &
-			// availableLineWidth
-			childrenConstraints.setIndentLevel(thisConstraints.getIndentLevel());
-			childrenConstraints.setAvailableLineWidth(thisConstraints.getAvailableLineWidth());
-
-			previousDocumentRegion = currentDocumentRegion;
-			IDOMNode childDOMNode = (IDOMNode) currentDOMNode.getFirstChild();
-			IStructuredDocumentRegion nextRegion = currentDocumentRegion.getNext();
-			boolean passedFormatRange = false;
-			// as long as there is one child
-			if (childDOMNode != null && nextRegion != null) {
-				while (childDOMNode != null && nextRegion != null && !passedFormatRange && (fProgressMonitor == null || !fProgressMonitor.isCanceled())) {
-					DOMRegion childDOMRegion = new DOMRegion();
-					childDOMRegion.documentRegion = nextRegion;
-					childDOMRegion.domNode = childDOMNode;
-					if (nextRegion == childDOMNode.getFirstStructuredDocumentRegion()) {
-						// format children. pass in child constraints
-						childDOMRegion = formatRegion(textEdit, formatRange, childrenConstraints, childDOMRegion, previousDocumentRegion);
-					}
-					else {
-						// TODO: what happens if they dont match up?
-					}
-
-					// update childDOMRegion with next dom/region node
-					if (childDOMRegion.domNode != null) {
-						childDOMNode = (IDOMNode) childDOMRegion.domNode.getNextSibling();
-					}
-					else {
-						childDOMNode = null;
-					}
-					previousDocumentRegion = childDOMRegion.documentRegion;
-					nextRegion = previousDocumentRegion.getNext();
-					if (nextRegion != null)
-						passedFormatRange = !formatRange.overlapsWith(nextRegion.getStartOffset(), nextRegion.getLength());
-				}
-			}
-			else {
-				// there were no children, so keep end tag inlined
-				childrenConstraints.setWhitespaceStrategy(XMLFormattingConstraints.COLLAPSE);
-				childrenConstraints.setIndentStrategy(XMLFormattingConstraints.INLINE);
-			}
-
-			if (!passedFormatRange) {
-				// update the dom region with the last formatted region/dom
-				// node should be end tag and this tag's DOMNode
-				currentDOMRegion.documentRegion = nextRegion;
-				currentDOMRegion.domNode = currentDOMNode;
-
-				// end tag's indent level should be same as start tag's
-				childrenConstraints.setIndentLevel(thisConstraints.getIndentLevel());
-				// format end tag
-				boolean formatEndTag = false;
-				if (nextRegion != null && currentDOMNode != null) {
-					ITextRegionList rs = nextRegion.getRegions();
-					if (rs.size() > 1) {
-						ITextRegion r = rs.get(0);
-						if (r != null && r.getType() == DOMRegionContext.XML_END_TAG_OPEN) {
-							r = rs.get(1);
-							if (r != null && r.getType() == DOMRegionContext.XML_TAG_NAME) {
-								String tagName = nextRegion.getText(r);
-								if (tagName != null && tagName.equals(currentDOMNode.getNodeName()))
-									formatEndTag = true;
-							}
-						}
-
-					}
-				}
-				if (formatEndTag)
-					formatEndTag(textEdit, formatRange, childrenConstraints, currentDOMRegion, previousDocumentRegion);
-				else {
-					// missing end tag so return last formatted document
-					// region
-					currentDOMRegion.documentRegion = previousDocumentRegion;
-				}
-			}
-			else {
-				// passed format range before could finish, so update dom
-				// region to last known formatted region
-				currentDOMRegion.documentRegion = nextRegion;
-				currentDOMRegion.domNode = childDOMNode;
-			}
-
-			// update parent constraint since this is what is passed back
-			parentConstraints.setAvailableLineWidth(childrenConstraints.getAvailableLineWidth());
-		}
-		else {
-			// update available line width
-			parentConstraints.setAvailableLineWidth(thisConstraints.getAvailableLineWidth());
-		}
-		return currentDOMRegion;
-	}
-
-	private void formatStartTagWithNoAttr(TextEdit textEdit, XMLFormattingConstraints constraints, IStructuredDocumentRegion currentDocumentRegion, IStructuredDocumentRegion previousDocumentRegion, int availableLineWidth, String indentStrategy, String whitespaceStrategy, ITextRegion currentTextRegion) {
-		// calculate available line width
-		int tagNameLineWidth = currentTextRegion.getTextLength() + 2;
-		availableLineWidth -= tagNameLineWidth;
-
-		if (indentStrategy == XMLFormattingConstraints.INLINE) {
-			// if was inlining, need to check if out of available line
-			// width
-			if (availableLineWidth < 0) {
-				// need to indent if possible
-				int lineWidth = indentIfPossible(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, true);
-				// update available line width
-				if (lineWidth > 0)
-					availableLineWidth = lineWidth - tagNameLineWidth;
-				else
-					availableLineWidth -= tagNameLineWidth;
-			}
-			else {
-				// no need to indent
-				// just make sure to delete previous whitespace if
-				// needed
-				if (previousDocumentRegion != null) {
-					if (previousDocumentRegion.getType() == DOMRegionContext.XML_CONTENT) {
-						String previousDocumentRegionText = previousDocumentRegion.getFullText();
-						if (previousDocumentRegionText.trim().length() == 0) {
-							availableLineWidth = collapseSpaces(textEdit, previousDocumentRegion.getStartOffset(), availableLineWidth, previousDocumentRegionText);
-						}
-					}
-				}
-			}
-		}
-
-		// delete any trail spaces after tag name
-		if (currentTextRegion.getTextLength() < currentTextRegion.getLength()) {
-			deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
-		}
-		constraints.setAvailableLineWidth(availableLineWidth);
-	}
-
-	/**
-	 * Format the text in xml content
-	 * 
-	 * @param textEdit
-	 * @param parentConstraints
-	 * @param currentRegion
-	 * @param fullText
-	 * @param whitespaceMode
-	 */
-	private void formatTextInContent(TextEdit textEdit, XMLFormattingConstraints parentConstraints, IStructuredDocumentRegion currentRegion, String fullText, String whitespaceMode) {
-		int availableLineWidth = parentConstraints.getAvailableLineWidth();
-
-		// determine indentation
-		boolean forceInitialIndent = false;
-		int indentLevel = parentConstraints.getIndentLevel() + 1;
-		String indentMode = parentConstraints.getIndentStrategy();
-		if (indentMode == XMLFormattingConstraints.INDENT) {
-			forceInitialIndent = true;
-		}
-		if (indentMode == XMLFormattingConstraints.NEW_LINE) {
-			indentLevel = parentConstraints.getIndentLevel();
-			forceInitialIndent = true;
-		}
-
-		int fullTextOffset = 0;
-		char[] fullTextArray = fullText.toCharArray();
-		while (fullTextOffset < fullTextArray.length) {
-			// gather all whitespaces
-			String whitespaceRun = getCharacterRun(fullTextArray, fullTextOffset, true);
-			if (whitespaceRun.length() > 0) {
-				// offset where whitespace starts
-				int whitespaceStart = fullTextOffset;
-				// update current offset in fullText
-				fullTextOffset += whitespaceRun.length();
-
-				// gather following word
-				String characterRun = getCharacterRun(fullTextArray, fullTextOffset, false);
-				int characterRunLength = characterRun.length();
-				if (characterRunLength > 0) {
-					// indent if word is too long or forcing initial
-					// indent
-					availableLineWidth -= characterRunLength;
-					// offset where indent/collapse will happen
-					int startOffset = currentRegion.getStartOffset() + whitespaceStart;
-					if (forceInitialIndent || (availableLineWidth <= 0)) {
-						// indent if not already indented
-						availableLineWidth = indentIfNotAlreadyIndented(textEdit, currentRegion, indentLevel, startOffset, whitespaceRun);
-						// remember to subtract word length
-						availableLineWidth -= characterRunLength;
-						forceInitialIndent = false; // initial indent done
-					}
-					else {
-						// just collapse spaces, but adjust for any indenting that may result from preserving line delimiters
-						if (whitespaceStart == 0 && whitespaceMode == XMLFormattingConstraints.IGNOREANDTRIM) {
-							// if ignore, trim
-							DeleteEdit deleteTrailing = new DeleteEdit(startOffset, whitespaceRun.length());
-							textEdit.addChild(deleteTrailing);
-						}
-						else if(whitespaceMode == XMLFormattingConstraints.REPLACE)
-							availableLineWidth = replaceSpaces(textEdit, startOffset, availableLineWidth, whitespaceRun);
-						else
-							availableLineWidth = collapseAndIndent(textEdit, startOffset, availableLineWidth, indentLevel, whitespaceRun, currentRegion);
-					}
-
-					fullTextOffset += characterRunLength;
-				}
-				else {
-					// handle trailing whitespace
-					int whitespaceOffset = currentRegion.getStartOffset() + whitespaceStart;
-					if (whitespaceMode == XMLFormattingConstraints.REPLACE)
-						availableLineWidth = replaceSpaces(textEdit, whitespaceOffset, availableLineWidth, whitespaceRun);
-					else if (whitespaceMode == XMLFormattingConstraints.IGNOREANDTRIM) {
-						// always trim
-						DeleteEdit deleteTrailing = new DeleteEdit(whitespaceOffset, whitespaceRun.length());
-						textEdit.addChild(deleteTrailing);
-					}
-					else if(getFormattingPreferences().getClearAllBlankLines()) {
-						if (whitespaceMode == XMLFormattingConstraints.IGNORE) {
-							// if ignore, trim
-							DeleteEdit deleteTrailing = new DeleteEdit(whitespaceOffset, whitespaceRun.length());
-							textEdit.addChild(deleteTrailing);
-						}
-						else {
-							// if collapse, leave a space. but what if end up
-							// wanting to add indent? then need to delete space
-							// added and add indent instead
-							availableLineWidth = collapseSpaces(textEdit, whitespaceOffset, availableLineWidth, whitespaceRun);
-						}
-					}
-				}
-			}
-			else {
-				// gather word
-				String characterRun = getCharacterRun(fullTextArray, fullTextOffset, false);
-				int characterRunLength = characterRun.length();
-				if (characterRunLength > 0) {
-					// indent if word is too long or forcing initial
-					// indent
-					availableLineWidth = availableLineWidth - characterRunLength;
-					if ((whitespaceMode == XMLFormattingConstraints.IGNORE || whitespaceMode == XMLFormattingConstraints.IGNOREANDTRIM) && (forceInitialIndent || (availableLineWidth <= 0))) {
-						// indent if not already indented
-						availableLineWidth = indentIfNotAlreadyIndented(textEdit, currentRegion, indentLevel, currentRegion.getStartOffset(), whitespaceRun);
-						// remember to subtract word length
-						availableLineWidth -= characterRunLength;
-						forceInitialIndent = false; // initial indent done
-					}
-					else {
-						// just collapse spaces
-						availableLineWidth -= characterRunLength;
-					}
-
-					fullTextOffset += characterRunLength;
-				}
-			}
-		}
-		// update available line width
-		parentConstraints.setAvailableLineWidth(availableLineWidth);
-	}
-
-	private void formatWithinEndTag(TextEdit textEdit, XMLFormattingConstraints constraints, IStructuredDocumentRegion currentDocumentRegion, IStructuredDocumentRegion previousDocumentRegion) {
-		String indentStrategy = constraints.getIndentStrategy();
-		String whitespaceStrategy = constraints.getWhitespaceStrategy();
-		int availableLineWidth = constraints.getAvailableLineWidth();
-		ITextRegionList textRegions = currentDocumentRegion.getRegions();
-		int currentTextRegionIndex = 1;
-
-		ITextRegion currentTextRegion = textRegions.get(currentTextRegionIndex);
-		String currentType = currentTextRegion.getType();
-		// tag name should always be the first text region
-		if (currentType == DOMRegionContext.XML_TAG_NAME) {
-			ITextRegion nextTextRegion = textRegions.get(currentTextRegionIndex + 1);
-			String nextType = nextTextRegion.getType();
-			if (nextType == DOMRegionContext.XML_TAG_CLOSE) {
-				// calculate available line width
-				int tagNameLineWidth = currentTextRegion.getTextLength() + 3;
-				availableLineWidth -= tagNameLineWidth;
-
-				if (indentStrategy == XMLFormattingConstraints.INLINE) {
-					// if was inlining, need to check if out of available line
-					// width - Whitespace may have been corrected in the text content
-					if (availableLineWidth < 0 && whitespaceStrategy == XMLFormattingConstraints.IGNORE) {
-						// need to deindent if possible
-						int lineWidth = indentIfPossible(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, false);
-						// update available line width
-						if (lineWidth > 0)
-							availableLineWidth = lineWidth - tagNameLineWidth;
-					}
-					else {
-						// no need to indent
-						// just make sure to delete previous whitespace if
-						// needed
-						if (previousDocumentRegion != null) {
-							if (previousDocumentRegion.getType() == DOMRegionContext.XML_CONTENT) {
-								String previousDocumentRegionText = previousDocumentRegion.getFullText();
-								if (previousDocumentRegionText.trim().length() == 0) {
-									availableLineWidth = collapseSpaces(textEdit, previousDocumentRegion.getStartOffset(), availableLineWidth, previousDocumentRegionText);
-								}
-							}
-						}
-					}
-				}
-				// delete any trail spaces after tag name
-				if (currentTextRegion.getTextLength() < currentTextRegion.getLength()) {
-					deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
-				}
-			}
-		}
-		else {
-			// end tag has unexpected stuff, so just leave it alone
-		}
-		constraints.setAvailableLineWidth(availableLineWidth);
-	}
-
-	/**
-	 * Formats the contents within a tag like tag name and attributes
-	 * 
-	 * @param textEdit
-	 * @param currentDocumentRegion
-	 * @param textRegions
-	 *            contains at least 3 regions
-	 * @return true if tag was ended, false otherwise
-	 */
-	private boolean formatWithinTag(TextEdit textEdit, XMLFormattingConstraints constraints, IStructuredDocumentRegion currentDocumentRegion, IStructuredDocumentRegion previousDocumentRegion) {
-		int availableLineWidth = constraints.getAvailableLineWidth();
-		String indentStrategy = constraints.getIndentStrategy();
-		String whitespaceStrategy = constraints.getWhitespaceStrategy();
-		int indentLevel = constraints.getIndentLevel();
-		ITextRegionList textRegions = currentDocumentRegion.getRegions();
-		int currentTextRegionIndex = 1;
-
-		ITextRegion currentTextRegion = textRegions.get(currentTextRegionIndex);
-		String currentType = currentTextRegion.getType();
-		// tag name should always be the first text region
-		if (currentType == DOMRegionContext.XML_TAG_NAME) {
-			ITextRegion nextTextRegion = textRegions.get(currentTextRegionIndex + 1);
-			String nextType = (nextTextRegion != null) ? nextTextRegion.getType() : null;
-			if (nextType == DOMRegionContext.XML_TAG_CLOSE) {
-				// already at tag close
-				formatStartTagWithNoAttr(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, availableLineWidth, indentStrategy, whitespaceStrategy, currentTextRegion);
-				return false;
-			}
-			else if (nextType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-				// already at empty tag close
-				formatEmptyStartTagWithNoAttr(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, availableLineWidth, indentStrategy, whitespaceStrategy, currentTextRegion);
-				return true;
-			}
-			else {
-				availableLineWidth -= (currentTextRegion.getTextLength() + 2);
-				boolean alignFinalBracket = getFormattingPreferences().getAlignFinalBracket();
-				boolean oneSpaceInTagName = getFormattingPreferences().getSpaceBeforeEmptyCloseTag();
-				boolean indentMultipleAttribute = getFormattingPreferences().getIndentMultipleAttributes();
-				// indicates if tag spanned more than one line
-				boolean spanMoreThan1Line = false;
-				// indicates if all attributes should be indented
-				boolean indentAllAttributes = false;
-				if (indentMultipleAttribute) {
-					int attributesCount = 0;
-					int i = 2;
-					while (i < textRegions.size() && attributesCount < 2) {
-						if (textRegions.get(i).getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
-							++attributesCount;
-					}
-					indentAllAttributes = (attributesCount > 1);
-				}
-
-				while ((currentTextRegionIndex + 1) < textRegions.size()) {
-					nextTextRegion = textRegions.get(currentTextRegionIndex + 1);
-					nextType = nextTextRegion.getType();
-					if (nextType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-						boolean indentAttribute = indentAllAttributes;
-						if (!indentAttribute)
-							indentAttribute = shouldIndentBeforeAttribute(constraints, textRegions, availableLineWidth, currentTextRegionIndex, currentTextRegion, nextTextRegion);
-						if (indentAttribute) {
-							availableLineWidth = indentIfNotAlreadyIndented(textEdit, indentLevel + 1, currentDocumentRegion, currentTextRegion);
-							spanMoreThan1Line = true;
-						}
-						else {
-							// otherwise, insertSpaceAndCollapse
-							insertSpaceAndCollapse(textEdit, currentDocumentRegion, availableLineWidth, currentTextRegion);
-							// update available line width
-							availableLineWidth -= (currentTextRegion.getTextLength() + 1);
-						}
-					}
-					else if (nextType == DOMRegionContext.XML_TAG_CLOSE) {
-						// if need to align bracket on next line, indent
-						if (alignFinalBracket && spanMoreThan1Line) {
-							availableLineWidth = indentIfNotAlreadyIndented(textEdit, indentLevel, currentDocumentRegion, currentTextRegion);
-							--availableLineWidth; // for tag close itself
-						}
-						else {
-							// otherwise, just delete space before tag close
-							if (currentTextRegion.getTextLength() < currentTextRegion.getLength()) {
-								deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
-								availableLineWidth -= (currentTextRegion.getTextLength() + 1);
-							}
-						}
-						// update line width
-						constraints.setAvailableLineWidth(availableLineWidth);
-						return false;
-					}
-					else if (nextType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-						int textLength = currentTextRegion.getTextLength();
-						int regionLength = currentTextRegion.getLength();
-
-						boolean thereAreSpaces = textLength < regionLength;
-						if (!oneSpaceInTagName && thereAreSpaces) {
-							// delete any trail spaces after tag name
-							deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
-							availableLineWidth -= (currentTextRegion.getTextLength() + 2);
-						}
-						// insert a space and collapse ONLY IF it's specified
-						else if (oneSpaceInTagName) {
-							insertSpaceAndCollapse(textEdit, currentDocumentRegion, availableLineWidth, currentTextRegion);
-							availableLineWidth -= (currentTextRegion.getTextLength() + 3);
-						}
-						// update line width
-						constraints.setAvailableLineWidth(availableLineWidth);
-						return true;
-					}
-					else {
-						if (currentType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME && nextType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
-							if (currentTextRegion.getTextLength() < currentTextRegion.getLength()) {
-								deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
-							}
-							// update available width
-							availableLineWidth -= currentTextRegion.getTextLength();
-						}
-						else if (currentType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS && nextType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-							if (currentTextRegion.getTextLength() < currentTextRegion.getLength()) {
-								deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
-							}
-							// update available width
-							availableLineWidth -= currentTextRegion.getTextLength();
-						}
-						else {
-							// otherwise, insertSpaceAndCollapse
-							insertSpaceAndCollapse(textEdit, currentDocumentRegion, availableLineWidth, currentTextRegion);
-							// update available line width
-							availableLineWidth -= (currentTextRegion.getTextLength() + 1);
-						}
-					}
-					currentTextRegion = nextTextRegion;
-					currentType = nextType;
-					++currentTextRegionIndex;
-				}
-			}
-		}
-		// update line width
-		constraints.setAvailableLineWidth(availableLineWidth);
-		return false;
-	}
-	
-	/**
-	 * Format an XML comment structured document region.
-	 */
-	private void formatComment(TextEdit textEdit, Position formatRange, XMLFormattingConstraints parentConstraints, DOMRegion currentDOMRegion, IStructuredDocumentRegion previousRegion) {
-		IStructuredDocumentRegion currentRegion = currentDOMRegion.documentRegion;
-		int lineWidth = parentConstraints.getAvailableLineWidth() - currentRegion.getFullText().length();
-		// Don't format if we're not exceeding the available line width, or if the whitespace
-		// strategy is to preserve whitespace - But update line width.
-		if(currentRegion == null ||	parentConstraints.getWhitespaceStrategy() == XMLFormattingConstraints.PRESERVE) {
-			parentConstraints.setAvailableLineWidth(lineWidth);
-			return;
-		}
-		
-		// If there is enough room, format the start of the comment tag if it
-		// is on its own line
-		if(lineWidth >= 0) {
-			parentConstraints.setAvailableLineWidth(lineWidth);
-			if(previousRegion.getType() == DOMRegionContext.XML_CONTENT) {
-				String delimiters = extractLineDelimiters(previousRegion.getFullText(), previousRegion);
-				// Format the comment if its on a newline
-				if(delimiters != null && delimiters.length() > 0)
-					textEdit.addChild(new ReplaceEdit(previousRegion.getStartOffset(), previousRegion.getLength(), delimiters + getIndentString(parentConstraints.getIndentLevel()+1)));
-			}
-			return;
-		}
-		
-		Iterator it = currentRegion.getRegions().iterator();
-		// Iterate over each text region of the comment
-		while(it.hasNext()) {
-			ITextRegion text = (ITextRegion) it.next();
-			formatCommentTag(textEdit, parentConstraints, currentRegion, text);
-		}
-	}
-	
-	/**
-	 * Handles formatting various portions of an XML comment. Because the XML
-	 * Comment is considered its own document region, there are cases where
-	 * the previous region must be referred to for proper indentation
-	 * consideration. Because of this, most of the special cases are
-	 * catering to the opening text region of the document region.
-	 * 
-	 * @param textEdit
-	 * @param parentConstraints
-	 * @param currentRegion
-	 * @param region
-	 */
-	private void formatCommentTag(TextEdit textEdit, XMLFormattingConstraints parentConstraints, IStructuredDocumentRegion currentRegion, ITextRegion region) {
-		int availableLineWidth = parentConstraints.getAvailableLineWidth();
-		int indentLevel = parentConstraints.getIndentLevel() + 1;
-		boolean initialIndent = false;
-		
-		// Indent the text of the comment an additional level
-		if(region.getType() == DOMRegionContext.XML_COMMENT_TEXT) {
-			indentLevel++;
-			initialIndent = true;
-		}
-		
-		int fullTextOffset = 0;
-		char[] fullTextArray = currentRegion.getFullText(region).toCharArray();
-		while (fullTextOffset < fullTextArray.length) {
-			// gather all whitespaces
-			String whitespaceRun = null;
-			
-			// If the region is a comment opening, the whitespace would actually come from the
-			// previous document region
-			if(region.getType() == DOMRegionContext.XML_COMMENT_OPEN && currentRegion.getPrevious() != null)
-				whitespaceRun = getCharacterRun(currentRegion.getPrevious().getFullText().toCharArray(), 0, true);
-			else
-				whitespaceRun = getCharacterRun(fullTextArray, fullTextOffset, true);
-			
-			if (whitespaceRun.length() > 0) {
-				// offset where whitespace starts
-				int whitespaceStart = fullTextOffset;
-				// update current offset in fullText for non comment-opening regions
-				if(region.getType() != DOMRegionContext.XML_COMMENT_OPEN)
-					fullTextOffset += whitespaceRun.length();
-
-				// gather following word
-				String characterRun = getCharacterRun(fullTextArray, fullTextOffset, false);
-				int characterRunLength = characterRun.length();
-				if (characterRunLength > 0) {
-					// indent if word is too long or forcing initial
-					// indent
-					availableLineWidth -= characterRunLength;
-					// offset where indent/collapse will happen - for comment-opening regions,
-					// this occurs in the previous document region
-					int startOffset = 0;
-					if(region.getType() == DOMRegionContext.XML_COMMENT_OPEN && currentRegion.getPrevious() != null)
-						startOffset = currentRegion.getPrevious().getStartOffset();
-					else
-						startOffset = currentRegion.getStartOffset(region) + whitespaceStart;
-					
-					if (region.getType() == DOMRegionContext.XML_COMMENT_OPEN || initialIndent || (availableLineWidth <= 0)) {
-						// indent if not already indented
-						availableLineWidth = indentIfNotAlreadyIndented(textEdit, currentRegion, indentLevel, startOffset, whitespaceRun);
-						// remember to subtract word length
-						availableLineWidth -= characterRunLength;
-						// Indented the first word of the comment
-						if(initialIndent)
-							initialIndent = false;
-					}
-					else {
-						// just collapse spaces
-						availableLineWidth = collapseSpaces(textEdit, startOffset, availableLineWidth, whitespaceRun);
-					}
-
-					fullTextOffset += characterRunLength;
-				}
-				else {
-					// handle trailing whitespace
-					int whitespaceOffset = currentRegion.getStartOffset(region) + whitespaceStart;
-					DeleteEdit deleteTrailing = new DeleteEdit(whitespaceOffset, whitespaceRun.length());
-					textEdit.addChild(deleteTrailing);
-				}
-			}
-			else {
-				// gather word
-				String characterRun = getCharacterRun(fullTextArray, fullTextOffset, false);
-				int characterRunLength = characterRun.length();
-				if (characterRunLength > 0) {
-					// indent if word is too long or forcing initial
-					// indent
-					availableLineWidth = availableLineWidth - characterRunLength;
-
-					if ((region.getType() == DOMRegionContext.XML_COMMENT_CLOSE || region.getType() == DOMRegionContext.XML_COMMENT_OPEN) || initialIndent || (region.getType() == DOMRegionContext.XML_COMMENT_TEXT && availableLineWidth <= 0)) {
-						// indent if not already indented
-						availableLineWidth = indentIfNotAlreadyIndented(textEdit, currentRegion, indentLevel, currentRegion.getStartOffset(region), whitespaceRun);
-						// remember to subtract word length
-						availableLineWidth -= characterRunLength;
-						if(initialIndent)
-							initialIndent = false;
-					}
-					else {
-						// just collapse spaces
-						availableLineWidth -= characterRunLength;
-					}
-					fullTextOffset += characterRunLength;
-				}
-			}
-		}
-		// update available line width
-		parentConstraints.setAvailableLineWidth(availableLineWidth);
-	}
-
-	/**
-	 * Returns either a String of whitespace or characters depending on
-	 * forWhitespace
-	 * 
-	 * @param fullTextArray
-	 *            the text array to look in
-	 * @param textOffset
-	 *            the start offset to start searching
-	 * @param forWhitespace
-	 *            true if should return whitespaces, false otherwise
-	 * @return a String of either all whitespace or all characters. Never
-	 *         returns null
-	 */
-	private String getCharacterRun(char[] fullTextArray, int textOffset, boolean forWhitespace) {
-		StringBuffer characterRun = new StringBuffer();
-		boolean nonCharacterFound = false;
-		while (textOffset < fullTextArray.length && !nonCharacterFound) {
-			char c = fullTextArray[textOffset];
-			boolean isWhitespace = Character.isWhitespace(c);
-			if ((forWhitespace && isWhitespace) || (!forWhitespace && !isWhitespace))
-				characterRun.append(c);
-			else
-				nonCharacterFound = true;
-			++textOffset;
-		}
-		return characterRun.toString();
-	}
-	
-	private String getTrailingWhitespace(String text) {
-		StringBuffer whitespaceRun = new StringBuffer();
-		int index = text.length() - 1;
-		while(index > 0) {
-			char c = text.charAt(index--);
-			if (Character.isWhitespace(c))
-				whitespaceRun.insert(0, c);
-			else
-				break;
-		}
-		return whitespaceRun.toString();
-	}
-
-	private String getIndentString(int indentLevel) {
-		StringBuffer indentString = new StringBuffer();
-		String indent = getFormattingPreferences().getOneIndent();
-		for (int i = 0; i < indentLevel; ++i) {
-			indentString.append(indent);
-		}
-		return indentString.toString();
-	}
-
-	protected XMLFormattingPreferences getFormattingPreferences() {
-		if (fPreferences == null)
-			fPreferences = new XMLFormattingPreferences();
-		return fPreferences;
-	}
-
-	protected void setFormattingPreferences(XMLFormattingPreferences preferences) {
-		fPreferences = preferences;
-	}
-
-	/**
-	 * Indent if whitespaceRun does not already contain an indent
-	 * 
-	 * @param textEdit
-	 * @param indentLevel
-	 * @param indentStartOffset
-	 * @param maxAvailableLineWidth
-	 * @param whitespaceRun
-	 * @return new available line width up to where indented
-	 */
-	private int indentIfNotAlreadyIndented(TextEdit textEdit, IStructuredDocumentRegion currentRegion, int indentLevel, int indentStartOffset, String whitespaceRun) {
-		int maxAvailableLineWidth = getFormattingPreferences().getMaxLineWidth();
-
-		int availableLineWidth;
-		String indentString = getIndentString(indentLevel);
-		String lineDelimiter = getLineDelimiter(currentRegion);
-		String newLineAndIndent = lineDelimiter + indentString;
-		
-		TextEdit indentation = null;
-		
-		// if not already correctly indented
-		if (!newLineAndIndent.equals(whitespaceRun)) {
-			if (getFormattingPreferences().getClearAllBlankLines()) {
-				if (whitespaceRun != null) {
-					// replace existing whitespace run
-					indentation = new ReplaceEdit(indentStartOffset, whitespaceRun.length(), newLineAndIndent);
-				}
-				else {
-					// just insert correct indent
-					indentation = new InsertEdit(indentStartOffset, newLineAndIndent);
-				}
-			}
-			// Keep the empty lines
-			else {
-				// just insert correct indent
-				if(whitespaceRun == null)
-					indentation = new InsertEdit(indentStartOffset, newLineAndIndent);
-				// Need to preserve the number of empty lines, but still indent on the current line properly
-				else {
-					String existingDelimiters = extractLineDelimiters(whitespaceRun, currentRegion);
-					if(existingDelimiters != null && existingDelimiters.length() > 0) {
-						String formatted = existingDelimiters + indentString;
-						// Don't perform a replace if the formatted string is the same as the existing whitespaceRun
-						if(!formatted.equals(whitespaceRun))
-							indentation = new ReplaceEdit(indentStartOffset, whitespaceRun.length(), formatted);
-					}
-					// No blank lines to preserve - correct the indent
-					else
-						indentation = new ReplaceEdit(indentStartOffset, whitespaceRun.length(), newLineAndIndent);
-				}
-			}
-		}
-		
-		if(indentation != null)
-			textEdit.addChild(indentation);
-		// update line width
-		availableLineWidth = maxAvailableLineWidth - indentString.length();
-		return availableLineWidth;
-	}
-
-	private int indentIfNotAlreadyIndented(TextEdit textEdit, int indentLevel, IStructuredDocumentRegion currentDocumentRegion, ITextRegion currentTextRegion) {
-		// indent if not already indented
-		int textLength = currentTextRegion.getTextLength();
-		int regionLength = currentTextRegion.getLength();
-		int indentStartOffset = currentDocumentRegion.getTextEndOffset(currentTextRegion);
-		String fullText = currentDocumentRegion.getFullText(currentTextRegion);
-		String whitespaceRun = fullText.substring(textLength, regionLength);
-
-		// update line width
-		int availableLineWidth = indentIfNotAlreadyIndented(textEdit, currentDocumentRegion, indentLevel, indentStartOffset, whitespaceRun);
-		return availableLineWidth;
-	}
-
-	private int indentIfPossible(TextEdit textEdit, XMLFormattingConstraints thisConstraints, IStructuredDocumentRegion currentDocumentRegion, IStructuredDocumentRegion previousDocumentRegion, String whitespaceStrategy, String indentStrategy, boolean addIndent) {
-		int availableLineWidth = -1;
-		// if there is no previous document region, there is no need to indent
-		// because we're at beginning of document
-		if (previousDocumentRegion == null)
-			return availableLineWidth;
-
-		// only indent if ignoring whitespace or if collapsing and
-		// there was a whitespace character before this region
-		boolean canIndent = false;
-		String previousRegionFullText = null;
-		String previousRegionType = null;
-
-		if ((whitespaceStrategy == XMLFormattingConstraints.IGNORE) || whitespaceStrategy == XMLFormattingConstraints.IGNOREANDTRIM) {
-			// if ignoring, need to check if previous region was cdata
-			previousRegionType = previousDocumentRegion.getType();
-			if (previousRegionType == DOMRegionContext.XML_CDATA_TEXT)
-				canIndent = false;
-			else
-				canIndent = true;
-		}
-		else if (whitespaceStrategy == XMLFormattingConstraints.COLLAPSE) {
-			// if collapsing, need to check if previous region ended in a
-			// whitespace
-			previousRegionType = previousDocumentRegion.getType();
-			if (previousRegionType == DOMRegionContext.XML_CONTENT) {
-				previousRegionFullText = previousDocumentRegion.getFullText();
-				int length = previousRegionFullText.length();
-				if (length > 1)
-					canIndent = Character.isWhitespace(previousRegionFullText.charAt(length - 1));
-			}
-		}
-		if (canIndent) {
-			int indentStartOffset = currentDocumentRegion.getStartOffset();
-			String whitespaceRun = null;
-
-			// get previous region type if it was not previously retrieved
-			if (previousRegionType == null)
-				previousRegionType = previousDocumentRegion.getType();
-
-			// get previous region's text if it was not previously retrieved
-			if (previousRegionFullText == null && previousRegionType == DOMRegionContext.XML_CONTENT)
-				previousRegionFullText = previousDocumentRegion.getFullText();
-
-			// if previous region was only whitespace, this may
-			// already be indented, so need to make sure
-			if ((previousRegionFullText != null) && (previousRegionFullText.trim().length() == 0)) {
-				indentStartOffset = previousDocumentRegion.getStartOffset();
-				whitespaceRun = previousRegionFullText;
-			}
-			if ((previousRegionFullText != null) && (whitespaceRun == null) && !getFormattingPreferences().getClearAllBlankLines()) {
-				whitespaceRun = getTrailingWhitespace(previousRegionFullText);
-				indentStartOffset = previousDocumentRegion.getEndOffset() - whitespaceRun.length();
-			}
-
-			int indentLevel = thisConstraints.getIndentLevel();
-			if (addIndent && indentStrategy == XMLFormattingConstraints.INDENT) {
-				++indentLevel;
-				thisConstraints.setIndentLevel(indentLevel);
-			}
-
-			// indent if not already indented
-			availableLineWidth = indentIfNotAlreadyIndented(textEdit, currentDocumentRegion, indentLevel, indentStartOffset, whitespaceRun);
-		}
-		return availableLineWidth;
-	}
-
-	/**
-	 * Allow exactly one whitespace in currentTextRegion. If there are more,
-	 * collapse to one. If there are none, insert one.
-	 * 
-	 * @param textEdit
-	 * @param currentDocumentRegion
-	 * @param availableLineWidth
-	 * @param currentTextRegion
-	 */
-	private void insertSpaceAndCollapse(TextEdit textEdit, IStructuredDocumentRegion currentDocumentRegion, int availableLineWidth, ITextRegion currentTextRegion) {
-		int textLength = currentTextRegion.getTextLength();
-		int regionLength = currentTextRegion.getLength();
-		boolean thereAreSpaces = textLength < regionLength;
-		int spacesStartOffset = currentDocumentRegion.getStartOffset(currentTextRegion) + textLength;
-
-		if (thereAreSpaces) {
-			String fullTagName = currentDocumentRegion.getFullText(currentTextRegion);
-			String whitespaceRun = fullTagName.substring(textLength, regionLength);
-			collapseSpaces(textEdit, spacesStartOffset, availableLineWidth, whitespaceRun);
-		}
-		else {
-			// insert a space
-			InsertEdit insertEdit = new InsertEdit(spacesStartOffset, SPACE);
-			textEdit.addChild(insertEdit);
-		}
-	}
-
-	private boolean shouldIndentBeforeAttribute(XMLFormattingConstraints constraints, ITextRegionList textRegions, int availableLineWidth, int currentTextRegionIndex, ITextRegion currentTextRegion, ITextRegion nextTextRegion) {
-		boolean indentAttribute = false;
-
-		// look ahead to see if going to hit max line width
-		// something attrName
-		int currentWidth = currentTextRegion.getTextLength() + nextTextRegion.getTextLength() + 1;
-		if (currentWidth > availableLineWidth)
-			indentAttribute = true;
-		else {
-			if ((currentTextRegionIndex + 2) < textRegions.size()) {
-				// still okay, so try next region
-				// something attrName=
-				ITextRegion textRegion = textRegions.get(currentTextRegionIndex + 2);
-				if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
-					++currentWidth;
-					if (currentWidth > availableLineWidth)
-						indentAttribute = true;
-					else {
-						if ((currentTextRegionIndex + 3) < textRegions.size()) {
-							// still okay, so try next region
-							// something attrName=attrValue
-							textRegion = textRegions.get(currentTextRegionIndex + 3);
-							if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-								currentWidth = +textRegion.getTextLength();
-								if (currentWidth > availableLineWidth)
-									indentAttribute = true;
-							}
-						}
-					}
-				}
-			}
-		}
-		return indentAttribute;
-	}
-
-	/**
-	 * Given the provided information (parentConstraints & currentDOMRegion),
-	 * update the formatting constraints (for this & child)
-	 * 
-	 * @param parentConstraints
-	 *            can be null
-	 * @param thisConstraints
-	 *            can be null
-	 * @param childConstraints
-	 *            can be null
-	 * @param currentDOMRegion
-	 *            cannot be null
-	 */
-	protected void updateFormattingConstraints(XMLFormattingConstraints parentConstraints, XMLFormattingConstraints thisConstraints, XMLFormattingConstraints childConstraints, DOMRegion currentDOMRegion) {
-		IStructuredDocumentRegion currentRegion = currentDOMRegion.documentRegion;
-		IDOMNode currentNode = currentDOMRegion.domNode;
-
-		// default to whatever parent's constraint said to do
-		if (parentConstraints != null) {
-			if (thisConstraints != null) {
-				thisConstraints.copyConstraints(parentConstraints);
-			}
-			if (childConstraints != null) {
-				childConstraints.copyConstraints(parentConstraints);
-				// if whitespace strategy was only a hint, null it out so
-				// defaults are taken instead
-				if (parentConstraints.isWhitespaceStrategyAHint())
-					childConstraints.setWhitespaceStrategy(null);
-			}
-		}
-
-		// set up constraints for direct children of document root
-		Node parentNode = currentNode.getParentNode();
-		if (parentNode != null && parentNode.getNodeType() == Node.DOCUMENT_NODE) {
-			if (thisConstraints != null) {
-				thisConstraints.setWhitespaceStrategy(XMLFormattingConstraints.IGNORE);
-				thisConstraints.setIndentStrategy(XMLFormattingConstraints.NEW_LINE);
-				thisConstraints.setIndentLevel(0);
-			}
-			if (childConstraints != null) {
-				childConstraints.setWhitespaceStrategy(null);
-				childConstraints.setIndentStrategy(null);
-				childConstraints.setIndentLevel(0);
-			}
-		}
-
-		// other conditions to check when setting up child constraints
-		if (childConstraints != null) {
-			XMLFormattingPreferences preferences = getFormattingPreferences();
-
-			// if we're at document root, child tags should always just start
-			// on a new line and have an indent level of 0
-			if (currentNode.getNodeType() == Node.DOCUMENT_NODE) {
-				childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.IGNORE);
-				childConstraints.setIndentStrategy(XMLFormattingConstraints.NEW_LINE);
-				childConstraints.setIndentLevel(0);
-			}
-			else {
-				// BUG108074 & BUG84688 - preserve whitespace in xsl:text &
-				// xsl:attribute
-				String nodeNamespaceURI = currentNode.getNamespaceURI();
-				if (XSL_NAMESPACE.equals(nodeNamespaceURI)) {
-					String nodeName = ((Element) currentNode).getLocalName();
-					if (XSL_ATTRIBUTE.equals(nodeName) || XSL_TEXT.equals(nodeName)) {
-						childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.PRESERVE);
-					}
-				}
-				else {
-					// search within current tag for xml:space attribute
-					ITextRegionList textRegions = currentRegion.getRegions();
-					int i = 0;
-					boolean xmlSpaceFound = false;
-					boolean preserveFound = false;
-					while (i < textRegions.size() && !xmlSpaceFound) {
-						ITextRegion textRegion = textRegions.get(i);
-						if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-							String regionText = currentRegion.getText(textRegion);
-							if (XML_SPACE.equals(regionText)) {
-								if ((i + 1) < textRegions.size()) {
-									++i;
-									textRegion = textRegions.get(i);
-									if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS && ((i + 1) < textRegions.size())) {
-										++i;
-										textRegion = textRegions.get(i);
-										regionText = currentRegion.getText(textRegion);
-										if (PRESERVE.equals(regionText) || PRESERVE_QUOTED.equals(regionText)) {
-											preserveFound = true;
-										}
-									}
-								}
-								xmlSpaceFound = true;
-							}
-						}
-						++i;
-					}
-					if (xmlSpaceFound) {
-						if (preserveFound) {
-							// preserve was found so set the strategy
-							childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.PRESERVE);
-						}
-						else {
-							// xml:space was found but it was not collapse, so
-							// use default whitespace strategy
-							childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.DEFAULT);
-						}
-					}
-					else {
-						// how to hande nodes that have nonwhitespace text
-						// content
-						NodeList nodeList = currentNode.getChildNodes();
-						int length = nodeList.getLength();
-						int index = 0;
-						boolean textNodeFound = false;
-						// BUG214516 - If the parent constraint is to preserve whitespace, child constraints should
-						// still reflect the parent constraints
-						while (index < length && !textNodeFound && parentConstraints != null && !XMLFormattingConstraints.PRESERVE.equals(parentConstraints.getWhitespaceStrategy())) {
-							Node childNode = nodeList.item(index);
-							if (childNode.getNodeType() == Node.TEXT_NODE) {
-								textNodeFound = !((IDOMText) childNode).isElementContentWhitespace();
-							}
-							++index;
-						}
-						if (textNodeFound) {
-							if (length > 1) {
-								// more in here than just text, so consider
-								// this mixed content
-								childConstraints.setWhitespaceStrategy(preferences.getMixedWhitespaceStrategy());
-								childConstraints.setIndentStrategy(preferences.getMixedIndentStrategy());
-							}
-							else {
-								// there's only text
-								childConstraints.setWhitespaceStrategy(preferences.getTextWhitespaceStrategy());
-								childConstraints.setIndentStrategy(preferences.getTextIndentStrategy());
-							}
-							childConstraints.setIsWhitespaceStrategyAHint(true);
-							childConstraints.setIsIndentStrategyAHint(true);
-						}
-
-						// try referring to content model for information on
-						// whitespace & indent strategy
-						ModelQueryAdapter adapter = (ModelQueryAdapter) ((IDOMDocument) currentNode.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
-						CMElementDeclaration elementDeclaration = (CMElementDeclaration) adapter.getModelQuery().getCMNode(currentNode);
-						if (elementDeclaration != null) {
-							// follow whitespace strategy preference for
-							// pcdata content
-							int contentType = elementDeclaration.getContentType();
-							
-							String facetValue = null;
-							if(elementDeclaration.getDataType() != null)
-								facetValue = (String) elementDeclaration.getDataType().getProperty(PROPERTY_WHITESPACE_FACET);
-							if(facetValue != null) {
-								if(PRESERVE.equals(facetValue))
-									childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.PRESERVE);
-								// For XSD types, "collapse" corresponds to the IGNOREANDTRIM strategy
-								else if(COLLAPSE.equals(facetValue))
-									childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.IGNOREANDTRIM);
-								else if(REPLACE.equals(facetValue))
-									childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.REPLACE);
-							}
-							else if (contentType == CMElementDeclaration.PCDATA && parentConstraints != null && !XMLFormattingConstraints.PRESERVE.equals(parentConstraints.getWhitespaceStrategy())) {
-								childConstraints.setWhitespaceStrategy(preferences.getPCDataWhitespaceStrategy());
-							}
-							else if (contentType == CMElementDeclaration.ELEMENT && parentConstraints != null && !XMLFormattingConstraints.PRESERVE.equals(parentConstraints.getWhitespaceStrategy())) {
-								childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.IGNORE);
-								childConstraints.setIndentStrategy(XMLFormattingConstraints.INDENT);
-								childConstraints.setIsWhitespaceStrategyAHint(true);
-								childConstraints.setIsIndentStrategyAHint(true);
-							}
-							else {
-								// look for xml:space in content model
-								CMNamedNodeMap cmAttributes = elementDeclaration.getAttributes();
-
-								CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(cmAttributes);
-								List nodes = ModelQueryUtil.getModelQuery(currentNode.getOwnerDocument()).getAvailableContent((Element) currentNode, elementDeclaration, ModelQuery.INCLUDE_ATTRIBUTES);
-								for (int k = 0; k < nodes.size(); k++) {
-									CMNode cmnode = (CMNode) nodes.get(k);
-									if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
-										allAttributes.put(cmnode);
-									}
-								}
-								cmAttributes = allAttributes;
-
-								// Check implied values from the DTD way.
-								CMAttributeDeclaration attributeDeclaration = (CMAttributeDeclaration) cmAttributes.getNamedItem(XML_SPACE);
-								if (attributeDeclaration != null) {
-									// CMAttributeDeclaration found, check
-									// it
-									// out.
-
-									//BUG214516/196544 - Fixed NPE that was caused by an attr having
-									// a null attr type
-									String defaultValue = null;
-									CMDataType attrType = attributeDeclaration.getAttrType();
-									if (attrType != null) {
-										if ((attrType.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE) && attrType.getImpliedValue() != null)
-											defaultValue = attrType.getImpliedValue();
-										else if ((attrType.getEnumeratedValues() != null) && (attrType.getEnumeratedValues().length > 0)) {
-											defaultValue = attrType.getEnumeratedValues()[0];
-										}
-									}
-
-									// xml:space="preserve" means preserve
-									// space,
-									// everything else means back to
-									// default.
-									if (PRESERVE.equals(defaultValue))
-										childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.PRESERVE);
-									else
-										childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.DEFAULT);
-								}
-								// If the node has no attributes, inherit the parents whitespace strategy
-								else {
-									if (parentConstraints != null)
-										childConstraints.setWhitespaceStrategy(parentConstraints.getWhitespaceStrategy());
-									else
-										childConstraints.setWhitespaceStrategy(null);
-								}
-							}
-						}
-					}
-				}
-			}
-			// set default values according to preferences
-			if (childConstraints.getWhitespaceStrategy() == null) {
-				childConstraints.setWhitespaceStrategy(preferences.getElementWhitespaceStrategy());
-			}
-			if (childConstraints.getIndentStrategy() == null) {
-				childConstraints.setIndentStrategy(preferences.getElementIndentStrategy());
-			}
-		}
-	}
-
-	/**
-	 * Calculates the current available line width given fullText.
-	 * 
-	 * @param fullText
-	 * @param availableLineWidth
-	 * @param maxAvailableLineWidth
-	 * @return
-	 */
-	private int updateLineWidthWithLastLine(String fullText, int availableLineWidth) {
-		int maxAvailableLineWidth = getFormattingPreferences().getMaxLineWidth();
-		int lineWidth = availableLineWidth;
-		if (fullText != null) {
-			int textLength = fullText.length();
-			// update available line width
-			// find last newline
-			int lastLFOffset = fullText.lastIndexOf('\n');
-			int lastCROffset = fullText.lastIndexOf('\r');
-			// all text was on 1 line
-			if (lastLFOffset == -1 && lastCROffset == -1) {
-				// just subtract text length from current
-				// available line width
-				lineWidth -= fullText.length();
-			}
-			else {
-				// calculate available line width of last line
-				int lastNewLine = Math.max(lastLFOffset, lastCROffset);
-				lineWidth = maxAvailableLineWidth - (textLength - lastNewLine);
-			}
-		}
-		return lineWidth;
-	}
-
-	private String getLineDelimiter(IStructuredDocumentRegion currentRegion) {
-		IStructuredDocument doc = currentRegion.getParentDocument();
-		int line = doc.getLineOfOffset(currentRegion.getStartOffset());
-		String lineDelimiter = doc.getLineDelimiter();
-		try {
-			if (line > 0) {
-				lineDelimiter = doc.getLineDelimiter(line - 1);
-			}
-		}
-		catch (BadLocationException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-		// BUG115716: if cannot get line delimiter from current line, just
-		// use default line delimiter
-		if (lineDelimiter == null)
-			lineDelimiter = doc.getLineDelimiter();
-		return lineDelimiter;
-	}
-	
-	private String extractLineDelimiters(String base, IStructuredDocumentRegion currentRegion) {
-		String lineDelimiter = getLineDelimiter(currentRegion);
-		StringBuffer sb = new StringBuffer();
-		for(int index = 0; index < base.length();) {
-			index = base.indexOf(lineDelimiter, index);
-			if(index++ >= 0)
-				sb.append(lineDelimiter);
-			else
-				break;
-		}
-		return sb.toString();
-	}
-
-	void setProgressMonitor(IProgressMonitor monitor) {
-		fProgressMonitor = monitor;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormatterFormatProcessor.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormatterFormatProcessor.java
deleted file mode 100644
index e02ee7e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormatterFormatProcessor.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.formatter;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.text.DocumentRewriteSession;
-import org.eclipse.jface.text.DocumentRewriteSessionType;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-/**
- * This is a wrapper for the new xml formatter so that it can be still
- * considered an IStruturedFormatProcessor
- */
-public class XMLFormatterFormatProcessor implements IStructuredFormatProcessor {
-	private DefaultXMLPartitionFormatter fFormatter = null;
-	private IProgressMonitor fProgressMonitor = null;
-
-	public void formatDocument(IDocument document, int start, int length) throws IOException, CoreException {
-		if (document instanceof IStructuredDocument) {
-			IStructuredModel model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) document);
-			if (model != null) {
-				try {
-					formatModel(model, start, length);
-				}
-				finally {
-					model.releaseFromEdit();
-				}
-			}
-		}
-	}
-
-	public void formatFile(IFile file) throws IOException, CoreException {
-		if (file == null)
-			return;
-
-		IStructuredModel structuredModel = null;
-		// OutputStream outputStream = null;
-		try {
-			// setup structuredModel
-			// Note: We are getting model for edit. Will save model if model
-			// changed.
-			structuredModel = StructuredModelManager.getModelManager().getModelForEdit(file);
-
-			// format
-			formatModel(structuredModel);
-
-			// save model if needed
-			if (!structuredModel.isSharedForEdit() && structuredModel.isSaveNeeded())
-				structuredModel.save();
-		}
-		finally {
-			// ensureClosed(outputStream, null);
-			// release from model manager
-			if (structuredModel != null) {
-				structuredModel.releaseFromEdit();
-			}
-
-		}
-	}
-
-	public void formatModel(IStructuredModel structuredModel) {
-		int start = 0;
-		int length = structuredModel.getStructuredDocument().getLength();
-
-		formatModel(structuredModel, start, length);
-	}
-
-	public void formatModel(IStructuredModel structuredModel, int start, int length) {
-		if(fProgressMonitor != null)
-			fProgressMonitor.beginTask("", 2);
-		IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-		DocumentRewriteSession activeRewriteSession = ((IDocumentExtension4) structuredDocument).getActiveRewriteSession();
-		boolean startedRewriteSession = false;
-		if (activeRewriteSession == null) {
-			activeRewriteSession = ((IDocumentExtension4) structuredDocument).startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED);
-			startedRewriteSession = true;
-		}
-		getFormatter().setProgressMonitor(new NullProgressMonitor() {
-			public boolean isCanceled() {
-				return fProgressMonitor != null && fProgressMonitor.isCanceled();
-			}
-		});
-		TextEdit edit = getFormatter().format(structuredModel, start, length);
-		if(fProgressMonitor != null)
-			fProgressMonitor.worked(1);
-		
-		try {
-			structuredModel.aboutToChangeModel();
-			edit.apply(structuredDocument);
-			if(fProgressMonitor != null)
-				fProgressMonitor.worked(1);
-		}
-		catch (Exception e) {
-			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-		}
-		finally {
-			if (startedRewriteSession && activeRewriteSession != null) {
-				((IDocumentExtension4) structuredDocument).stopRewriteSession(activeRewriteSession);
-			}
-			structuredModel.changedModel();
-			if(fProgressMonitor != null)
-				fProgressMonitor.done();
-		}
-	}
-
-	public void formatNode(Node node) {
-		if (node instanceof IDOMNode) {
-			IDOMNode domNode = (IDOMNode) node;
-			formatModel(domNode.getModel(), domNode.getStartOffset(), domNode.getLength());
-		}
-	}
-
-	public void setProgressMonitor(IProgressMonitor monitor) {
-		fProgressMonitor = monitor;
-	}
-
-	private DefaultXMLPartitionFormatter getFormatter() {
-		if (fFormatter == null) {
-			fFormatter = new DefaultXMLPartitionFormatter();
-		}
-		return fFormatter;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingConstraints.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingConstraints.java
deleted file mode 100644
index fa2a53b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingConstraints.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.formatter;
-
-
-public class XMLFormattingConstraints {
-	public final static String PRESERVE = "PRESERVE"; //$NON-NLS-1$
-	public final static String COLLAPSE = "COLLAPSE"; //$NON-NLS-1$
-	public final static String IGNORE = "IGNORE"; //$NON-NLS-1$
-	public final static String IGNOREANDTRIM = "IGNOREANDTRIM"; //$NON-NLS-1$
-	public final static String DEFAULT = "DEFAULT"; //$NON-NLS-1$
-	public final static String REPLACE = "REPLACE"; //$NON-NLS-1$
-	
-	public final static String INDENT = "INDENT"; //$NON-NLS-1$
-	public final static String NEW_LINE = "NEW_LINE"; //$NON-NLS-1$
-	public final static String INLINE = "INLINE"; //$NON-NLS-1$
-
-	private int fAvailableLineWidth = 0;
-	private int fIndentLevel = 0;
-	private String fIndentStrategy;
-	private String fWhitespaceStrategy;
-	private boolean fIsIndentStrategyAHint = false;
-	private boolean fIsWhitespaceStrategyAHint = false;
-
-	/**
-	 * Initializes the values in this formatting constraint with values from
-	 * constraints
-	 * 
-	 * @param constraints
-	 *            cannot be null
-	 */
-	public void copyConstraints(XMLFormattingConstraints constraints) {
-		setAvailableLineWidth(constraints.getAvailableLineWidth());
-		setIndentLevel(constraints.getIndentLevel());
-		setIndentStrategy(constraints.getIndentStrategy());
-		setWhitespaceStrategy(constraints.getWhitespaceStrategy());
-	}
-
-	public int getAvailableLineWidth() {
-		return fAvailableLineWidth;
-	}
-
-	public void setAvailableLineWidth(int lineWidth) {
-		fAvailableLineWidth = lineWidth;
-	}
-
-	public int getIndentLevel() {
-		return fIndentLevel;
-	}
-
-	public void setIndentLevel(int indentLevel) {
-		fIndentLevel = indentLevel;
-	}
-
-	public String getIndentStrategy() {
-		return fIndentStrategy;
-	}
-
-	public void setIndentStrategy(String indentStrategy) {
-		fIndentStrategy = indentStrategy;
-	}
-
-	public String getWhitespaceStrategy() {
-		return fWhitespaceStrategy;
-	}
-
-	public void setWhitespaceStrategy(String whitespaceStrategy) {
-		fWhitespaceStrategy = whitespaceStrategy;
-	}
-
-	public boolean isIndentStrategyAHint() {
-		return fIsIndentStrategyAHint;
-	}
-
-	public void setIsIndentStrategyAHint(boolean isIndentStrategyAHint) {
-		fIsIndentStrategyAHint = isIndentStrategyAHint;
-	}
-
-	public boolean isWhitespaceStrategyAHint() {
-		return fIsWhitespaceStrategyAHint;
-	}
-
-	public void setIsWhitespaceStrategyAHint(boolean isWhitespaceStrategyAHint) {
-		fIsWhitespaceStrategyAHint = isWhitespaceStrategyAHint;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingPreferences.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingPreferences.java
deleted file mode 100644
index 78711d9..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingPreferences.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.formatter;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-
-public class XMLFormattingPreferences {
-	public final static String PRESERVE = XMLFormattingConstraints.PRESERVE;
-	public final static String COLLAPSE = XMLFormattingConstraints.COLLAPSE;
-	public final static String IGNORE = XMLFormattingConstraints.IGNORE;
-
-	public final static String INDENT = XMLFormattingConstraints.INDENT;
-	public final static String NEW_LINE = XMLFormattingConstraints.NEW_LINE;
-	public final static String INLINE = XMLFormattingConstraints.INLINE;
-
-	private int fMaxLineWidth = 72;
-	private boolean fAlignFinalBracket = false;
-	private boolean fSpaceBeforeEmptyCloseTag = true;
-	private boolean fIndentMultipleAttributes = false;
-	private String fPCDataWhitespaceStrategy = XMLFormattingConstraints.PRESERVE;
-	private String fTextIndentStrategy = XMLFormattingConstraints.INLINE;
-	private String fTextWhitespaceStrategy = XMLFormattingConstraints.COLLAPSE;
-	private String fElementIndentStrategy = XMLFormattingConstraints.INDENT;
-	private String fElementWhitespaceStrategy = XMLFormattingConstraints.IGNORE;
-	private String fMixedIndentStrategy = XMLFormattingConstraints.INDENT;
-	private String fMixedWhitespaceStrategy = XMLFormattingConstraints.IGNORE;
-	private String fOneIndent = "\t"; //$NON-NLS-1$
-	private boolean fClearAllBlankLines = false;
-
-	public XMLFormattingPreferences() {
-		Preferences preferences = XMLCorePlugin.getDefault().getPluginPreferences();
-		if (preferences != null) {
-			setMaxLineWidth(preferences.getInt(XMLCorePreferenceNames.LINE_WIDTH));
-			setIndentMultipleAttributes(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
-			setAlignFinalBracket(preferences.getBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET));
-			setSpaceBeforeEmptyCloseTag(preferences.getBoolean(XMLCorePreferenceNames.SPACE_BEFORE_EMPTY_CLOSE_TAG));
-			
-			boolean preservepcdata = preferences.getBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT);
-			if (preservepcdata)
-				fPCDataWhitespaceStrategy = XMLFormattingPreferences.PRESERVE;
-			else
-				fPCDataWhitespaceStrategy = XMLFormattingPreferences.COLLAPSE;
-
-			char indentChar = ' ';
-			String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
-			if (XMLCorePreferenceNames.TAB.equals(indentCharPref)) {
-				indentChar = '\t';
-			}
-			int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
-
-			StringBuffer indent = new StringBuffer();
-			for (int i = 0; i < indentationWidth; i++) {
-				indent.append(indentChar);
-			}
-			setOneIndent(indent.toString());
-			setClearAllBlankLines(preferences.getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-		}
-	}
-
-	public int getMaxLineWidth() {
-		return fMaxLineWidth;
-	}
-
-	public boolean getAlignFinalBracket() {
-		return fAlignFinalBracket;
-	}
-
-	public boolean getSpaceBeforeEmptyCloseTag() {
-		return fSpaceBeforeEmptyCloseTag;
-	}
-	
-	public boolean getIndentMultipleAttributes() {
-		return fIndentMultipleAttributes;
-	}
-
-	public String getPCDataWhitespaceStrategy() {
-		return fPCDataWhitespaceStrategy;
-	}
-
-	public String getTextIndentStrategy() {
-		return fTextIndentStrategy;
-	}
-
-	public String getTextWhitespaceStrategy() {
-		return fTextWhitespaceStrategy;
-	}
-
-	public String getElementIndentStrategy() {
-		return fElementIndentStrategy;
-	}
-
-	public String getElementWhitespaceStrategy() {
-		return fElementWhitespaceStrategy;
-	}
-	
-	public void setSpaceBeforeEmptyCloseTag(boolean spaceBeforeEmptyCloseTag) {
-		fSpaceBeforeEmptyCloseTag = spaceBeforeEmptyCloseTag;
-	}
-
-	public void setIndentMultipleAttributes(boolean indentMultipleAttributes) {
-		fIndentMultipleAttributes = indentMultipleAttributes;
-	}
-
-	public void setPCDataWhitespaceStrategy(String dataWhitespaceStrategy) {
-		fPCDataWhitespaceStrategy = dataWhitespaceStrategy;
-	}
-
-	public void setAlignFinalBracket(boolean alignFinalBracket) {
-		fAlignFinalBracket = alignFinalBracket;
-	}
-
-	public String getMixedIndentStrategy() {
-		return fMixedIndentStrategy;
-	}
-
-	public void setMixedIndentStrategy(String mixedIndentStrategy) {
-		fMixedIndentStrategy = mixedIndentStrategy;
-	}
-
-	public String getMixedWhitespaceStrategy() {
-		return fMixedWhitespaceStrategy;
-	}
-
-	public void setMixedWhitespaceStrategy(String mixedWhitespaceStrategy) {
-		fMixedWhitespaceStrategy = mixedWhitespaceStrategy;
-	}
-
-	public String getOneIndent() {
-		return fOneIndent;
-	}
-
-	protected void setMaxLineWidth(int maxLineWidth) {
-		fMaxLineWidth = maxLineWidth;
-	}
-
-	protected void setOneIndent(String oneIndent) {
-		fOneIndent = oneIndent;
-	}
-
-	public boolean getClearAllBlankLines() {
-		return fClearAllBlankLines;
-	}
-
-	public void setClearAllBlankLines(boolean clearAllBlankLines) {
-		fClearAllBlankLines = clearAllBlankLines;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/EmbeddedXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/EmbeddedXML.java
deleted file mode 100644
index 566b6ef..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/EmbeddedXML.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.modelhandler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryAdapterFactoryForEmbeddedXML;
-
-
-public class EmbeddedXML implements EmbeddedTypeHandler {
-
-	private static List supportedMimeTypes;
-	public String ContentTypeID_EmbeddedXML = "org.eclipse.wst.xml.core.contenttype.EmbeddedXML"; //$NON-NLS-1$
-
-	/**
-	 * Constructor for EmbeddedXML.
-	 */
-	public EmbeddedXML() {
-		super();
-	}
-
-	/*
-	 * @see EmbeddedContentType#getAdapterFactories()
-	 */
-	public List getAdapterFactories() {
-		List factories = new ArrayList();
-		factories.add(new ModelQueryAdapterFactoryForEmbeddedXML());
-		// factories.addAll(PluginContributedFactoryReader.getInstance().getFactories(this));
-		return factories;
-	}
-
-	/**
-	 * @see EmbeddedContentType#getFamilyId()
-	 */
-	public String getFamilyId() {
-		return ModelHandlerForXML.AssociatedContentTypeID;
-	}
-
-	public List getSupportedMimeTypes() {
-		if (supportedMimeTypes == null) {
-			supportedMimeTypes = new ArrayList();
-			supportedMimeTypes.add("application/xml"); //$NON-NLS-1$
-			supportedMimeTypes.add("text/xml"); //$NON-NLS-1$
-		}
-		return supportedMimeTypes;
-	}
-
-	public void initializeFactoryRegistry(FactoryRegistry registry) {
-		//TODO: initialize
-	}
-
-	/*
-	 * @see EmbeddedContentType#initializeParser(RegionParser)
-	 */
-	public void initializeParser(JSPCapableParser parser) {
-		// nothing to initialize for "pure" XML
-		// compare with XHTML
-	}
-
-	public boolean isDefault() {
-		return false;
-	}
-
-	public EmbeddedTypeHandler newInstance() {
-		return new EmbeddedXML();
-	}
-
-	public void uninitializeFactoryRegistry(FactoryRegistry registry) {
-		// TODO: need to undo anything we did in initialize
-
-	}
-
-	public void uninitializeParser(JSPCapableParser parser) {
-		// need to undo anything we did in initialize
-	}
-
-	public boolean canHandleMimeType(String mimeType) {
-		boolean canHandle = getSupportedMimeTypes().contains(mimeType);
-		if(!canHandle) {
-			canHandle = mimeType.endsWith("+xml"); //$NON-NLS-1$
-		}
-		return canHandle;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/ModelHandlerForXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/ModelHandlerForXML.java
deleted file mode 100644
index f4bdf3c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/ModelHandlerForXML.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.modelhandler;
-
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.AbstractModelHandler;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
-import org.eclipse.wst.xml.core.internal.encoding.XMLDocumentCharsetDetector;
-import org.eclipse.wst.xml.core.internal.encoding.XMLDocumentLoader;
-
-
-/**
- * Provides generic XML model handling. It is also marked as the default
- * content type handler. There should be only one implementation of the
- * default.
- */
-public class ModelHandlerForXML extends AbstractModelHandler implements IModelHandler {
-	/**
-	 * Needs to match what's in plugin registry. In fact, can be overwritten
-	 * at run time with what's in registry! (so should never be 'final')
-	 */
-	static String AssociatedContentTypeID = "org.eclipse.core.runtime.xml"; //$NON-NLS-1$
-	/**
-	 * Needs to match what's in plugin registry. In fact, can be overwritten
-	 * at run time with what's in registry! (so should never be 'final')
-	 */
-	private static String ModelHandlerID = "org.eclipse.wst.xml.core.modelhandler"; //$NON-NLS-1$
-
-	public ModelHandlerForXML() {
-		super();	
-		setId(ModelHandlerID);
-		setAssociatedContentTypeId(AssociatedContentTypeID);
-	}
-
-	public IDocumentLoader getDocumentLoader() {
-		return new XMLDocumentLoader();
-	}
-
-	public IDocumentCharsetDetector getEncodingDetector() {
-		return new XMLDocumentCharsetDetector();
-	}
-
-	public IModelLoader getModelLoader() {
-		return new XMLModelLoader();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/XMLModelLoader.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/XMLModelLoader.java
deleted file mode 100644
index ecf9223..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/XMLModelLoader.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.modelhandler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.model.AbstractModelLoader;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.DebugAdapterFactory;
-import org.eclipse.wst.xml.core.internal.document.DOMModelImpl;
-import org.eclipse.wst.xml.core.internal.encoding.XMLDocumentLoader;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryAdapterFactoryForXML;
-import org.eclipse.wst.xml.core.internal.propagate.PropagatingAdapterFactoryImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-
-/**
- * This class reads an XML file and creates an XML Structured Model.
- *  
- */
-public class XMLModelLoader extends AbstractModelLoader {
-
-	//	private static final String STR_ENCODING = "encoding"; //$NON-NLS-1$
-
-	/**
-	 * XMLLoader constructor comment.
-	 */
-	public XMLModelLoader() {
-		super();
-	}
-
-	public List getAdapterFactories() {
-		List result = new ArrayList();
-		INodeAdapterFactory factory = null;
-		factory = new ModelQueryAdapterFactoryForXML();
-		result.add(factory);
-		// Does XML need propagating adapter? Or just JSP?
-		factory = new PropagatingAdapterFactoryImpl();
-		result.add(factory);
-		return result;
-	}
-
-	public IDocumentLoader getDocumentLoader() {
-		if (documentLoaderInstance == null) {
-			documentLoaderInstance = new XMLDocumentLoader();
-		}
-		return documentLoaderInstance;
-	}
-
-	public IModelLoader newInstance() {
-		return new XMLModelLoader();
-	}
-
-	public IStructuredModel newModel() {
-		return new DOMModelImpl();
-	}
-
-	protected void preLoadAdapt(IStructuredModel structuredModel) {
-		super.preLoadAdapt(structuredModel);
-		IDOMModel domModel = (IDOMModel) structuredModel;
-		// if there is a model in the adapter, this will adapt it to
-		// first node. After that the PropagatingAdater spreads over the
-		// children being
-		// created. Each time that happends, a side effect is to
-		// also "spread" sprecific registered adapters,
-		// they two can propigate is needed.
-		((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
-
-		if (Debug.debugNotificationAndEvents) {
-			PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
-			propagatingAdapter.addAdaptOnCreateFactory(new DebugAdapterFactory());
-		}
-
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedXML.java
deleted file mode 100644
index 805a9c1..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedXML.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-
-
-public class ModelQueryAdapterFactoryForEmbeddedXML extends ModelQueryAdapterFactoryForXML {
-
-
-	/**
-	 * Constructor for ModelQueryAdapterFactoryForEmbeddedXML.
-	 */
-	public ModelQueryAdapterFactoryForEmbeddedXML() {
-		super(ModelQueryAdapter.class, false);
-	}
-
-	protected void configureDocumentManager(CMDocumentManager mgr) {
-		super.configureDocumentManager(mgr);
-		mgr.setPropertyEnabled(CMDocumentManager.PROPERTY_ASYNC_LOAD, true);
-	}
-	
-	/**
-	 * ISSUE: this "forces" a new one to always be created/returned, 
-	 * not "cached" on the node. That seems incorrect. 
-	 * Simply using shouldRegisterFalse should work, except, 
-	 * there might have been one there that someone else already 
-	 * explicitly put there, so this is only way I know to 
-	 * override that. Especially complicated here since a number
-	 * of adapters are for ModelQueryAdapter.class.
-	 */
-	public INodeAdapter adapt(INodeNotifier object) {
-		return adaptNew(object);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForXML.java
deleted file mode 100644
index cbb4add..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForXML.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.modelquery;
-
-
-
-import java.io.File;
-import java.net.URI;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapterImpl;
-
-
-public class ModelQueryAdapterFactoryForXML extends AbstractAdapterFactory {
-
-	protected ModelQueryAdapterImpl modelQueryAdapterImpl;
-	IStructuredModel stateNotifier = null;
-	private InternalModelStateListener internalModelStateListener;
-
-	/**
-	 * ModelQueryAdapterFactoryForXML constructor comment.
-	 */
-	public ModelQueryAdapterFactoryForXML() {
-		this(ModelQueryAdapter.class, true);
-	}
-
-	/**
-	 * ModelQueryAdapterFactoryForXML constructor comment.
-	 * 
-	 * @param adapterKey
-	 *            java.lang.Object
-	 * @param registerAdapters
-	 *            boolean
-	 */
-	protected ModelQueryAdapterFactoryForXML(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-	class InternalModelStateListener implements IModelStateListener {
-
-		/**
-		 * @see IModelStateListener#modelAboutToBeChanged(IStructuredModel)
-		 */
-		public void modelAboutToBeChanged(IStructuredModel model) {
-		}
-
-		/**
-		 * @see IModelStateListener#modelChanged(IStructuredModel)
-		 */
-		public void modelChanged(IStructuredModel model) {
-		}
-
-		/**
-		 * @see IModelStateListener#modelDirtyStateChanged(IStructuredModel,
-		 *      boolean)
-		 */
-		public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
-		}
-
-		/**
-		 * @see IModelStateListener#modelResourceDeleted(IStructuredModel)
-		 */
-		public void modelResourceDeleted(IStructuredModel model) {
-		}
-
-		/**
-		 * @see IModelStateListener#modelResourceMoved(IStructuredModel,
-		 *      IStructuredModel)
-		 */
-		public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) {
-			stateNotifier.removeModelStateListener(this);
-			stateNotifier = newModel;
-			updateResolver(stateNotifier);
-			stateNotifier.addModelStateListener(this);
-		}
-
-		public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
-			// TODO Auto-generated method stub
-
-		}
-
-		public void modelReinitialized(IStructuredModel structuredModel) {
-			updateResolver(structuredModel);
-
-		}
-
-
-	}
-
-	protected boolean autoLoadCM() {
-		// until the existence of a CMDocumentRequesterFactory to create the
-		// load requests,
-		// return true
-		return true;
-	}
-
-	protected void configureDocumentManager(CMDocumentManager mgr) {
-		// this depends on there being a CMDocumentRequesterFactory installed
-		mgr.setPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD, autoLoadCM());
-	}
-
-	public INodeAdapterFactory copy() {
-
-		return new ModelQueryAdapterFactoryForXML(getAdapterKey(), isShouldRegisterAdapter());
-	}
-
-	/**
-	 * createAdapter method comment.
-	 */
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-
-		if (org.eclipse.wst.sse.core.internal.util.Debug.displayInfo)
-			System.out.println("-----------------------ModelQueryAdapterFactoryForXML.createAdapter" + target); //$NON-NLS-1$
-		if (modelQueryAdapterImpl == null) {
-			if (target instanceof IDOMNode) {
-				IDOMNode xmlNode = (IDOMNode) target;
-				IStructuredModel model = xmlNode.getModel();
-				stateNotifier = xmlNode.getModel();
-				stateNotifier.addModelStateListener(getInternalModelStateListener());
-
-				org.eclipse.wst.sse.core.internal.util.URIResolver resolver = model.getResolver();
-				if (Debug.displayInfo)
-					System.out.println("----------------ModelQueryAdapterFactoryForXML... baseLocation : " + resolver.getFileBaseLocation()); //$NON-NLS-1$
-
-				/**
-				 * XMLCatalogIdResolver currently requires a filesystem
-				 * location string. Customarily this will be what is in the
-				 * deprecated SSE URIResolver and required by the Common URI
-				 * Resolver.
-				 */
-				URIResolver idResolver = null;
-				if (resolver != null) {
-					idResolver = new XMLCatalogIdResolver(resolver.getFileBaseLocation(), resolver);
-				}
-				else {
-					/*
-					 * 203649 - this block may be necessary due to ordering of
-					 * setting the resolver into the model
-					 */
-					String baseLocation = null;
-					String modelsBaseLocation = model.getBaseLocation();
-					if (modelsBaseLocation != null) {
-						File file = new Path(modelsBaseLocation).toFile();
-						if (file.exists()) {
-							baseLocation = file.getAbsolutePath();
-						}
-						else {
-							IPath basePath = new Path(model.getBaseLocation());
-							IResource derivedResource = null;
-							if (basePath.segmentCount() > 1)
-								derivedResource = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
-							else
-								derivedResource = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
-							IPath derivedPath = derivedResource.getLocation();
-							if (derivedPath != null) {
-								baseLocation = derivedPath.toString();
-							}
-							else {
-								URI uri = derivedResource.getLocationURI();
-								if (uri != null) {
-									baseLocation = uri.toString();
-								}
-							}
-						}
-						if(baseLocation == null) {
-							baseLocation = modelsBaseLocation;
-						}
-					}
-					idResolver = new XMLCatalogIdResolver(baseLocation, null);
-				}
-
-				CMDocumentCache cmDocumentCache = new CMDocumentCache();
-				ModelQuery modelQuery = new XMLModelQueryImpl(cmDocumentCache, idResolver);
-
-				// cs todo...
-				// for now we create a CMDocumentCache on a 'per editor' basis
-				// in the future we need to support a CMDocumentCache that is
-				// shared between editors
-				// nsd comment: may not be appropriate depending on
-				CMDocumentManager documentManager = modelQuery.getCMDocumentManager();
-				if (documentManager != null) {
-					configureDocumentManager(documentManager);
-				}
-				modelQueryAdapterImpl = new ModelQueryAdapterImpl(cmDocumentCache, modelQuery, idResolver);
-			}
-		}
-		return modelQueryAdapterImpl;
-	}
-
-	public void release() {
-		super.release();
-		if (stateNotifier != null)
-			stateNotifier.removeModelStateListener(getInternalModelStateListener());
-		stateNotifier = null;
-		if (modelQueryAdapterImpl != null)
-			modelQueryAdapterImpl.release();
-	}
-
-	protected void updateResolver(IStructuredModel model) {
-
-		String baseLocation = model.getBaseLocation();
-		IFile baseFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
-		if (baseFile != null) {
-			if (baseFile.getLocation() != null) {
-				baseLocation = baseFile.getLocation().toString();
-			}
-			if (baseLocation == null && baseFile.getLocationURI() != null) {
-				baseLocation = baseFile.getLocationURI().toString();
-			}
-			if (baseLocation == null) {
-				baseLocation = baseFile.getFullPath().toString();
-			}
-		}
-		else {
-			baseLocation = model.getBaseLocation();
-		}
-		modelQueryAdapterImpl.setIdResolver(new XMLCatalogIdResolver(baseLocation, model.getResolver()));
-	}
-
-	private final InternalModelStateListener getInternalModelStateListener() {
-		if (internalModelStateListener == null) {
-			internalModelStateListener = new InternalModelStateListener();
-		}
-		return internalModelStateListener;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryUtil.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryUtil.java
deleted file mode 100644
index eae3e89..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryUtil.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.w3c.dom.Document;
-
-
-/**
- * This class is used to associate ModelQuery (and related data) with a
- * Document (or IStructuredModel).
- */
-public class ModelQueryUtil {
-
-	public static CMDocumentCache getCMDocumentCache(Document node) {
-		ModelQueryAdapter modelQueryAdapter = getModelQueryAdapter(node);
-		return modelQueryAdapter != null ? modelQueryAdapter.getCMDocumentCache() : null;
-	}
-
-	public static URIResolver getIdResolver(Document node) {
-		ModelQueryAdapter modelQueryAdapter = getModelQueryAdapter(node);
-		return modelQueryAdapter != null ? modelQueryAdapter.getIdResolver() : null;
-	}
-
-	public static ModelQuery getModelQuery(Document node) {
-		ModelQueryAdapter modelQueryAdapter = getModelQueryAdapter(node);
-		return modelQueryAdapter != null ? modelQueryAdapter.getModelQuery() : null;
-	}
-
-	public static ModelQuery getModelQuery(IStructuredModel model) {
-		if ((!(model instanceof IDOMModel)) || model == null)
-			return null;
-		return getModelQuery(((IDOMModel) model).getDocument());
-	}
-
-	public static ModelQueryAdapter getModelQueryAdapter(Document node) {
-		ModelQueryAdapter result = null;
-
-		if (node instanceof INodeNotifier) {
-			INodeNotifier notifier = (INodeNotifier) node;
-			result = (ModelQueryAdapter) notifier.getAdapterFor(ModelQueryAdapter.class);
-		}
-
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java
deleted file mode 100644
index 61852f9..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.modelquery;
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.xml.core.internal.Logger;
-
-
-// TODO cs : remove this class and utilize the common URIResolver directly
-// We need to update some of the ModelQuery related code to pass the
-// 'baseLocation' thru
-// and then there'll be node need for this class.
-// 
-public class XMLCatalogIdResolver implements org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver {
-	protected String resourceLocation;
-
-	protected URIResolver uriresolver;
-
-	private XMLCatalogIdResolver() {
-		super();
-	}
-
-	private XMLCatalogIdResolver(String resourceLocation) {
-		this();
-		this.resourceLocation = resourceLocation;
-	}
-
-	public XMLCatalogIdResolver(String resourceLocation, URIResolver uriresolver) {
-		this(resourceLocation);
-// this constructor should not be called with two null arguments.
-// If so, an assert will occur later when resolve is called. 
-// See 118371 XMLCatalogIdResolver#resolve throws AssertionFailedException
-//
-// but, I'm not enabling this check now due to lateness in cycle. 		
-//		if (resourceLocation == null && uriresolver == null) {
-//			throw new IllegalArgumentException("both location and resolver can not be null");
-//		}
-		this.uriresolver = uriresolver;
-	}
-
-
-	/**
-	 * Gets the resourceLocation.
-	 * 
-	 * @return Returns a String
-	 */
-	private String getResourceLocation() {
-		String location = resourceLocation;
-		if (location == null) {
-			if (uriresolver != null)
-				location = uriresolver.getFileBaseLocation();
-		}
-		return location;
-	}
-
-
-	public String resolve(String base, String publicId, String systemId) {
-
-		String result = systemId;
-		if (base == null) {
-			base = getResourceLocation();
-			// bug 117320, ensure base URI is 'protocal' qualified before
-			// passing it thru to URIResolver
-			// bug 117424, we should be able to assume that the base location
-			// is non-null
-
-			/**
-			 * We shouldn't assert a failure because the catalog does not
-			 * require a base location to operate and it will be called from
-			 * non-file-based scenarios.
-			 * 
-			 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=206176
-			 */
-			// Assert.isNotNull(base, "Base location is expected to be non null."); //$NON-NLS-1$
-			if (base != null) {
-				base = URIHelper.addImpliedFileProtocol(base);
-			}
-		}
-		result = URIResolverPlugin.createResolver().resolve(base, publicId, systemId);
-		return result;
-	}
-
-	public String resolvePhysicalLocation(String baseLocation, String publicId, String logicalLocation) {
-		// This class should never be called to perform physical resolution!
-		// If it does we should log it as an error
-		Logger.log(Logger.ERROR_DEBUG, "XMLCatalogIDResolver.resolvePhysicalLocation() called unexpectedly"); //$NON-NLS-1$
-		return logicalLocation;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryAssociationProvider.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryAssociationProvider.java
deleted file mode 100644
index 74d14ab..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryAssociationProvider.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.XMLAssociationProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.w3c.dom.Document;
-
-/**
- * XMLModelQueryAssociationProvider
- * 
- * This added and/or made public specifically for experimentation. It will
- * change as this functionality becomes API. See
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=119084
- * 
- */
-public class XMLModelQueryAssociationProvider extends XMLAssociationProvider {
-
-	protected URIResolver idResolver;
-
-	public XMLModelQueryAssociationProvider(CMDocumentCache cache, URIResolver idResolver) {
-		super(cache);
-		this.idResolver = idResolver;
-	}
-
-	protected String resolveGrammarURI(Document document, String publicId, String systemId) {
-
-		// CS : spooky code alert!
-		// this look really strange because we're passing null in as the first
-		// argument
-		// however we're assuming the use of a 'fudged' URIResolver that knows
-		// the
-		// correct baseLocation and will call to the URIResolver framework
-		// properly
-
-		// CS : note that we should never call resolvePhysical at this point.
-		// Physical resolution should only occur when we're interesting to
-		// opening the actual stream.
-		// The CMDocumentFactory implementation would be responsible for
-		// calling resolvePhysical.
-		// All we need to do here is return a 'logical' URI
-
-		if (idResolver == null)
-			return null;
-		return idResolver.resolve(null, publicId, systemId);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryImpl.java
deleted file mode 100644
index 7bfa001..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.ModelQueryImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.MovableModelQuery;
-
-
-public class XMLModelQueryImpl extends ModelQueryImpl implements MovableModelQuery {
-
-	protected CMDocumentCache fCache = null;
-
-	public XMLModelQueryImpl(CMDocumentCache cache, URIResolver idResolver) {
-		super(new XMLModelQueryAssociationProvider(cache, idResolver));
-		fCache = cache;
-	}
-
-	/**
-	 * @see MovableModelQuery#setIdResolver(URIResolver)
-	 */
-	public void setIdResolver(URIResolver newIdResolver) {
-		modelQueryAssociationProvider = new XMLModelQueryAssociationProvider(fCache, newIdResolver);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/BlockStructuredDocumentRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/BlockStructuredDocumentRegion.java
deleted file mode 100644
index 7754a80..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/BlockStructuredDocumentRegion.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-import org.eclipse.wst.sse.core.internal.ltk.parser.IBlockedStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocumentRegion;
-
-
-public class BlockStructuredDocumentRegion extends BasicStructuredDocumentRegion implements IBlockedStructuredDocumentRegion {
-
-	private String partitionType;
-
-	/**
-	 * A BlockStructuredDocumentRegion is like a IStructuredDocumentRegion,
-	 * but is the result of a "block scan".
-	 */
-	public BlockStructuredDocumentRegion() {
-		super();
-	}
-
-	public String getPartitionType() {
-		if (partitionType == null) {
-			// eventually can look up surroundingTag name
-			// but this field is primarily entended for future
-			// extensibility. This may change.
-			//partitionType = "org.eclipse.wst.sse.core." + tagname;
-		}
-		return partitionType;
-	}
-
-	public void setPartitionType(String partitionType) {
-		this.partitionType = partitionType;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/ContextRegionContainer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/ContextRegionContainer.java
deleted file mode 100644
index a13f814..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/ContextRegionContainer.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.text.TextRegionListImpl;
-import org.eclipse.wst.xml.core.internal.Logger;
-
-
-public class ContextRegionContainer implements ITextRegionContainer {
-	protected int length;
-	protected ITextRegionCollection parent;
-	protected ITextRegionList regions;
-	protected int start;
-	protected int textLength;
-	protected String type;
-
-	public ContextRegionContainer() {
-		super();
-		regions = new TextRegionListImpl();
-
-	}
-
-	/**
-	 * these "deep" parenting is not normal, but just in case.
-	 */
-	private IStructuredDocument _getParentDocument() {
-		// go up enough parents to get to document
-		ITextRegionCollection parent = getParent();
-		while (!(parent instanceof IStructuredDocumentRegion)) {
-			// would be an error not to be container, but
-			// won't check for it now
-			parent = ((ITextRegionContainer) parent).getParent();
-		}
-		return ((IStructuredDocumentRegion) parent).getParentDocument();
-	}
-
-
-	public void adjust(int i) {
-
-		start += i;
-		// I erroneously added length and textLength
-		// TODO: may want to rename this method to adjustStart
-		//length += i;
-		//textLength += i;
-
-	}
-
-	public void adjustLength(int i) {
-		length += i;
-	}
-
-	public void adjustStart(int i) {
-		start += i;
-	}
-
-
-	public void adjustTextLength(int i) {
-		textLength += i;
-
-	}
-
-	public boolean containsOffset(int i) {
-
-		return getStartOffset() <= i && i < getEndOffset();
-	}
-
-	public boolean containsOffset(ITextRegion containedRegion, int offset) {
-		return getStartOffset(containedRegion) <= offset && offset < getEndOffset(containedRegion);
-	}
-
-	/**
-	 * This method is just to equate positions. clients may (will probably)
-	 * still need to make calls to equate regions, parent, etc.
-	 */
-	public void equatePositions(ITextRegion region) {
-		start = region.getStart();
-		length = region.getLength();
-		textLength = region.getTextLength();
-	}
-
-	public int getEnd() {
-		return start + length;
-	}
-
-	public int getEndOffset() {
-		// our startOffset take into account our parent, and our start
-		return getStartOffset() + getLength();
-	}
-
-	public int getEndOffset(ITextRegion containedRegion) {
-		return getStartOffset(containedRegion) + containedRegion.getLength();
-	}
-
-	public ITextRegion getFirstRegion() {
-		return getRegions().get(0);
-	}
-
-	public String getFullText() {
-		return getParent().getFullText(this);
-	}
-
-	public String getFullText(org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion aRegion) {
-		// Must be proxied here since aRegion should always be a child of
-		// *this* container and indexed from
-		// this container's offset
-		return parent.getFullText().substring(start + aRegion.getStart(), start + aRegion.getEnd());
-	}
-
-	public ITextRegion getLastRegion() {
-		return getRegions().get(getRegions().size() - 1);
-	}
-
-	public int getLength() {
-		return length;
-	}
-
-
-	public int getNumberOfRegions() {
-		return getRegions().size();
-	}
-
-	public ITextRegionCollection getParent() {
-		return parent;
-	}
-
-	/**
-	 * The parameter offset refers to the overall offset in the document.
-	 */
-	public ITextRegion getRegionAtCharacterOffset(int offset) {
-		ITextRegion result = null;
-		if (regions != null) {
-			// transform the requested offset to the "scale" that
-			// regions are stored in, which are all relative to the
-			// start point.
-			//int transformedOffset = offset - getStartOffset();
-			//
-			int length = getRegions().size();
-			for (int i = 0; i < length; i++) {
-				ITextRegion region = getRegions().get(i);
-				if (org.eclipse.wst.sse.core.internal.util.Debug.debugStructuredDocument) {
-					System.out.println("region(s) in IStructuredDocumentRegion::getRegionAtCharacterOffset: " + region); //$NON-NLS-1$
-					System.out.println("       requested offset: " + offset); //$NON-NLS-1$
-					//System.out.println(" transformedOffset: " +
-					// transformedOffset); //$NON-NLS-1$
-					System.out.println("       region start: " + region.getStart()); //$NON-NLS-1$
-					System.out.println("       region end: " + region.getEnd()); //$NON-NLS-1$
-					System.out.println("       region type: " + region.getType()); //$NON-NLS-1$
-					System.out.println("       region class: " + region.getClass()); //$NON-NLS-1$
-
-				}
-				if ((getStartOffset(region) <= offset) && (offset < getEndOffset(region))) {
-					result = region;
-					break;
-				}
-			}
-		}
-		return result;
-	}
-
-	public ITextRegionList getRegions() {
-		return regions;
-	}
-
-	public int getStart() {
-		return start;
-	}
-
-	public int getStartOffset() {
-		return getParent().getStartOffset() + getStart();
-	}
-
-	public int getStartOffset(ITextRegion containedRegion) {
-		// it is an error to pass null to this method
-		// ISSUE: need better "spec" on error behavior: 
-		// for now will return zero as this will roughly 
-		// work for some cases (and avoid NPE).
-		if (containedRegion == null) {
-			return getStartOffset();
-		}
-		return getStartOffset() + containedRegion.getStart();
-	}
-
-	/**
-	 * same as getFullText for this region type ... do we need to take white
-	 * space off?
-	 */
-
-	public String getText() {
-		String result = null;
-		try {
-			IStructuredDocument parentDocument = _getParentDocument();
-			result = parentDocument.get(start, length);
-		} catch (BadLocationException e) {
-			Logger.logException("program error: unreachable exception", e); //$NON-NLS-1$
-		}
-		return result;
-	}
-
-	public String getText(org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion aRegion) {
-		// Must be proxied here since aRegion should always be a child of
-		// *this* container and indexed from
-		// this container's offset
-		return parent.getText().substring(start + aRegion.getStart(), start + aRegion.getTextEnd());
-	}
-
-	public int getTextEnd() {
-		return start + textLength;
-	}
-
-	public int getTextEndOffset() {
-		ITextRegion region = regions.get(regions.size() - 1);
-		// our startOffset take into account our parent, and our start
-		// (pa) 10/4 changed to be based on text end
-		//           it used to return incorrect value for embedded region containers
-		//
-
-		// TODO CRITICAL -- need to re-work this work around, so doesn't
-		// depend on XMLRegionContext
-		//		// this is a workaround for 226823///////////
-		//		for (int i = regions.size() - 1; i >= 0 && region.getType() ==
-		// XMLRegionContext.WHITE_SPACE; i--)
-		//			region = (ITextRegion) regions.get(i);
-		//		/////////////////////////////////////////////
-
-		return getStartOffset() + region.getTextEnd();
-	}
-
-	public int getTextEndOffset(ITextRegion containedRegion) {
-		int result = 0;
-		if (regions != null) {
-			int length = getRegions().size();
-			for (int i = 0; i < length; i++) {
-				ITextRegion region = getRegions().get(i);
-				if (region == containedRegion) {
-					result = getStartOffset(region) + region.getTextEnd();
-					break;
-				}
-			}
-		}
-		return result;
-	}
-
-	public int getTextLength() {
-		return textLength;
-	}
-
-	public String getType() {
-		return type;
-	}
-
-	public void setLength(int i) {
-		length = i;
-	}
-
-	public void setParent(ITextRegionCollection parentRegion) {
-		parent = parentRegion;
-	}
-
-	public void setRegions(ITextRegionList containedRegions) {
-		regions = containedRegions;
-	}
-
-	public void setStart(int i) {
-		start = i;
-	}
-
-	public void setTextLength(int i) {
-		textLength = i;
-	}
-
-	public void setType(String string) {
-		type = string;
-	}
-
-	public String toString() {
-		String className = getClass().getName();
-		String shortClassName = className.substring(className.lastIndexOf(".") + 1); //$NON-NLS-1$
-		String result = "Container!!! " + shortClassName + "--> " + getType() + ": " + getStart() + "-" + getTextEnd() + (getTextEnd() != getEnd() ? ("/" + getEnd()) : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
-		return result;
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent result = null;
-		// FUTURE_TO_DO: need to implement region level parsing in
-		// ITextRegionContainer::updateModel
-		// never being called?
-		return result;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/IntStack.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/IntStack.java
deleted file mode 100644
index b871545..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/IntStack.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-/*
- * 
- * A non-resizable class implementing the behavior of java.util.Stack, but
- * directly for the <code> integer </code> primitive.
- */
-import java.util.EmptyStackException;
-
-public class IntStack {
-	private int[] list = null;
-
-	private int size = 0;
-
-	public IntStack() {
-		this(100);
-	}
-
-	public IntStack(int maxdepth) {
-		super();
-		list = new int[maxdepth];
-		initialize();
-	}
-
-	public boolean empty() {
-		return size == 0;
-	}
-
-	public int get(int slot) {
-		return list[slot];
-	}
-
-	void initialize() {
-		for (int i = 0; i < list.length; i++)
-			list[i] = -1;
-	}
-
-	/**
-	 * Returns the int at the top of the stack without removing it
-	 * 
-	 * @return int at the top of this stack.
-	 * @exception EmptyStackException
-	 *                when empty.
-	 */
-	public int peek() {
-		if (size == 0)
-			throw new EmptyStackException();
-		return list[size - 1];
-	}
-
-	/**
-	 * Removes and returns the int at the top of the stack
-	 * 
-	 * @return int at the top of this stack.
-	 * @exception EmptyStackException
-	 *                when empty.
-	 */
-	public int pop() {
-		int value = peek();
-		list[size - 1] = -1;
-		size--;
-		return value;
-	}
-
-	/**
-	 * Pushes an item onto the top of this stack.
-	 * 
-	 * @param newValue -
-	 *            the int to be pushed onto this stack.
-	 * @return the <code>newValue</code> argument.
-	 */
-	public int push(int newValue) {
-		if (size == list.length) {
-			throw new StackOverflowError();
-		}
-		list[size++] = newValue;
-		return newValue;
-	}
-
-	public int size() {
-		return list.length;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/RegionFactory.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/RegionFactory.java
deleted file mode 100644
index 1315a77..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/RegionFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-import org.eclipse.wst.sse.core.internal.parser.ContextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-
-
-public class RegionFactory {
-
-	public RegionFactory() {
-		super();
-	}
-
-	public ITextRegion createToken(ITextRegionContainer parent, String context, int start, int textLength, int length) {
-		return this.createToken(parent, context, start, textLength, length, null, null);
-	}
-
-	public ITextRegion createToken(ITextRegionContainer parent, String context, int start, int textLength, int length, String lang, String surroundingTag) {
-		ITextRegion newRegion = createToken(context, start, textLength, length);
-		// DW, 4/16/2003 token regions no longer have parents
-		//newRegion.setParent(parent);
-		return newRegion;
-	}
-
-	public ITextRegion createToken(String context, int start, int textLength, int length) {
-		return this.createToken(context, start, textLength, length, null, null);
-	}
-
-	public ITextRegion createToken(String context, int start, int textLength, int length, String lang, String surroundingTag) {
-		ITextRegion newRegion = new ContextRegion(context, start, textLength, length);
-		return newRegion;
-
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XML10Names.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XML10Names.java
deleted file mode 100644
index af91c63..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XML10Names.java
+++ /dev/null
@@ -1,595 +0,0 @@
-/* The following code was generated by JFlex 1.4 on 2/25/08 10:25 AM */
-
-/*******************************************************************************
- * Copyright (c) 2004,2008 IBM Corporation, and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     kb.huang  - Bug 214416  Dot char is not escaped in XML10Names.jFlex
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-
-/**
- * This class is a scanner generated by 
- * <a href="http://www.jflex.de/">JFlex</a> 1.4
- * on 2/25/08 10:25 AM from the specification file
- * <tt>XML10Names.jflex</tt>
- */
-public final class XML10Names {
-
-  /** This character denotes the end of file */
-  private static final int YYEOF = -1;
-
-  /** initial size of the lookahead buffer */
-  private static final int ZZ_BUFFERSIZE = 2048;
-
-  /** lexical states */
-  private static final int YYINITIAL = 0;
-
-  /** 
-   * Translates characters to character classes
-   */
-  private static final String ZZ_CMAP_PACKED = 
-    "\12\0\1\3\42\0\1\2\1\2\1\0\12\2\1\1\6\0\32\1"+
-    "\4\0\1\1\1\0\32\1\74\0\1\2\10\0\27\1\1\0\37\1"+
-    "\1\0\72\1\2\0\13\1\2\0\10\1\1\0\65\1\1\0\104\1"+
-    "\11\0\44\1\3\0\2\1\4\0\36\1\70\0\131\1\22\0\7\1"+
-    "\16\0\2\2\56\0\106\2\32\0\2\2\44\0\1\1\1\2\3\1"+
-    "\1\0\1\1\1\0\24\1\1\0\54\1\1\0\7\1\3\0\1\1"+
-    "\1\0\1\1\1\0\1\1\1\0\1\1\1\0\22\1\15\0\14\1"+
-    "\1\0\102\1\1\0\14\1\1\0\44\1\1\0\4\2\11\0\65\1"+
-    "\2\0\2\1\2\0\2\1\3\0\34\1\2\0\10\1\2\0\2\1"+
-    "\67\0\46\1\2\0\1\1\7\0\46\1\12\0\21\2\1\0\27\2"+
-    "\1\0\3\2\1\0\1\2\1\0\2\2\1\0\1\2\13\0\33\1"+
-    "\5\0\3\1\56\0\32\1\5\0\1\2\12\1\10\2\15\0\12\2"+
-    "\6\0\1\2\107\1\2\0\5\1\1\0\17\1\1\0\4\1\1\0"+
-    "\1\1\17\2\2\1\2\2\1\0\4\2\2\0\12\2\u0207\0\3\2"+
-    "\1\0\65\1\2\0\1\2\1\1\20\2\3\0\4\2\3\0\12\1"+
-    "\2\2\2\0\12\2\21\0\3\2\1\0\10\1\2\0\2\1\2\0"+
-    "\26\1\1\0\7\1\1\0\1\1\3\0\4\1\2\0\1\2\1\0"+
-    "\7\2\2\0\2\2\2\0\3\2\11\0\1\2\4\0\2\1\1\0"+
-    "\3\1\2\2\2\0\12\2\2\1\20\0\1\2\2\0\6\1\4\0"+
-    "\2\1\2\0\26\1\1\0\7\1\1\0\2\1\1\0\2\1\1\0"+
-    "\2\1\2\0\1\2\1\0\5\2\4\0\2\2\2\0\3\2\13\0"+
-    "\4\1\1\0\1\1\7\0\12\2\2\2\3\1\14\0\3\2\1\0"+
-    "\7\1\1\0\1\1\1\0\3\1\1\0\26\1\1\0\7\1\1\0"+
-    "\2\1\1\0\5\1\2\0\1\2\1\1\10\2\1\0\3\2\1\0"+
-    "\3\2\22\0\1\1\5\0\12\2\21\0\3\2\1\0\10\1\2\0"+
-    "\2\1\2\0\26\1\1\0\7\1\1\0\2\1\2\0\4\1\2\0"+
-    "\1\2\1\1\6\2\3\0\2\2\2\0\3\2\10\0\2\2\4\0"+
-    "\2\1\1\0\3\1\4\0\12\2\22\0\2\2\1\0\6\1\3\0"+
-    "\3\1\1\0\4\1\3\0\2\1\1\0\1\1\1\0\2\1\3\0"+
-    "\2\1\3\0\3\1\3\0\10\1\1\0\3\1\4\0\5\2\3\0"+
-    "\3\2\1\0\4\2\11\0\1\2\17\0\11\2\21\0\3\2\1\0"+
-    "\10\1\1\0\3\1\1\0\27\1\1\0\12\1\1\0\5\1\4\0"+
-    "\7\2\1\0\3\2\1\0\4\2\7\0\2\2\11\0\2\1\4\0"+
-    "\12\2\22\0\2\2\1\0\10\1\1\0\3\1\1\0\27\1\1\0"+
-    "\12\1\1\0\5\1\4\0\7\2\1\0\3\2\1\0\4\2\7\0"+
-    "\2\2\7\0\1\1\1\0\2\1\4\0\12\2\22\0\2\2\1\0"+
-    "\10\1\1\0\3\1\1\0\27\1\1\0\20\1\4\0\6\2\2\0"+
-    "\3\2\1\0\4\2\11\0\1\2\10\0\2\1\4\0\12\2\221\0"+
-    "\56\1\1\0\1\1\1\2\2\1\7\2\5\0\6\1\1\2\10\2"+
-    "\1\0\12\2\47\0\2\1\1\0\1\1\2\0\2\1\1\0\1\1"+
-    "\2\0\1\1\6\0\4\1\1\0\7\1\1\0\3\1\1\0\1\1"+
-    "\1\0\1\1\2\0\2\1\1\0\2\1\1\0\1\1\1\2\2\1"+
-    "\6\2\1\0\2\2\1\1\2\0\5\1\1\0\1\2\1\0\6\2"+
-    "\2\0\12\2\76\0\2\2\6\0\12\2\13\0\1\2\1\0\1\2"+
-    "\1\0\1\2\4\0\2\2\10\1\1\0\41\1\7\0\24\2\1\0"+
-    "\6\2\4\0\6\2\1\0\1\2\1\0\25\2\3\0\7\2\1\0"+
-    "\1\2\346\0\46\1\12\0\47\1\11\0\1\1\1\0\2\1\1\0"+
-    "\3\1\1\0\1\1\1\0\2\1\1\0\5\1\51\0\1\1\1\0"+
-    "\1\1\1\0\1\1\13\0\1\1\1\0\1\1\1\0\1\1\3\0"+
-    "\2\1\3\0\1\1\5\0\3\1\1\0\1\1\1\0\1\1\1\0"+
-    "\1\1\1\0\1\1\3\0\2\1\3\0\2\1\1\0\1\1\50\0"+
-    "\1\1\11\0\1\1\2\0\1\1\2\0\2\1\7\0\2\1\1\0"+
-    "\1\1\1\0\7\1\50\0\1\1\4\0\1\1\10\0\1\1\u0c06\0"+
-    "\234\1\4\0\132\1\6\0\26\1\2\0\6\1\2\0\46\1\2\0"+
-    "\6\1\2\0\10\1\1\0\1\1\1\0\1\1\1\0\1\1\1\0"+
-    "\37\1\2\0\65\1\1\0\7\1\1\0\1\1\3\0\3\1\1\0"+
-    "\7\1\3\0\4\1\2\0\6\1\4\0\15\1\5\0\3\1\1\0"+
-    "\7\1\323\0\15\2\4\0\1\2\104\0\1\1\3\0\2\1\2\0"+
-    "\1\1\121\0\3\1\u0e82\0\1\2\1\0\1\1\31\0\11\1\6\2"+
-    "\1\0\5\2\13\0\124\1\4\0\2\2\2\0\2\2\2\0\132\1"+
-    "\1\0\3\2\6\0\50\1\u1cd3\0\u51a6\1\u0c5a\0\u2ba4\1\u285c\0";
-
-  /** 
-   * Translates characters to character classes
-   */
-  private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
-
-  /** 
-   * Translates DFA states to action switch labels.
-   */
-  private static final int [] ZZ_ACTION = zzUnpackAction();
-
-  private static final String ZZ_ACTION_PACKED_0 =
-    "\1\0\1\1\1\2\1\3";
-
-  private static int [] zzUnpackAction() {
-    int [] result = new int[4];
-    int offset = 0;
-    offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
-    return result;
-  }
-
-  private static int zzUnpackAction(String packed, int offset, int [] result) {
-    int i = 0;       /* index in packed string  */
-    int j = offset;  /* index in unpacked array */
-    int l = packed.length();
-    while (i < l) {
-      int count = packed.charAt(i++);
-      int value = packed.charAt(i++);
-      do result[j++] = value; while (--count > 0);
-    }
-    return j;
-  }
-
-
-  /** 
-   * Translates a state to a row index in the transition table
-   */
-  private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
-
-  private static final String ZZ_ROWMAP_PACKED_0 =
-    "\0\0\0\4\0\10\0\14";
-
-  private static int [] zzUnpackRowMap() {
-    int [] result = new int[4];
-    int offset = 0;
-    offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
-    return result;
-  }
-
-  private static int zzUnpackRowMap(String packed, int offset, int [] result) {
-    int i = 0;  /* index in packed string  */
-    int j = offset;  /* index in unpacked array */
-    int l = packed.length();
-    while (i < l) {
-      int high = packed.charAt(i++) << 16;
-      result[j++] = high | packed.charAt(i++);
-    }
-    return j;
-  }
-
-  /** 
-   * The transition table of the DFA
-   */
-  private static final int ZZ_TRANS [] = {
-    1, 2, 1, -1, -1, -1, -1, -1, 3, 2, 
-    2, -1, 3, 3, 3, -1
-  };
-
-  /* error codes */
-  private static final int ZZ_UNKNOWN_ERROR = 0;
-  private static final int ZZ_NO_MATCH = 1;
-//  private static final int ZZ_PUSHBACK_2BIG = 2;
-
-  /* error messages for the codes above */
-  private static final String ZZ_ERROR_MSG[] = {
-    "Unkown internal scanner error",
-    "Error: could not match input",
-    "Error: pushback value was too large"
-  };
-
-  /**
-   * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
-   */
-  private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
-
-  private static final String ZZ_ATTRIBUTE_PACKED_0 =
-    "\1\0\1\11\2\1";
-
-  private static int [] zzUnpackAttribute() {
-    int [] result = new int[4];
-    int offset = 0;
-    offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
-    return result;
-  }
-
-  private static int zzUnpackAttribute(String packed, int offset, int [] result) {
-    int i = 0;       /* index in packed string  */
-    int j = offset;  /* index in unpacked array */
-    int l = packed.length();
-    while (i < l) {
-      int count = packed.charAt(i++);
-      int value = packed.charAt(i++);
-      do result[j++] = value; while (--count > 0);
-    }
-    return j;
-  }
-
-  /** the input device */
-  private java.io.Reader zzReader;
-
-  /** the current state of the DFA */
-  private int zzState;
-
-  /** the current lexical state */
-  private int zzLexicalState = YYINITIAL;
-
-  /** this buffer contains the current text to be matched and is
-      the source of the yytext() string */
-  private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
-
-  /** the textposition at the last accepting state */
-  private int zzMarkedPos;
-
-  /** the textposition at the last state to be included in yytext */
-  private int zzPushbackPos;
-
-  /** the current text position in the buffer */
-  private int zzCurrentPos;
-
-  /** startRead marks the beginning of the yytext() string in the buffer */
-  private int zzStartRead;
-
-  /** endRead marks the last character in the buffer, that has been read
-      from input */
-  private int zzEndRead;
-
-  /** number of newlines encountered up to the start of the matched text */
-//  private int yyline;
-
-  /** the number of characters up to the start of the matched text */
-//  private int yychar;
-
-  /**
-   * the number of characters from the last newline up to the start of the 
-   * matched text
-   */
-//  private int yycolumn;
-
-  /** 
-   * zzAtBOL == true <=> the scanner is currently at the beginning of a line
-   */
-//  private boolean zzAtBOL = true;
-
-  /** zzAtEOF == true <=> the scanner is at the EOF */
-  private boolean zzAtEOF;
-
-  /* user code: */
-        boolean result;
-        /**
-         * Creates a new scanner
-         */
-        public XML10Names() {
-                this.zzReader = null;
-        }
-
-        public boolean isValidXML10Name(String stringToCheck) {
-                boolean result = false;
-                yyreset(new java.io.StringReader(stringToCheck));
-                try {
-                        result = isValidXML10Name();
-                }
-                catch (java.io.IOException e) {
-                        // should be impossible with strings, but if occurs, just means
-                        // "not"
-                        result = false;
-                }
-                return result;
-        }
-
-
-
-  /**
-   * Creates a new scanner
-   * There is also a java.io.InputStream version of this constructor.
-   *
-   * @param   in  the java.io.Reader to read input from.
-   */
-  public XML10Names(java.io.Reader in) {
-    this.zzReader = in;
-  }
-
-  /**
-   * Creates a new scanner.
-   * There is also java.io.Reader version of this constructor.
-   *
-   * @param   in  the java.io.Inputstream to read input from.
-   */
-  public XML10Names(java.io.InputStream in) {
-    this(new java.io.InputStreamReader(in));
-  }
-
-  /** 
-   * Unpacks the compressed character translation table.
-   *
-   * @param packed   the packed character translation table
-   * @return         the unpacked character translation table
-   */
-  private static char [] zzUnpackCMap(String packed) {
-    char [] map = new char[0x10000];
-    int i = 0;  /* index in packed string  */
-    int j = 0;  /* index in unpacked array */
-    while (i < 1218) {
-      int  count = packed.charAt(i++);
-      char value = packed.charAt(i++);
-      do map[j++] = value; while (--count > 0);
-    }
-    return map;
-  }
-
-
-  /**
-   * Refills the input buffer.
-   *
-   * @return      <code>false</code>, iff there was new input.
-   * 
-   * @exception   java.io.IOException  if any I/O-Error occurs
-   */
-  private boolean zzRefill() throws java.io.IOException {
-
-    /* first: make room (if you can) */
-    if (zzStartRead > 0) {
-      System.arraycopy(zzBuffer, zzStartRead,
-                       zzBuffer, 0,
-                       zzEndRead-zzStartRead);
-
-      /* translate stored positions */
-      zzEndRead-= zzStartRead;
-      zzCurrentPos-= zzStartRead;
-      zzMarkedPos-= zzStartRead;
-      zzPushbackPos-= zzStartRead;
-      zzStartRead = 0;
-    }
-
-    /* is the buffer big enough? */
-    if (zzCurrentPos >= zzBuffer.length) {
-      /* if not: blow it up */
-      char newBuffer[] = new char[zzCurrentPos*2];
-      System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
-      zzBuffer = newBuffer;
-    }
-
-    /* finally: fill the buffer with new input */
-    int numRead = zzReader.read(zzBuffer, zzEndRead,
-                                            zzBuffer.length-zzEndRead);
-
-    if (numRead < 0) {
-      return true;
-    }
-    else {
-      zzEndRead+= numRead;
-      return false;
-    }
-  }
-
-    
-  /**
-   * Closes the input stream.
-   */
-//  private final void yyclose() throws java.io.IOException {
-//    zzAtEOF = true;            /* indicate end of file */
-//    zzEndRead = zzStartRead;  /* invalidate buffer    */
-//
-//    if (zzReader != null)
-//      zzReader.close();
-//  }
-
-
-  /**
-   * Resets the scanner to read from a new input stream.
-   * Does not close the old reader.
-   *
-   * All internal variables are reset, the old input stream 
-   * <b>cannot</b> be reused (internal buffer is discarded and lost).
-   * Lexical state is set to <tt>ZZ_INITIAL</tt>.
-   *
-   * @param reader   the new input stream 
-   */
-  private final void yyreset(java.io.Reader reader) {
-    zzReader = reader;
-//    zzAtBOL  = true;
-    zzAtEOF  = false;
-    zzEndRead = zzStartRead = 0;
-    zzCurrentPos = zzMarkedPos = zzPushbackPos = 0;
-//    yyline = yychar = yycolumn = 0;
-    zzLexicalState = YYINITIAL;
-  }
-
-
-  /**
-   * Returns the current lexical state.
-   */
-//  private final int yystate() {
-//    return zzLexicalState;
-//  }
-
-
-  /**
-   * Enters a new lexical state
-   *
-   * @param newState the new lexical state
-   */
-//  private final void yybegin(int newState) {
-//    zzLexicalState = newState;
-//  }
-
-
-  /**
-   * Returns the text matched by the current regular expression.
-   */
-//  private final String yytext() {
-//    return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
-//  }
-
-
-  /**
-   * Returns the character at position <tt>pos</tt> from the 
-   * matched text. 
-   * 
-   * It is equivalent to yytext().charAt(pos), but faster
-   *
-   * @param pos the position of the character to fetch. 
-   *            A value from 0 to yylength()-1.
-   *
-   * @return the character at position pos
-   */
-//  private final char yycharat(int pos) {
-//    return zzBuffer[zzStartRead+pos];
-//  }
-
-
-  /**
-   * Returns the length of the matched text region.
-   */
-//  private final int yylength() {
-//    return zzMarkedPos-zzStartRead;
-//  }
-
-
-  /**
-   * Reports an error that occured while scanning.
-   *
-   * In a wellformed scanner (no or only correct usage of 
-   * yypushback(int) and a match-all fallback rule) this method 
-   * will only be called with things that "Can't Possibly Happen".
-   * If this method is called, something is seriously wrong
-   * (e.g. a JFlex bug producing a faulty scanner etc.).
-   *
-   * Usual syntax/scanner level error handling should be done
-   * in error fallback rules.
-   *
-   * @param   errorCode  the code of the errormessage to display
-   */
-  private void zzScanError(int errorCode) {
-    String message;
-    try {
-      message = ZZ_ERROR_MSG[errorCode];
-    }
-    catch (ArrayIndexOutOfBoundsException e) {
-      message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
-    }
-
-    throw new Error(message);
-  } 
-
-
-  /**
-   * Pushes the specified amount of characters back into the input stream.
-   *
-   * They will be read again by then next call of the scanning method
-   *
-   * @param number  the number of characters to be read again.
-   *                This number must not be greater than yylength()!
-   */
-//  private void yypushback(int number)  {
-//    if ( number > yylength() )
-//      zzScanError(ZZ_PUSHBACK_2BIG);
-//
-//    zzMarkedPos -= number;
-//  }
-
-
-  /**
-   * Resumes scanning until the next regular expression is matched,
-   * the end of input is encountered or an I/O-Error occurs.
-   *
-   * @return      the next token
-   * @exception   java.io.IOException  if any I/O-Error occurs
-   */
-  private boolean isValidXML10Name() throws java.io.IOException {
-    int zzInput;
-    int zzAction;
-
-    // cached fields:
-    int zzCurrentPosL;
-    int zzMarkedPosL;
-    int zzEndReadL = zzEndRead;
-    char [] zzBufferL = zzBuffer;
-    char [] zzCMapL = ZZ_CMAP;
-
-    int [] zzTransL = ZZ_TRANS;
-    int [] zzRowMapL = ZZ_ROWMAP;
-    int [] zzAttrL = ZZ_ATTRIBUTE;
-
-    while (true) {
-      zzMarkedPosL = zzMarkedPos;
-
-      zzAction = -1;
-
-      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
-  
-      zzState = zzLexicalState;
-
-
-      zzForAction: {
-        while (true) {
-    
-          if (zzCurrentPosL < zzEndReadL)
-            zzInput = zzBufferL[zzCurrentPosL++];
-          else if (zzAtEOF) {
-            zzInput = YYEOF;
-            break zzForAction;
-          }
-          else {
-            // store back cached positions
-            zzCurrentPos  = zzCurrentPosL;
-            zzMarkedPos   = zzMarkedPosL;
-            boolean eof = zzRefill();
-            // get translated positions and possibly new buffer
-            zzCurrentPosL  = zzCurrentPos;
-            zzMarkedPosL   = zzMarkedPos;
-            zzBufferL      = zzBuffer;
-            zzEndReadL     = zzEndRead;
-            if (eof) {
-              zzInput = YYEOF;
-              break zzForAction;
-            }
-            else {
-              zzInput = zzBufferL[zzCurrentPosL++];
-            }
-          }
-          int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
-          if (zzNext == -1) break zzForAction;
-          zzState = zzNext;
-
-          int zzAttributes = zzAttrL[zzState];
-          if ( (zzAttributes & 1) == 1 ) {
-            zzAction = zzState;
-            zzMarkedPosL = zzCurrentPosL;
-            if ( (zzAttributes & 8) == 8 ) break zzForAction;
-          }
-
-        }
-      }
-
-      // store back cached position
-      zzMarkedPos = zzMarkedPosL;
-
-      switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
-        case 1: 
-          { return false; /* matched wild */
-          }
-        case 4: break;
-        case 2: 
-          { return true; /* exact name */
-          }
-        case 5: break;
-        case 3: 
-          { return false; /* more than name */
-          }
-        case 6: break;
-        default: 
-          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
-            zzAtEOF = true;
-              { {return false; /* hit end with no match */} }
-          } 
-          else {
-            zzScanError(ZZ_NO_MATCH);
-          }
-      }
-    }
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java
deleted file mode 100644
index 0ada81c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java
+++ /dev/null
@@ -1,623 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTagParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTokenizer;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParserExtension;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.text.CharSequenceReader;
-import org.eclipse.wst.sse.core.internal.text.IRegionComparible;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- * Takes input from the HTMLTokenizer and creates a tag list
- */
-
-public class XMLSourceParser implements RegionParser, BlockTagParser, StructuredDocumentRegionParser, IRegionComparible, StructuredDocumentRegionParserExtension {
-	// made public to aid access from inner classes in hierarchy.
-	// TODO: in future, figure out how to solve without exposing data.
-	public CharSequence fCharSequenceSource = null;
-	private IDocument fDocumentInput;
-	protected int fOffset = 0;
-	// DMW: 2/12/03. Removed some state data, since not really needed,
-	// and since it added a lot to overhead (since so many regions are
-	// created.
-	// protected IStructuredDocumentRegion fCurrentNode = null;
-	// protected IStructuredDocumentRegion fNodes = null;
-	// protected List fRegions = null;
-	// protected Object fInput = null;
-	protected String fStringInput = null;
-	protected List fStructuredDocumentRegionHandlers;
-
-	protected BlockTokenizer fTokenizer = null;
-	protected long startTime;
-	protected long stopTime;
-
-	/**
-	 * HTMLSourceParser constructor comment.
-	 */
-	public XMLSourceParser() {
-		super();
-		fStructuredDocumentRegionHandlers = new ArrayList();
-	}
-
-	/**
-	 * This is a simple utility to count nodes. Used only for debug
-	 * statements.
-	 */
-	protected int _countNodes(IStructuredDocumentRegion nodes) {
-		int result = 0;
-		IStructuredDocumentRegion countNode = nodes;
-		while (countNode != null) {
-			result++;
-			countNode = countNode.getNext();
-		}
-		return result;
-	}
-
-	public void addBlockMarker(BlockMarker marker) {
-		getTokenizer().addBlockMarker(marker);
-	}
-
-	public void addStructuredDocumentRegionHandler(StructuredDocumentRegionHandler handler) {
-		if (fStructuredDocumentRegionHandlers == null)
-			fStructuredDocumentRegionHandlers = new ArrayList();
-		fStructuredDocumentRegionHandlers.add(handler);
-	}
-
-	public void beginBlockScan(String newTagName) {
-		getTokenizer().beginBlockTagScan(newTagName);
-	}
-
-	/**
-	 * @return IStructuredDocumentRegion
-	 */
-	protected IStructuredDocumentRegion createStructuredDocumentRegion(String type) {
-		IStructuredDocumentRegion newNode = null;
-		if (type == DOMRegionContext.BLOCK_TEXT)
-			newNode = XMLStructuredRegionFactory.createRegion(XMLStructuredRegionFactory.XML_BLOCK);
-		else
-			newNode = XMLStructuredRegionFactory.createRegion(XMLStructuredRegionFactory.XML);
-		return newNode;
-	}
-
-	protected void fireNodeParsed(IStructuredDocumentRegion fCurrentNode) {
-		/*
-		 * Never let an Exceptions from foreign code interfere with completion
-		 * of parsing. To get an exception here is definitely a program error
-		 * somewhere, but we can't afford to interrupt the flow of control. or
-		 * backwards typing can result!
-		 * 
-		 * Protect the user's data above everything.
-		 */
-		try {
-			if (fCurrentNode != null && fStructuredDocumentRegionHandlers != null) {
-				for (int i = 0; i < fStructuredDocumentRegionHandlers.size(); i++) {
-					((StructuredDocumentRegionHandler) fStructuredDocumentRegionHandlers.get(i)).nodeParsed(fCurrentNode);
-				}
-			}
-		}
-		catch (Exception e) {
-		    Logger.log(Logger.ERROR, "Error occurred while firing Node Parsed event", e); //$NON-NLS-1$
-		}
-	}
-
-	public BlockMarker getBlockMarker(String tagName) {
-		List markers = getTokenizer().getBlockMarkers();
-		for (int i = 0; i < markers.size(); i++) {
-			BlockMarker marker = (BlockMarker) markers.get(i);
-			if (marker.isCaseSensitive()) {
-				if (marker.getTagName().equals(tagName))
-					return marker;
-			}
-			else {
-				if (marker.getTagName().equalsIgnoreCase(tagName))
-					return marker;
-			}
-		}
-		return null;
-	}
-
-	public List getBlockMarkers() {
-		return getTokenizer().getBlockMarkers();
-	}
-
-	/**
-	 * @return IStructuredDocumentRegion
-	 */
-	public IStructuredDocumentRegion getDocumentRegions() {
-		IStructuredDocumentRegion headnode = null;
-		if (headnode == null) {
-			if (Debug.perfTest) {
-				startTime = System.currentTimeMillis();
-			}
-			headnode = parseNodes();
-			if (Debug.perfTest) {
-				stopTime = System.currentTimeMillis();
-				System.out.println(" -- creating nodes of IStructuredDocument -- "); //$NON-NLS-1$
-				System.out.println(" Time parse and init all regions: " + (stopTime - startTime) + " (msecs)"); //$NON-NLS-2$//$NON-NLS-1$
-				// System.out.println(" for " + fRegions.size() + "
-				// Regions");//$NON-NLS-2$//$NON-NLS-1$
-				System.out.println("      and " + _countNodes(headnode) + " Nodes"); //$NON-NLS-2$//$NON-NLS-1$
-			}
-		}
-		return headnode;
-	}
-
-	protected ITextRegion getNextRegion() {
-		ITextRegion region = null;
-		try {
-			region = getTokenizer().getNextToken();
-			// DMW: 2/12/03 Removed state
-			// if (region != null) {
-			// fRegions.add(region);
-			// }
-			return region;
-		}
-		catch (StackOverflowError e) {
-			Logger.logException(getClass().getName() + ": input could not be parsed correctly at position " + getTokenizer().getOffset(), e); //$NON-NLS-1$
-			throw e;
-		}
-		catch (Exception e) {
-			Logger.logException(getClass().getName() + ": input could not be parsed correctly at position " + getTokenizer().getOffset() + " (" + e.getLocalizedMessage() + ")", e); //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-		}
-		return null;
-	}
-
-	/**
-	 * Return the full list of known regions. Typically getNodes should be
-	 * used instead of this method.
-	 */
-	public List getRegions() {
-		IStructuredDocumentRegion headNode = null;
-		if (!getTokenizer().isEOF()) {
-			headNode = getDocumentRegions();
-			// throw new IllegalStateException("parsing has not finished");
-		}
-		// for memory recovery, we assume if someone
-		// requests all regions, we can reset our big
-		// memory consuming objects
-		// but the new "getRegions" method is then more expensive.
-		// I don't think its used much, though.
-		List localRegionsList = getRegions(headNode);
-		primReset();
-		return localRegionsList;
-	}
-
-	/**
-	 * Method getRegions.
-	 * 
-	 * @param headNode
-	 * @return List
-	 */
-	protected List getRegions(IStructuredDocumentRegion headNode) {
-		List allRegions = new ArrayList();
-		IStructuredDocumentRegion currentNode = headNode;
-		while (currentNode != null) {
-			ITextRegionList nodeRegions = currentNode.getRegions();
-			for (int i = 0; i < nodeRegions.size(); i++) {
-				allRegions.add(nodeRegions.get(i));
-			}
-			currentNode = currentNode.getNext();
-		}
-		return allRegions;
-	}
-
-	/**
-	 * @deprecated - use the add/remove methods instead
-	 * @return java.util.List
-	 */
-	public List getStructuredDocumentRegionHandlers() {
-		if (fStructuredDocumentRegionHandlers == null) {
-			fStructuredDocumentRegionHandlers = new ArrayList(0);
-		}
-		return fStructuredDocumentRegionHandlers;
-	}
-
-	/**
-	 * Returns text from the current input. Text is only valid before
-	 * getNodes() has been called and only when a raw String or DocumentReader
-	 * is given as the input.
-	 */
-	public String getText(int offset, int length) {
-		String text = null;
-		if (fCharSequenceSource != null) {
-			int start = fOffset + offset;
-			int end = start + length;
-			text = fCharSequenceSource.subSequence(start, end).toString();
-		}
-		else if (fDocumentInput != null) {
-			try {
-				text = fDocumentInput.get(offset, length);
-			}
-			catch (BadLocationException e) {
-				text = ""; //$NON-NLS-1$
-			}
-		}
-		else {
-			if (fStringInput == null || fStringInput.length() == 0 || offset + length > fStringInput.length() || offset < 0) {
-				text = ""; //$NON-NLS-1$
-			}
-			else {
-				// offset is entirely valid during parsing as the parse
-				// numbers haven't been adjusted.
-				text = fStringInput.substring(offset, offset + length);
-			}
-		}
-		return text;
-	}
-
-	protected BlockTokenizer getTokenizer() {
-		if (fTokenizer == null) {
-			fTokenizer = new XMLTokenizer();
-		}
-		return fTokenizer;
-	}
-
-
-	public RegionParser newInstance() {
-		XMLSourceParser newInstance = new XMLSourceParser();
-		newInstance.setTokenizer(getTokenizer().newInstance());
-		return newInstance;
-	}
-
-	protected IStructuredDocumentRegion parseNodes() {
-		// regions are initially reported as complete offsets within the
-		// scanned input
-		// they are adjusted here to be indexes from the currentNode's start
-		// offset
-		IStructuredDocumentRegion headNode = null;
-		IStructuredDocumentRegion lastNode = null;
-		ITextRegion region = null;
-		IStructuredDocumentRegion currentNode = null;
-		String type = null;
-
-		while ((region = getNextRegion()) != null) {
-			type = region.getType();
-			// these types (might) demand a IStructuredDocumentRegion for each
-			// of them
-			if (type == DOMRegionContext.BLOCK_TEXT) {
-				if (currentNode != null && currentNode.getLastRegion().getType() == DOMRegionContext.BLOCK_TEXT) {
-					// multiple block texts indicated embedded containers; no
-					// new IStructuredDocumentRegion
-					currentNode.addRegion(region);
-					currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
-					region.adjustStart(-currentNode.getStart());
-					// DW 4/16/2003 regions no longer have parents
-					// region.setParent(currentNode);
-				}
-				else {
-					// not continuing a IStructuredDocumentRegion
-					if (currentNode != null) {
-						// ensure that any existing node is at least
-						// terminated
-						if (!currentNode.isEnded()) {
-							currentNode.setLength(region.getStart() - currentNode.getStart());
-							// fCurrentNode.setTextLength(region.getStart() -
-							// fCurrentNode.getStart());
-						}
-						lastNode = currentNode;
-					}
-					fireNodeParsed(currentNode);
-					currentNode = createStructuredDocumentRegion(type);
-					if (lastNode != null) {
-						lastNode.setNext(currentNode);
-					}
-					currentNode.setPrevious(lastNode);
-					currentNode.setStart(region.getStart());
-					currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
-					currentNode.setEnded(true);
-					region.adjustStart(-currentNode.getStart());
-					currentNode.addRegion(region);
-					// DW 4/16/2003 regions no longer have parents
-					// region.setParent(currentNode);
-				}
-			}
-			// the following contexts OPEN new StructuredDocumentRegions
-			else if ((currentNode != null && currentNode.isEnded()) || (type == DOMRegionContext.XML_CONTENT) || (type == DOMRegionContext.XML_CHAR_REFERENCE) || (type == DOMRegionContext.XML_ENTITY_REFERENCE) || (type == DOMRegionContext.XML_PI_OPEN) || (type == DOMRegionContext.XML_TAG_OPEN) || (type == DOMRegionContext.XML_END_TAG_OPEN) || (type == DOMRegionContext.XML_COMMENT_OPEN) || (type == DOMRegionContext.XML_CDATA_OPEN) || (type == DOMRegionContext.XML_DECLARATION_OPEN)) {
-				if (currentNode != null) {
-					// ensure that any existing node is at least terminated
-					if (!currentNode.isEnded()) {
-						currentNode.setLength(region.getStart() - currentNode.getStart());
-						// fCurrentNode.setTextLength(region.getStart() -
-						// fCurrentNode.getStart());
-					}
-					lastNode = currentNode;
-				}
-				fireNodeParsed(currentNode);
-				currentNode = createStructuredDocumentRegion(type);
-				if (lastNode != null) {
-					lastNode.setNext(currentNode);
-				}
-				currentNode.setPrevious(lastNode);
-				currentNode.setStart(region.getStart());
-				currentNode.addRegion(region);
-				currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
-				region.adjustStart(-currentNode.getStart());
-				// DW 4/16/2003 regions no longer have parents
-				// region.setParent(currentNode);
-			}
-			// the following contexts neither open nor close
-			// StructuredDocumentRegions; just add to them
-			else if ((type == DOMRegionContext.XML_TAG_NAME) || (type == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) || (type == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) || (type == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) || (type == DOMRegionContext.XML_COMMENT_TEXT) || (type == DOMRegionContext.XML_PI_CONTENT) || (type == DOMRegionContext.XML_DOCTYPE_INTERNAL_SUBSET)) {
-				currentNode.addRegion(region);
-				currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
-				region.adjustStart(-currentNode.getStart());
-				// DW 4/16/2003 regions no longer have parents
-				// region.setParent(currentNode);
-			}
-			// the following contexts close off StructuredDocumentRegions
-			// cleanly
-			else if ((type == DOMRegionContext.XML_PI_CLOSE) || (type == DOMRegionContext.XML_TAG_CLOSE) || (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE) || (type == DOMRegionContext.XML_COMMENT_CLOSE) || (type == DOMRegionContext.XML_DECLARATION_CLOSE) || (type == DOMRegionContext.XML_CDATA_CLOSE)) {
-				currentNode.setEnded(true);
-				currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
-				currentNode.addRegion(region);
-				region.adjustStart(-currentNode.getStart());
-				// DW 4/16/2003 regions no longer have parents
-				// region.setParent(currentNode);
-			}
-			// this is extremely rare, but valid
-			else if (type == DOMRegionContext.WHITE_SPACE) {
-				ITextRegion lastRegion = currentNode.getLastRegion();
-				// pack the embedded container with this region
-				if (lastRegion instanceof ITextRegionContainer) {
-					ITextRegionContainer container = (ITextRegionContainer) lastRegion;
-					container.getRegions().add(region);
-					// containers must have parent set ...
-					// setting for EACH subregion is redundent, but not sure
-					// where else to do, so will do here for now.
-					container.setParent(currentNode);
-					// DW 4/16/2003 regions no longer have parents
-					// region.setParent(container);
-					region.adjustStart(container.getLength() - region.getStart());
-				}
-				currentNode.getLastRegion().adjustLength(region.getLength());
-				currentNode.adjustLength(region.getLength());
-			}
-			else if (type == DOMRegionContext.UNDEFINED && currentNode != null) {
-				// skip on a very-first region situation as the default
-				// behavior is good enough
-				// combine with previous if also undefined
-				if (currentNode.getLastRegion() != null && currentNode.getLastRegion().getType() == DOMRegionContext.UNDEFINED) {
-					currentNode.getLastRegion().adjustLength(region.getLength());
-					currentNode.adjustLength(region.getLength());
-				}
-				// previous wasn't undefined
-				else {
-					currentNode.addRegion(region);
-					currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
-					region.adjustStart(-currentNode.getStart());
-				}
-			}
-			else {
-				// if an unknown type is the first region in the document,
-				// ensure that a node exists
-				if (currentNode == null) {
-					currentNode = createStructuredDocumentRegion(type);
-					currentNode.setStart(region.getStart());
-				}
-				currentNode.addRegion(region);
-				currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
-				region.adjustStart(-currentNode.getStart());
-				// DW 4/16/2003 regions no longer have parents
-				// region.setParent(currentNode);
-				if (Debug.debugTokenizer)
-					System.out.println(getClass().getName() + " found region of not specifically handled type " + region.getType() + " @ " + region.getStart() + "[" + region.getLength() + "]"); //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-				//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-			}
-
-			// these regions also get their own node, so close them cleanly
-			// NOTE: these regions have new StructuredDocumentRegions created
-			// for them above; it may
-			// be more readable if that is handled here as well, but the
-			// current layout
-			// ensures that they open StructuredDocumentRegions the same way
-			if ((type == DOMRegionContext.XML_CONTENT) || (type == DOMRegionContext.XML_CHAR_REFERENCE) || (type == DOMRegionContext.XML_ENTITY_REFERENCE)) {
-				currentNode.setEnded(true);
-			}
-			if (headNode == null && currentNode != null) {
-				headNode = currentNode;
-			}
-		}
-		if (currentNode != null) {
-			fireNodeParsed(currentNode);
-			currentNode.setPrevious(lastNode);
-		}
-		// fStringInput = null;
-		primReset();
-		return headNode;
-	}
-
-	protected void primReset() {
-		// fNodes = null;
-		// fRegions = null;
-		// fInput = null;
-		fStringInput = null;
-		fCharSequenceSource = null;
-		fDocumentInput = null;
-		fOffset = 0;
-		// fCurrentNode = null;
-		// DMW: also reset tokenizer so it doesn't hold on
-		// to large arrays
-		getTokenizer().reset(new char[0]);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.internal.text.IRegionComparible#regionMatches(int,
-	 *      int, java.lang.String)
-	 */
-	public boolean regionMatches(int offset, int length, String stringToCompare) {
-		// by definition
-		if (stringToCompare == null)
-			return false;
-
-		boolean result = false;
-		if (fCharSequenceSource != null && fCharSequenceSource instanceof IRegionComparible) {
-			result = ((IRegionComparible) fCharSequenceSource).regionMatches(offset, length, stringToCompare);
-		}
-		else {
-			// old fashioned ways
-			String test = null;
-			if (fCharSequenceSource != null) {
-				test = fCharSequenceSource.subSequence(offset, offset + length).toString();
-			}
-			else if (fStringInput != null) {
-				test = fStringInput.substring(offset, offset + length);
-			}
-			result = stringToCompare.equals(test);
-		}
-		return result;
-	}
-
-	public boolean regionMatchesIgnoreCase(int offset, int length, String stringToCompare) {
-		// by definition
-		if (stringToCompare == null)
-			return false;
-
-		boolean result = false;
-		if (fCharSequenceSource != null && fCharSequenceSource instanceof IRegionComparible) {
-			result = ((IRegionComparible) fCharSequenceSource).regionMatchesIgnoreCase(offset, length, stringToCompare);
-		}
-		else {
-			// old fashioned ways
-			String test = null;
-			if (fCharSequenceSource != null) {
-				test = fCharSequenceSource.subSequence(offset, offset + length).toString();
-			}
-			else if (fStringInput != null) {
-				test = fStringInput.substring(offset, offset + length);
-			}
-			result = stringToCompare.equalsIgnoreCase(test);
-		}
-		return result;
-	}
-
-	public void removeBlockMarker(BlockMarker marker) {
-		getTokenizer().removeBlockMarker(marker);
-	}
-
-	public void removeBlockMarker(String tagName) {
-		getTokenizer().removeBlockMarker(tagName);
-	}
-
-	public void removeStructuredDocumentRegionHandler(StructuredDocumentRegionHandler handler) {
-		if (fStructuredDocumentRegionHandlers == null)
-			return;
-		if (fStructuredDocumentRegionHandlers.contains(handler))
-			fStructuredDocumentRegionHandlers.remove(handler);
-	}
-
-	/**
-	 * Resets the input.
-	 */
-	public void reset(java.io.FileInputStream instream) {
-		primReset();
-		// fInput = instream;
-		getTokenizer().reset(instream);
-	}
-
-	/**
-	 * Resets the input.
-	 */
-	public void reset(java.io.Reader reader) {
-		reset(reader, 0);
-	}
-
-	/**
-	 * Resets the input.
-	 */
-	public void reset(java.io.Reader reader, int position) {
-		primReset();
-		fOffset = position;
-		getTokenizer().reset(reader, position);
-		if (reader instanceof DocumentReader) {
-			IDocument doc = ((DocumentReader) reader).getDocument();
-			if (doc instanceof CharSequence) {
-				fCharSequenceSource = (CharSequence) doc;
-			}
-			else {
-				// old fashioned IDocument
-				fDocumentInput = ((DocumentReader) reader).getDocument();
-			}
-
-		}
-		else if (reader instanceof CharSequenceReader) {
-			fCharSequenceSource = ((CharSequenceReader) reader).getOriginalSource();
-		}
-	}
-
-	/**
-	 * Resets the input. Use this version to allow text to be retrieved
-	 * <em>during</em> parsing, such as by the
-	 * StructuredDocumentRegionHandler.
-	 */
-	public void reset(String sourceString) {
-		reset(new StringReader(sourceString));
-		fStringInput = sourceString;
-	}
-
-	/**
-	 * Resets the input. Use this version to allow text to be retrieved
-	 * <em>during</em> parsing, such as by the
-	 * StructuredDocumentRegionHandler.
-	 */
-	public void reset(String sourceString, int position) {
-		StringReader reader = new StringReader(sourceString);
-		reset(reader, position);
-		fStringInput = sourceString;
-	}
-
-	public void resetHandlers() {
-		if (fStructuredDocumentRegionHandlers != null) {
-			int size = fStructuredDocumentRegionHandlers.size();
-			for (int i = 0; i < size; i++)
-				((StructuredDocumentRegionHandler) fStructuredDocumentRegionHandlers.get(i)).resetNodes();
-		}
-	}
-
-	/**
-	 * 
-	 * @param List
-	 */
-	public void setStructuredDocumentRegionHandlers(List newStructuredDocumentRegionHandlers) {
-		fStructuredDocumentRegionHandlers = newStructuredDocumentRegionHandlers;
-	}
-
-	protected void setTokenizer(BlockTokenizer newTokenizer) {
-		// DMW: changed from private to protected, so subclass could use in
-		// creation of 'newInstance'.
-		fTokenizer = newTokenizer;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredDocumentReParser.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredDocumentReParser.java
deleted file mode 100644
index c185520..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredDocumentReParser.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextReParser;
-import org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class XMLStructuredDocumentReParser extends StructuredDocumentReParser {
-
-	public XMLStructuredDocumentReParser() {
-		super();
-	}
-
-	protected IStructuredDocumentRegion findDirtyEnd(int end) {
-		// Caution: here's one place we have to cast
-		IStructuredDocumentRegion result = fStructuredDocument.getRegionAtCharacterOffset(end);
-		// if not well formed, get one past, if there is something there
-		if ((result != null) && (!result.isEnded())) {
-			if (result.getNext() != null) {
-				result = result.getNext();
-			}
-		}
-		// also, get one past if exactly equal to the end (this was needed
-		// as a simple fix to when a whole exact region is deleted.
-		// there's probably a better way.
-		if ((result != null) && (end == result.getEnd())) {
-			if (result.getNext() != null) {
-				result = result.getNext();
-			}
-		}
-
-		// 12/6/2001 - Since we've changed the parser/scanner to allow a lone
-		// '<' without
-		// always interpretting it as start of a tag name, we need to be a
-		// little fancier, in order
-		// to "skip" over any plain 'ol content between the lone '<' and any
-		// potential meating
-		// regions past plain 'ol content.
-		if (isLoneOpenFollowedByContent(result) && (result.getNext() != null)) {
-			result = result.getNext();
-		}
-
-		if (result != null)
-			fStructuredDocument.setCachedDocumentRegion(result);
-		dirtyEnd = result;
-
-		return dirtyEnd;
-	}
-
-	protected void findDirtyStart(int start) {
-		IStructuredDocumentRegion result = fStructuredDocument.getRegionAtCharacterOffset(start);
-		// heuristic: if the postion is exactly equal to the start, then
-		// go back one more, if it exists. This prevents problems with
-		// insertions
-		// of text that should be merged with the previous node instead of
-		// simply hung
-		// off of it as a separate node (ex.: XML content inserted right
-		// before an open
-		// bracket should become part of the previous content node)
-		if (result != null) {
-			IStructuredDocumentRegion previous = result.getPrevious();
-			if ((previous != null) && ((!(previous.isEnded())) || (start == result.getStart()))) {
-				result = previous;
-			}
-			// If we are now at the end of a "tag dependent" content area (or
-			// JSP area)
-			// then we need to back up all the way to the beginning of that.
-			IStructuredDocumentRegion potential = result;
-			while (isPartOfBlockRegion(potential)) {
-				potential = potential.getPrevious();
-			}
-			if (potential != null) {
-				result = potential;
-				fStructuredDocument.setCachedDocumentRegion(result);
-			}
-		}
-		dirtyStart = result;
-	}
-
-	/**
-	 * The rule is, that is we are content, preceded by lone <, then we need
-	 * to advance one more for dirty end.
-	 */
-	protected boolean isLoneOpenFollowedByContent(IStructuredDocumentRegion flatNode) {
-		boolean result = false;
-		String type = flatNode.getType();
-		if (type == DOMRegionContext.XML_CONTENT) {
-			IStructuredDocumentRegion previous = flatNode.getPrevious();
-			String previousType = null;
-			if (previous != null) {
-				previousType = previous.getType();
-			}
-			if (previousType != null) {
-				result = (previousType == DOMRegionContext.XML_TAG_OPEN);
-			}
-		}
-		return result;
-	}
-
-	protected boolean isPartOfBlockRegion(IStructuredDocumentRegion flatNode) {
-		boolean result = false;
-		String type = flatNode.getType();
-		result = (type == DOMRegionContext.BLOCK_TEXT);
-		return result;
-	}
-
-	public IStructuredTextReParser newInstance() {
-		return new XMLStructuredDocumentReParser();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredRegionFactory.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredRegionFactory.java
deleted file mode 100644
index 8a98dc2..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredRegionFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.text.XMLStructuredDocumentRegion;
-
-
-/**
- * A simple class to generate instances of StructuredRegions.
- */
-public class XMLStructuredRegionFactory {
-	public final static int JSP_DIRECTIVE = 1003;
-	public final static int XML = 1001;
-	public final static int XML_BLOCK = 1002;
-
-	public static IStructuredDocumentRegion createRegion(int type) {
-		IStructuredDocumentRegion instance = null;
-		switch (type) {
-			case XML :
-				instance = new XMLStructuredDocumentRegion();
-				break;
-			case XML_BLOCK :
-				instance = new BlockStructuredDocumentRegion();
-				break;
-			default :
-				throw new IllegalArgumentException("AbstractRegion::createRegion. Invalid type."); //$NON-NLS-1$
-		}
-		return instance;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java
deleted file mode 100644
index b4607a2..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java
+++ /dev/null
@@ -1,1937 +0,0 @@
-/* The following code was generated by JFlex 1.2.2 on 10/17/07 4:27 AM */
-
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.parser;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTokenizer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.parser.regions.XMLParserRegionFactory;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- * This class is a scanner generated by 
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 10/17/07 4:27 AM from the specification file
- * <tt>file:/D:/eclipse.wtp/workspace/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex</tt>
- */
-public class XMLTokenizer implements BlockTokenizer, DOMRegionContext {
-
-  /** this character denotes the end of file */
-  final public static int YYEOF = -1;
-
-  /** lexical states */
-  final public static int ST_XML_DOCTYPE_EXTERNAL_ID = 23;
-  final public static int ST_XML_ELEMENT_DECLARATION_CONTENT = 27;
-  final public static int ST_DHTML_ATTRIBUTE_NAME = 12;
-  final public static int ST_XML_PI_TAG_CLOSE = 11;
-  final public static int ST_XML_DECLARATION_CLOSE = 21;
-  final public static int ST_XML_PI_ATTRIBUTE_VALUE = 10;
-  final public static int ST_DHTML_EQUALS = 13;
-  final public static int ST_XML_TAG_NAME = 16;
-  final public static int ST_XML_ATTRIBUTE_VALUE = 19;
-  final public static int ST_DHTML_ATTRIBUTE_VALUE = 14;
-  final public static int ST_XML_DOCTYPE_ID_SYSTEM = 25;
-  final public static int ST_XML_ATTRIBUTE_NAME = 17;
-  final public static int ST_XML_ELEMENT_DECLARATION = 26;
-  final public static int ST_XML_DOCTYPE_DECLARATION = 22;
-  final public static int ST_XML_ATTLIST_DECLARATION = 28;
-  final public static int ST_XML_COMMENT_END = 4;
-  final public static int ST_CDATA_TEXT = 1;
-  final public static int ST_DHTML_TAG_CLOSE = 15;
-  final public static int ST_XML_COMMENT = 3;
-  final public static int ST_PI_CONTENT = 7;
-  final public static int ST_PI_WS = 6;
-  final public static int ST_CDATA_END = 2;
-  final public static int ST_XML_ATTLIST_DECLARATION_CONTENT = 29;
-  final public static int ST_BLOCK_TAG_SCAN = 30;
-  final public static int ST_XML_PI_EQUALS = 9;
-  final public static int ST_XML_DECLARATION = 20;
-  final public static int YYINITIAL = 0;
-  final public static int ST_XML_DOCTYPE_ID_PUBLIC = 24;
-  final public static int ST_XML_EQUALS = 18;
-  final public static int ST_PI = 5;
-  final public static int ST_XML_PI_ATTRIBUTE_NAME = 8;
-
-  /** 
-   * Translates characters to character classes
-   */
-  final private static String yycmap_packed = 
-    "\11\0\1\5\1\22\2\0\1\14\22\0\1\14\1\21\1\11\1\55"+
-    "\1\16\1\17\1\12\1\13\1\16\1\16\1\16\1\16\1\16\1\7"+
-    "\1\6\1\3\12\15\1\10\1\61\1\1\1\45\1\2\1\4\1\16"+
-    "\1\34\1\62\1\32\1\33\1\50\1\57\1\36\1\36\1\42\1\36"+
-    "\1\36\1\27\1\25\1\44\1\43\1\47\1\36\1\40\1\56\1\35"+
-    "\1\60\2\36\1\23\1\46\1\36\1\31\1\0\1\20\1\0\1\10"+
-    "\1\0\1\52\1\62\1\63\1\53\1\37\1\57\1\36\1\66\1\42"+
-    "\2\36\1\30\1\26\1\44\1\43\1\47\1\36\1\40\1\41\1\51"+
-    "\1\60\1\36\1\36\1\24\1\54\1\36\1\0\1\0\72\0\1\65"+
-    "\10\0\27\64\1\0\37\64\1\0\72\64\2\0\13\64\2\0\10\64"+
-    "\1\0\65\64\1\0\104\64\11\0\44\64\3\0\2\64\4\0\36\64"+
-    "\70\0\131\64\22\0\7\64\16\0\2\65\56\0\106\65\32\0\2\65"+
-    "\44\0\1\64\1\65\3\64\1\0\1\64\1\0\24\64\1\0\54\64"+
-    "\1\0\7\64\3\0\1\64\1\0\1\64\1\0\1\64\1\0\1\64"+
-    "\1\0\22\64\15\0\14\64\1\0\102\64\1\0\14\64\1\0\44\64"+
-    "\1\0\4\65\11\0\65\64\2\0\2\64\2\0\2\64\3\0\34\64"+
-    "\2\0\10\64\2\0\2\64\67\0\46\64\2\0\1\64\7\0\46\64"+
-    "\12\0\21\65\1\0\27\65\1\0\3\65\1\0\1\65\1\0\2\65"+
-    "\1\0\1\65\13\0\33\64\5\0\3\64\56\0\32\64\5\0\1\65"+
-    "\12\64\10\65\15\0\12\65\6\0\1\65\107\64\2\0\5\64\1\0"+
-    "\17\64\1\0\4\64\1\0\1\64\17\65\2\64\2\65\1\0\4\65"+
-    "\2\0\12\65\u0207\0\3\65\1\0\65\64\2\0\1\65\1\64\20\65"+
-    "\3\0\4\65\3\0\12\64\2\65\2\0\12\65\21\0\3\65\1\0"+
-    "\10\64\2\0\2\64\2\0\26\64\1\0\7\64\1\0\1\64\3\0"+
-    "\4\64\2\0\1\65\1\0\7\65\2\0\2\65\2\0\3\65\11\0"+
-    "\1\65\4\0\2\64\1\0\3\64\2\65\2\0\12\65\2\64\20\0"+
-    "\1\65\2\0\6\64\4\0\2\64\2\0\26\64\1\0\7\64\1\0"+
-    "\2\64\1\0\2\64\1\0\2\64\2\0\1\65\1\0\5\65\4\0"+
-    "\2\65\2\0\3\65\13\0\4\64\1\0\1\64\7\0\12\65\2\65"+
-    "\3\64\14\0\3\65\1\0\7\64\1\0\1\64\1\0\3\64\1\0"+
-    "\26\64\1\0\7\64\1\0\2\64\1\0\5\64\2\0\1\65\1\64"+
-    "\10\65\1\0\3\65\1\0\3\65\22\0\1\64\5\0\12\65\21\0"+
-    "\3\65\1\0\10\64\2\0\2\64\2\0\26\64\1\0\7\64\1\0"+
-    "\2\64\2\0\4\64\2\0\1\65\1\64\6\65\3\0\2\65\2\0"+
-    "\3\65\10\0\2\65\4\0\2\64\1\0\3\64\4\0\12\65\22\0"+
-    "\2\65\1\0\6\64\3\0\3\64\1\0\4\64\3\0\2\64\1\0"+
-    "\1\64\1\0\2\64\3\0\2\64\3\0\3\64\3\0\10\64\1\0"+
-    "\3\64\4\0\5\65\3\0\3\65\1\0\4\65\11\0\1\65\17\0"+
-    "\11\65\21\0\3\65\1\0\10\64\1\0\3\64\1\0\27\64\1\0"+
-    "\12\64\1\0\5\64\4\0\7\65\1\0\3\65\1\0\4\65\7\0"+
-    "\2\65\11\0\2\64\4\0\12\65\22\0\2\65\1\0\10\64\1\0"+
-    "\3\64\1\0\27\64\1\0\12\64\1\0\5\64\4\0\7\65\1\0"+
-    "\3\65\1\0\4\65\7\0\2\65\7\0\1\64\1\0\2\64\4\0"+
-    "\12\65\22\0\2\65\1\0\10\64\1\0\3\64\1\0\27\64\1\0"+
-    "\20\64\4\0\6\65\2\0\3\65\1\0\4\65\11\0\1\65\10\0"+
-    "\2\64\4\0\12\65\221\0\56\64\1\0\1\64\1\65\2\64\7\65"+
-    "\5\0\6\64\1\65\10\65\1\0\12\65\47\0\2\64\1\0\1\64"+
-    "\2\0\2\64\1\0\1\64\2\0\1\64\6\0\4\64\1\0\7\64"+
-    "\1\0\3\64\1\0\1\64\1\0\1\64\2\0\2\64\1\0\2\64"+
-    "\1\0\1\64\1\65\2\64\6\65\1\0\2\65\1\64\2\0\5\64"+
-    "\1\0\1\65\1\0\6\65\2\0\12\65\76\0\2\65\6\0\12\65"+
-    "\13\0\1\65\1\0\1\65\1\0\1\65\4\0\2\65\10\64\1\0"+
-    "\41\64\7\0\24\65\1\0\6\65\4\0\6\65\1\0\1\65\1\0"+
-    "\25\65\3\0\7\65\1\0\1\65\346\0\46\64\12\0\47\64\11\0"+
-    "\1\64\1\0\2\64\1\0\3\64\1\0\1\64\1\0\2\64\1\0"+
-    "\5\64\51\0\1\64\1\0\1\64\1\0\1\64\13\0\1\64\1\0"+
-    "\1\64\1\0\1\64\3\0\2\64\3\0\1\64\5\0\3\64\1\0"+
-    "\1\64\1\0\1\64\1\0\1\64\1\0\1\64\3\0\2\64\3\0"+
-    "\2\64\1\0\1\64\50\0\1\64\11\0\1\64\2\0\1\64\2\0"+
-    "\2\64\7\0\2\64\1\0\1\64\1\0\7\64\50\0\1\64\4\0"+
-    "\1\64\10\0\1\64\u0c06\0\234\64\4\0\132\64\6\0\26\64\2\0"+
-    "\6\64\2\0\46\64\2\0\6\64\2\0\10\64\1\0\1\64\1\0"+
-    "\1\64\1\0\1\64\1\0\37\64\2\0\65\64\1\0\7\64\1\0"+
-    "\1\64\3\0\3\64\1\0\7\64\3\0\4\64\2\0\6\64\4\0"+
-    "\15\64\5\0\3\64\1\0\7\64\323\0\15\65\4\0\1\65\104\0"+
-    "\1\64\3\0\2\64\2\0\1\64\121\0\3\64\u0e82\0\1\65\1\0"+
-    "\1\64\31\0\11\64\6\65\1\0\5\65\13\0\124\64\4\0\2\65"+
-    "\2\0\2\65\2\0\132\64\1\0\3\65\6\0\50\64\u1cd3\0\u51a6\64"+
-    "\u0c5a\0\u2ba4\64\134\0\u0800\0\u1ffe\0\2\0";
-
-  /** 
-   * Translates characters to character classes
-   */
-  final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
-
-  /** 
-   * Translates a state to a row index in the transition table
-   */
-  final private static int yy_rowMap [] = { 
-        0,    55,   110,   165,   220,   275,   330,   385,   440,   495, 
-      550,   605,   660,   715,   770,   825,   880,   935,   990,  1045, 
-     1100,  1155,  1210,  1265,  1320,  1375,  1430,  1485,  1540,  1595, 
-     1650,  1705,  1760,  1815,  1870,  1925,  1980,  1925,  1980,  2035, 
-     1925,  1925,  1980,  2090,  2145,  2200,  2255,  2310,  2365,  2420, 
-     2475,  1925,  1980,  2530,  2585,  2640,  1925,  2695,  2695,  2750, 
-     2805,  2860,  2530,  1925,  2915,  2970,  1925,  3025,  3080,  3135, 
-     3190,  3245,  3300,  1925,  3355,  3410,  3465,  3520,  1925,  3575, 
-     3630,  3685,  3740,  3795,  1925,  3850,  3905,  3960,  4015,  4070, 
-     4125,  4180,  4235,  4235,  4290,  4345,  4400,  4455,  4455,  4510, 
-     4565,  4620,  4675,  4675,  4730,  4785,  4840,  4895,  1925,  4950, 
-     4950,  5005,  5060,  5115,  5170,  1925,  1925,  1980,  1925,  1925, 
-     5225,  5280,  5335,  5390,  5445,  5500,  5555,  5610,  1925,  5665, 
-     5720,  5775,  1925,  1925,  2695,  5830,  2805,  1925,  5885,  2860, 
-     2915,  3025,  3080,  5940,  3135,  1925,  5995,  3190,  1925,  3575, 
-     6050,  3685,  1925,  6105,  3740,  5225,  6160,  6215,  6270,  4015, 
-     1925,  6325,  6380,  4235,  6435,  4290,  1925,  6490,  6545,  6600, 
-     6600,  6655,  6710,  4400,  4235,  4455,  6765,  4510,  1925,  6820, 
-     4565,  4620,  4455,  4675,  6875,  4730,  1925,  6930,  6985,  7040, 
-     7040,  7095,  7150,  7205,  4950,  7260,  5005,  1925,  7315,  7370, 
-     7425,  7425,  7480,  7535,  7590,  7645,  7700,  7755,  7810,  1925, 
-     7865,  7920,  1925,  1925,  1925,  2255,  7975,  8030,  8085,  8140, 
-     8195,  8250,  8305,  6490,  8360,  8360,  6930,  8415,  8415,  8470, 
-     7315,  8525,  8525,  8580,  1925,  8635,  8690,  1925,  8745,  8800, 
-     8855,  8910,  8965,  9020,  9075,  9130,  6655,  7095,  9185,  7480, 
-     9240,  9295,  9350,  9405,  9460,  9515,  9570,  9625,  9680,  9735, 
-     9790,  9845,  9900,  9955, 10010, 10065, 10120,  1925,  1925, 10175, 
-    10230, 10285, 10340, 10395,  1925,  1925,  1925, 10450, 10505, 10560, 
-    10615, 10670, 10725,  1925, 10780,  4840,  5115, 10835, 10890, 10945, 
-    11000,  2255
-  };
-
-  /** 
-   * The packed transition table of the DFA
-   */
-  final private static String yy_packed = 
-    "\1\40\1\41\10\40\1\42\4\40\1\43\47\40\1\44"+
-    "\1\45\65\44\1\46\1\47\16\46\1\50\1\46\1\51"+
-    "\44\46\1\52\1\53\65\52\1\46\1\47\5\46\1\54"+
-    "\12\46\1\51\45\46\1\47\2\46\1\55\1\56\2\46"+
-    "\1\57\3\46\1\56\5\46\1\56\1\60\1\61\4\57"+
-    "\1\46\10\57\1\62\2\57\1\46\7\57\1\46\3\57"+
-    "\1\46\3\57\1\46\1\57\1\46\1\47\2\46\1\55"+
-    "\1\63\6\46\1\63\5\46\1\63\44\46\1\64\1\65"+
-    "\2\64\1\66\15\64\1\51\44\64\1\46\1\47\2\46"+
-    "\1\67\1\56\2\46\1\70\3\46\1\56\5\46\1\56"+
-    "\6\70\1\46\13\70\1\46\7\70\1\46\3\70\1\46"+
-    "\3\70\1\46\1\70\1\46\1\47\2\46\1\67\1\56"+
-    "\2\46\1\70\3\46\1\56\5\46\1\56\6\70\1\46"+
-    "\13\70\1\71\7\70\1\46\3\70\1\46\3\70\1\46"+
-    "\1\70\1\72\1\47\1\46\1\73\1\74\1\56\3\72"+
-    "\1\75\1\72\1\76\1\56\5\72\1\56\44\72\1\46"+
-    "\1\47\2\46\1\77\15\46\1\51\45\46\1\47\1\100"+
-    "\1\101\1\46\1\56\2\46\1\102\3\46\1\56\5\46"+
-    "\1\56\6\102\1\46\13\102\1\46\7\102\1\46\3\102"+
-    "\1\46\3\102\1\46\1\102\1\46\1\47\1\100\1\101"+
-    "\1\46\1\56\2\46\1\102\3\46\1\56\5\46\1\56"+
-    "\6\102\1\46\13\102\1\103\7\102\1\46\3\102\1\46"+
-    "\3\102\1\46\1\102\1\104\1\47\1\100\1\105\1\104"+
-    "\1\56\3\104\1\106\1\104\1\107\1\56\5\104\1\56"+
-    "\44\104\1\46\1\47\3\46\1\56\6\46\1\56\5\46"+
-    "\1\56\44\46\1\110\1\111\1\112\1\113\4\110\1\114"+
-    "\12\110\6\115\1\110\13\115\1\110\7\115\1\110\3\115"+
-    "\1\110\3\115\1\110\1\115\1\46\1\111\1\112\1\113"+
-    "\1\46\1\56\2\46\1\116\3\46\1\56\5\46\1\56"+
-    "\6\116\1\46\13\116\1\46\7\116\1\46\3\116\1\46"+
-    "\3\116\1\46\1\116\1\46\1\111\1\112\1\113\1\46"+
-    "\1\56\2\46\1\116\3\46\1\56\5\46\1\56\6\116"+
-    "\1\46\13\116\1\117\7\116\1\46\3\116\1\46\3\116"+
-    "\1\46\1\116\1\120\1\111\1\112\1\121\1\120\1\56"+
-    "\3\120\1\122\1\120\1\123\1\56\5\120\1\56\44\120"+
-    "\1\46\1\124\1\125\2\46\1\56\6\46\1\56\5\46"+
-    "\1\56\10\46\1\126\1\127\2\46\1\130\10\46\1\130"+
-    "\1\46\1\127\1\126\14\46\1\47\1\125\2\46\1\56"+
-    "\6\46\1\56\5\46\1\56\6\46\1\131\36\46\1\47"+
-    "\1\125\2\46\1\56\2\46\1\132\3\46\1\56\5\46"+
-    "\1\56\6\132\1\131\13\132\1\46\7\132\1\46\3\132"+
-    "\1\46\3\132\1\46\1\132\1\46\1\47\1\125\2\46"+
-    "\1\56\6\46\1\56\5\46\1\56\6\46\1\131\7\46"+
-    "\1\133\5\46\1\134\6\46\1\133\10\46\1\135\1\47"+
-    "\1\125\1\136\1\135\1\56\3\135\1\137\1\135\1\140"+
-    "\1\56\5\135\1\56\6\135\1\141\35\135\1\142\1\47"+
-    "\1\125\1\143\1\142\1\56\3\142\1\144\1\142\1\145"+
-    "\1\56\5\142\1\56\6\142\1\146\35\142\1\147\1\47"+
-    "\1\125\1\150\1\147\1\56\3\147\1\151\1\147\1\152"+
-    "\1\56\5\147\1\56\44\147\1\153\1\154\1\155\64\153"+
-    "\1\156\1\47\1\125\1\157\1\156\1\56\3\156\1\160"+
-    "\1\156\1\161\1\56\5\156\1\56\44\156\1\162\1\163"+
-    "\1\164\64\162\1\165\1\166\65\165\1\40\1\0\10\40"+
-    "\1\0\4\40\1\0\47\40\3\0\1\167\1\170\14\0"+
-    "\1\171\52\0\1\172\2\0\1\173\3\0\1\172\5\0"+
-    "\1\172\6\173\1\0\13\173\1\0\7\173\1\174\3\173"+
-    "\1\0\3\173\1\0\1\173\5\0\1\172\2\0\1\175"+
-    "\3\0\1\172\5\0\1\172\6\175\1\0\13\175\1\0"+
-    "\7\175\1\0\3\175\1\0\3\175\1\0\1\175\110\0"+
-    "\1\176\65\0\1\177\55\0\1\200\61\0\1\201\71\0"+
-    "\1\56\6\0\1\56\5\0\1\56\52\0\3\57\4\0"+
-    "\1\57\5\0\6\57\1\0\13\57\1\0\7\57\1\0"+
-    "\3\57\1\0\5\57\6\0\3\57\4\0\1\57\5\0"+
-    "\2\57\2\202\2\57\1\0\13\57\1\0\7\57\1\0"+
-    "\3\57\1\0\5\57\6\0\3\57\4\0\1\57\5\0"+
-    "\2\57\1\202\1\203\2\57\1\0\13\57\1\0\7\57"+
-    "\1\0\3\57\1\0\5\57\6\0\3\57\4\0\1\57"+
-    "\5\0\2\57\2\204\2\57\1\0\13\57\1\0\7\57"+
-    "\1\0\3\57\1\0\5\57\5\0\1\63\6\0\1\63"+
-    "\5\0\1\63\46\0\1\205\66\0\1\206\72\0\3\70"+
-    "\4\0\1\70\5\0\6\70\1\0\13\70\1\0\7\70"+
-    "\1\0\3\70\1\0\5\70\1\72\2\0\1\207\1\72"+
-    "\1\0\3\72\1\0\1\72\2\0\5\72\1\0\45\72"+
-    "\1\0\1\206\1\207\1\72\1\0\3\72\1\0\1\72"+
-    "\2\0\5\72\1\0\44\72\1\75\1\0\1\210\1\211"+
-    "\1\75\1\210\3\75\1\212\1\75\2\210\5\75\1\210"+
-    "\44\75\1\76\1\0\1\213\1\214\1\76\1\213\3\76"+
-    "\1\213\1\76\1\212\1\213\5\76\1\213\44\76\2\0"+
-    "\1\100\1\215\71\0\3\102\4\0\1\102\5\0\6\102"+
-    "\1\0\13\102\1\0\7\102\1\0\3\102\1\0\5\102"+
-    "\1\104\2\0\1\216\1\104\1\0\3\104\1\0\1\104"+
-    "\2\0\5\104\1\0\45\104\1\0\1\100\1\217\1\104"+
-    "\1\0\3\104\1\0\1\104\2\0\5\104\1\0\44\104"+
-    "\1\106\1\0\1\220\1\221\1\106\1\220\3\106\1\222"+
-    "\1\106\2\220\5\106\1\220\44\106\1\107\1\0\1\223"+
-    "\1\224\1\107\1\223\3\107\1\223\1\107\1\222\1\223"+
-    "\5\107\1\223\44\107\1\110\3\0\17\110\6\0\1\110"+
-    "\13\0\1\110\7\0\1\110\3\0\1\110\3\0\1\110"+
-    "\4\0\1\167\15\0\1\171\47\0\1\225\64\0\1\110"+
-    "\3\0\2\110\3\114\4\110\1\114\5\110\6\115\1\110"+
-    "\13\115\1\110\7\115\1\110\3\115\1\110\3\115\1\114"+
-    "\1\115\6\0\3\115\4\0\1\115\5\0\6\115\1\0"+
-    "\13\115\1\0\7\115\1\0\3\115\1\0\5\115\6\0"+
-    "\3\116\4\0\1\116\5\0\6\116\1\0\13\116\1\0"+
-    "\7\116\1\0\3\116\1\0\5\116\1\120\2\0\1\226"+
-    "\1\120\1\0\3\120\1\0\1\120\2\0\5\120\1\0"+
-    "\45\120\1\0\1\225\1\226\1\120\1\0\3\120\1\0"+
-    "\1\120\2\0\5\120\1\0\44\120\1\122\1\0\1\227"+
-    "\1\230\1\122\1\227\3\122\1\231\1\122\2\227\5\122"+
-    "\1\227\44\122\1\123\1\0\1\232\1\233\1\123\1\232"+
-    "\3\123\1\232\1\123\1\231\1\232\5\123\1\232\44\123"+
-    "\3\0\1\167\15\0\1\234\110\0\1\235\60\0\1\236"+
-    "\13\0\1\236\44\0\2\237\36\0\20\240\1\241\46\240"+
-    "\6\0\3\132\4\0\1\132\5\0\6\132\1\0\13\132"+
-    "\1\0\7\132\1\0\3\132\1\0\5\132\46\0\1\242"+
-    "\5\0\1\242\72\0\1\243\6\0\1\135\2\0\1\244"+
-    "\1\135\1\0\3\135\1\0\1\135\2\0\5\135\1\0"+
-    "\44\135\1\137\1\0\1\245\1\246\1\137\1\245\3\137"+
-    "\1\247\1\137\2\245\5\137\1\245\44\137\1\250\1\0"+
-    "\1\251\1\252\1\253\1\251\3\253\1\251\1\250\1\254"+
-    "\1\255\3\253\1\250\1\253\1\255\6\253\1\250\32\253"+
-    "\2\250\1\253\1\141\2\240\1\256\1\141\1\240\3\141"+
-    "\1\240\1\141\2\240\3\141\1\257\1\141\1\240\44\141"+
-    "\1\142\2\0\1\260\1\142\1\0\3\142\1\0\1\142"+
-    "\2\0\5\142\1\0\44\142\1\144\2\261\1\262\1\144"+
-    "\1\261\3\144\1\263\1\144\2\261\5\144\1\261\44\144"+
-    "\1\145\2\264\1\265\1\145\1\264\3\145\1\264\1\145"+
-    "\1\263\1\264\5\145\1\264\44\145\1\146\2\240\1\266"+
-    "\1\146\1\240\3\146\1\240\1\146\2\240\3\146\1\267"+
-    "\1\146\1\240\44\146\1\147\2\0\1\270\1\147\1\0"+
-    "\3\147\1\0\1\147\2\0\5\147\1\0\44\147\1\151"+
-    "\1\0\1\271\1\272\1\151\1\271\3\151\1\273\1\151"+
-    "\2\271\5\151\1\271\44\151\1\274\1\0\1\275\1\276"+
-    "\1\277\1\275\3\277\1\275\1\274\1\300\1\301\3\277"+
-    "\1\274\1\277\1\301\6\277\1\274\32\277\2\274\1\277"+
-    "\2\153\1\0\66\153\1\0\16\153\1\302\45\153\1\156"+
-    "\2\0\1\303\1\156\1\0\3\156\1\0\1\156\2\0"+
-    "\5\156\1\0\44\156\1\160\1\0\1\304\1\305\1\160"+
-    "\1\304\3\160\1\306\1\160\2\304\5\160\1\304\44\160"+
-    "\1\307\1\0\1\310\1\311\1\312\1\310\3\312\1\310"+
-    "\1\307\1\313\1\314\3\312\1\307\1\312\1\314\6\312"+
-    "\1\307\32\312\2\307\1\312\2\162\1\0\66\162\1\0"+
-    "\16\162\1\315\45\162\7\0\1\316\21\0\1\317\42\0"+
-    "\1\172\2\0\1\40\3\0\1\172\5\0\1\172\6\40"+
-    "\1\0\13\40\1\0\7\40\1\0\3\40\1\0\3\40"+
-    "\1\0\1\40\1\320\1\0\3\320\1\321\3\173\1\320"+
-    "\1\0\1\320\1\321\1\173\1\320\1\0\2\320\1\321"+
-    "\6\173\1\320\13\173\1\320\7\173\1\320\3\173\1\322"+
-    "\5\173\15\0\1\323\6\0\1\324\42\0\1\320\1\0"+
-    "\3\320\1\321\3\175\1\320\1\0\1\320\1\321\1\175"+
-    "\1\320\1\0\2\320\1\321\6\175\1\320\13\175\1\320"+
-    "\7\175\1\320\3\175\1\325\5\175\31\0\1\317\37\0"+
-    "\1\326\66\0\1\327\72\0\3\57\4\0\1\57\5\0"+
-    "\4\57\2\330\1\0\13\57\1\0\7\57\1\0\3\57"+
-    "\1\0\5\57\6\0\3\57\4\0\1\57\5\0\4\57"+
-    "\1\330\1\331\1\0\13\57\1\0\7\57\1\0\3\57"+
-    "\1\0\5\57\6\0\3\57\4\0\1\57\5\0\6\57"+
-    "\1\0\13\57\1\0\1\57\1\332\5\57\1\0\3\57"+
-    "\1\0\5\57\1\210\1\0\7\210\1\212\55\210\1\213"+
-    "\1\0\11\213\1\212\53\213\1\220\1\0\7\220\1\222"+
-    "\55\220\1\223\1\0\11\223\1\222\53\223\1\227\1\0"+
-    "\7\227\1\231\55\227\1\232\1\0\11\232\1\231\53\232"+
-    "\32\0\1\333\30\0\1\333\40\0\1\334\13\0\1\334"+
-    "\54\0\1\335\10\0\1\335\57\0\1\336\14\0\1\336"+
-    "\72\0\1\337\4\0\1\245\1\0\7\245\1\247\55\245"+
-    "\1\250\1\0\1\251\1\340\1\250\1\251\3\250\1\251"+
-    "\1\250\1\247\1\251\5\250\1\251\44\250\1\251\1\0"+
-    "\11\251\1\247\53\251\1\250\1\0\1\251\1\340\1\250"+
-    "\1\251\3\250\1\251\1\250\1\341\1\251\5\250\1\251"+
-    "\44\250\13\0\1\342\53\0\1\251\1\0\11\251\1\341"+
-    "\53\251\11\261\1\263\55\261\13\264\1\263\53\264\1\271"+
-    "\1\0\7\271\1\273\55\271\1\274\1\0\1\275\1\343"+
-    "\1\274\1\275\3\274\1\275\1\274\1\273\1\275\5\274"+
-    "\1\275\44\274\1\275\1\0\11\275\1\273\53\275\1\274"+
-    "\1\0\1\275\1\343\1\274\1\275\3\274\1\275\1\274"+
-    "\1\344\1\275\5\274\1\275\44\274\13\0\1\345\53\0"+
-    "\1\275\1\0\11\275\1\344\53\275\2\153\1\0\26\153"+
-    "\1\346\35\153\1\304\1\0\7\304\1\306\55\304\1\307"+
-    "\1\0\1\310\1\347\1\307\1\310\3\307\1\310\1\307"+
-    "\1\306\1\310\5\307\1\310\44\307\1\310\1\0\11\310"+
-    "\1\306\53\310\1\307\1\0\1\310\1\347\1\307\1\310"+
-    "\3\307\1\310\1\307\1\350\1\310\5\307\1\310\44\307"+
-    "\13\0\1\351\53\0\1\310\1\0\11\310\1\350\53\310"+
-    "\2\162\1\0\26\162\1\352\35\162\7\0\1\353\111\0"+
-    "\1\354\34\0\1\320\1\0\10\320\1\0\4\320\1\0"+
-    "\41\320\1\0\6\320\1\0\3\320\1\321\4\320\1\0"+
-    "\1\320\1\321\2\320\1\0\2\320\1\321\36\320\1\355"+
-    "\5\320\15\0\1\323\43\0\1\356\22\0\1\357\14\0"+
-    "\3\357\2\0\1\357\10\0\1\357\1\0\2\357\3\0"+
-    "\1\357\2\0\2\357\11\0\1\57\1\360\1\57\4\0"+
-    "\1\57\5\0\6\57\1\0\13\57\1\0\7\57\1\0"+
-    "\3\57\1\0\5\57\6\0\3\57\4\0\1\57\5\0"+
-    "\6\57\1\0\11\57\1\361\1\57\1\0\7\57\1\0"+
-    "\3\57\1\0\5\57\35\0\1\362\13\0\1\362\44\0"+
-    "\2\363\63\0\2\364\75\0\1\365\13\0\1\365\44\0"+
-    "\2\366\41\0\2\367\1\0\3\367\2\0\1\254\4\367"+
-    "\1\0\10\367\1\0\32\367\2\0\1\367\3\0\2\370"+
-    "\1\0\3\370\2\0\1\300\4\370\1\0\10\370\1\0"+
-    "\32\370\2\0\1\370\2\153\1\0\27\153\1\371\34\153"+
-    "\3\0\2\372\1\0\3\372\2\0\1\313\4\372\1\0"+
-    "\10\372\1\0\32\372\2\0\1\372\2\162\1\0\27\162"+
-    "\1\373\34\162\33\0\1\374\114\0\1\355\22\0\1\357"+
-    "\14\0\3\357\2\0\1\357\10\0\1\357\1\0\2\357"+
-    "\3\0\1\357\1\0\1\356\2\357\11\0\3\57\4\0"+
-    "\1\57\5\0\6\57\1\0\7\57\1\375\3\57\1\0"+
-    "\7\57\1\0\3\57\1\0\5\57\6\0\3\57\4\0"+
-    "\1\57\5\0\6\57\1\0\6\57\1\376\4\57\1\0"+
-    "\7\57\1\0\3\57\1\0\5\57\46\0\1\377\5\0"+
-    "\1\377\54\0\1\u0100\63\0\1\u0101\10\0\1\u0101\55\0"+
-    "\1\u0102\10\0\1\u0102\60\0\1\u0103\24\0\2\153\1\0"+
-    "\30\153\1\u0104\33\153\2\162\1\0\30\162\1\u0105\33\162"+
-    "\34\0\1\u0106\40\0\3\57\4\0\1\57\5\0\6\57"+
-    "\1\0\13\57\1\0\3\57\1\u0107\3\57\1\0\3\57"+
-    "\1\0\5\57\6\0\3\57\4\0\1\57\5\0\6\57"+
-    "\1\0\3\57\1\u0108\7\57\1\0\3\57\1\u0108\3\57"+
-    "\1\0\3\57\1\0\5\57\47\0\1\u0109\60\0\1\u010a"+
-    "\14\0\1\u010a\54\0\1\u010b\47\0\2\u010c\72\0\1\u010d"+
-    "\30\0\1\u010d\3\0\2\153\1\0\31\153\1\u010e\32\153"+
-    "\2\162\1\0\31\162\1\u010f\32\162\35\0\1\u0110\37\0"+
-    "\3\57\4\0\1\57\5\0\6\57\1\0\13\57\1\0"+
-    "\6\57\1\u0111\1\0\3\57\1\0\5\57\5\0\1\u0112"+
-    "\3\57\3\0\1\u0112\1\57\4\0\1\u0112\6\57\1\0"+
-    "\13\57\1\0\7\57\1\0\3\57\1\0\5\57\37\0"+
-    "\1\u0113\10\0\1\u0113\53\0\1\u0114\13\0\1\u0114\52\0"+
-    "\1\u0115\13\0\1\u0115\15\0\2\153\1\0\32\153\1\u0116"+
-    "\31\153\2\162\1\0\32\162\1\u0117\31\162\34\0\1\u0118"+
-    "\40\0\3\57\4\0\1\57\5\0\5\57\1\u0119\1\0"+
-    "\13\57\1\0\7\57\1\0\3\57\1\0\5\57\5\0"+
-    "\1\u0112\6\0\1\u0112\5\0\1\u0112\44\0\2\153\1\0"+
-    "\31\153\1\u011a\32\153\2\162\1\0\31\162\1\u011b\32\162"+
-    "\31\0\1\u011c\43\0\3\57\4\0\1\57\5\0\6\57"+
-    "\1\0\5\57\1\u011d\5\57\1\0\7\57\1\0\3\57"+
-    "\1\0\5\57\2\153\1\0\26\153\1\u011e\35\153\2\162"+
-    "\1\0\26\162\1\u011f\35\162\6\0\3\57\4\0\1\57"+
-    "\5\0\6\57\1\0\7\57\1\u0120\3\57\1\0\7\57"+
-    "\1\0\3\57\1\0\5\57\6\0\3\57\4\0\1\57"+
-    "\5\0\6\57\1\0\13\57\1\0\7\57\1\0\3\57"+
-    "\1\0\4\57\1\u0121\6\0\3\57\4\0\1\57\5\0"+
-    "\6\57\1\0\5\57\1\u0122\5\57\1\0\7\57\1\0"+
-    "\3\57\1\0\5\57\6\0\3\57\4\0\1\57\5\0"+
-    "\6\57\1\0\5\57\1\u0123\5\57\1\0\7\57\1\0"+
-    "\3\57\1\0\5\57\6\0\3\57\4\0\1\57\5\0"+
-    "\6\57\1\0\13\57\1\0\3\57\1\u0124\3\57\1\0"+
-    "\3\57\1\0\5\57";
-
-  /** 
-   * The transition table of the DFA
-   */
-  final private static int yytrans [] = yy_unpack(yy_packed);
-
-
-  /* error codes */
-  final private static int YY_UNKNOWN_ERROR = 0;
-  // final private static int YY_ILLEGAL_STATE = 1;
-  final private static int YY_NO_MATCH = 2;
-  final private static int YY_PUSHBACK_2BIG = 3;
-
-  /* error messages for the codes above */
-  final private static String YY_ERROR_MSG[] = {
-    "Unkown internal scanner error",		//$NON-NLS-1$
-    "Internal error: unknown state",		//$NON-NLS-1$
-    "Error: could not match input",		//$NON-NLS-1$
-    "Error: pushback value was too large"	//$NON-NLS-1$
-  };
-
-  /**
-   * YY_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
-   */
-  private final static byte YY_ATTRIBUTE[] = {
-     1,  0,  0,  0,  0,  1,  0,  0,  1,  1,  1,  0,  1,  1,  1,  1, 
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  1, 
-     1,  1,  1,  9,  1,  9,  1,  1,  9,  9,  1,  1,  1,  1,  1,  1, 
-     1,  1,  1,  9,  1,  1,  1,  1,  9,  1,  1,  1,  1,  1,  1,  9, 
-     1,  1,  9,  1,  1,  1,  1,  1,  1,  9,  1,  1,  1,  1,  9,  1, 
-     1,  1,  1,  1,  9,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  9,  1,  1,  1, 
-     1,  1,  1,  9,  9,  1,  9,  9,  1,  0,  1,  0,  1,  0,  0,  0, 
-     9,  1,  1,  1,  9,  9,  0,  0,  0,  9,  0,  0,  0,  0,  0,  0, 
-     0,  9,  0,  0,  9,  0,  0,  0,  9,  0,  0,  0,  0,  0,  0,  0, 
-     9,  0,  0,  0,  0,  0,  9,  1,  0,  0,  1,  1,  0,  0,  1,  0, 
-     0,  0,  9,  0,  0,  0,  1,  0,  0,  0,  9,  1,  0,  0,  1,  1, 
-     0,  1,  0,  0,  0,  9,  1,  0,  0,  1,  1,  0,  1,  0,  0,  1, 
-     1,  9,  0,  0,  9,  9,  9,  1,  1,  1,  0,  0,  0,  0,  0,  0, 
-     1,  0,  0,  1,  0,  1,  0,  1,  0,  1,  9,  0,  1,  9,  0,  1, 
-     1,  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  1,  1,  0,  0, 
-     0,  0,  0,  1,  1,  0,  1,  1,  0,  0,  0,  9,  9,  1,  1,  0, 
-     1,  1,  9,  9,  9,  1,  1,  0,  1,  1,  1,  9,  1,  1,  1,  1, 
-     1,  1,  1,  1
-  };
-
-  /** the input device */
-  private java.io.Reader yy_reader;
-
-  /** the current state of the DFA */
-  private int yy_state;
-
-  /** the current lexical state */
-  private int yy_lexical_state = YYINITIAL;
-
-  /** this buffer contains the current text to be matched and is
-      the source of the yytext() string */
-  private char yy_buffer[] = new char[16384];
-
-  /** the textposition at the last accepting state */
-  private int yy_markedPos;
-
-  /** the textposition at the last state to be included in yytext */
-  private int yy_pushbackPos;
-
-  /** the current text position in the buffer */
-  private int yy_currentPos;
-
-  /** startRead marks the beginning of the yytext() string in the buffer */
-  private int yy_startRead;
-
-  /** endRead marks the last character in the buffer, that has been read
-      from input */
-  private int yy_endRead;
-
-  /** number of newlines encountered up to the start of the matched text */
-  private int yyline;
-
-  /** the number of characters up to the start of the matched text */
-  private int yychar;
-
-  /**
-   * the number of characters from the last newline up to the start of the 
-   * matched text
-   */
-  // private int yycolumn; 
-
-  /** 
-   * yy_atBOL == true <=> the scanner is currently at the beginning of a line
-   */
-  // private boolean yy_atBOL;
-
-  /** yy_atEOF == true <=> the scanner has returned a value for EOF */
-  private boolean yy_atEOF;
-
-  /** denotes if the user-EOF-code has already been executed */
-  private boolean yy_eof_done;
-
-  /* user code: */
-	private int fTokenCount = 0;
- 
-	// required holders for white-space compacting
-	private boolean fShouldLoadBuffered = false;
-	private String fBufferedContext = null;
-	private int fBufferedStart = 1;
-	private int fBufferedLength = 0;
-	private String f_context = null;
-
-	// state stack for handling embedded regions
-	private IntStack fStateStack = new IntStack();
-
-	private String context = null;
-	private int start = 0;
-	private int textLength = 0;
-	private int length = 0;
-
-	// offset for tracking position specific block tags
-	private int fOffset = 0;
-	
-	// the name of the current tag being opened
-	private String fCurrentTagName = null;
-
-	// the list of tag name BlockMarkers
-	private List fBlockMarkers = new ArrayList();
-
-	// required to not seek text blocks on an end tag
-	private boolean fIsBlockingEnabled = false;
-	private boolean fIsCaseSensitiveBlocking = true;
-
-	private XMLParserRegionFactory fRegionFactory = new XMLParserRegionFactory();
-/**
- * user method 
- */
-public final void addBlockMarker(BlockMarker marker) {
-	if(containsTagName(marker.getTagName()))
-		return;
-	fBlockMarkers.add(marker);
-}
-/**
- * user method 
- */
-public final void removeBlockMarker(BlockMarker marker) {
-	fBlockMarkers.remove(marker);
-}
-/**
- * user method 
- */
-public final void removeBlockMarker(String tagname) {
-	if (fBlockMarkers != null) {
-		Iterator blocks = fBlockMarkers.iterator();
-		while (blocks.hasNext()) {
-			if (((BlockMarker) blocks.next()).getTagName().equals(tagname))
-				blocks.remove();
-		}
-	}
-}
-/* user method */
-public final boolean isCaseSensitiveBlocking() {
-	return fIsCaseSensitiveBlocking;
-}
-/* user method */
-public final void setCaseSensitiveBlocking(boolean newValue) {
-	fIsCaseSensitiveBlocking = newValue;
-}
-/* user method */
-public boolean getBlockMarkerCaseSensitivity() {
-        return getBlockMarkerCaseSensitivity(fCurrentTagName);
-}
-/* user method */
-public boolean getBlockMarkerCaseSensitivity(String name) {
-	Iterator iterator = fBlockMarkers.iterator();
-	while(iterator.hasNext()) {
-		BlockMarker marker = (BlockMarker)iterator.next();
-		boolean casesensitive = marker.isCaseSensitive();
-		if(casesensitive && marker.getTagName().equals(name))
-			return casesensitive;
-		else if(!casesensitive && marker.getTagName().equalsIgnoreCase(name))
-			return casesensitive;
-	}
-	return true;
-}
-/* user method */
-public String getBlockMarkerContext() {
-	return getBlockMarkerContext(fCurrentTagName);
-}
-/* user method */
-public String getBlockMarkerContext(String name) {
-	Iterator iterator = fBlockMarkers.iterator();
-	while(iterator.hasNext()) {
-		BlockMarker marker = (BlockMarker)iterator.next();
-		if(marker.getTagName().equals(name))
-			return marker.getContext();
-	}
-	return BLOCK_TEXT;
-}
-/* user method */
-public List getBlockMarkers() {
-	return fBlockMarkers;
-}
-/* user method */
-public final int getOffset() {
-	return fOffset + yychar;
-}
-private final boolean isBlockMarker() {
-	return isBlockMarker(fCurrentTagName);
-}
-private final boolean isBlockMarker(String tagName) {
-	if (!fIsBlockingEnabled)
-		return false;
-	return containsTagName(tagName);
-}
-/**
- * user method
- */
-public final void beginBlockTagScan(String newTagName) {
-	beginBlockMarkerScan(newTagName, BLOCK_TEXT);
-}
-/**
- * user method
- *
- * Special tokenizer setup.  Allows tokenization to be initiated at the
- * start of a text block within a "newTagName" tag.
- *
- * Example: 
- *	Tokenizer toker = new Tokenizer();
- *	toker.setCaseSensitiveBlocking(false);
- *	toker.reset(new java.io.StringReader("afiuhqwkejhtasihgalkwhtq</scripter></scr></script>asgdasga"));
- *	toker.beginBlockMarkerScan("script", BLOCK_TEXT);
- *	toker.getRegions(); 
- *
- * Returns:
- *	BLOCK_TEXT: 0-40
- *	XML_END_TAG_OPEN: 41-42
- *	XML_TAG_NAME: 43-48
- *	XML_TAG_CLOSE: 49-49
- *	XML_CONTENT: 50-57
- *
- */
-public final void beginBlockMarkerScan(String newTagName, String blockcontext) {
-	yybegin(ST_BLOCK_TAG_SCAN);
-	fCurrentTagName = newTagName;
-}
-/**
- * Method doScan.
- * 
- * Returns a context region for all of the text from the current position upto the end of input or
- * to right *before* the first occurence of searchString
- * 
- * @param searchString - target string to search for ex.: "-->", "</tagname"
- * @param requireTailSeparator - whether the target must be immediately followed by whitespace or '>'
- * @param context - the context of the scanned region if non-zero length
- * @param exitState - the state to go to if the region was of non-zero length
- * @param abortState - the state to go to if the searchString was found immediately
- * @return String - the context found: the desired context on a non-zero length match, the abortContext on immediate success
- * @throws IOException
- */
-private final String doScan(String searchString, boolean requireTailSeparator, String searchContext, int exitState, int immediateFallbackState) throws IOException {
-	boolean stillSearching = true;
-	// Disable further block (probably)
-	fIsBlockingEnabled = false;
-	int searchStringLength = searchString.length();
-	int n = 0;
-	char lastCheckChar;
-	int i;
-	boolean same = false;
-	while (stillSearching) {
-		n = 0;
-		// Ensure that enough data from the input exists to compare against the search String.
-		n = yy_advance();
-		while(n != YYEOF && yy_currentPos < searchStringLength)
-			n = yy_advance();
-		// If the input was too short or we've exhausted the input, stop immediately.
-		if (n == YYEOF) {
-			stillSearching = false;
-		}
-		else {
-			same = true;
-			// Ensure that we've not encountered a complete block (<%%>) that was *shorter* than the closeTagString and
-			// thus found twice at current-targetLength [since the first scan would have come out this far anyway].
-			// Check the characters in the target versus the last targetLength characters read from the buffer
-			// and see if it matches
-			
-			// safety check for array accesses (yy_currentPos is the *last* character we can check against)
-			if(yy_currentPos >= searchStringLength && yy_currentPos <= yy_buffer.length) {
-				for(i = 0; i < searchStringLength; i++) {
-					if(same && fIsCaseSensitiveBlocking)
-						same = yy_buffer[i + yy_currentPos - searchStringLength] == searchString.charAt(i);
-					else if(same && !fIsCaseSensitiveBlocking)
-						same = Character.toLowerCase(yy_buffer[i + yy_currentPos - searchStringLength]) == Character.toLowerCase(searchString.charAt(i));
-				}
-			}
-			// safety check failed; no match is possible right now
-			else {
-				same = false;
-			}
-			if (same && requireTailSeparator && yy_currentPos < yy_buffer.length) {
-				// Additional check for close tags to ensure that targetString="</script" doesn't match
-				// "</scriptS"
-				lastCheckChar = yy_buffer[yy_currentPos];
-				// Succeed on "</script>" and "</script "
-				if(lastCheckChar == '>' || Character.isWhitespace(lastCheckChar))
-					stillSearching = false;
-			}
-			else {
-				stillSearching = !same || (yy_currentPos < yy_startRead + searchStringLength);
-			}
-		}
-	}
-	if (n != YYEOF || same) {
-		// We've stopped short of the end or definitely found a match
-		yy_markedPos = yy_currentPos - searchStringLength;
-		yy_currentPos = yy_markedPos + 1;
-		// If the searchString occurs at the very beginning of what would have
-		// been a Block, resume scanning normally immediately
-		if (yy_markedPos == yy_startRead) {
-			yybegin(immediateFallbackState);
-			return primGetNextToken();
-		}
-	}
-	else {
-		// We ran through the rest of the input
-		yy_markedPos = yy_currentPos;
-		yy_currentPos++;
-	}
-	yybegin(exitState);
-	// If the ending occurs at the very beginning of what would have
-	// been a Block, resume scanning normally immediately
-	if(yy_markedPos == yy_startRead)
-		return primGetNextToken();
-	return searchContext;
-}
-/**
- * user method
- *
- * A generic lookahead-like operation
- */
-private final String doBlockScan(String target, String targetContext, int immediateFallbackState) throws IOException {
-	return doScan(target, false, targetContext, immediateFallbackState, immediateFallbackState);
-}
-/**
- * user method 
- * does a lookahead for the current tag name
- */
-private final String doBlockTagScan() throws IOException {
-        fIsCaseSensitiveBlocking = getBlockMarkerCaseSensitivity();
-	return doScan("</" + fCurrentTagName, true, getBlockMarkerContext(fCurrentTagName), YYINITIAL, YYINITIAL);
-}
-/**
- * user method
- *
- * Converts the raw context String returned by the primGetNextToken()
- * method into a full ITextRegion by pulling in values for the
- * current offset within the scanning text.
- *
- * Returns null when EOF is encountered and attaches intermittently
- * discovered whitespace onto the end of useful regions.
- *
- * Note that this algorithm caches the token following the one being returned
- * so that whitespace can be collapsed.
- */
-public final ITextRegion getNextToken() throws IOException {
-	// load the starting non-whitespace token (assume that it is so)
-	if (fShouldLoadBuffered) {
-		context = fBufferedContext;
-		start = fBufferedStart;
-		textLength = length = fBufferedLength;
-		fShouldLoadBuffered = false;
-	}
-	else {
-		context = primGetNextToken();
-		if (context == XML_TAG_NAME) {
-			if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
-				fCurrentTagName = yytext();
-			else
-				fCurrentTagName = null;
-		}
-		else if (context == XML_TAG_OPEN) {
-			fIsBlockingEnabled = true;
-		}
-		else if (context == XML_END_TAG_OPEN) {
-			fIsBlockingEnabled = false;
-		}
-		start = yychar;
-		textLength = length = yylength();
-		if (yy_atEOF) {
-			fTokenCount++;
-			return null;
-		}
-	}
-	// store the next token
-	f_context = primGetNextToken();
-	if (f_context == XML_TAG_NAME) {
-		if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
-			fCurrentTagName = yytext();
-		else
-			fCurrentTagName = null;
-	}
-	else if (f_context == XML_TAG_OPEN) {
-		fIsBlockingEnabled = true;
-	}
-	else if (f_context == XML_END_TAG_OPEN) {
-		fIsBlockingEnabled = false;
-	}
-	fBufferedContext = f_context;
-	fBufferedStart = yychar;
-	fBufferedLength = yylength();
-	fShouldLoadBuffered = true;
-	if (fBufferedContext == WHITE_SPACE) {
-		fShouldLoadBuffered = false;
-		length += fBufferedLength;
-	}
-	if (context == null) {
-		// EOF
-		if (Debug.debugTokenizer) {
-			System.out.println(getClass().getName() + " discovered " + fTokenCount + " tokens."); //$NON-NLS-2$//$NON-NLS-1$
-		}
-		return null;
-	}
-	fTokenCount++;
-	return fRegionFactory.createToken(context, start, textLength, length, null, fCurrentTagName);
-}
-/* user method */
-public XMLTokenizer(){
-	super();
-}
-/* user method */
-public XMLTokenizer(char[] charArray){
-		this(new CharArrayReader(charArray));
-}
-/* user method */
-public void reset(char[] charArray) {
-	reset(new CharArrayReader(charArray), 0);
-}
-/* user method */
-public void reset(char[] charArray, int newOffset) {
-	reset(new CharArrayReader(charArray), newOffset);
-}
-/* user method */
-public void reset(java.io.InputStream in) {
-	reset(new java.io.InputStreamReader(in), 0);
-}
-/* user method */
-public void reset(java.io.InputStream in, int newOffset) {
-	reset(new java.io.InputStreamReader(in), newOffset);
-}
-/* user method */
-public void reset(java.io.Reader in) {
-	reset(in, 0);
-}
-/**
- * user method *
- *
- * Reset internal counters and vars to "newly created" values, in the hopes
- * that resetting a pre-existing tokenizer is faster than creating a new one.
- *
- * This method contains code blocks that were essentially duplicated from the
- * <em>generated</em> output of this specification before this method was
- * added.  Those code blocks were under the above copyright.
- */
-public void reset(java.io.Reader in, int newOffset) {
-	if (Debug.debugTokenizer) {
-		System.out.println("resetting tokenizer");//$NON-NLS-1$
-	}
-	fOffset = newOffset;
-
-	/* the input device */
-	yy_reader = in;
-
-	/* the current state of the DFA */
-	yy_state = 0;
-
-	/* the current lexical state */
-	yy_lexical_state = YYINITIAL;
-
-	/* this buffer contains the current text to be matched and is
-	the source of the yytext() string */
-	java.util.Arrays.fill(yy_buffer, (char)0);
-
-	/* the textposition at the last accepting state */
-	yy_markedPos = 0;
-
-	/* the textposition at the last state to be included in yytext */
-	yy_pushbackPos = 0;
-
-	/* the current text position in the buffer */
-	yy_currentPos = 0;
-
-	/* startRead marks the beginning of the yytext() string in the buffer */
-	yy_startRead = 0;
-
-	/** 
-	 * endRead marks the last character in the buffer, that has been read
-	 * from input 
-	 */
-	yy_endRead = 0;
-
-	/* number of newlines encountered up to the start of the matched text */
-	yyline = 0;
-
-	/* the number of characters up to the start of the matched text */
-	yychar = 0;
-
-	/* yy_atEOF == true <=> the scanner has returned a value for EOF */
-	yy_atEOF = false;
-
-	/* denotes if the user-EOF-code has already been executed */
-	yy_eof_done = false;
-
-
-	/* user vars: */
-	fTokenCount = 0;
- 
-	fShouldLoadBuffered = false;
-	fBufferedContext = null;
-	fBufferedStart = 1;
-	fBufferedLength = 0;
-	fStateStack = new IntStack();
-
-	context = null;
-	start = 0;
-	textLength = 0;
-	length = 0;
-}
-
-	/**
-	 * user method
-	 *
-	 */
-	public BlockTokenizer newInstance() {
-		XMLTokenizer newInstance = new XMLTokenizer();
-		// global tagmarkers can be shared; they have no state and 
-		// are never destroyed (e.g. 'release')
-		for(int i = 0; i < fBlockMarkers.size(); i++) {
-			BlockMarker blockMarker = (BlockMarker) fBlockMarkers.get(i);
-			if(blockMarker.isGlobal())
-				newInstance.addBlockMarker(blockMarker);
-		}
-		return newInstance;
-	}
-/* user method */
-private final String scanXMLCommentText() throws IOException {
-	// Scan for '-->' and return the text up to that point as
-	//   XML_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
-	//  case change to the ST_XML_COMMENT_END state and return the next
-	//  context as usual.
-	return doScan("-->", false, XML_COMMENT_TEXT, ST_XML_COMMENT_END, ST_XML_COMMENT_END);
-}
-
-
-  /**
-   * Creates a new scanner
-   * There is also a java.io.InputStream version of this constructor.
-   *
-   * @param   in  the java.io.Reader to read input from.
-   */
-  public XMLTokenizer(java.io.Reader in) {
-    this.yy_reader = in;
-  }
-
-  /**
-   * Creates a new scanner.
-   * There is also java.io.Reader version of this constructor.
-   *
-   * @param   in  the java.io.Inputstream to read input from.
-   */
-  public XMLTokenizer(java.io.InputStream in) {
-    this(new java.io.InputStreamReader(in));
-  }
-
-  /** 
-   * Unpacks the compressed DFA transition table.
-   *
-   * @param packed   the packed transition table
-   * @return         the unpacked transition table
-   */
-  private static int [] yy_unpack(String packed) {
-    int [] trans = new int[11055];
-    int i = 0;  /* index in packed string  */
-    int j = 0;  /* index in unpacked array */
-    while (i < 3734) {
-      int count = packed.charAt(i++);
-      int value = packed.charAt(i++);
-      value--;
-      do trans[j++] = value; while (--count > 0);
-    }
-    return trans;
-  }
-
-  /** 
-   * Unpacks the compressed character translation table.
-   *
-   * @param packed   the packed character translation table
-   * @return         the unpacked character translation table
-   */
-  private static char [] yy_unpack_cmap(String packed) {
-    char [] map = new char[0x10000];
-    int i = 0;  /* index in packed string  */
-    int j = 0;  /* index in unpacked array */
-    while (i < 1372) {
-      int  count = packed.charAt(i++);
-      char value = packed.charAt(i++);
-      do map[j++] = value; while (--count > 0);
-    }
-    return map;
-  }
-
-
-  /**
-   * Gets the next input character.
-   *
-   * @return      the next character of the input stream, EOF if the
-   *              end of the stream is reached.
-   * @exception   IOException  if any I/O-Error occurs
-   */
-  private int yy_advance() throws java.io.IOException {
-
-    /* standard case */
-    if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];
-
-    /* if the eof is reached, we don't need to work hard */ 
-    if (yy_atEOF) return YYEOF;
-
-    /* otherwise: need to refill the buffer */
-
-    /* first: make room (if you can) */
-    if (yy_startRead > 0) {
-      System.arraycopy(yy_buffer, yy_startRead, 
-                       yy_buffer, 0, 
-                       yy_endRead-yy_startRead);
-
-      /* translate stored positions */
-      yy_endRead-= yy_startRead;
-      yy_currentPos-= yy_startRead;
-      yy_markedPos-= yy_startRead;
-      yy_pushbackPos-= yy_startRead;
-      yy_startRead = 0;
-    }
-
-    /* is the buffer big enough? */
-    if (yy_currentPos >= yy_buffer.length) {
-      /* if not: blow it up */
-      char newBuffer[] = new char[yy_currentPos*2];
-      System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
-      yy_buffer = newBuffer;
-    }
-
-    /* finally: fill the buffer with new input */
-    int numRead = yy_reader.read(yy_buffer, yy_endRead, 
-                                            yy_buffer.length-yy_endRead);
-
-    if ( numRead == -1 ) return YYEOF;
-
-    yy_endRead+= numRead;
-
-    return yy_buffer[yy_currentPos++];
-  }
-
-    
-  /**
-   * Closes the input stream.
-   */
-  final public void yyclose() throws java.io.IOException {
-    yy_atEOF = true;            /* indicate end of file */
-    yy_endRead = yy_startRead;  /* invalidate buffer    */
-    yy_reader.close();
-  }
-
-
-  /**
-   * Returns the current lexical state.
-   */
-  final public int yystate() {
-    return yy_lexical_state;
-  }
-
-  /**
-   * Enters a new lexical state
-   *
-   * @param newState the new lexical state
-   */
-  final public void yybegin(int newState) {
-    yy_lexical_state = newState;
-  }
-
-
-  /**
-   * Returns the text matched by the current regular expression.
-   */
-  final public String yytext() {
-    return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
-  }
-
-  /**
-   * Returns the length of the matched text region.
-   */
-  final public int yylength() {
-    return yy_markedPos-yy_startRead;
-  }
-
-
-  /**
-   * Reports an error that occured while scanning - from the SED JFlex skeleton
-   *
-   * @param   errorCode  the code of the errormessage to display
-   */
-  private void yy_ScanError(int errorCode) {
-    try {
-      Logger.log(Logger.ERROR, YY_ERROR_MSG[errorCode]);
-    }
-    catch (ArrayIndexOutOfBoundsException e) {
-      Logger.log(Logger.ERROR, YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
-    }
-    // DO NOT EXIT the VM on an error
-    // System.exit(1);
-  } 
-
-
-  /**
-   * Pushes the specified amount of characters back into the input stream.
-   *
-   * They will be read again by then next call of the scanning method
-   *
-   * @param number  the number of characters to be read again.
-   *                This number must not be greater than yylength()!
-   */
-  void yypushback(int number) {
-    if ( number > yylength() )
-      yy_ScanError(YY_PUSHBACK_2BIG);
-
-    yy_markedPos -= number;
-  }
-
-	/**
-	 * user method - skeleton.sed
-	 */
-	protected final boolean containsTagName(char[] markerTagName, int offset, int tagnameLength) {
-		for(int j = 0; j < fBlockMarkers.size(); j++) {
-			BlockMarker marker = (BlockMarker)fBlockMarkers.get(j);
-			if(marker.getTagName().length() == tagnameLength) {
-				boolean matchesSoFar = true;
-				for(int i = 0; i < tagnameLength && matchesSoFar; i++) {
-					if(marker.isCaseSensitive()) {
-						if(marker.getTagName().charAt(i) != markerTagName[i + offset])
-							matchesSoFar = false;
-					}
-					else {
-						if(Character.toLowerCase(marker.getTagName().charAt(i)) != Character.toLowerCase(markerTagName[i + offset]))
-							matchesSoFar = false;
-					}
-				}
-				if(matchesSoFar)
-					return true;
-			}
-		}
-		return false;
-	}
-
-	/**
-	 * user method - skeleton.sed
-	 *
-	 * Return ALL of the regions scannable within the remaining text
-	 * Note: for verification use
-	 */
-	public final List getRegions() {
-		List tokens = new ArrayList();
-		ITextRegion region = null;
-		try {
-			region = getNextToken();
-			while(region != null) {
-				if (region != null) {
-					tokens.add(region);
-				}
-				region = getNextToken();
-			}
-		}
-		catch (StackOverflowError e) {
-			Logger.logException(getClass().getName()+": input could not be tokenized correctly at position " + getOffset(), e);//$NON-NLS-1$
-			throw e;
-		}
-		catch (Exception e) {
-			// Since this is convenience method and NOT the recommended 
-			// way of getting tokens, many errors are simply hidden
-			Logger.logException("Exception not handled retrieving regions: " + e.getLocalizedMessage(), e);//$NON-NLS-1$
-		}
-		return tokens;
-	}
-	/**
-	 * user method - skeleton.sed
-	 */
-	private final void dump(String s) {
-		if (Debug.debugTokenizer) {
-			System.out.println(s + " (" + yychar + "-" + //$NON-NLS-2$//$NON-NLS-1$
-				(yylength() + yychar) + "):\'" +//$NON-NLS-1$
-					StringUtils.escape(yytext()) + "\'");//$NON-NLS-1$
-		}
-	}
-	/* user method  - skeleton.sed */
-	public final boolean isEOF() {
-		return yy_atEOF;
-	}
-/* user method - skeleton.sed */
-protected final boolean containsTagName(String markerTagName) {
-	Iterator blocks = fBlockMarkers.iterator();
-	while(blocks.hasNext()) {
-		BlockMarker marker = (BlockMarker)blocks.next();
-		if(marker.isCaseSensitive()) {
-			if(marker.getTagName().equals(markerTagName))
-				return true;
-		}
-		else {
-			if(marker.getTagName().equalsIgnoreCase(markerTagName))
-				return true;
-		}
-	}
-	return false;
-}
-
-  /**
-   * Contains user EOF-code, which will be executed exactly once,
-   * when the end of file is reached
-   */
-  private void yy_do_eof() {
-    if (!yy_eof_done) {
-      yy_eof_done = true;
-    // do nothing, this is the downstream parser's job
-
-    }
-  }
-
-
-  /**
-   * Resumes scanning until the next regular expression is matched,
-   * the end of input is encountered or an I/O-Error occurs.
-   *
-   * @return      the next token
-   * @exception   IOException  if any I/O-Error occurs
-   */
-  public String primGetNextToken() throws java.io.IOException {
-    int yy_input;
-    int yy_action;
-
-
-    while (true) {
-
-      yychar+= yylength();
-
-      boolean yy_counted = false;
-      for (yy_currentPos = yy_startRead; yy_currentPos < yy_markedPos;
-                                                      yy_currentPos++) {
-        switch (yy_buffer[yy_currentPos]) {
-        case '\r':
-          yyline++;
-          yy_counted = true;
-          break;
-        case '\n':
-          if (yy_counted)
-            yy_counted = false;
-          else {
-            yyline++;
-          }
-          break;
-        default:
-          yy_counted = false;
-        }
-      }
-
-      if (yy_counted) {
-        if ( yy_advance() == '\n' ) yyline--;
-        if ( !yy_atEOF ) yy_currentPos--;
-      }
-
-      yy_action = -1;
-
-      yy_currentPos = yy_startRead = yy_markedPos;
-
-      yy_state = yy_lexical_state;
-
-
-      yy_forAction: {
-        while (true) {
-    
-          yy_input = yy_advance();
-
-          if ( yy_input == YYEOF ) break yy_forAction;
-
-          int yy_next = yytrans[ yy_rowMap[yy_state] + yycmap[yy_input] ];
-          if (yy_next == -1) break yy_forAction;
-          yy_state = yy_next;
-
-          int yy_attributes = YY_ATTRIBUTE[yy_state];
-          if ( (yy_attributes & 1) > 0 ) {
-            yy_action = yy_state; 
-            yy_markedPos = yy_currentPos; 
-            if ( (yy_attributes & 8) > 0 ) break yy_forAction;
-          }
-
-        }
-      }
-
-
-      switch (yy_action) {    
-
-        case 291: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XSL processing instruction target");//$NON-NLS-1$
-        yybegin(ST_XML_PI_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
- }
-        case 293: break;
-        case 283: 
-        case 285: 
-        case 286: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nCDATA start");//$NON-NLS-1$
-	fStateStack.push(yystate());
-	yybegin(ST_CDATA_TEXT);
-	return XML_CDATA_OPEN;
- }
-        case 294: break;
-        case 276: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("element");//$NON-NLS-1$
-	yybegin(ST_XML_ELEMENT_DECLARATION);
-	return XML_ELEMENT_DECLARATION;
- }
-        case 295: break;
-        case 275: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attlist");//$NON-NLS-1$
-	yybegin(ST_XML_ATTLIST_DECLARATION);
-	return XML_ATTLIST_DECLARATION;
- }
-        case 296: break;
-        case 274: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_DECLARATION);
-	return XML_DOCTYPE_DECLARATION;
- }
-        case 297: break;
-        case 268: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype external id");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_ID_PUBLIC);
-	return XML_DOCTYPE_EXTERNAL_ID_PUBLIC;
- }
-        case 298: break;
-        case 267: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype external id");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
-	return XML_DOCTYPE_EXTERNAL_ID_SYSTEM;
- }
-        case 299: break;
-        case 263: 
-        case 273: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction target");//$NON-NLS-1$
-        yybegin(ST_DHTML_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
- }
-        case 300: break;
-        case 237: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nCharRef");//$NON-NLS-1$
-	return XML_CHAR_REFERENCE;
- }
-        case 301: break;
-        case 234: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\ncomment start");//$NON-NLS-1$
-	yybegin(ST_XML_COMMENT);
-	return XML_COMMENT_OPEN;
- }
-        case 302: break;
-        case 215: 
-        case 216: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction target");//$NON-NLS-1$
-        yybegin(ST_XML_PI_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
- }
-        case 303: break;
-        case 214: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("comment end");//$NON-NLS-1$
-	yybegin(YYINITIAL);
-	return XML_COMMENT_CLOSE;
- }
-        case 304: break;
-        case 213: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("CDATA end");//$NON-NLS-1$
-	yybegin(fStateStack.pop());
-	return XML_CDATA_CLOSE;
- }
-        case 305: break;
-        case 212: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nPEReference");//$NON-NLS-1$
-	return XML_PE_REFERENCE;
- }
-        case 306: break;
-        case 209: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nEntityRef");//$NON-NLS-1$
-	return XML_ENTITY_REFERENCE;
- }
-        case 307: break;
-        case 160: 
-        case 174: 
-        case 182: 
-          { 
-	return XML_DOCTYPE_INTERNAL_SUBSET;
- }
-        case 308: break;
-        case 148: 
-          { 
-        yybegin(YYINITIAL);
-	if(Debug.debugTokenizer)
-		dump("empty tag close");//$NON-NLS-1$
-        return XML_EMPTY_TAG_CLOSE;
- }
-        case 309: break;
-        case 133: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction end");//$NON-NLS-1$
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 310: break;
-        case 132: 
-          { 
-		// ended with nothing inside
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 311: break;
-        case 128: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("processing instruction end");//$NON-NLS-1$
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 312: break;
-        case 120: 
-          { 
-	fStateStack.push(yystate());
-	if(Debug.debugTokenizer)
-		dump("\ndeclaration start");//$NON-NLS-1$
-        yybegin(ST_XML_DECLARATION);
-	return XML_DECLARATION_OPEN;
- }
-        case 313: break;
-        case 119: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nprocessing instruction start");//$NON-NLS-1$
-	yybegin(ST_PI);
-        return XML_PI_OPEN;
- }
-        case 314: break;
-        case 63: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction end");//$NON-NLS-1$
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 315: break;
-        case 57: 
-        case 59: 
-        case 60: 
-        case 61: 
-        case 137: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction attribute value");//$NON-NLS-1$
-        yybegin(ST_XML_PI_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 316: break;
-        case 56: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction '='");//$NON-NLS-1$
-        yybegin(ST_XML_PI_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
- }
-        case 317: break;
-        case 55: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction attribute name");//$NON-NLS-1$
-        yybegin(ST_XML_PI_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
- }
-        case 318: break;
-        case 51: 
-        case 52: 
-        case 53: 
-          { 
-	// block scan until close is found
-	return doScan("?>", false, XML_PI_CONTENT, ST_XML_PI_TAG_CLOSE, ST_XML_PI_TAG_CLOSE);
- }
-        case 319: break;
-        case 50: 
-          { 
-        yybegin(ST_PI_CONTENT);
-        return WHITE_SPACE;
- }
-        case 320: break;
-        case 46: 
-        case 47: 
-        case 48: 
-        case 49: 
-        case 129: 
-        case 130: 
-        case 131: 
-        case 217: 
-        case 239: 
-        case 240: 
-        case 252: 
-        case 253: 
-        case 262: 
-        case 272: 
-        case 280: 
-        case 284: 
-        case 287: 
-        case 288: 
-        case 289: 
-        case 290: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("processing instruction target");//$NON-NLS-1$
-        yybegin(ST_PI_WS);
-        return XML_TAG_NAME;
- }
-        case 321: break;
-        case 41: 
-        case 42: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("comment content");//$NON-NLS-1$
-	return scanXMLCommentText();
- }
-        case 322: break;
-        case 40: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("LINE FEED");//$NON-NLS-1$
-	return WHITE_SPACE;
- }
-        case 323: break;
-        case 0: 
-        case 31: 
-        case 122: 
-        case 124: 
-        case 207: 
-        case 208: 
-        case 236: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nXML content");//$NON-NLS-1$
-	return XML_CONTENT;
- }
-        case 324: break;
-        case 5: 
-        case 8: 
-        case 9: 
-        case 10: 
-        case 12: 
-        case 13: 
-        case 14: 
-        case 15: 
-        case 17: 
-        case 18: 
-        case 19: 
-        case 20: 
-        case 21: 
-        case 22: 
-        case 23: 
-        case 24: 
-        case 25: 
-        case 26: 
-        case 28: 
-        case 45: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("white space");//$NON-NLS-1$
-        return WHITE_SPACE;
- }
-        case 325: break;
-        case 16: 
-        case 71: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("inappropriate tag name");//$NON-NLS-1$
-	yybegin(YYINITIAL);
-        return XML_CONTENT;
- }
-        case 326: break;
-        case 27: 
-        case 106: 
-        case 107: 
-        case 193: 
-        case 229: 
-        case 248: 
-        case 259: 
-        case 269: 
-        case 277: 
-        case 281: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("elementdecl contentspec");//$NON-NLS-1$
-	return XML_ELEMENT_DECL_CONTENT;
- }
-        case 327: break;
-        case 29: 
-        case 113: 
-        case 114: 
-        case 204: 
-        case 233: 
-        case 250: 
-        case 260: 
-        case 270: 
-        case 278: 
-        case 282: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attlist contentspec");//$NON-NLS-1$
-	return XML_ATTLIST_DECL_CONTENT;
- }
-        case 328: break;
-        case 32: 
-        case 72: 
-        case 83: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nstart tag open");//$NON-NLS-1$
-        yybegin(ST_XML_TAG_NAME);
-        return XML_TAG_OPEN;
- }
-        case 329: break;
-        case 33: 
-        case 34: 
-        case 37: 
-        case 38: 
-        case 39: 
-        case 43: 
-        case 44: 
-        case 54: 
-        case 58: 
-        case 62: 
-        case 64: 
-        case 68: 
-        case 74: 
-        case 80: 
-        case 85: 
-        case 86: 
-        case 87: 
-        case 88: 
-        case 90: 
-        case 91: 
-        case 93: 
-        case 98: 
-        case 103: 
-        case 110: 
-          { 
-	if (Debug.debugTokenizer)
-		System.out.println("!!!unexpected!!!: \"" + yytext() + "\":" + //$NON-NLS-2$//$NON-NLS-1$
-			yychar + "-" + (yychar + yylength()));//$NON-NLS-1$
-	return UNDEFINED;
- }
-        case 330: break;
-        case 35: 
-        case 36: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("CDATA text");//$NON-NLS-1$
-	String blockContext = doBlockScan("]]>", XML_CDATA_TEXT, ST_CDATA_END);//$NON-NLS-1$
-	if(blockContext == XML_CDATA_TEXT)
-		yybegin(ST_CDATA_END);
-	return blockContext;
- }
-        case 331: break;
-        case 65: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction attribute name");//$NON-NLS-1$
-        yybegin(ST_DHTML_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
- }
-        case 332: break;
-        case 66: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction '='");//$NON-NLS-1$
-        yybegin(ST_DHTML_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
- }
-        case 333: break;
-        case 67: 
-        case 69: 
-        case 70: 
-        case 145: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction attribute value");//$NON-NLS-1$
-        yybegin(ST_DHTML_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 334: break;
-        case 73: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("tag close");//$NON-NLS-1$
-	if(isBlockMarker()) {
-        	yybegin(ST_BLOCK_TAG_SCAN);
-	}
-	else
-        	yybegin(YYINITIAL);
-        return XML_TAG_CLOSE;
- }
-        case 335: break;
-        case 75: 
-        case 76: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("tag name");//$NON-NLS-1$
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
- }
-        case 336: break;
-        case 77: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attr name");//$NON-NLS-1$
-        yybegin(ST_XML_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
- }
-        case 337: break;
-        case 78: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("equals");//$NON-NLS-1$
-        yybegin(ST_XML_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
- }
-        case 338: break;
-        case 79: 
-        case 81: 
-        case 82: 
-        case 152: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attr value");//$NON-NLS-1$
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 339: break;
-        case 84: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("declaration end");//$NON-NLS-1$
-	if (Debug.debugTokenizer) {
-		if(fStateStack.peek()!=YYINITIAL)
-			System.out.println("end embedded region");//$NON-NLS-1$
-	}
-	yybegin(fStateStack.pop());
-	return XML_DECLARATION_CLOSE;
- }
-        case 340: break;
-        case 89: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype type");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_EXTERNAL_ID);
-	return XML_DOCTYPE_NAME;
- }
-        case 341: break;
-        case 92: 
-        case 94: 
-        case 95: 
-        case 96: 
-        case 166: 
-        case 167: 
-        case 170: 
-        case 171: 
-        case 224: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype public reference");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
-	return XML_DOCTYPE_EXTERNAL_ID_PUBREF;
- }
-        case 342: break;
-        case 97: 
-        case 99: 
-        case 100: 
-        case 101: 
-        case 178: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype system reference");//$NON-NLS-1$
-	yybegin(ST_XML_DECLARATION_CLOSE);
-	return XML_DOCTYPE_EXTERNAL_ID_SYSREF;
- }
-        case 343: break;
-        case 102: 
-        case 104: 
-        case 105: 
-        case 186: 
-        case 187: 
-        case 190: 
-        case 191: 
-        case 227: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("elementdecl name");//$NON-NLS-1$
-	yybegin(ST_XML_ELEMENT_DECLARATION_CONTENT);
-	return XML_ELEMENT_DECL_NAME;
- }
-        case 344: break;
-        case 108: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("elementdecl close");//$NON-NLS-1$
-	if (Debug.debugTokenizer) {
-		if(fStateStack.peek()!=YYINITIAL)
-			System.out.println("end embedded region");//$NON-NLS-1$
-	}
-	yybegin(fStateStack.pop());
-	return XML_DECLARATION_CLOSE;
- }
-        case 345: break;
-        case 109: 
-        case 111: 
-        case 112: 
-        case 197: 
-        case 198: 
-        case 201: 
-        case 202: 
-        case 231: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attlist name");//$NON-NLS-1$
-	yybegin(ST_XML_ATTLIST_DECLARATION_CONTENT);
-	return XML_ATTLIST_DECL_NAME;
- }
-        case 346: break;
-        case 115: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attlist close");//$NON-NLS-1$
-	if (Debug.debugTokenizer) {
-		if(fStateStack.peek()!=YYINITIAL)
-			System.out.println("end embedded region");//$NON-NLS-1$
-	}
-	yybegin(fStateStack.pop());
-	return XML_DECLARATION_CLOSE;
- }
-        case 347: break;
-        case 118: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nend tag open");//$NON-NLS-1$
-        yybegin(ST_XML_TAG_NAME);
-        return XML_END_TAG_OPEN;
- }
-        case 348: break;
-        case 116: 
-        case 117: 
-          { 
-		return doBlockTagScan();
-	 }
-        case 349: break;
-        default: 
-          if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
-            yy_atEOF = true;
-            yy_do_eof();
-              return null;
-          } 
-          else {
-            yy_ScanError(YY_NO_MATCH);
-          }
-      }
-    }
-  }    
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeEqualsRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeEqualsRegion.java
deleted file mode 100644
index 836dd41..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeEqualsRegion.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-
-public class AttributeEqualsRegion implements ITextRegion {
-	static private final byte fTextLength = 1;
-	static private final String fType = DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS;
-	private short fLength;
-	private int fStart;
-
-
-	public AttributeEqualsRegion() {
-		super();
-	}
-
-	public AttributeEqualsRegion(int start, int textLength, int length) {
-		this();
-		fStart = start;
-		fLength = (short) length;
-	}
-
-
-	public void adjustLength(int i) {
-		fLength += i;
-
-	}
-
-	public void adjustStart(int i) {
-		fStart += i;
-
-	}
-
-	public void adjustTextLength(int i) {
-		// not supported
-
-	}
-
-	public void equatePositions(ITextRegion region) {
-		fStart = region.getStart();
-		fLength = (short) region.getLength();
-	}
-
-	public int getEnd() {
-		return fStart + fLength;
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public int getStart() {
-		return fStart;
-	}
-
-	public int getTextEnd() {
-		return fStart + fTextLength;
-	}
-
-	public int getTextLength() {
-		return fTextLength;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public String toString() {
-		return RegionToStringUtil.toString(this);
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		// can never be updated
-		return null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeNameRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeNameRegion.java
deleted file mode 100644
index a2c4158..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeNameRegion.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class AttributeNameRegion implements ITextRegion {
-	// specify correct type
-	static private final String fType = DOMRegionContext.XML_TAG_ATTRIBUTE_NAME;
-	private int fLength;
-	private int fStart;
-	private int fTextLength;
-
-	public AttributeNameRegion() {
-		super();
-	}
-
-	public AttributeNameRegion(int start, int textLength, int length) {
-		this();
-		fStart = start;
-		fTextLength = textLength;
-		fLength = length;
-	}
-
-	public void adjustLength(int i) {
-		fLength += i;
-
-	}
-
-	public void adjustStart(int i) {
-		fStart += i;
-
-	}
-
-	public void adjustTextLength(int i) {
-		fTextLength += 1;
-
-	}
-
-	public void equatePositions(ITextRegion region) {
-		fStart = region.getStart();
-		fLength = region.getLength();
-		fTextLength = region.getTextLength();
-	}
-
-	public int getEnd() {
-		return fStart + fLength;
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public int getStart() {
-		return fStart;
-	}
-
-	public int getTextEnd() {
-		return fStart + fTextLength;
-	}
-
-	public int getTextLength() {
-		return fTextLength;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public String toString() {
-		return RegionToStringUtil.toString(this);
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		RegionChangedEvent result = null;
-		// if the region is an easy type (e.g. attribute value),
-		// and the requested changes are all
-		// alphanumeric, then make the change here locally.
-		// (This can obviously be made more sophisticated as the need arises,
-		// but should
-		// always follow this pattern.)
-		if (Debug.debugStructuredDocument) {
-			System.out.println("\t\tContextRegion::updateModel"); //$NON-NLS-1$
-			System.out.println("\t\t\tregion type is " + fType); //$NON-NLS-1$
-		}
-		boolean canHandle = false;
-		// note: we'll always handle deletes from these
-		// regions ... if its already that region,
-		// deleting something from it won't change its
-		// type. (remember, the calling program needs
-		// to insure we are not called, if not all contained
-		// on one region.
-		if ((changes == null) || (changes.length() == 0)) {
-			// delete case
-			// We can not do the quick delete, if
-			// if all the text in a region is to be deleted.
-			// Or, if the delete starts in the white space region.
-			// In these cases, a reparse is needed.
-			// Minor note, we use textEnd-start since it always
-			// less than or equal to end-start. This might
-			// cause us to miss a few cases we could have handled,
-			// but will prevent us from trying to handle funning cases
-			// involving whitespace.
-			if ((fStart >= getTextEnd()) || (Math.abs(lengthToReplace) >= getTextEnd() - getStart())) {
-				canHandle = false;
-			} else {
-				canHandle = true;
-			}
-		} else {
-			if ((RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) || RegionUpdateRule.canHandleAsLetterOrDigit(this, parent, changes, requestStart, lengthToReplace)) {
-				canHandle = true;
-			} else {
-				canHandle = false;
-			}
-
-		}
-		if (canHandle) {
-			// at this point, we still have the old region. We won't create a
-			// new instance, we'll just update the one we have, by changing
-			// its end postion,
-			// The parent flatnode, upon return, has responsibility
-			// for updating sibling regions.
-			// and in turn, the structuredDocument itself has responsibility
-			// for
-			// updating the text store and down stream flatnodes.
-			if (Debug.debugStructuredDocument) {
-				System.out.println("change handled by region"); //$NON-NLS-1$
-			}
-			int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
-			// Note: we adjust both end and text end, because for any change
-			// that is in only the trailing whitespace region, we should not
-			// do a quick change,
-			// so 'canHandle' should have been false for those case.
-			// TO_DO_FUTURE: cache value of canHandleAsWhiteSpace from above
-			// If we are handling as whitespace, there is no need to increase
-			// the text length, only
-			// the total length is changing.
-			if (!RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) {
-				fTextLength += lengthDifference;
-			}
-			fLength += lengthDifference;
-			result = new RegionChangedEvent(parent.getParentDocument(), requester, parent, this, changes, requestStart, lengthToReplace);
-		}
-
-		return result;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeValueRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeValueRegion.java
deleted file mode 100644
index 7fbbbbf..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeValueRegion.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class AttributeValueRegion implements ITextRegion {
-	// specify correct type
-	static private final String fType = DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE;
-	private int fLength;
-	private int fStart;
-	private int fTextLength;
-
-	public AttributeValueRegion() {
-		super();
-	}
-
-	public AttributeValueRegion(int start, int textLength, int length) {
-		this();
-		fStart = start;
-		fTextLength = textLength;
-		fLength = length;
-	}
-
-	public void adjustLength(int i) {
-		fLength += i;
-	}
-
-	public void adjustStart(int i) {
-		fStart += i;
-	}
-
-	public void adjustTextLength(int i) {
-		fTextLength += 1;
-	}
-
-	public void equatePositions(ITextRegion region) {
-		fStart = region.getStart();
-		fLength = region.getLength();
-		fTextLength = region.getTextLength();
-	}
-
-	public int getEnd() {
-		return fStart + fLength;
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public int getStart() {
-		return fStart;
-	}
-
-	public int getTextEnd() {
-		return fStart + fTextLength;
-	}
-
-	public int getTextLength() {
-		return fTextLength;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public String toString() {
-		return RegionToStringUtil.toString(this);
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		RegionChangedEvent result = null;
-		// if the region is an easy type (e.g. attribute value),
-		// and the requested changes are all
-		// alphanumeric, then make the change here locally.
-		// (This can obviously be made more sophisticated as the need arises,
-		// but should
-		// always follow this pattern.)
-		if (Debug.debugStructuredDocument) {
-			System.out.println("\t\tContextRegion::updateModel"); //$NON-NLS-1$
-			System.out.println("\t\t\tregion type is " + fType); //$NON-NLS-1$
-		}
-		boolean canHandle = false;
-		// note: we'll always handle deletes from these
-		// regions ... if its already that region,
-		// deleting something from it won't change its
-		// type. (remember, the calling program needs
-		// to insure we are not called, if not all contained
-		// on one region.
-		if ((changes == null) || (changes.length() == 0)) {
-			// delete case
-			// We can not do the quick delete, if
-			// if all the text in a region is to be deleted.
-			// Or, if the delete starts in the white space region.
-			// In these cases, a reparse is needed.
-			// Minor note, we use textEnd-start since it always
-			// less than or equal to end-start. This might
-			// cause us to miss a few cases we could have handled,
-			// but will prevent us from trying to handle funning cases
-			// involving whitespace.
-			if ((fStart >= getTextEnd()) || (Math.abs(lengthToReplace) >= getTextEnd() - getStart())) {
-				canHandle = false;
-			} else {
-				canHandle = true;
-			}
-		} else {
-			if ((RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) || RegionUpdateRule.canHandleAsLetterOrDigit(this, parent, changes, requestStart, lengthToReplace)) {
-				canHandle = true;
-			} else {
-				canHandle = false;
-			}
-		}
-		if (canHandle) {
-			// at this point, we still have the old region. We won't create a
-			// new instance, we'll just update the one we have, by changing
-			// its end postion,
-			// The parent flatnode, upon return, has responsibility
-			// for updating sibling regions.
-			// and in turn, the structuredDocument itself has responsibility
-			// for
-			// updating the text store and down stream flatnodes.
-			if (Debug.debugStructuredDocument) {
-				System.out.println("change handled by region"); //$NON-NLS-1$
-			}
-			int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
-			// Note: we adjust both end and text end, because for any change
-			// that is in only the trailing whitespace region, we should not
-			// do a quick change,
-			// so 'canHandle' should have been false for those case.
-			// TO_DO_FUTURE: cache value of canHandleAsWhiteSpace from above
-			// If we are handling as whitespace, there is no need to increase
-			// the text length, only
-			// the total length is changing.
-			if (!RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) {
-				fTextLength += lengthDifference;
-			}
-			// update length (and end) after above check for white space,
-			// since
-			// it looks to determine if at end of region.
-			fLength += lengthDifference;
-			result = new RegionChangedEvent(parent.getParentDocument(), requester, parent, this, changes, requestStart, lengthToReplace);
-		}
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EmptyTagCloseRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EmptyTagCloseRegion.java
deleted file mode 100644
index 339d692..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EmptyTagCloseRegion.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class EmptyTagCloseRegion implements ITextRegion {
-	private int fLength = 2;
-	static private final byte fTextLength = 2;
-	static private final String fType = DOMRegionContext.XML_EMPTY_TAG_CLOSE;
-	private int fStart;
-
-
-	public EmptyTagCloseRegion() {
-		super();
-	}
-
-	public EmptyTagCloseRegion(int start, int textLength, int length) {
-		super();
-		fStart = start;
-		fLength = length;
-		if (fTextLength != textLength)
-			throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
-	}
-
-	public void adjustLength(int i) {
-		fLength += i;
-	}
-
-	public void adjustStart(int i) {
-		fStart += i;
-
-	}
-
-	public void adjustTextLength(int i) {
-		throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
-	}
-
-	public void equatePositions(ITextRegion region) {
-		fStart = region.getStart();
-	}
-
-	public int getEnd() {
-		return fStart + fLength;
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public int getStart() {
-		return fStart;
-	}
-
-	public int getTextEnd() {
-		return fStart + fTextLength;
-	}
-
-	public int getTextLength() {
-		return fTextLength;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public String toString() {
-		return RegionToStringUtil.toString(this);
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		// can never be updated
-		return null;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EndTagOpenRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EndTagOpenRegion.java
deleted file mode 100644
index 1ad5549..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EndTagOpenRegion.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class EndTagOpenRegion implements ITextRegion {
-	static private final String fType = DOMRegionContext.XML_END_TAG_OPEN;
-	private int fLength;
-	private int fStart;
-	static private final byte fTextLength = 2;
-
-
-	public EndTagOpenRegion() {
-		super();
-	}
-
-	public EndTagOpenRegion(int start, int textLength, int length) {
-		this();
-		fStart = start;
-		if (fTextLength != textLength)
-			throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
-		fLength = length;
-	}
-
-	public EndTagOpenRegion(int start, int length) {
-		this();
-		fStart = start;
-		fLength = length;
-	}
-
-	public void adjustLength(int i) {
-		fLength += i;
-
-	}
-
-	public void adjustStart(int i) {
-		fStart += i;
-
-	}
-
-
-	public void adjustTextLength(int i) {
-//		fTextLength += 1;
-		throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
-	}
-
-	public void equatePositions(ITextRegion region) {
-		fStart = region.getStart();
-		fLength = region.getLength();
-//		fTextLength = region.getTextLength();
-	}
-
-	public int getEnd() {
-		return fStart + fLength;
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public int getStart() {
-		return fStart;
-	}
-
-	public int getTextEnd() {
-		return fStart + fTextLength;
-	}
-
-	public int getTextLength() {
-		return fTextLength;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public String toString() {
-		return RegionToStringUtil.toString(this);
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		// can never be updated
-		return null;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/GenericTemplateRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/GenericTemplateRegion.java
deleted file mode 100644
index e6064be..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/GenericTemplateRegion.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- * 
- * This class is not intended to be used, its just present to server as a
- * generic starting point for adding new specific region types.
- * 
- */
-
-public class GenericTemplateRegion implements ITextRegion {
-	// specify correct type
-	static private final String fType = DOMRegionContext.UNDEFINED;
-	private int fLength;
-	private int fStart;
-	private int fTextLength;
-
-
-	public GenericTemplateRegion() {
-		super();
-	}
-
-	public GenericTemplateRegion(int start, int textLength, int length) {
-		this();
-		fStart = start;
-		fTextLength = textLength;
-		fLength = length;
-	}
-
-	public void adjustLength(int i) {
-		fLength += i;
-
-	}
-
-	public void adjustStart(int i) {
-		fStart += i;
-
-	}
-
-
-	public void adjustTextLength(int i) {
-		fTextLength += i;
-
-	}
-
-	public void equatePositions(ITextRegion region) {
-		fStart = region.getStart();
-		fLength = region.getLength();
-		fTextLength = region.getTextLength();
-	}
-
-	public int getEnd() {
-		return fStart + fLength;
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public int getStart() {
-		return fStart;
-	}
-
-	public int getTextEnd() {
-		return fStart + fTextLength;
-	}
-
-	public int getTextLength() {
-		return fTextLength;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public String toString() {
-		return RegionToStringUtil.toString(this);
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		// can never be updated
-		return null;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionToStringUtil.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionToStringUtil.java
deleted file mode 100644
index af783f6..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionToStringUtil.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public class RegionToStringUtil {
-	static public String toString(ITextRegion region) {
-		String className = region.getClass().getName();
-		String shortClassName = className.substring(className.lastIndexOf(".") + 1); //$NON-NLS-1$
-		String result = shortClassName + "--> " + region.getType() + ": " + region.getStart() + "-" + region.getTextEnd() + (region.getTextEnd() != region.getEnd() ? ("/" + region.getEnd()) : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-		// NOTE: if the document held by any region has been updated and the
-		// region offsets have not
-		// yet been updated, the output from this method invalid.
-		return result;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionUpdateRule.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionUpdateRule.java
deleted file mode 100644
index 567d093..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionUpdateRule.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-
-/**
- * 
- * This is a utility class to centralize 'region' update. Note: care must be
- * taken that is is not used for StructuredDocumentRegions, or container
- * regions, its only for "token regions"
- *  
- */
-public class RegionUpdateRule {
-
-	static public boolean allLetterOrDigit(String changes) {
-		boolean result = true;
-		for (int i = 0; i < changes.length(); i++) {
-			// TO_DO_FUTURE: check that a Java Letter or Digit is
-			// the same thing as an XML letter or digit
-			if (!(Character.isLetterOrDigit(changes.charAt(i)))) {
-				result = false;
-				break;
-			}
-		}
-		return result;
-	}
-
-	static public boolean allWhiteSpace(String changes) {
-		boolean result = true;
-		for (int i = 0; i < changes.length(); i++) {
-			if (!Character.isWhitespace(changes.charAt(i))) {
-				result = false;
-				break;
-			}
-		}
-		return result;
-	}
-
-	static public boolean canHandleAsLetterOrDigit(ITextRegion region, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		if (parent == null)
-			return canHandleAsLetterOrDigit(region, changes, requestStart, lengthToReplace);
-		boolean result = false;
-		// Make sure we are in a non-white space area
-		if ((requestStart <= (parent.getTextEndOffset(region))) && (allLetterOrDigit(changes))) {
-			result = true;
-		}
-		return result;
-	}
-
-	static public boolean canHandleAsLetterOrDigit(ITextRegion region, String changes, int requestStart, int lengthToReplace) {
-		boolean result = false;
-		// Make sure we are in a non-white space area
-		if ((requestStart <= (region.getTextEnd())) && (allLetterOrDigit(changes))) {
-			result = true;
-		}
-		return result;
-	}
-
-	static public boolean canHandleAsWhiteSpace(ITextRegion region, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		// we don't explect a null parent, but just in case!
-		// (in which case, we must be dealing with regions that are
-		// structuredDocumentRegions).
-		if (parent == null)
-			return canHandleAsWhiteSpace(region, changes, requestStart, lengthToReplace);
-		boolean result = false;
-		// if we are in the "white space" area of a region, then
-		// we don't want to handle, a reparse is needed.
-		// the white space region is consider anywhere that would
-		// leave whitespace between this character and the text part.
-		// and of course, we can insert whitespace in whitespace region
-		//
-		// if there is no whitespace in this region, no need to look further
-		if (region.getEnd() > region.getTextEnd()) {
-			// no need to add one to end of text, as we used to, since we
-			// change definition of length to equate to offset plus one.
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=105866
-			// watch out for whitespace at end of text
-			if (requestStart >= parent.getTextEndOffset(region)) {
-				// ok, we are in the whitespace region, so we can't handle,
-				// unless
-				// we are just inserting whitespace.
-				if (allWhiteSpace(changes)) {
-					result = true;
-				} else {
-					result = false;
-				}
-			}
-		}
-		return result;
-	}
-
-	static public boolean canHandleAsWhiteSpace(ITextRegion region, String changes, int requestStart, int lengthToReplace) {
-		boolean result = false;
-		// if we are in the "white space" area of a region, then
-		// we don't want to handle, a reparse is needed.
-		// the white space region is consider anywhere that would
-		// leave whitespace between this character and the text part.
-		// and of course, we can insert whitespace in whitespace region
-		//
-		// if there is no whitespace in this region, no need to look further
-		if (region.getEnd() > region.getTextEnd()) {
-			// no need to add one to end of text, as we used to, since we
-			// change definition of length to equate to offset plus one.
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=105866
-			// watch out for whitespace at end of text
-			if (requestStart >= region.getTextEnd()) {
-				// ok, we are in the whitespace region, so we can't handle,
-				// unless
-				// we are just inserting whitespace.
-				if (allWhiteSpace(changes)) {
-					result = true;
-				} else {
-					result = false;
-				}
-			}
-		}
-		return result;
-	}
-
-	// need an adjust text length API before this can be used
-	static public StructuredDocumentEvent updateModel(ITextRegion region, Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		RegionChangedEvent result = null;
-		// if the region is an easy type (e.g. attribute value),
-		// and the requested changes are all
-		// alphanumeric, then make the change here locally.
-		// (This can obviously be made more sophisticated as the need arises,
-		// but should
-		// always follow this pattern.)
-		if (Debug.debugStructuredDocument) {
-			System.out.println("\t\tContextRegion::updateModel"); //$NON-NLS-1$
-			System.out.println("\t\t\tregion type is " + region.getType()); //$NON-NLS-1$
-		}
-		boolean canHandle = false;
-		// note: we'll always handle deletes from these
-		// regions ... if its already that region,
-		// deleting something from it won't change its
-		// type. (remember, the calling program needs
-		// to insure we are not called, if not all contained
-		// on one region.
-		if ((changes == null) || (changes.length() == 0)) {
-			// delete case
-			// We can not do the quick delete, if
-			// if all the text in a region is to be deleted.
-			// Or, if the delete starts in the white space region.
-			// In these cases, a reparse is needed.
-			// Minor note, we use textEnd-start since it always
-			// less than or equal to end-start. This might
-			// cause us to miss a few cases we could have handled,
-			// but will prevent us from trying to handle funning cases
-			// involving whitespace.
-			if ((region.getStart() >= region.getTextEnd()) || (Math.abs(lengthToReplace) >= region.getTextEnd() - region.getStart())) {
-				canHandle = false;
-			} else {
-				canHandle = true;
-			}
-		} else {
-			if ((RegionUpdateRule.canHandleAsWhiteSpace(region, parent, changes, requestStart, lengthToReplace)) || RegionUpdateRule.canHandleAsLetterOrDigit(region, parent, changes, requestStart, lengthToReplace)) {
-				canHandle = true;
-			} else {
-				canHandle = false;
-			}
-		}
-		if (canHandle) {
-			// at this point, we still have the old region. We won't create a
-			// new instance, we'll just update the one we have, by changing
-			// its end postion,
-			// The parent flatnode, upon return, has responsibility
-			// for updating sibling regions.
-			// and in turn, the structuredDocument itself has responsibility
-			// for
-			// updating the text store and down stream flatnodes.
-			if (Debug.debugStructuredDocument) {
-				System.out.println("change handled by region"); //$NON-NLS-1$
-			}
-			int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
-			// Note: we adjust both end and text end, because for any change
-			// that is in only the trailing whitespace region, we should not
-			// do a quick change,
-			// so 'canHandle' should have been false for those case.
-			region.adjustLength(lengthDifference);
-			// TO_DO_FUTURE: cache value of canHandleAsWhiteSpace from above
-			// If we are handling as whitespace, there is no need to increase
-			// the text length, only
-			// the total length is changing.
-			if (!RegionUpdateRule.canHandleAsWhiteSpace(region, parent, changes, region.getStart(), lengthToReplace)) {
-				//				region.adjustTextLength(lengthDifference);
-			}
-			result = new RegionChangedEvent(parent.getParentDocument(), requester, parent, region, changes, requestStart, lengthToReplace);
-		}
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagCloseRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagCloseRegion.java
deleted file mode 100644
index 027ae4d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagCloseRegion.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class TagCloseRegion implements ITextRegion {
-	static private final byte fLength = 1;
-	static private final byte fTextLength = 1;
-	static private final String fType = DOMRegionContext.XML_TAG_CLOSE;
-	private int fStart;
-
-
-	public TagCloseRegion() {
-		super();
-	}
-
-	public TagCloseRegion(int start) {
-		this();
-		fStart = start;
-	}
-
-	public void adjustLength(int i) {
-		throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
-
-	}
-
-	public void adjustStart(int i) {
-		fStart += i;
-
-	}
-
-	public void adjustTextLength(int i) {
-		// not supported
-
-	}
-
-	public void equatePositions(ITextRegion region) {
-		fStart = region.getStart();
-	}
-
-	public int getEnd() {
-		return fStart + fLength;
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public int getStart() {
-		return fStart;
-	}
-
-	public int getTextEnd() {
-		return fStart + fTextLength;
-	}
-
-	public int getTextLength() {
-		return fTextLength;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public String toString() {
-		return RegionToStringUtil.toString(this);
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		// can never be updated
-		return null;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagNameRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagNameRegion.java
deleted file mode 100644
index 38b59c4..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagNameRegion.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class TagNameRegion implements ITextRegion {
-	static private final String fType = DOMRegionContext.XML_TAG_NAME;
-	private short fLength;
-	private int fStart;
-	private short fTextLength;
-
-
-	public TagNameRegion() {
-		super();
-	}
-
-	public TagNameRegion(int start, int textLength, int length) {
-		this();
-		fStart = start;
-		fTextLength = (short) textLength;
-		fLength = (short) length;
-	}
-
-	public void adjustLength(int i) {
-		fLength += i;
-
-	}
-
-	public void adjustStart(int i) {
-		fStart += i;
-
-	}
-
-
-	public void adjustTextLength(int i) {
-		fTextLength += i;
-	}
-
-	public void equatePositions(ITextRegion region) {
-		fStart = region.getStart();
-		fLength = (short) region.getLength();
-		fTextLength = (short) region.getTextLength();
-	}
-
-	public int getEnd() {
-		return fStart + fLength;
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public int getStart() {
-		return fStart;
-	}
-
-	public int getTextEnd() {
-		return fStart + fTextLength;
-	}
-
-	public int getTextLength() {
-		return fTextLength;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public String toString() {
-		return RegionToStringUtil.toString(this);
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		// can never be updated
-		return null;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagOpenRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagOpenRegion.java
deleted file mode 100644
index e8cb85e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagOpenRegion.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class TagOpenRegion implements ITextRegion {
-	static private final String fType = DOMRegionContext.XML_TAG_OPEN;
-	private int fLength;
-	private int fStart;
-	static private final byte fTextLength = 1;
-
-
-	public TagOpenRegion() {
-		super();
-	}
-
-	public TagOpenRegion(int start, int textLength, int length) {
-		this(start, length);
-		if (fTextLength != textLength)
-			throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
-	}
-
-	public TagOpenRegion(int start, int length) {
-		this();
-		fStart = start;
-		fLength = length;
-	}
-
-	public void adjustLength(int i) {
-		fLength += i;
-
-	}
-
-	public void adjustStart(int i) {
-		fStart += i;
-
-	}
-
-
-	public void adjustTextLength(int i) {
-//		fTextLength += 1;
-		throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
-	}
-
-	public void equatePositions(ITextRegion region) {
-		fStart = region.getStart();
-		fLength = region.getLength();
-	}
-
-	public int getEnd() {
-		return fStart + fLength;
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public int getStart() {
-		return fStart;
-	}
-
-	public int getTextEnd() {
-		return fStart + fTextLength;
-	}
-
-	public int getTextLength() {
-		return fTextLength;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public String toString() {
-		return RegionToStringUtil.toString(this);
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		// can never be updated
-		return null;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/WhiteSpaceOnlyRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/WhiteSpaceOnlyRegion.java
deleted file mode 100644
index bc0bcc1..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/WhiteSpaceOnlyRegion.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class WhiteSpaceOnlyRegion implements ITextRegion {
-	static private final byte fTextLength = 0;
-
-	static private final String fType = DOMRegionContext.WHITE_SPACE;
-	protected int fLength;
-	protected int fStart;
-
-	public WhiteSpaceOnlyRegion(int start, int length) {
-		super();
-		fStart = start;
-		fLength = length;
-	}
-
-	public void adjust(int i) {
-		fStart += i;
-	}
-
-	public void adjustLength(int i) {
-		fLength += i;
-	}
-
-	public void adjustStart(int i) {
-		fStart += i;
-	}
-
-
-	public void adjustTextLength(int i) {
-		// not supported
-
-	}
-
-	public boolean contains(int position) {
-
-		return fStart <= position && position < fStart + fLength;
-	}
-
-	public void equatePositions(ITextRegion region) {
-		fStart = region.getStart();
-		fLength = region.getLength();
-	}
-
-	public int getEnd() {
-		return fStart + fLength;
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public int getStart() {
-		return fStart;
-	}
-
-	public int getTextEnd() {
-		return fStart + fTextLength;
-	}
-
-	public int getTextLength() {
-		return fTextLength;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public void setLength(int i) {
-		fLength = i;
-	}
-
-	public void setStart(int i) {
-		fStart = i;
-	}
-
-	public void setTextLength(short i) {
-		throw new RuntimeException("invalid call"); //$NON-NLS-1$
-	}
-
-	public void setType(String string) {
-		throw new RuntimeException("invalid call"); //$NON-NLS-1$
-	}
-
-	public String toString() {
-		return RegionToStringUtil.toString(this);
-	}
-
-	/**
-	 * For this ITextRegion type, the start must in terms of what the region
-	 * expects ... that is, its not document offset, but start relative to
-	 * what ever contains it.
-	 */
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		// if the region is an easy type (e.g. attribute value),
-		// and the requested changes are all
-		// alphanumeric, then make the change here locally.
-		// (This can obviously be made more sophisticated as the need arises,
-		// but should
-		// always follow this pattern.)
-		if (Debug.debugStructuredDocument) {
-			System.out.println("\t\tContextRegion::updateModel"); //$NON-NLS-1$
-			System.out.println("\t\t\tregion type is " + fType); //$NON-NLS-1$
-		}
-		boolean canHandle = false;
-		// note: we'll always handle deletes from these
-		// regions ... if its already that region,
-		// deleting something from it won't change its
-		// type. (remember, the calling program needs
-		// to insure we are not called, if not all contained
-		// on one region.
-		if ((changes == null) || (changes.length() == 0)) {
-			// delete case
-			// We can not do the quick delete, if
-			// if all the text in a region is to be deleted.
-			// Or, if the delete starts in the white space region.
-			// In these cases, a reparse is needed.
-			// Minor note, we use textEnd-start since it always
-			// less than or equal to end-start. This might
-			// cause us to miss a few cases we could have handled,
-			// but will prevent us from trying to handle funning cases
-			// involving whitespace.
-			if ((fStart >= getTextEnd()) || (Math.abs(lengthToReplace) >= getTextEnd() - getStart())) {
-				canHandle = false;
-			}
-			else {
-				canHandle = true;
-			}
-		}
-		else {
-			if (RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) {
-				canHandle = true;
-			}
-			else {
-				canHandle = false;
-			}
-
-		}
-		RegionChangedEvent result = null;
-
-		if (canHandle) {
-			// at this point, we still have the old region. We won't create a
-			// new instance, we'll just update the one we have, by changing
-			// its end postion,
-			// The parent flatnode, upon return, has responsibility
-			// for updating sibling regions.
-			// and in turn, the structuredDocument itself has responsibility
-			// for
-			// updating the text store and down stream flatnodes.
-			if (Debug.debugStructuredDocument) {
-				System.out.println("change handled by region"); //$NON-NLS-1$
-			}
-			int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
-			// Note: we adjust both end and text end, because for any change
-			// that is in only the trailing whitespace region, we should not
-			// do a quick change,
-			// so 'canHandle' should have been false for those case.
-			fLength += lengthDifference;
-
-			result = new RegionChangedEvent(parent.getParentDocument(), requester, parent, this, changes, requestStart, lengthToReplace);
-		}
-
-		return result;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLCDataTextRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLCDataTextRegion.java
deleted file mode 100644
index 23da980..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLCDataTextRegion.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class XMLCDataTextRegion implements ITextRegion {
-	static private final String fType = DOMRegionContext.XML_CDATA_TEXT;
-	private int fLength;
-	private int fStart;
-	private int fTextLength;
-
-
-	public XMLCDataTextRegion() {
-		super();
-	}
-
-	public XMLCDataTextRegion(int start, int textLength, int length) {
-		this();
-		fStart = start;
-		fTextLength = textLength;
-		fLength = length;
-	}
-
-	public void adjustLength(int i) {
-		fLength += i;
-
-	}
-
-	public void adjustStart(int i) {
-		fStart += i;
-
-	}
-
-
-	public void adjustTextLength(int i) {
-		fTextLength += i;
-
-	}
-
-	public void equatePositions(ITextRegion region) {
-		fStart = region.getStart();
-		fLength = region.getLength();
-		fTextLength = region.getTextLength();
-	}
-
-	public int getEnd() {
-		return fStart + fLength;
-	}
-
-	public int getLength() {
-		// TODO: shouldn't cdata be like XML Content ... length and text
-		// length
-		// always be the same, regardless of whitespace?
-		return fLength;
-	}
-
-	public int getStart() {
-		return fStart;
-	}
-
-	public int getTextEnd() {
-		return fStart + fTextLength;
-	}
-
-	public int getTextLength() {
-		return fTextLength;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public String toString() {
-		return RegionToStringUtil.toString(this);
-	}
-
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		// TODO: this is a pretty lame method, since XML CData region can have
-		// a much
-		// better rule for region update, but this is what previous
-		// (unfactored)
-		// version had, so I'll carry it over, of now.
-		RegionChangedEvent result = null;
-		// if the region is an easy type (e.g. attribute value),
-		// and the requested changes are all
-		// alphanumeric, then make the change here locally.
-		// (This can obviously be made more sophisticated as the need arises,
-		// but should
-		// always follow this pattern.)
-		if (Debug.debugStructuredDocument) {
-			System.out.println("\t\tContextRegion::updateModel"); //$NON-NLS-1$
-			System.out.println("\t\t\tregion type is " + fType); //$NON-NLS-1$
-		}
-		boolean canHandle = false;
-		// note: we'll always handle deletes from these
-		// regions ... if its already that region,
-		// deleting something from it won't change its
-		// type. (remember, the calling program needs
-		// to insure we are not called, if not all contained
-		// on one region.
-		if ((changes == null) || (changes.length() == 0)) {
-			// delete case
-			// We can not do the quick delete, if
-			// if all the text in a region is to be deleted.
-			// Or, if the delete starts in the white space region.
-			// In these cases, a reparse is needed.
-			// Minor note, we use textEnd-start since it always
-			// less than or equal to end-start. This might
-			// cause us to miss a few cases we could have handled,
-			// but will prevent us from trying to handle funning cases
-			// involving whitespace.
-			if ((fStart >= getTextEnd()) || (Math.abs(lengthToReplace) >= getTextEnd() - getStart())) {
-				canHandle = false;
-			} else {
-				canHandle = true;
-			}
-		} else {
-			if ((RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) || RegionUpdateRule.canHandleAsLetterOrDigit(this, parent, changes, requestStart, lengthToReplace)) {
-				canHandle = true;
-			} else {
-				canHandle = false;
-			}
-
-		}
-		if (canHandle) {
-			// at this point, we still have the old region. We won't create a
-			// new instance, we'll just update the one we have, by changing
-			// its end postion,
-			// The parent flatnode, upon return, has responsibility
-			// for updating sibling regions.
-			// and in turn, the structuredDocument itself has responsibility
-			// for
-			// updating the text store and down stream flatnodes.
-			if (Debug.debugStructuredDocument) {
-				System.out.println("change handled by region"); //$NON-NLS-1$
-			}
-			int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
-			// Note: we adjust both end and text end, because for any change
-			// that is in only the trailing whitespace region, we should not
-			// do a quick change,
-			// so 'canHandle' should have been false for those case.
-			// TO_DO_FUTURE: cache value of canHandleAsWhiteSpace from above
-			// If we are handling as whitespace, there is no need to increase
-			// the text length, only
-			// the total length is changing.
-			if (!RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) {
-				fTextLength += lengthDifference;
-			}
-			fLength += lengthDifference;
-			result = new RegionChangedEvent(parent.getParentDocument(), requester, parent, this, changes, requestStart, lengthToReplace);
-		}
-
-		return result;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLContentRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLContentRegion.java
deleted file mode 100644
index e9088db..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLContentRegion.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-
-public class XMLContentRegion implements ITextRegion {
-	static private final String fType = DOMRegionContext.XML_CONTENT;
-	// length and textLength are always the same for content region
-	//private int fTextLength;
-	private int fLength;
-	private int fStart;
-
-
-	public XMLContentRegion() {
-		super();
-	}
-
-	public XMLContentRegion(int start, int length) {
-		this();
-		fStart = start;
-		fLength = length;
-	}
-
-
-	public void adjustLength(int i) {
-		fLength += i;
-
-	}
-
-	public void adjustStart(int i) {
-		fStart += i;
-
-	}
-
-
-	public void adjustTextLength(int i) {
-		// not supported
-
-	}
-
-	public void equatePositions(ITextRegion region) {
-		fStart = region.getStart();
-		fLength = region.getLength();
-	}
-
-	public int getEnd() {
-		return fStart + fLength;
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public int getStart() {
-		return fStart;
-	}
-
-	public int getTextEnd() {
-		return fStart + fLength;
-	}
-
-	public int getTextLength() {
-		return fLength;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public String toString() {
-		return RegionToStringUtil.toString(this);
-	}
-
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		// TODO: this is a pretty lame method, since XML Content can have a
-		// much
-		// better rule for region update, but this is what previous
-		// (unfactored)
-		// version had, so I'll carry it over, of now.
-		RegionChangedEvent result = null;
-		// if the region is an easy type (e.g. attribute value),
-		// and the requested changes are all
-		// alphanumeric, then make the change here locally.
-		// (This can obviously be made more sophisticated as the need arises,
-		// but should
-		// always follow this pattern.)
-		if (Debug.debugStructuredDocument) {
-			System.out.println("\t\tContextRegion::updateModel"); //$NON-NLS-1$
-			System.out.println("\t\t\tregion type is " + fType); //$NON-NLS-1$
-		}
-		boolean canHandle = false;
-		// note: we'll always handle deletes from these
-		// regions ... if its already that region,
-		// deleting something from it won't change its
-		// type. (remember, the calling program needs
-		// to insure we are not called, if not all contained
-		// on one region.
-		if ((changes == null) || (changes.length() == 0)) {
-			// delete case
-			// We can not do the quick delete, if
-			// if all the text in a region is to be deleted.
-			// Or, if the delete starts in the white space region.
-			// In these cases, a reparse is needed.
-			// Minor note, we use textEnd-start since it always
-			// less than or equal to end-start. This might
-			// cause us to miss a few cases we could have handled,
-			// but will prevent us from trying to handle funning cases
-			// involving whitespace.
-			if ((fStart >= getTextEnd()) || (Math.abs(lengthToReplace) >= getTextEnd() - getStart())) {
-				canHandle = false;
-			} else {
-				canHandle = true;
-			}
-		} else {
-			if ((RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) || RegionUpdateRule.canHandleAsLetterOrDigit(this, parent, changes, requestStart, lengthToReplace)) {
-				canHandle = true;
-			} else {
-				canHandle = false;
-			}
-
-		}
-		if (canHandle) {
-			// at this point, we still have the old region. We won't create a
-			// new instance, we'll just update the one we have, by changing
-			// its end postion,
-			// The parent flatnode, upon return, has responsibility
-			// for updating sibling regions.
-			// and in turn, the structuredDocument itself has responsibility
-			// for
-			// updating the text store and down stream flatnodes.
-			if (Debug.debugStructuredDocument) {
-				System.out.println("change handled by region"); //$NON-NLS-1$
-			}
-			int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
-			// Note: we adjust both end and text end, because for any change
-			// that is in only the trailing whitespace region, we should not
-			// do a quick change,
-			// so 'canHandle' should have been false for those case.
-			fLength += lengthDifference;
-			// TO_DO_FUTURE: cache value of canHandleAsWhiteSpace from above
-			// If we are handling as whitespace, there is no need to increase
-			// the text length, only
-			// the total length is changing.
-			// don't need for content region
-			//			if (!RegionUpdateRule.canHandleAsWhiteSpace(this, changes,
-			// fStart, lengthToReplace)) {
-			//				fTextLength += lengthDifference;
-			//			}
-			result = new RegionChangedEvent(parent.getParentDocument(), requester, parent, this, changes, requestStart, lengthToReplace);
-		}
-
-		return result;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserFactory.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserFactory.java
deleted file mode 100644
index 38df3ea..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserFactory.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-public class XMLHeadParserFactory {
-	public ITextRegion createToken(String context, int start, int textLength, int length, String text) {
-		ITextRegion newRegion = null;
-		//		if (context == XMLRegionContext.XML_CDATA_TEXT) {
-		newRegion = new XMLHeadParserRegion(context, start, textLength, length, text);
-		//		}
-		return newRegion;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserRegion.java
deleted file mode 100644
index f3917b6..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserRegion.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- * 
- * This class is not intended to be used, its just present to server as a
- * generic starting point for adding new specific region types.
- */
-
-public class XMLHeadParserRegion implements ITextRegion {
-	private int fLength;
-	private int fStart;
-	private String fText;
-	private int fTextLength;
-	// specify correct type
-	private String fType = DOMRegionContext.UNDEFINED;
-
-	public XMLHeadParserRegion() {
-		super();
-	}
-
-	public XMLHeadParserRegion(String context, int start, int textLength, int length, String text) {
-		this();
-		fType = context;
-		fStart = start;
-		fTextLength = textLength;
-		fLength = length;
-		fText = text;
-	}
-
-	public void adjustLength(int i) {
-		fLength += i;
-
-	}
-
-	public void adjustStart(int i) {
-		fStart += i;
-
-	}
-
-
-	public void adjustTextLength(int i) {
-		fTextLength += 1;
-
-	}
-
-	public void equatePositions(ITextRegion region) {
-		fStart = region.getStart();
-		fLength = region.getLength();
-		fTextLength = region.getTextLength();
-	}
-
-	public int getEnd() {
-		return fStart + fLength;
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public int getStart() {
-		return fStart;
-	}
-
-	public String getText() {
-		return fText;
-	}
-
-	public int getTextEnd() {
-		return fStart + fTextLength;
-	}
-
-	public int getTextLength() {
-		return fTextLength;
-	}
-
-	public String getType() {
-		return fType;
-	}
-
-	public String toString() {
-		return RegionToStringUtil.toString(this);
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		// can never be updated
-		return null;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLParserRegionFactory.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLParserRegionFactory.java
deleted file mode 100644
index 581f447..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLParserRegionFactory.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-
-
-import org.eclipse.wst.sse.core.internal.parser.ContextRegion;
-import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- * 
- * This region factory is very specific to the parser output, and the specific
- * implementation classes for various regions.
- */
-
-public class XMLParserRegionFactory {
-
-	public XMLParserRegionFactory() {
-		super();
-	}
-
-	public ITextRegion createToken(ITextRegionContainer parent, String context, int start, int textLength, int length) {
-		return this.createToken(parent, context, start, textLength, length, null, null);
-	}
-
-	public ITextRegion createToken(ITextRegionContainer parent, String context, int start, int textLength, int length, String lang, String surroundingTag) {
-		ITextRegion newRegion = createToken(context, start, textLength, length);
-		// DW, 4/16/2003 token regions no longer have parents
-		// newRegion.setParent(parent);
-		return newRegion;
-	}
-
-	public ITextRegion createToken(String context, int start, int textLength, int length) {
-		return this.createToken(context, start, textLength, length, null, null);
-	}
-
-	public ITextRegion createToken(String context, int start, int textLength, int length, String lang, String surroundingTag) {
-		ITextRegion newRegion = null;
-		if (context == DOMRegionContext.XML_CDATA_TEXT) {
-			newRegion = new XMLCDataTextRegion(start, textLength, length);
-		}
-		else if (context == DOMRegionContext.XML_CONTENT) {
-			newRegion = new XMLContentRegion(start, length);
-		}
-		else if (context == DOMRegionContext.XML_TAG_NAME) {
-			newRegion = new TagNameRegion(start, textLength, length);
-		}
-		else if (context == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-			newRegion = new AttributeNameRegion(start, textLength, length);
-		}
-		else if (context == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
-			newRegion = new AttributeEqualsRegion(start, textLength, length);
-		}
-		else if (context == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-			newRegion = new AttributeValueRegion(start, textLength, length);
-		}
-		else if (context == DOMRegionContext.XML_TAG_OPEN) {
-			newRegion = new TagOpenRegion(start, textLength, length);
-		}
-		else if (context == DOMRegionContext.XML_END_TAG_OPEN) {
-			newRegion = new EndTagOpenRegion(start, textLength, length);
-		}
-		else if (context == DOMRegionContext.XML_TAG_CLOSE) {
-			newRegion = new TagCloseRegion(start);
-		}
-		else if (context == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-			newRegion = new EmptyTagCloseRegion(start, textLength, length);
-		}
-		else if (context == DOMRegionContext.WHITE_SPACE) {
-			newRegion = new WhiteSpaceOnlyRegion(start, length);
-		}
-		else
-		// removed this condition during transition, and implemented in
-		// subclass
-		// if (context == XMLJSPRegionContexts.JSP_CONTENT) {
-		// newRegion = new JSPCodeRegion(context, start, textLength, length);
-		// } else
-		if (context == DOMRegionContext.BLOCK_TEXT) {
-			newRegion = new ForeignRegion(context, start, textLength, length);
-			((ForeignRegion) newRegion).setSurroundingTag(surroundingTag);
-		}
-		else {
-			newRegion = new ContextRegion(context, start, textLength, length);
-		}
-		return newRegion;
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java
deleted file mode 100644
index 6c6c59b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     David Carver - STAR - [205989] - [validation] validate XML after XInclude resolution
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-
-/**
- * Sets default values for XML Core preferences
- */
-public class XMLCorePreferenceInitializer extends AbstractPreferenceInitializer {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
-	 */
-	public void initializeDefaultPreferences() {
-		IEclipsePreferences node = new DefaultScope().getNode(XMLCorePlugin.getDefault().getBundle().getSymbolicName());
-
-		// formatting preferences
-		node.putInt(XMLCorePreferenceNames.LINE_WIDTH, 72);
-		node.putBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES, false);
-		node.put(XMLCorePreferenceNames.INDENTATION_CHAR, XMLCorePreferenceNames.TAB);
-		node.putInt(XMLCorePreferenceNames.INDENTATION_SIZE, 1);
-		node.putBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS, false);
-		node.putBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET, false);
-		node.putBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT, false);
-		node.putBoolean(XMLCorePreferenceNames.SPACE_BEFORE_EMPTY_CLOSE_TAG, true);
-		
-		// cleanup preferences
-		node.putBoolean(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS, true);
-		node.putBoolean(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, true);
-		node.putBoolean(XMLCorePreferenceNames.INSERT_MISSING_TAGS, true);
-		node.putBoolean(XMLCorePreferenceNames.QUOTE_ATTR_VALUES, true);
-		node.putBoolean(XMLCorePreferenceNames.FORMAT_SOURCE, true);
-		node.putBoolean(XMLCorePreferenceNames.CONVERT_EOL_CODES, false);
-
-		node.put(CommonEncodingPreferenceNames.INPUT_CODESET, ""); //$NON-NLS-1$
-		node.put(CommonEncodingPreferenceNames.OUTPUT_CODESET, "UTF-8");//$NON-NLS-1$
-		node.put(CommonEncodingPreferenceNames.END_OF_LINE_CODE, ""); //$NON-NLS-1$
-
-		// this could be made smarter by actually looking up the content
-		// type's valid extensions
-		node.put(XMLCorePreferenceNames.DEFAULT_EXTENSION, "xml"); //$NON-NLS-1$
-
-		node.putBoolean(XMLCorePreferenceNames.WARN_NO_GRAMMAR, true);
-		node.putInt(XMLCorePreferenceNames.INDICATE_NO_GRAMMAR, 1);
-		node.putBoolean(XMLCorePreferenceNames.USE_XINCLUDE, false);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java
deleted file mode 100644
index f572af5..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     David Carver - STAR - [205989] - [validation] validate XML after XInclude resolution
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.preferences;
-
-/**
- * Common preference keys used by XML core
- * 
- * @plannedfor 1.0
- */
-public class XMLCorePreferenceNames {
-	private XMLCorePreferenceNames() {
-		// empty private constructor so users cannot instantiate class
-	}
-
-	/**
-	 * The default extension to use when none is specified in the New File
-	 * Wizard.
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 */
-	public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
-
-
-	/**
-	 * The maximum width of a line before a line split is needed.
-	 * <p>
-	 * Value is of type <code>Integer</code>.
-	 * </p>
-	 */
-	public static final String LINE_WIDTH = "lineWidth";//$NON-NLS-1$
-
-	/**
-	 * Indicates if all blanks lines should be cleared during formatting.
-	 * Blank lines will be kept when false.
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public static final String CLEAR_ALL_BLANK_LINES = "clearAllBlankLines";//$NON-NLS-1$
-
-	/**
-	 * The number of #INDENTATION_CHAR for 1 indentation.
-	 * <p>
-	 * Value is of type <code>Integer</code>.
-	 * </p>
-	 */
-	public static final String INDENTATION_SIZE = "indentationSize";//$NON-NLS-1$
-
-	/**
-	 * The character used for indentation.
-	 * <p>
-	 * Value is of type <code>String</code>.<br />
-	 * Possible values: {TAB, SPACE}
-	 * </p>
-	 */
-	public static final String INDENTATION_CHAR = "indentationChar";//$NON-NLS-1$
-
-	/**
-	 * Possible value for the preference #INDENTATION_CHAR. Indicates to use
-	 * tab character when formatting.
-	 * 
-	 * @see #SPACE
-	 * @see #INDENTATION_CHAR
-	 */
-	public static final String TAB = "tab"; //$NON-NLS-1$
-
-	/**
-	 * Possible value for the preference #INDENTATION_CHAR. Indicates to use
-	 * space character when formatting.
-	 * 
-	 * @see #TAB
-	 * @see #INDENTATION_CHAR
-	 */
-	public static final String SPACE = "space"; //$NON-NLS-1$
-
-	/**
-	 * Indicates if tags with multiple attributes should be formatted
-	 * (splitting each attr on a new line).
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public static final String SPLIT_MULTI_ATTRS = "splitMultiAttrs";//$NON-NLS-1$
-
-	/**
-	 * Indicates whether or not cleanup processor should format source.
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public static final String FORMAT_SOURCE = "formatSource";//$NON-NLS-1$
-
-	/**
-	 * Indicates whether or not empty elements should be compressed during
-	 * cleanup.
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public static final String COMPRESS_EMPTY_ELEMENT_TAGS = "compressEmptyElementTags";//$NON-NLS-1$
-
-	/**
-	 * Indicates whether or not to insert required attributes during cleanup.
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public static final String INSERT_REQUIRED_ATTRS = "insertRequiredAttrs";//$NON-NLS-1$
-
-	/**
-	 * Indicates whether or not to insert missing tags during cleanup.
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public static final String INSERT_MISSING_TAGS = "insertMissingTags";//$NON-NLS-1$
-
-	/**
-	 * Indicates whether or not to quote all attribute values during cleanup.
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public static final String QUOTE_ATTR_VALUES = "quoteAttrValues";//$NON-NLS-1$
-
-	/**
-	 * Indicates whether or not to convert all line delimiters during cleanup.
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 * @deprecated - no longer used
-	 */
-	public static final String CONVERT_EOL_CODES = "convertEOLCodes";//$NON-NLS-1$
-
-	/**
-	 * Indicates the line delimiter to use during cleanup if converting line
-	 * delimiters.
-	 * <p>
-	 * Value is of type <code>String</code>.<br />
-	 * Possible values: {CR, CRLF, LF, NO_TRANSLATION}
-	 * </p>
-	 * 
-	 */
-	public static final String CLEANUP_EOL_CODE = "cleanupEOLCode";//$NON-NLS-1$
-
-	/**
-	 * Indicates whether or not a warning should be produced when validating a
-	 * file that specifies not grammar.
-	 * <p>
-	 * Value is of type <code>boolean</code>.<br />
-	 * Possible values: {TRUE, FALSE}
-	 * </p>
-	 * @deprecated
-	 */
-	public static final String WARN_NO_GRAMMAR = "warnNoGrammar";//$NON-NLS-1$
-	
-	/**
-	 * Indicates whether or not a message should be produced when validating a
-	 * file that specifies not grammar.
-	 * <p>
-	 * Value is of type <code>integer</code>.<br />
-	 * Possible values: {0, 1, 2} (none, warning, error)
-	 * </p>
-	 */
-	public static final String INDICATE_NO_GRAMMAR = "indicateNoGrammar";//$NON-NLS-1$
-
- 	/**
-	 * Indicates whether or not xincludes should be processed before
-	 * validation.
-	 * <p>
-	 * Value is of type <code>boolean</code>.<br />
-	 * Possible values: {TRUE, FALSE}
-	 * </p>
-	 * 
-	 */
-	public static final String USE_XINCLUDE = "xinclude";//$NON-NLS-1$
-
-	/**
-	 * Indicates if all whitespace in tags with CDATA content should be
-	 * preserved.
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public static final String PRESERVE_CDATACONTENT = "preserveCDATAContent";//$NON-NLS-1$
-
-	/**
-	 * Indicates if end brackets of start tags should be placed on a new line
-	 * if the start tag spans more than one line.
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public static final String ALIGN_END_BRACKET = "alignEndBracket";//$NON-NLS-1$
-	
-	/**
-	 * Indicates if an empty close tag should have a space inserted before
-	 * closing.
-	 * <p>
-	 * Value is of type <code>Boolean</code>
-	 * </p>
-	 */
-	public static final String SPACE_BEFORE_EMPTY_CLOSE_TAG = "spaceBeforeEmptyCloseTag";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterFactoryImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterFactoryImpl.java
deleted file mode 100644
index 7376d4e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterFactoryImpl.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.propagate;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-
-/**
- * The PropagatingAdapterFactory is part of the "adapt on create" mechanism. A
- * PropagatingAdapter, once added to a node, will cause proagating adapters to
- * be created for all child nodes. A side effect of creating a
- * PropagatingAdapter for a node is that is is also creates adapters for and
- * adapts the Node for all other registered 'create on adapt' Adapters. This
- * other adapters are registered by registering their factories via plugin
- * extension point.
- */
-public class PropagatingAdapterFactoryImpl extends AbstractAdapterFactory implements PropagatingAdapterFactory {
-
-	private PropagatingAdapter fAdapterInstance;
-	private List fContributedFactories = null;
-
-	/**
-	 * PropagatingAdapterFactory constructor comment.
-	 */
-	public PropagatingAdapterFactoryImpl() {
-		this(PropagatingAdapter.class, true);
-	}
-
-	protected PropagatingAdapterFactoryImpl(Object adapterKey, boolean registerAdapters) { // ,
-		super(adapterKey, registerAdapters);
-	}
-
-	public void addContributedFactories(INodeAdapterFactory factory) {
-		if (fContributedFactories != null) {
-			fContributedFactories.add(factory);
-		}
-
-	}
-
-	/**
-	 * createAdapter method comment.
-	 */
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		// every notifier get's one of these
-		// (and the same instance of it)
-		return getAdapterInstance();
-	}
-
-	/**
-	 * Gets the adapterInstance.
-	 * 
-	 * @return Returns a PropagatingAdapter
-	 */
-	private PropagatingAdapter getAdapterInstance() {
-		if (fAdapterInstance == null) {
-			fAdapterInstance = new PropagatingAdapterImpl();
-			if (fContributedFactories != null) {
-				for (int i = 0; i < fContributedFactories.size(); i++)
-					fAdapterInstance.addAdaptOnCreateFactory((PropagatingAdapterFactory) fContributedFactories.get(i));
-			}
-		}
-		return fAdapterInstance;
-	}
-
-	public void release() {
-		// give the adapter instance a chance to release its factories
-		getAdapterInstance().release();
-
-	}
-
-	public void setContributedFactories(ArrayList list) {
-		fContributedFactories = list;
-
-	}
-
-	public INodeAdapterFactory copy() {
-		PropagatingAdapterFactory clonedInstance = new PropagatingAdapterFactoryImpl(getAdapterKey(), isShouldRegisterAdapter());
-		// clone this adapters specific list of adapter factories too
-		if (fContributedFactories != null) {
-			
-			Iterator iterator = fContributedFactories.iterator();
-			clonedInstance.setContributedFactories(new ArrayList());
-			while (iterator.hasNext()) {
-				INodeAdapterFactory existingFactory = (INodeAdapterFactory) iterator.next();
-				clonedInstance.addContributedFactories(existingFactory.copy());
-			}
-		}
-		return clonedInstance;
-	}
-
-	
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterImpl.java
deleted file mode 100644
index f581590..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterImpl.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.propagate;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class PropagatingAdapterImpl implements PropagatingAdapter {
-
-	private List adaptOnCreateFactories = null;
-
-	/**
-	 * AbstractPropagatingAdapterImpl constructor comment.
-	 */
-	public PropagatingAdapterImpl() {
-		super();
-	}
-
-	private void adaptOnCreate(IDOMNode node) {
-		// give each of the factories a chance to adapt the node, if it
-		// chooses to
-		if (adaptOnCreateFactories != null) {
-
-
-			synchronized (adaptOnCreateFactories) {
-				int length = adaptOnCreateFactories.size();
-				for (int i = 0; i < length; i++) {
-					INodeAdapterFactory factory = (INodeAdapterFactory) adaptOnCreateFactories.get(i);
-					factory.adapt(node);
-				}
-			}
-
-		}
-
-	}
-
-	/**
-	 * This mechanism can be made "easier to use" later.
-	 */
-	public void addAdaptOnCreateFactory(INodeAdapterFactory factory) {
-		getAdaptOnCreateFactories().add(factory);
-	}
-
-	/**
-	 * Gets the adaptOnCreateFactories.
-	 * 
-	 * @return Returns a List
-	 */
-	public List getAdaptOnCreateFactories() {
-		if (adaptOnCreateFactories == null)
-			adaptOnCreateFactories = new ArrayList();
-		return adaptOnCreateFactories;
-	}
-
-
-	/**
-	 * @see PropagatingAdapter#initializeForFactory(INodeAdapterFactory,
-	 *      INodeNotifier)
-	 */
-	public void initializeForFactory(INodeAdapterFactory factory, INodeNotifier node) {
-		// ISSUE: we are a DOM specific implimentation, 
-		// we should not be.
-		if (node instanceof IDOMNode) {
-			IDOMNode xmlNode = (IDOMNode) node;
-			propagateTo(xmlNode);
-		}
-	}
-
-	/**
-	 * Allowing the INodeAdapter to compare itself against the type allows it
-	 * to return true in more than one case.
-	 */
-	public boolean isAdapterForType(Object type) {
-		return type.equals(PropagatingAdapter.class);
-	}
-
-	private boolean isInteresting(Object newValue) {
-		return (newValue != null && (newValue instanceof Element || newValue instanceof Document || newValue instanceof DocumentType));
-	}
-
-	/**
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		// Issue: We only propagate to Elements ...
-		// not attributes too! We should careful consider doning all when
-		// when we improve "adapt on create" design.
-		if (eventType == INodeNotifier.ADD && isInteresting(newValue)) {
-			propagateTo((IDOMNode) newValue);
-		}
-	}
-
-	private void propagateTo(IDOMNode node) {
-		// get adapter to ensure its created
-		node.getAdapterFor(PropagatingAdapter.class);
-		adaptOnCreate(node);
-		propagateToChildren(node);
-	}
-
-	private void propagateToChildren(IDOMNode parent) {
-		for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
-			propagateTo((IDOMNode) child);
-		}
-	}
-
-	/**
-	 * @see PropagatingAdapter#release()
-	 */
-	public void release() {
-		if (adaptOnCreateFactories != null) {
-
-			synchronized (adaptOnCreateFactories) {
-				int length = adaptOnCreateFactories.size();
-				for (int i = 0; i < length; i++) {
-					INodeAdapterFactory factory = (INodeAdapterFactory) adaptOnCreateFactories.get(i);
-					factory.release();
-				}
-			}
-
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLCharEntity.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLCharEntity.java
deleted file mode 100644
index b1fb483..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLCharEntity.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional;
-
-
-
-/**
- * XML Namespace constants
- * 
- * @plannedfor 1.0
- */
-public interface IXMLCharEntity {
-	static final String AMP_NAME = "amp";//$NON-NLS-1$
-	static final String AMP_REF = "&amp;";//$NON-NLS-1$
-	static final String AMP_VALUE = "&";//$NON-NLS-1$
-	static final String APOS_NAME = "apos";//$NON-NLS-1$
-	static final String APOS_REF = "&apos;";//$NON-NLS-1$
-	static final String APOS_VALUE = "'";//$NON-NLS-1$
-	static final String GT_NAME = "gt";//$NON-NLS-1$
-	static final String GT_REF = "&gt;";//$NON-NLS-1$
-	static final String GT_VALUE = ">";//$NON-NLS-1$
-
-	static final String LT_NAME = "lt";//$NON-NLS-1$
-	static final String LT_REF = "&lt;";//$NON-NLS-1$
-	static final String LT_VALUE = "<";//$NON-NLS-1$
-	static final String QUOT_NAME = "quot";//$NON-NLS-1$
-	static final String QUOT_REF = "&quot;";//$NON-NLS-1$
-	static final String QUOT_VALUE = "\"";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLNamespace.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLNamespace.java
deleted file mode 100644
index 8cb2260..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLNamespace.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional;
-
-
-
-/**
- * XML Namespace constants
- * 
- * @plannedfor 1.0
- */
-public interface IXMLNamespace {
-
-	static final String XMLNS = "xmlns";//$NON-NLS-1$
-	static final String XMLNS_PREFIX = "xmlns:";//$NON-NLS-1$
-	static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLPreferenceNames.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLPreferenceNames.java
deleted file mode 100644
index df49d48..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLPreferenceNames.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional;
-
-/**
- * Keys to use for preference settings.
- * 
- * @plannedfor 1.0
- */
-
-public interface IXMLPreferenceNames {
-	String CLEANUP_ATTR_NAME_CASE = "cleanupAttrNameCase";//$NON-NLS-1$
-	String CLEANUP_EOL_CODE = "cleanupEOLCode";//$NON-NLS-1$
-	// cleanup preference names
-	String CLEANUP_TAG_NAME_CASE = "cleanupTagNameCase";//$NON-NLS-1$
-	String CONVERT_EOL_CODES = "convertEOLCodes";//$NON-NLS-1$
-	String FORMAT_SOURCE = "formatSource";//$NON-NLS-1$
-	String INSERT_MISSING_TAGS = "insertMissingTags";//$NON-NLS-1$
-
-	// others
-	String LAST_ACTIVE_PAGE = "lastActivePage";//$NON-NLS-1$
-	String QUOTE_ATTR_VALUES = "quoteAttrValues";//$NON-NLS-1$
-
-	/*
-	 * not used for now // highlighting types String COMMENT_BORDER =
-	 * "commentBorder";//$NON-NLS-1$ String COMMENT_TEXT =
-	 * "commentText";//$NON-NLS-1$ String CDATA_BORDER =
-	 * "cdataBorder";//$NON-NLS-1$ String CDATA_TEXT =
-	 * "cdataText";//$NON-NLS-1$ String PI_BORDER = "piBorder";//$NON-NLS-1$
-	 * String PI_CONTENT = "piContent";//$NON-NLS-1$ String TAG_BORDER =
-	 * "tagBorder";//$NON-NLS-1$ String TAG_NAME = "tagName";//$NON-NLS-1$
-	 * String TAG_ATTRIBUTE_NAME = "tagAttributeName";//$NON-NLS-1$ String
-	 * TAG_ATTRIBUTE_VALUE = "tagAttributeValue";//$NON-NLS-1$ String
-	 * DECL_BORDER = "declBoder";//$NON-NLS-1$ String DOCTYPE_NAME =
-	 * "doctypeName";//$NON-NLS-1$ String DOCTYPE_EXTERNAL_ID =
-	 * "doctypeExternalId";//$NON-NLS-1$ String DOCTYPE_EXTERNAL_ID_PUBREF =
-	 * "doctypeExternalPubref";//$NON-NLS-1$ String DOCTYPE_EXTERNAL_ID_SYSREF =
-	 * "doctypeExtrenalSysref";//$NON-NLS-1$ String XML_CONTENT =
-	 * "xmlContent";//$NON-NLS-1$ // highlighting preferences String COMMA =
-	 * ",";//$NON-NLS-1$ String COLOR = "color";//$NON-NLS-1$ String NAME =
-	 * "name";//$NON-NLS-1$ String FOREGROUND = "foreground";//$NON-NLS-1$
-	 * String BACKGROUND = "background";//$NON-NLS-1$ String BOLD =
-	 * "bold";//$NON-NLS-1$ String ITALIC = "italic";//$NON-NLS-1$
-	 */
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/NameValidator.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/NameValidator.java
deleted file mode 100644
index 496beb7..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/NameValidator.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional;
-
-import java.io.Reader;
-
-import org.eclipse.wst.xml.core.internal.parser.XML10Names;
-
-/**
- * This class provides consistent way to pre-check if a string is a valid XML
- * name, before, for example, trying to actually create an Element with it.
- * Attempting to create an Element with an invalid name will throw the appropriate
- * DOM Exception, but often clients want to check the validiting of a name
- * such as based on some user input, long in advance of actually making 
- * the DOM call. And, natually, want to give the user feedback in a more 
- * timely fashion.
- * 
- * ISSUE: is "endns:" really valid xml name? I think not, but this method
- * (currently) says it is.
- * 
- * @plannedfor 1.0
- */
-public final class NameValidator {
-
-	private static XML10Names xml10charChecker = null;
-
-	/**
-	 * Returns true if <code>name</code> is valid XML name according to XML
-	 * 1.0 rules, false otherwise.
-	 * 
-	 * @param name
-	 *            name is the string to test
-	 * @return true if valid name according to XML 1.0 rules, false otherwise.
-	 */
-	public synchronized static final boolean isValid(String name) {
-
-		if (xml10charChecker == null) {
-			xml10charChecker = inititailizeXML10Names();
-		}
-		return xml10charChecker.isValidXML10Name(name);
-	}
-
-	private static XML10Names inititailizeXML10Names() {
-		return new XML10Names((Reader) null);
-	}
-
-	/**
-	 * Not intenteded to be instantiated.
-	 */
-	private NameValidator() {
-		super();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocType.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocType.java
deleted file mode 100644
index 7a3d95f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocType.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.contentmodel;
-
-
-public interface CMDocType {
-	/**
-	 * CHTML files
-	 */
-	public final static String CHTML_DOC_TYPE = "CHTML";//$NON-NLS-1$
-	/**
-	 * HTML files
-	 */
-	public final static String HTML_DOC_TYPE = "HTML";//$NON-NLS-1$
-	/**
-	 * JSP 1.1 files (currently includes 1.2 elements for backward behavioral compatibility)
-	 */
-	public final static String JSP11_DOC_TYPE = "JSP11";//$NON-NLS-1$
-	/**
-	 * JSP 1.2 files
-	 */
-	public final static String JSP12_DOC_TYPE = "JSP12";//$NON-NLS-1$
-	/**
-	 * JSP 2.0 JSP files
-	 */
-	public final static String JSP20_DOC_TYPE = "JSP20";//$NON-NLS-1$
-	/**
-	 * JSP 2.0 Tag files
-	 */
-	public final static String TAG20_DOC_TYPE = "JSP20.TAG";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocumentTracker.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocumentTracker.java
deleted file mode 100644
index 19baa55..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocumentTracker.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.contentmodel;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-
-/**
- * Position dependent CMDocument tracker. A tracker matches a
- * IStructuredDocumentRegion with a CMDocument that it enables allowing for
- * position-dependent content models
- */
-public interface CMDocumentTracker {
-
-	CMDocument getDocument();
-
-	IStructuredDocumentRegion getStructuredDocumentRegion();
-}
-
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMNodeWrapper.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMNodeWrapper.java
deleted file mode 100644
index dbe75d6..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMNodeWrapper.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public interface CMNodeWrapper extends CMNode {
-	CMNode getOriginNode();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/ContentModelAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/ContentModelAdapter.java
deleted file mode 100644
index a66811e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/ContentModelAdapter.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * ContentModelAdapter interface
- */
-public interface ContentModelAdapter extends org.eclipse.wst.sse.core.internal.provisional.INodeAdapter {
-
-	/**
-	 * getCMDocument method
-	 * 
-	 * @return CMDocument
-	 * @param notifer
-	 * 
-	 * Returns CMDocument associated to the adapting node. For exampl : HTML
-	 * CMDocument is associated to HTML Document node, DTD CMDocument is
-	 * associated to DocumentType node, DTD/Schema CMDocument is associated to
-	 * Element node (sometime with namespace), and taglib CMDocument is
-	 * associated to taglib directive Element node.
-	 * 
-	 * INodeNotifier is passed for stateless (singleton) INodeAdapter
-	 * implementation.
-	 */
-	CMDocument getCMDocument(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier notifier);
-
-	/**
-	 * getDeclaration method
-	 * 
-	 * @return CMNode
-	 * @param notifer
-	 * 
-	 * Returns ElementDefinition or AttributeDefinition for the adapting node.
-	 * 
-	 * INodeNotifier is passed for stateless (singleton) INodeAdapter
-	 * implementation.
-	 */
-	CMNode getDeclaration(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier notifier);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/NullContentModel.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/NullContentModel.java
deleted file mode 100644
index 0b2ee6b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/NullContentModel.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.contentmodel;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-/**
- * This class can be used to intialize specific variables that need a content
- * model, until the true content model is available. This prevents having to
- * do lots of null checks.
- */
-public class NullContentModel implements CMDocument {
-
-	private static class NullCMNamedNodeMap implements CMNamedNodeMap {
-		public int getLength() {
-			return 0;
-		}
-
-		public CMNode getNamedItem(String name) {
-			return null;
-		}
-
-		public CMNode item(int index) {
-			return null;
-		}
-
-		public Iterator iterator() {
-			return new NullIterator();
-		}
-
-	}
-
-	private static class NullIterator implements Iterator {
-		public NullIterator() {
-		}
-
-		public boolean hasNext() {
-			return false;
-		}
-
-		public Object next() {
-			throw new NoSuchElementException();
-		}
-
-		public void remove() {
-			throw new UnsupportedOperationException("can not remove regions via iterator"); //$NON-NLS-1$
-
-		}
-
-	}
-
-	public NullContentModel() {
-		super();
-	}
-
-	public CMNamedNodeMap getElements() {
-		return new NullCMNamedNodeMap();
-	}
-
-	public CMNamedNodeMap getEntities() {
-		return new NullCMNamedNodeMap();
-	}
-
-	public CMNamespace getNamespace() {
-		return null;
-	}
-
-	public String getNodeName() {
-		return null;
-	}
-
-	public int getNodeType() {
-		return 0;
-	}
-
-	public Object getProperty(String propertyName) {
-		return null;
-	}
-
-	public boolean supports(String propertyName) {
-		return false;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contenttype/ContentTypeIdForXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contenttype/ContentTypeIdForXML.java
deleted file mode 100644
index 67c3a90..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contenttype/ContentTypeIdForXML.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.provisional.contenttype;
-
-/**
- * This class, with its few field, is a convience to provide compile-time
- * safety when refering to a contentType ID. The value of the contenttype id
- * field must match what is specified in plugin.xml file.
- * 
- * @plannedfor 1.0
- */
-final public class ContentTypeIdForXML {
-	/**
-	 * This content type is actually supplied by base Eclipse. Its given here
-	 * just as documentation for WTP based clients. Typically, clients should
-	 * use the values/constants supplied by base Eclipse.
-	 */
-	public final static String ContentTypeID_XML = getConstantString2();
-	/**
-	 * This value is public only for testing and special infrastructure. The
-	 * constant nor is value should not be referenced by clients.
-	 * 
-	 * The value of the contenttype id field must match what is specified in
-	 * plugin.xml file. Note: this value is intentially set with default
-	 * protected method so it will not be inlined.
-	 */
-	public final static String ContentTypeID_SSEXML = getConstantString();
-
-	/**
-	 * Don't allow instantiation.
-	 */
-	private ContentTypeIdForXML() {
-		super();
-	}
-
-	static String getConstantString() {
-		return "org.eclipse.wst.xml.core.xmlsource"; //$NON-NLS-1$
-	}
-
-	static String getConstantString2() {
-		return "org.eclipse.core.runtime.xml"; //$NON-NLS-1$
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMAttr.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMAttr.java
deleted file mode 100644
index ee16e15..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMAttr.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.w3c.dom.Attr;
-
-
-/**
- * This interface provides extensions to corresponding DOM interface to enable
- * functions for source editing and incremental parsing.
- * 
- * @plannedfor 1.0
- * 
- */
-public interface IDOMAttr extends IDOMNode, Attr {
-
-	/**
-	 * Get's the region in attribute representing the '=' sign. May or may not
-	 * have whitespace surrounding it.
-	 * 
-	 * @deprecated - 
-	 * ISSUE: need to change/remove to avoid exposing 'ITextRegion'
-	 * change to offset pattern, as others.
-	 * 
-	 * @return ITextRegion - the region representing the equals sign, or null
-	 *         if their is no equals sign.
-	 */
-	ITextRegion getEqualRegion();
-
-	/**
-	 * Gets the source location of the end of the attribute name, including
-	 * whitespace.
-	 * 
-	 * @return int - the source location of the end of the attribute name,
-	 *         including whitespace.
-	 */
-	int getNameRegionEndOffset();
-
-	/**
-	 * Gets the source location of the start of the attribute name.
-	 * 
-	 * @return int - the source location of the start of the attribute name.
-	 */
-	int getNameRegionStartOffset();
-
-
-	/**
-	 * Gets the text associated with the attribute name.
-	 * 
-	 * @return String - the text associated with the attribute name.
-	 */
-	String getNameRegionText();
-
-	/**
-	 * Gets the source location of the end of the attribute name, excluding
-	 * whitespace.
-	 * 
-	 * @return int - returns the source location of the end of the attribute
-	 *         name, excluding whitespace.
-	 */
-	int getNameRegionTextEndOffset();
-
-	/**
-	 * Gets the source location of the start of the attribute value.
-	 * 
-	 * @return int - returns the source location of the start of the attribute
-	 *         value.
-	 * 
-	 * ISSUE: need to better spec interaction with quote marks
-	 */
-	int getValueRegionStartOffset();
-
-	/**
-	 * Gets the text associated with the attribute value.
-	 * 
-	 * @return String - returns the text associated with the attribute value.
-	 */
-	String getValueRegionText();
-
-	/**
-	 * Check if Attr has a nested value (such as a JSP expression).
-	 * 
-	 * @return true if contains a nested value, false otherwise.
-	 */
-	boolean hasNestedValue();
-
-	/**
-	 * Check if Attr has only name but not equal sign nor value.
-	 * 
-	 * @return true if has only name but not equal sign nor value.
-	 */
-	boolean hasNameOnly();
-
-	/**
-	 * Returns true if attribute is defined globally for document. Returns
-	 * false if attribute is preceeded by a prefix (whether valid name space
-	 * or not). Returns true if its owning element is a global element.
-	 * 
-	 * @return true if attribute is defined globally for document. Returns
-	 *         false if attribute is preceeded by a prefix (whether valid name
-	 *         space or not). Returns true if its owning element is a global
-	 *         element.
-	 */
-	boolean isGlobalAttr();
-
-	/**
-	 * Returns true if is xml attr
-	 * 
-	 * ISSUE: need to figure out how to specify this one in a meaningful way.
-	 * 
-	 * @return boolean - returns true if is xml attr
-	 */
-	boolean isXMLAttr();
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocument.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocument.java
deleted file mode 100644
index 4d69e58..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocument.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This interface enables creation of DOCTYPE declaration and some DOM Level 2
- * interfaces. May be referenced but not implemented by clients.
- * 
- * @plannedfor 1.0
- */
-public interface IDOMDocument extends Node, Document, IDOMNode {
-
-	/**
-	 * create comment element. tagName must be registered as comment element
-	 * name in plugin.xml
-	 * 
-	 * @param tagName
-	 *            the element name
-	 * @param isJSPTag
-	 *            true if the element is JSP style comment (&lt;%-- ...
-	 *            --%&gt;)
-	 * @return Element element instance
-	 * @throws DOMException
-	 *             thrown if the element name is registered as comment element
-	 */
-	Element createCommentElement(String tagName, boolean isJSPTag) throws DOMException;
-
-	/**
-	 * Creates a DocumentType node
-	 * 
-	 * ISSUE: I believe this 'name' is the one specific in doctype extension,
-	 * need to verify.
-	 * 
-	 * @param name -
-	 *            name of the doctype
-	 * @return DocumentType - returns a document type node.
-	 */
-	DocumentType createDoctype(String name);
-
-	/**
-	 * Returns the DocumentType ID. Unlike the standard DOM approach of
-	 * "getDocumentType().getPublicId()", this method returns the id even if
-	 * implicit.
-	 * 
-	 * @return the DocumentType ID
-	 */
-	String getDocumentTypeId();
-
-	/**
-	 * NOT API ... needs to be removed/changed
-	 * 
-	 * ISSUE: need to specify
-	 * 
-	 * @deprecated
-	 * 
-	 * @return true if is JSPDocument
-	 * 
-	 */
-	boolean isJSPDocument();
-
-	/**
-	 * NOT API ... needs to be removed/changed
-	 * 
-	 * ISSUE: need to specify
-	 * 
-	 * @deprecated
-	 * 
-	 */
-	boolean isJSPType();
-
-	/**
-	 * NOT API ... may removed/changed
-	 * 
-	 * ISSUE: need to specify -- currently used to denote an HTML DOM document
-	 * is XHTML
-	 * 
-	 * @deprecated
-	 * 
-	 */
-	boolean isXMLType();
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocumentType.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocumentType.java
deleted file mode 100644
index 602c65e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocumentType.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.DocumentType;
-
-/**
- * This interface enables setting of Public and System ID for DOCTYPE
- * declaration.
- * 
- * @plannedfor 1.0
- */
-public interface IDOMDocumentType extends IDOMNode, DocumentType {
-
-
-	/**
-	 * Sets document type's public id, as source.
-	 * 
-	 * @param String -
-	 *            the publicId
-	 */
-	void setPublicId(String publicId);
-
-	/**
-	 * Sets docment type's system id, as source.
-	 * 
-	 * @param String -
-	 *            the systemId
-	 */
-	void setSystemId(String systemId);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMElement.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMElement.java
deleted file mode 100644
index fcd7763..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMElement.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-
-/**
- * This interface provides extensions to corresponding DOM interface to enable
- * functions for source editing and incremental parsing.
- * 
- * @plannedfor 1.0
- * 
- */
-public interface IDOMElement extends IDOMNode, Element {
-
-	/**
-	 * Retuns the start offset of the end tag.
-	 * 
-	 * ISSUE: need to sort out need for this
-	 * 
-	 * @return int - the start offset of the end tag.
-	 */
-	int getEndStartOffset();
-
-	/**
-	 * Returns the end offset of the
-	 * 
-	 * ISSUE: need to sort out need for this
-	 * 
-	 * @return int - the end offset of the start tag.
-	 */
-	int getStartEndOffset();
-
-	/**
-	 * Returns true if has an end tag.
-	 * 
-	 * In our source-oriented DOM, sometimes Elements are "ended", even
-	 * without an explicit end tag in the source.
-	 * 
-	 * @return true if has an end tag.
-	 */
-	boolean hasEndTag();
-
-	/**
-	 * returns true if has a start tag.
-	 * 
-	 * In our source-oriented DOM, a lone end tag will cause a node to be
-	 * created in the tree, unlike well-formed-only DOMs.
-	 * 
-	 * @return true if has a start tag.
-	 */
-	boolean hasStartTag();
-
-	/**
-	 * returns true if this element is a comment element
-	 * 
-	 * @return true if this element is a comment element
-	 */
-	boolean isCommentTag();
-
-	/**
-	 * isEmptyTag method
-	 * 
-	 * @return boolean - true if is empty tag, false otherwise
-	 */
-	boolean isEmptyTag();
-
-	/**
-	 * Returns true if floating end tag.
-	 * 
-	 * @return true if floating end tag.
-	 */
-	boolean isEndTag();
-
-	/**
-	 * Returns true for "global tag" (basically, without prefix)
-	 * 
-	 * @return true for "global tag" (basically, without prefix)
-	 */
-	boolean isGlobalTag();
-
-	/**
-	 * Returns true for no start and the end tags in source.
-	 * 
-	 * Provided for some very special cases when, for example, and HTML tag is
-	 * assumed in an HTML document that does not have a literal HTML tag.
-	 * 
-	 * ISSUE: check with clients to see if still needed
-	 * 
-	 * @return true or no start and the end tags in source.
-	 */
-	boolean isImplicitTag();
-
-	/**
-	 * isJSPTag method
-	 * 
-	 * @return boolean
-	 * 
-	 * ISSUE: change to isContainerLanguageTag(String type);
-	 */
-	boolean isJSPTag();
-
-	/**
-	 * Returns true if start tag is closed.
-	 * 
-	 * @return true if start tag is closed.
-	 */
-	boolean isStartTagClosed();
-
-	/**
-	 * returns true if is xml tag
-	 * 
-	 * ISSUE: need to spec this better.
-	 * 
-	 * @return true if is xml tag
-	 */
-	boolean isXMLTag();
-
-	/**
-	 * NOT CLIENT API
-	 * 
-	 * notifyEndTagChanged
-	 * 
-	 */
-	void notifyEndTagChanged();
-
-	/**
-	 * NOT CLIENT API
-	 * 
-	 * notifyStartTagChanged
-	 * 
-	 */
-	void notifyStartTagChanged();
-
-	/**
-	 * NOT CLIENT API
-	 * 
-	 * Signify that this tag is a comment
-	 * 
-	 * For use only by parsers.
-	 * 
-	 */
-	void setCommentTag(boolean isCommentTag);
-
-	/**
-	 * NOT CLIENT API
-	 * 
-	 * Signify that this tag is an empty tag
-	 * 
-	 * For use only by parsers
-	 */
-	void setEmptyTag(boolean isEmptyTag);
-
-	/**
-	 * NOT CLIENT API
-	 * 
-	 * Signify that this tag is a JSP tag
-	 * 
-	 * For use only by parsers
-	 * 
-	 * ISSUE: I have had one non-parsing client who has had to use this ...
-	 * need to check
-	 * 
-	 */
-	void setJSPTag(boolean isJSPTag);
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public void setIdAttribute(String name, boolean isId);
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public void setIdAttributeNS(String namespaceURI, String localName, boolean isId);
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
-	 */
-	public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException;
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMEntity.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMEntity.java
deleted file mode 100644
index 3e22ec0..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMEntity.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.provisional.document;
-
-import org.w3c.dom.Entity;
-
-public interface IDOMEntity extends Entity {
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation of DOM 3.
-	 */
-	public String getInputEncoding();
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation of DOM 3.
-	 */
-	public String getXmlEncoding();
-
-	/**
-	 * NOT IMPLEMENTED. Is defined here in preparation of DOM 3.
-	 */
-	public String getXmlVersion();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMImplementation.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMImplementation.java
deleted file mode 100644
index da73e24..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMImplementation.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.provisional.document;
-
-public interface IDOMImplementation {
-
-	/**
-	 * NOT IMPLEMENTED. This is defined here in preparation of DOM 3.
-	 * 
-	 * This method returns a specialized object which implements the
-	 * specialized APIs of the specified feature and version, as specified in .
-	 * The specialized object may also be obtained by using binding-specific
-	 * casting methods but is not necessarily expected to, as discussed in .
-	 * This method also allow the implementation to provide specialized
-	 * objects which do not support the <code>DOMImplementation</code>
-	 * interface.
-	 * 
-	 * @param feature
-	 *            The name of the feature requested. Note that any plus sign
-	 *            "+" prepended to the name of the feature will be ignored
-	 *            since it is not significant in the context of this method.
-	 * @param version
-	 *            This is the version number of the feature to test.
-	 * @return Returns an object which implements the specialized APIs of the
-	 *         specified feature and version, if any, or <code>null</code>
-	 *         if there is no object which implements interfaces associated
-	 *         with that feature. If the <code>DOMObject</code> returned by
-	 *         this method implements the <code>DOMImplementation</code>
-	 *         interface, it must delegate to the primary core
-	 *         <code>DOMImplementation</code> and not return results
-	 *         inconsistent with the primary core
-	 *         <code>DOMImplementation</code> such as
-	 *         <code>hasFeature</code>, <code>getFeature</code>, etc.
-	 * @see DOM Level 3
-	 */
-	public Object getFeature(String feature, String version);
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMModel.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMModel.java
deleted file mode 100644
index 3effc7e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMModel.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.document;
-
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.document.XMLModelNotifier;
-
-/**
- * Provides means to get the XMLModel form of IStrucutredModel. Not to be
- * implemented or extended by clients.
- * 
- * @plannedfor 1.0
- */
-public interface IDOMModel extends IStructuredModel {
-
-	/**
-	 * Returns the DOM Document.
-	 * 
-	 * @return the DOM Document.
-	 */
-	IDOMDocument getDocument();
-
-	/**
-	 * 
-	 * Returns an source generator appropriate for this model.
-	 * 
-	 * @return the source generator
-	 */
-	ISourceGenerator getGenerator();
-
-	/**
-	 * NOT CLIENT API
-	 * 
-	 * Returns an XMLModelNotifier. Clients should not use.
-	 * 
-	 * ISSUE: should be "internalized".
-	 * 
-	 */
-	XMLModelNotifier getModelNotifier();
-
-	/**
-	 * NOT CLIENT API
-	 *
-	 * Sets the model notifier Clients should not use.
-	 * 
-	 * ISSUE: need to review with legacy clients.
-	 */
-	void setModelNotifier(XMLModelNotifier notifier);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMNode.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMNode.java
deleted file mode 100644
index ed8875f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMNode.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.document.InvalidCharacterException;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-
-/**
- * This interface describes the extended functionality of our source-oriented
- * DOM. First, our nodes extend the w3c Node interface, IndexedRegion, and
- * INodeNotifier. Plus, has the extra methods called out here.
- * 
- * ISSUE: the 'read-only' API should be broken out in their own interface
- * 
- * @plannedfor 1.0
- * 
- */
-public interface IDOMNode extends IndexedRegion, INodeNotifier, Node {
-
-	/**
-	 * Gets the last structured document region of this node.
-	 * 
-	 * ISSUE: need to resolve getEnd/getLast confusion.
-	 * 
-	 * @return IStructuredDocumentRegion - returns the last structured
-	 *         document region associated with
-	 */
-	IStructuredDocumentRegion getEndStructuredDocumentRegion();
-
-	/**
-	 * Gets the first structured document region of this node.
-	 * 
-	 * ISSUE: need to resolve getFirst/getStart confusion
-	 * 
-	 * @return the first structured document region of this node.
-	 */
-	IStructuredDocumentRegion getFirstStructuredDocumentRegion();
-
-	/**
-	 * Gets the last structured document region of this node.
-	 * 
-	 * ISSUE: need to resolve getEnd/getLast confusion.
-	 * 
-	 * @return IStructuredDocumentRegion - returns the last structured
-	 *         document region associated with
-	 */
-	IStructuredDocumentRegion getLastStructuredDocumentRegion();
-
-	/**
-	 * Returns the model associated with this node. Returns null if not part
-	 * of an active model.
-	 * 
-	 * @return IDOMModel - returns the IDOMModel this node is part of.
-	 */
-	IDOMModel getModel();
-
-	/**
-	 * Get's the region representing the name of this node
-	 * 
-	 * ISSUE: only implemented/used at attribute and DTDNodes -- should move.
-	 * 
-	 * @return ITextRegion - returns the ITextRegion associated with this
-	 *         Node.
-	 * 
-	 * @deprecated
-	 */
-	ITextRegion getNameRegion();
-
-	/**
-	 * Returns the literal source representing this node in source document.
-	 * 
-	 * ISSUE: need to fix implementation to match.
-	 * 
-	 * @return the literal source representing this node in source document.
-	 */
-	String getSource();
-
-	/**
-	 * Gets the first structured document region of this node.
-	 * 
-	 * ISSUE: need to resolve getFirst/getStart confusion
-	 * 
-	 * @return the first structured document region of this node.
-	 */
-	IStructuredDocumentRegion getStartStructuredDocumentRegion();
-
-	/**
-	 * Returns the structured document that underlies this node's model.
-	 * 
-	 * Returns null if this node is not actively part of a source document. In
-	 * contrast, in the pure DOM world, "owning document" is not null even
-	 * after a node is deleted from the DOM.
-	 * 
-	 * ISSUE: we need to fix our implementation to match this spec.
-	 * 
-	 * @return the structured document.
-	 */
-	IStructuredDocument getStructuredDocument();
-
-	/**
-	 * Get's the region representing the value of this node if only one
-	 * ITextRegion, null otherwise.
-	 * 
-	 * ISSUE: only implemented/used at attribute level, move "down".
-	 * 
-	 * @return ITextRegion - returns the ITextRegion associated with this
-	 *         Node.
-	 * 
-	 * @deprecated
-	 */
-	ITextRegion getValueRegion();
-
-	/**
-	 * Returns a string representing the source of this node, but with
-	 * character enties converted (e.g. &lt; is converted to '<').
-	 * 
-	 * ISSUE: need to better spec extent of this conversion, we may not know
-	 * all character entities.
-	 * 
-	 * ISSUE: need to fix implementation to match spec.
-	 * 
-	 * @return String - get's the source of this Node.
-	 */
-	String getValueSource();
-
-	/**
-	 * Used to know read-only state of children.
-	 * 
-	 * @return boolean Whether children of the element can be appended or
-	 *         removed.
-	 */
-	boolean isChildEditable();
-
-	/**
-	 * Returns true if tag is closed in source.
-	 * 
-	 * In our source orient DOM we sometimes end a Node without it being
-	 * explicitly closed in source.
-	 * 
-	 * @return boolean - true if node is closed
-	 */
-	boolean isClosed();
-
-	/**
-	 * Returns true if this node can contain children.
-	 * 
-	 * @return boolean - true if this node can contain children.
-	 */
-	boolean isContainer();
-
-	/**
-	 * Used to know read-only state of data.
-	 * 
-	 */
-	boolean isDataEditable();
-
-	/**
-	 * Set's readonly state of children
-	 * 
-	 */
-	void setChildEditable(boolean editable);
-
-	/**
-	 * Set's readonly state of data
-	 * 
-	 */
-	void setDataEditable(boolean editable);
-
-	/**
-	 * Sets readonly state of data
-	 * 
-	 * faster approach to set read-only state.
-	 */
-	void setEditable(boolean editable, boolean deep);
-
-	/**
-	 * Sets the specified raw source to the Text node. Throws
-	 * InvalidCharacterException when the specified raw source includes
-	 * invalid characters, such as, ' <', '>' and '&'. Valid character
-	 * entities, such as, "&amp;lt;", are accepted.
-	 */
-	void setSource(String source) throws InvalidCharacterException;
-
-	/**
-	 * Sets the specified raw source to the Text or Attr node's value. When
-	 * the specified raw source includes invalid characters, such as, ' <',
-	 * '>' and '&', converts them. Valid character entities, such as,
-	 * "&amp;lt;", are accepted.
-	 */
-	void setValueSource(String source);
-	
-	
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public short compareDocumentPosition(Node other) throws DOMException;
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public String getBaseURI();
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public Object getFeature(String feature, String version);
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public String getTextContent() throws DOMException;
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public Object getUserData(String key);
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public boolean isDefaultNamespace(String namespaceURI);
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public boolean isEqualNode(Node arg);
-	
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public boolean isSameNode(Node other);
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public String lookupNamespaceURI(String prefix);
-
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public String lookupPrefix(String namespaceURI);
-	
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public void setTextContent(String textContent) throws DOMException;
-	
-	
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public boolean isId();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMText.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMText.java
deleted file mode 100644
index efb3a5f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMText.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Text;
-
-/**
- * This interface provides extensions to corresponding DOM interface to enable
- * functions for source editing and incremental parsing.
- * 
- * @plannedfor 1.0
- * 
- */
-public interface IDOMText extends IDOMNode, Text {
-
-	/**
-	 * NOT API - can be eliminated or moved to ltk level
-	 * 
-	 * Appends the content of the text node
-	 * 
-	 * @param text -
-	 *            the Text to append.
-	 */
-	void appendText(Text text);
-
-	/**
-	 * NOT API - can be eliminated or moved to ltk level
-	 * 
-	 * Returns true if is not valid.
-	 */
-	boolean isInvalid();
-
-	/**
-	 * Returns true if is entirely white space.
-	 * 
-	 * This is intened to be better performing that all clients getting the
-	 * source, and checking themselves.
-	 * 
-	 * ISSUE: need to clarify if implementation is pure to "white space" as
-	 * per DOM spec? Here is the DOM spec:
-	 * 
-	 * Returns whether this text node contains <a
-	 * href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204#infoitem.character'>
-	 * element content whitespace</a>, often abusively called "ignorable
-	 * whitespace". The text node is determined to contain whitespace in
-	 * element content during the load of the document or if validation occurs
-	 * while using <code>Document.normalizeDocument()</code>.
-	 * 
-	 * @see DOM Level 3
-	 * 
-	 * @return true if is entirely white space.
-	 */
-
-	public boolean isElementContentWhitespace();
-
-	/**
-	 * NOT YET IMPLEMTENTED but exists here interface in preparation for DOM3
-	 * 
-	 * Returns all text of <code>Text</code> nodes logically-adjacent text
-	 * nodes to this node, concatenated in document order. <br>
-	 * For instance, in the example below <code>wholeText</code> on the
-	 * <code>Text</code> node that contains "bar" returns "barfoo", while on
-	 * the <code>Text</code> node that contains "foo" it returns "barfoo".
-	 * 
-	 * @see DOM Level 3
-	 * 
-	 */
-	public String getWholeText();
-
-	/**
-	 * NOT YET IMPLEMTENTED but exists here interface in preparation for DOM3
-	 * 
-	 * Replaces the text of the current node and all logically-adjacent text
-	 * nodes with the specified text. All logically-adjacent text nodes are
-	 * removed including the current node unless it was the recipient of the
-	 * replacement text. <br>
-	 * This method returns the node which received the replacement text. The
-	 * returned node is:
-	 * <ul>
-	 * <li><code>null</code>, when the replacement text is the empty
-	 * string; </li>
-	 * <li>the current node, except when the current node is read-only; </li>
-	 * <li> a new <code>Text</code> node of the same type (
-	 * <code>Text</code> or <code>CDATASection</code>) as the current
-	 * node inserted at the location of the replacement. </li>
-	 * </ul>
-	 * <br>
-	 * For instance, in the above example calling
-	 * <code>replaceWholeText</code> on the <code>Text</code> node that
-	 * contains "bar" with "yo" in argument results in the following: <br>
-	 * Where the nodes to be removed are read-only descendants of an
-	 * <code>EntityReference</code>, the <code>EntityReference</code>
-	 * must be removed instead of the read-only nodes. If any
-	 * <code>EntityReference</code> to be removed has descendants that are
-	 * not <code>EntityReference</code>, <code>Text</code>, or
-	 * <code>CDATASection</code> nodes, the <code>replaceWholeText</code>
-	 * method must fail before performing any modification of the document,
-	 * raising a <code>DOMException</code> with the code
-	 * <code>NO_MODIFICATION_ALLOWED_ERR</code>. <br>
-	 * For instance, in the example below calling
-	 * <code>replaceWholeText</code> on the <code>Text</code> node that
-	 * contains "bar" fails, because the <code>EntityReference</code> node
-	 * "ent" contains an <code>Element</code> node which cannot be removed.
-	 * 
-	 * @param content
-	 *            The content of the replacing <code>Text</code> node.
-	 * @return The <code>Text</code> node created with the specified
-	 *         content.
-	 * @exception DOMException
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if one of the
-	 *                <code>Text</code> nodes being replaced is readonly.
-	 * @see DOM Level 3
-	 */
-	public Text replaceWholeText(String content) throws DOMException;
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/ISourceGenerator.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/ISourceGenerator.java
deleted file mode 100644
index 473048c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/ISourceGenerator.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.document;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-/**
- * 
- * ISourceGenerator allows DOM models to generate source appropriate for their
- * parameter, relative to the model that provides the source generator.
- * 
- */
-
-public interface ISourceGenerator {
-
-	/**
-	 * Generate attribute name.
-	 * 
-	 * @param attr -
-	 *            the Attr
-	 * @return String - the string generated
-	 */
-	String generateAttrName(Attr attr);
-
-	/**
-	 * generateAttrValue
-	 * 
-	 * @param attr -
-	 *            the Attr
-	 * @return String - the string generated
-	 */
-	String generateAttrValue(Attr attr);
-
-	/**
-	 * generateAttrValue
-	 * 
-	 * @param attr -
-	 *            the Attr
-	 * @param char -
-	 *            the type of quote desired (' or ").
-	 * @return String - the string generated
-	 */
-	String generateAttrValue(Attr attr, char quote);
-
-	/**
-	 * generateAttrValue
-	 * 
-	 * @param value
-	 *            the String value
-	 * @param char -
-	 *            the type of quote desired (' or ").
-	 * @return String - the string generated
-	 */
-	String generateAttrValue(String value, char quote);
-
-	/**
-	 * generateCDATASection method
-	 * 
-	 * @param comment
-	 *            CDATASection
-	 * @return String - the string generated
-	 */
-	String generateCDATASection(CDATASection cdata);
-
-	/**
-	 * generateChild method
-	 * 
-	 * @return String
-	 * @param Node
-	 * @return String - the string generated
-	 */
-	String generateChild(Node parentNode);
-
-	/**
-	 * generateCloseTag
-	 * 
-	 * @param node -
-	 *            the Node
-	 * @return String - the string generated
-	 */
-	String generateCloseTag(Node node);
-
-	/**
-	 * generateComment method
-	 * 
-	 * @param comment
-	 *            org.w3c.dom.Comment
-	 * @return String - the string generated
-	 */
-	String generateComment(Comment comment);
-
-	/**
-	 * generateDoctype method
-	 * 
-	 * @param docType
-	 *            DocumentType
-	 * @return String - the string generated
-	 */
-	String generateDoctype(DocumentType docType);
-
-	/**
-	 * generateElement method
-	 * 
-	 * @param element -
-	 *            Element
-	 * @return String - the string generated
-	 */
-	String generateElement(Element element);
-
-	/**
-	 * generateEndTag method
-	 * 
-	 * @param element -
-	 *            Element
-	 * @return String - the string generated
-	 */
-	String generateEndTag(Element element);
-
-	/**
-	 * generateEntityRef method
-	 * 
-	 * @param entityRef
-	 *            EntityReference
-	 * @return String - the string generated
-	 */
-	String generateEntityRef(EntityReference entityRef);
-
-	/**
-	 * generatePI method
-	 * 
-	 * @param pi -
-	 *            ProcessingInstruction
-	 * @return String - the string generated
-	 */
-	String generatePI(ProcessingInstruction pi);
-
-	/**
-	 * generateSource method
-	 * 
-	 * @param node -
-	 *            the Node
-	 * @return String - the string generated
-	 */
-	String generateSource(Node node);
-
-	/**
-	 * generateStartTag method
-	 * 
-	 * @param element
-	 *            Element
-	 * @return String - the string generated
-	 */
-	String generateStartTag(Element element);
-
-	/**
-	 * Generate tag name.
-	 * 
-	 * @param element -
-	 *            element
-	 * @return String - the string generated
-	 */
-	String generateTagName(Element element);
-
-	/**
-	 * generateText method
-	 * 
-	 * @param text -
-	 *            the Text
-	 * @return String - the string generated
-	 */
-	String generateText(Text text);
-
-	/**
-	 * generate text data
-	 * 
-	 * @param text -
-	 *            the Text
-	 * @param data -
-	 *            the data
-	 * @return String - the string generated
-	 */
-	String generateTextData(Text text, String data);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java
deleted file mode 100644
index f30ed3a..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-
-public class CommentNodeFormatter extends NodeFormatter {
-	static private final String CR = "\r"; //$NON-NLS-1$
-	static private final String LF = "\n"; //$NON-NLS-1$
-
-	protected String adjustIndentations(String aString, String lineIndent, String singleIndent) {
-		String result = new String();
-
-		int indexOfLineDelimiter = StringUtils.indexOfLineDelimiter(aString);
-		result = aString.substring(0, indexOfLineDelimiter);
-		while (indexOfLineDelimiter != -1) {
-			// Before find the next LineDelimiter, we have to figure out the
-			// size of the current LineDelimiter
-			// so we can figure out how many bytes to skip before finding the
-			// next LineDelimiter.
-			// Otherwise, we may treat the LF in CRLF as the next
-			// LineDelimiter.
-			int lineDelimiterSize = 1;
-			if (aString.length() >= indexOfLineDelimiter + 2 && aString.substring(indexOfLineDelimiter, indexOfLineDelimiter + 1).compareTo(CR) == 0 && aString.substring(indexOfLineDelimiter + 1, indexOfLineDelimiter + 2).compareTo(LF) == 0)
-				lineDelimiterSize = 2;
-
-			int indexOfNextLineDelimiter = StringUtils.indexOfLineDelimiter(aString, indexOfLineDelimiter + lineDelimiterSize);
-			int indexOfNonblank = StringUtils.indexOfNonblank(aString, indexOfLineDelimiter);
-
-			if (indexOfNonblank != -1) {
-				if (indexOfNextLineDelimiter == -1) {
-					// last line; copy till the end
-					result += lineIndent + singleIndent + aString.substring(indexOfNonblank);
-				} else if (indexOfNextLineDelimiter != -1 && indexOfNextLineDelimiter < indexOfNonblank) {
-					// blank line; just add a indent
-					result += lineIndent + singleIndent;
-				} else {
-					// copy all text between indexOfNonblank and
-					// indexOfNextLineDelimiter
-					result += lineIndent + singleIndent + aString.substring(indexOfNonblank, indexOfNextLineDelimiter);
-				}
-
-				indexOfLineDelimiter = indexOfNextLineDelimiter;
-			} else {
-				if (indexOfNextLineDelimiter == -1) {
-					result += lineIndent;
-				} else {
-					// blank line; just add a indent
-					result += lineIndent + singleIndent;
-				}
-
-				indexOfLineDelimiter = indexOfNextLineDelimiter;
-			}
-		}
-
-		return result;
-	}
-
-	protected void formatNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		if (node != null) {
-			// lineDelimiterFound means multi line comment
-			String nodeValue = node.getNodeValue();
-			boolean lineDelimiterFoundInComment = StringUtils.containsLineDelimiter(nodeValue);
-
-			if (lineDelimiterFoundInComment) {
-				// format indentation before node
-				formatIndentationBeforeNode(node, formatContraints);
-
-				// adjust indentations in multi line comment
-				String lineDelimiter = node.getModel().getStructuredDocument().getLineDelimiter();
-				String lineIndent = formatContraints.getCurrentIndent();
-				String singleIndent = getFormatPreferences().getIndent();
-				String newNodevalue = adjustIndentations(nodeValue, lineDelimiter + lineIndent, singleIndent);
-				if (nodeValue.compareTo(newNodevalue) != 0)
-					node.setNodeValue(newNodevalue);
-			}
-
-			if (!nodeHasSiblings(node) || (node.getPreviousSibling() != null && node.getPreviousSibling().getNodeType() == Node.TEXT_NODE && !StringUtils.containsLineDelimiter(node.getPreviousSibling().getNodeValue()) && node.getNextSibling() == null)) {
-				// single child
-				// or inline comment after text
-				// do nothing
-			} else
-				// format indentation after node
-				formatIndentationAfterNode(node, formatContraints);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/DocumentNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/DocumentNodeFormatter.java
deleted file mode 100644
index 297df28..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/DocumentNodeFormatter.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     Jesper Steen Møller - xml:space='preserve' support
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-
-public class DocumentNodeFormatter extends NodeFormatter {
-	protected void formatChildren(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		String singleIndent = getFormatPreferences().getIndent();
-		String lineIndent = formatContraints.getCurrentIndent();
-
-		if (node != null && (fProgressMonitor == null || !fProgressMonitor.isCanceled())) {
-			// normalize node first to combine adjacent text nodes
-			node.normalize();
-
-			IDOMNode nextChild = (IDOMNode) node.getFirstChild();
-			while (nextChild != null) {
-				IDOMNode eachChildNode = nextChild;
-				nextChild = (IDOMNode) eachChildNode.getNextSibling();
-				IStructuredFormatter formatter = getFormatter(eachChildNode);
-				IStructuredFormatContraints childFormatContraints = formatter.getFormatContraints();
-				String childIndent = lineIndent + singleIndent;
-				childFormatContraints.setCurrentIndent(childIndent);
-				childFormatContraints.setClearAllBlankLines(formatContraints.getClearAllBlankLines());
-				childFormatContraints.setInPreserveSpaceElement(formatContraints.getInPreserveSpaceElement());
-
-				// format each child
-				formatter.format(eachChildNode, childFormatContraints);
-
-				if (nextChild != null && nextChild.getParentNode() == null)
-					// nextNode is deleted during format
-					nextChild = (IDOMNode) eachChildNode.getNextSibling();
-			}
-		}
-	}
-
-	protected void formatNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		if (node != null)
-			formatChildren(node, formatContraints);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java
deleted file mode 100644
index beed8f4..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     Jesper Steen Møller - xml:space='preserve' support
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.document.AttrImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-
-public class ElementNodeFormatter extends DocumentNodeFormatter {
-	static private final char DOUBLE_QUOTE = '"';//$NON-NLS-1$
-	static private final String DOUBLE_QUOTES = "\"\"";//$NON-NLS-1$
-	static private final char EQUAL_CHAR = '='; // equal sign$NON-NLS-1$
-	static private final String PRESERVE = "preserve";//$NON-NLS-1$
-	static private final String PRESERVE_QUOTED = "\"preserve\"";//$NON-NLS-1$
-	static private final char SINGLE_QUOTE = '\'';//$NON-NLS-1$
-	static private final String XML_SPACE = "xml:space";//$NON-NLS-1$
-	static private final char SPACE_CHAR = ' '; //$NON-NLS-1$
-	static private final String XSL_NAMESPACE = "http://www.w3.org/1999/XSL/Transform"; //$NON-NLS-1$
-	static private final String XSL_ATTRIBUTE = "attribute"; //$NON-NLS-1$
-	static private final String XSL_TEXT = "text"; //$NON-NLS-1$
-
-	protected void formatEndTag(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		if (!isEndTagMissing(node)) {
-			// end tag exists
-
-			IStructuredDocument structuredDocument = node.getModel().getStructuredDocument();
-			String lineDelimiter = structuredDocument.getLineDelimiter();
-			String nodeIndentation = getNodeIndent(node);
-			IDOMNode lastChild = (IDOMNode) node.getLastChild();
-			if (lastChild != null && lastChild.getNodeType() != Node.TEXT_NODE) {
-				if (isEndTagMissing(lastChild)) {
-					// find deepest child
-					IDOMNode deepestChild = (IDOMNode) lastChild.getLastChild();
-					while (deepestChild != null && deepestChild.getLastChild() != null && isEndTagMissing(deepestChild)) {
-						lastChild = deepestChild;
-						deepestChild = (IDOMNode) deepestChild.getLastChild();
-					}
-
-					if (deepestChild != null) {
-						if (deepestChild.getNodeType() == Node.TEXT_NODE) {
-							// Special indentation handling if lastChild's end
-							// tag is missing and deepestChild is a text node.
-							String nodeText = deepestChild.getNodeValue();
-
-							if (!nodeText.endsWith(lineDelimiter + nodeIndentation)) {
-								nodeText = StringUtils.appendIfNotEndWith(nodeText, lineDelimiter);
-								nodeText = StringUtils.appendIfNotEndWith(nodeText, nodeIndentation);
-							}
-
-							replaceNodeValue(deepestChild, nodeText);
-						}
-						else
-							insertAfterNode(lastChild, lineDelimiter + nodeIndentation);
-					}
-				}
-				else
-					// indent end tag
-					insertAfterNode(lastChild, lineDelimiter + nodeIndentation);
-			}
-			else if (lastChild == null && firstStructuredDocumentRegionContainsLineDelimiters(node)) {
-				// BUG174243 do not indent end tag if node has empty content
-				// (otherwise new text node would be introduced)
-				ModelQueryAdapter adapter = (ModelQueryAdapter) ((IDOMDocument) node.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
-				CMElementDeclaration elementDeclaration = (CMElementDeclaration) adapter.getModelQuery().getCMNode(node);
-				if ((elementDeclaration == null) || (elementDeclaration.getContentType() != CMElementDeclaration.EMPTY)) {
-					// indent end tag
-					replace(structuredDocument, node.getFirstStructuredDocumentRegion().getEndOffset(), 0, lineDelimiter + nodeIndentation);
-				}
-			}
-
-			// format end tag name
-			IStructuredDocumentRegion endTagStructuredDocumentRegion = node.getLastStructuredDocumentRegion();
-			if (endTagStructuredDocumentRegion.getRegions().size() >= 3) {
-				ITextRegion endTagNameRegion = endTagStructuredDocumentRegion.getRegions().get(1);
-				removeRegionSpaces(node, endTagStructuredDocumentRegion, endTagNameRegion);
-			}
-		}
-	}
-
-	protected void formatNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		if (node != null) {
-			// format indentation before node
-			formatIndentationBeforeNode(node, formatContraints);
-
-			// format start tag
-			IDOMNode newNode = node;
-			int startTagStartOffset = node.getStartOffset();
-			IDOMModel structuredModel = node.getModel();
-
-			boolean currentlyInXmlSpacePreserve = formatContraints.getInPreserveSpaceElement();
-			formatStartTag(node, formatContraints);
-			// save new node
-			newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset);
-
-			IStructuredDocumentRegion flatNode = newNode.getFirstStructuredDocumentRegion();
-			if (flatNode != null) {
-				ITextRegionList regions = flatNode.getRegions();
-				ITextRegion lastRegion = regions.get(regions.size() - 1);
-				// format children and end tag if not empty start tag
-				if (lastRegion.getType() != DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-					// format children
-					formatChildren(newNode, formatContraints);
-
-					// save new node
-					newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset);
-
-					// format end tag
-					formatEndTag(newNode, formatContraints);
-				}
-			}
-
-			formatContraints.setInPreserveSpaceElement(currentlyInXmlSpacePreserve);
-			// only indent if not at last node
-			if (newNode != null && newNode.getNextSibling() != null)
-				// format indentation after node
-				formatIndentationAfterNode(newNode, formatContraints);
-		}
-	}
-
-	/**
-	 * This method formats the start tag name, and formats the attributes if
-	 * available.
-	 */
-	protected void formatStartTag(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		StructuredFormatPreferencesXML preferences = (StructuredFormatPreferencesXML) getFormatPreferences();
-		String singleIndent = preferences.getIndent();
-		String lineIndent = formatContraints.getCurrentIndent();
-		String attrIndent = lineIndent + singleIndent;
-		boolean splitMultiAttrs = preferences.getSplitMultiAttrs();
-		boolean alignEndBracket = preferences.isAlignEndBracket();
-		boolean sawXmlSpace = false;
-
-		IStructuredDocumentRegion flatNode = node.getFirstStructuredDocumentRegion();
-		NamedNodeMap attributes = node.getAttributes();
-
-		// Note: attributes should not be null even if the node has no
-		// attributes. However, attributes.getLength() will be 0. But, check
-		// for null just in case.
-		if (attributes != null) {
-			// compute current available line width
-			int currentAvailableLineWidth = 0;
-			try {
-				// 1 is for "<"
-				int nodeNameOffset = node.getStartOffset() + 1 + node.getNodeName().length();
-				int lineOffset = node.getStructuredDocument().getLineInformationOfOffset(nodeNameOffset).getOffset();
-				String text = node.getStructuredDocument().get(lineOffset, nodeNameOffset - lineOffset);
-				int usedWidth = getIndentationLength(text);
-				currentAvailableLineWidth = preferences.getLineWidth() - usedWidth;
-			}
-			catch (BadLocationException e) {
-				// log for now, unless we find reason not to
-				Logger.log(Logger.INFO, e.getMessage());
-			}
-
-			StringBuffer stringBuffer = new StringBuffer();
-			String lineDelimiter = node.getModel().getStructuredDocument().getLineDelimiter();
-			int attrLength = attributes.getLength();
-			int lastUndefinedRegionOffset = 0;
-			boolean startTagSpansOver1Line = false;
-
-			for (int i = 0; i < attrLength; i++) {
-				AttrImpl attr = (AttrImpl) attributes.item(i);
-				ITextRegion nameRegion = attr.getNameRegion();
-				ITextRegion equalRegion = attr.getEqualRegion();
-				ITextRegion valueRegion = attr.getValueRegion();
-
-				// append undefined regions
-				String undefinedRegion = getUndefinedRegions(node, lastUndefinedRegionOffset, attr.getStartOffset() - lastUndefinedRegionOffset);
-				stringBuffer.append(undefinedRegion);
-				lastUndefinedRegionOffset = attr.getStartOffset();
-
-				// check for xml:space attribute
-				if (flatNode.getText(nameRegion).compareTo(XML_SPACE) == 0) {
-					if (valueRegion == null) {
-						// [111674] If nothing has been written yet, treat as
-						// preserve, but only as hint
-						formatContraints.setInPreserveSpaceElement(true);
-						// Note we don't set 'sawXmlSpace', so that default or
-						// fixed DTD/XSD values may override.
-					}
-					else {
-						ISourceGenerator generator = node.getModel().getGenerator();
-						String newAttrValue = generator.generateAttrValue(attr);
-
-						// There is a problem in
-						// StructuredDocumentRegionUtil.getAttrValue(ITextRegion)
-						// when the region is instanceof ContextRegion.
-						// Workaround for now.
-						if (flatNode.getText(valueRegion).length() == 1) {
-							char firstChar = flatNode.getText(valueRegion).charAt(0);
-							if ((firstChar == DOUBLE_QUOTE) || (firstChar == SINGLE_QUOTE))
-								newAttrValue = DOUBLE_QUOTES;
-						}
-
-						if (newAttrValue.compareTo(PRESERVE_QUOTED) == 0)
-							formatContraints.setInPreserveSpaceElement(true);
-						else
-							formatContraints.setInPreserveSpaceElement(false);
-						sawXmlSpace = true;
-					}
-				}
-
-				if (splitMultiAttrs && attrLength > 1) {
-					stringBuffer.append(lineDelimiter + attrIndent);
-					stringBuffer.append(flatNode.getText(nameRegion));
-					startTagSpansOver1Line = true;
-					if (valueRegion != null) {
-						// append undefined regions
-						undefinedRegion = getUndefinedRegions(node, lastUndefinedRegionOffset, flatNode.getStartOffset(equalRegion) - lastUndefinedRegionOffset);
-						stringBuffer.append(undefinedRegion);
-						lastUndefinedRegionOffset = flatNode.getStartOffset(equalRegion);
-
-						stringBuffer.append(EQUAL_CHAR);
-
-						// append undefined regions
-						undefinedRegion = getUndefinedRegions(node, lastUndefinedRegionOffset, flatNode.getStartOffset(valueRegion) - lastUndefinedRegionOffset);
-						stringBuffer.append(undefinedRegion);
-						lastUndefinedRegionOffset = flatNode.getStartOffset(valueRegion);
-
-						// Note: trim() should not be needed for
-						// valueRegion.getText(). Just a workaround for a
-						// problem found in valueRegion for now.
-						stringBuffer.append(flatNode.getText(valueRegion).trim());
-					}
-				}
-				else {
-					if (valueRegion != null) {
-						int textLength = 1 + flatNode.getText(nameRegion).length() + 1 + flatNode.getText(valueRegion).length();
-						if (i == attrLength - 1) {
-							if (flatNode != null) {
-								ITextRegionList regions = flatNode.getRegions();
-								ITextRegion lastRegion = regions.get(regions.size() - 1);
-								if (lastRegion.getType() != DOMRegionContext.XML_EMPTY_TAG_CLOSE)
-									// 3 is for " />"
-									textLength += 3;
-								else
-									// 1 is for ">"
-									textLength++;
-							}
-						}
-
-						if (currentAvailableLineWidth >= textLength) {
-							stringBuffer.append(SPACE_CHAR);
-							currentAvailableLineWidth--;
-						}
-						else {
-							stringBuffer.append(lineDelimiter + attrIndent);
-							startTagSpansOver1Line = true;
-							currentAvailableLineWidth = preferences.getLineWidth() - attrIndent.length();
-						}
-
-						stringBuffer.append(flatNode.getText(nameRegion));
-
-						// append undefined regions
-						undefinedRegion = getUndefinedRegions(node, lastUndefinedRegionOffset, flatNode.getStartOffset(equalRegion) - lastUndefinedRegionOffset);
-						stringBuffer.append(undefinedRegion);
-						lastUndefinedRegionOffset = flatNode.getStartOffset(equalRegion);
-
-						stringBuffer.append(EQUAL_CHAR);
-
-						// append undefined regions
-						undefinedRegion = getUndefinedRegions(node, lastUndefinedRegionOffset, flatNode.getStartOffset(valueRegion) - lastUndefinedRegionOffset);
-						stringBuffer.append(undefinedRegion);
-						lastUndefinedRegionOffset = flatNode.getStartOffset(valueRegion);
-
-						// Note: trim() should not be needed for
-						// valueRegion.getText(). Just a workaround for a
-						// problem found in valueRegion for now.
-						stringBuffer.append(flatNode.getText(valueRegion).trim());
-
-						currentAvailableLineWidth -= flatNode.getText(nameRegion).length();
-						currentAvailableLineWidth--;
-						currentAvailableLineWidth -= flatNode.getText(valueRegion).trim().length();
-					}
-					else {
-						if (currentAvailableLineWidth >= 1 + flatNode.getText(nameRegion).length()) {
-							stringBuffer.append(SPACE_CHAR);
-							currentAvailableLineWidth--;
-						}
-						else {
-							stringBuffer.append(lineDelimiter + attrIndent);
-							startTagSpansOver1Line = true;
-							currentAvailableLineWidth = preferences.getLineWidth() - attrIndent.length();
-						}
-
-						stringBuffer.append(flatNode.getText(nameRegion));
-
-						currentAvailableLineWidth -= flatNode.getText(nameRegion).length();
-					}
-				}
-			}
-
-			// append undefined regions
-			String undefinedRegion = getUndefinedRegions(node, lastUndefinedRegionOffset, node.getEndOffset() - lastUndefinedRegionOffset);
-			stringBuffer.append(undefinedRegion);
-
-			IDOMModel structuredModel = node.getModel();
-			IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-			// 1 is for "<"
-			int offset = node.getStartOffset() + 1 + node.getNodeName().length();
-			// 1 is for "<"
-			int length = node.getFirstStructuredDocumentRegion().getTextLength() - 1 - node.getNodeName().length();
-
-			if (flatNode != null) {
-				ITextRegionList regions = flatNode.getRegions();
-				ITextRegion firstRegion = regions.get(0);
-				ITextRegion lastRegion = regions.get(regions.size() - 1);
-
-				if (firstRegion.getType() == DOMRegionContext.XML_END_TAG_OPEN)
-					// skip formatting for end tags in this format: </tagName>
-					return;
-				else {
-					if (lastRegion.getType() == DOMRegionContext.XML_TAG_CLOSE || lastRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE)
-						length = length - lastRegion.getLength();
-
-					if (lastRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-						// leave space before XML_EMPTY_TAG_CLOSE: <tagName />
-						// unless already going to move end bracket
-						if (!startTagSpansOver1Line || !alignEndBracket)
-							stringBuffer.append(SPACE_CHAR);
-					}
-				}
-			}
-
-			if (startTagSpansOver1Line && alignEndBracket) {
-				stringBuffer.append(lineDelimiter).append(lineIndent);
-			}
-
-			replace(structuredDocument, offset, length, stringBuffer.toString());
-
-			// BUG108074 & BUG84688 - preserve whitespace in xsl:text &
-			// xsl:attribute
-			String nodeNamespaceURI = node.getNamespaceURI();
-			if (XSL_NAMESPACE.equals(nodeNamespaceURI)) {
-				String nodeName = ((Element) node).getLocalName();
-				if (XSL_ATTRIBUTE.equals(nodeName) || XSL_TEXT.equals(nodeName)) {
-					sawXmlSpace = true;
-					formatContraints.setInPreserveSpaceElement(true);
-				}
-			}
-
-			// If we didn't see a xml:space attribute above, we'll look for
-			// one in the DTD.
-			// We do not check for a conflict between a DTD's 'fixed' value
-			// and the attribute value found in the instance document, we
-			// leave that to the validator.
-			if (!sawXmlSpace) {
-				ModelQueryAdapter adapter = (ModelQueryAdapter) ((IDOMDocument) node.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
-				CMElementDeclaration elementDeclaration = (CMElementDeclaration) adapter.getModelQuery().getCMNode(node);
-				if (elementDeclaration != null) {
-					int contentType = elementDeclaration.getContentType();
-					if (preferences.isPreservePCDATAContent() && contentType == CMElementDeclaration.PCDATA) {
-						formatContraints.setInPreserveSpaceElement(true);
-					}
-					else {
-						CMNamedNodeMap cmAttributes = elementDeclaration.getAttributes();
-						// Check implied values from the DTD way.
-						CMAttributeDeclaration attributeDeclaration = (CMAttributeDeclaration) cmAttributes.getNamedItem(XML_SPACE);
-						if (attributeDeclaration != null) {
-							// CMAttributeDeclaration found, check it out.
-							String defaultValue = attributeDeclaration.getAttrType().getImpliedValue();
-
-							// xml:space="preserve" means preserve space,
-							// everything else means back to default.
-							if (PRESERVE.compareTo(defaultValue) == 0)
-								formatContraints.setInPreserveSpaceElement(true);
-							else
-								formatContraints.setInPreserveSpaceElement(false);
-						}
-					}
-				}
-			}
-		}
-	}
-
-	protected String getUndefinedRegions(IDOMNode node, int startOffset, int length) {
-		String result = new String();
-
-		IStructuredDocumentRegion flatNode = node.getFirstStructuredDocumentRegion();
-		ITextRegionList regions = flatNode.getRegions();
-		for (int i = 0; i < regions.size(); i++) {
-			ITextRegion region = regions.get(i);
-			String regionType = region.getType();
-			int regionStartOffset = flatNode.getStartOffset(region);
-
-			if (regionType.compareTo(DOMRegionContext.UNDEFINED) == 0 && regionStartOffset >= startOffset && regionStartOffset < startOffset + length)
-				result = result + flatNode.getFullText(region);
-		}
-
-		if (result.length() > 0)
-			return SPACE_CHAR + result.trim();
-		else
-			return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/FormatProcessorXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/FormatProcessorXML.java
deleted file mode 100644
index a798dbd..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/FormatProcessorXML.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.internal.format.AbstractStructuredFormatProcessor;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatPreferences;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatter;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.w3c.dom.Node;
-
-public class FormatProcessorXML extends AbstractStructuredFormatProcessor {
-	protected IStructuredFormatPreferences fFormatPreferences = null;
-
-	protected String getFileExtension() {
-		return "xml"; //$NON-NLS-1$
-	}
-
-	public IStructuredFormatPreferences getFormatPreferences() {
-		if (fFormatPreferences == null) {
-			fFormatPreferences = new StructuredFormatPreferencesXML();
-
-			Preferences preferences = getModelPreferences();
-			if (preferences != null) {
-				fFormatPreferences.setLineWidth(preferences.getInt(XMLCorePreferenceNames.LINE_WIDTH));
-				((StructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
-				((StructuredFormatPreferencesXML) fFormatPreferences).setAlignEndBracket(preferences.getBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET));
-				((StructuredFormatPreferencesXML) fFormatPreferences).setPreservePCDATAContent(preferences.getBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT));
-				fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
-				char indentChar = ' ';
-				String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
-				if (XMLCorePreferenceNames.TAB.equals(indentCharPref)) {
-					indentChar = '\t';
-				}
-				int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
-
-				StringBuffer indent = new StringBuffer();
-				for (int i = 0; i < indentationWidth; i++) {
-					indent.append(indentChar);
-				}
-				fFormatPreferences.setIndent(indent.toString());
-			}
-		}
-
-		return fFormatPreferences;
-	}
-
-	protected IStructuredFormatter getFormatter(Node node) {
-		// 262135 - NPE during format of empty document
-		if (node == null)
-			return null;
-
-		short nodeType = node.getNodeType();
-		IStructuredFormatter formatter = null;
-		switch (nodeType) {
-			case Node.ELEMENT_NODE : {
-				formatter = new ElementNodeFormatter();
-				break;
-			}
-			case Node.TEXT_NODE : {
-				formatter = new TextNodeFormatter();
-				break;
-			}
-			case Node.CDATA_SECTION_NODE : {
-				formatter = new NoMoveFormatter();
-				break;
-			}
-			case Node.COMMENT_NODE : {
-				formatter = new CommentNodeFormatter();
-				break;
-			}
-			case Node.PROCESSING_INSTRUCTION_NODE : {
-				formatter = new NodeFormatter();
-				break;
-			}
-			case Node.DOCUMENT_NODE : {
-				formatter = new DocumentNodeFormatter();
-				break;
-			}
-			case Node.ENTITY_REFERENCE_NODE : {
-				formatter = new NoMoveFormatter();
-				break;
-			}
-			default : {
-				formatter = new NodeFormatter();
-			}
-		}
-
-		// init fomatter
-		formatter.setFormatPreferences(getFormatPreferences());
-		formatter.setProgressMonitor(fProgressMonitor);
-
-		return formatter;
-	}
-
-	protected Preferences getModelPreferences() {
-		return XMLCorePlugin.getDefault().getPluginPreferences();
-	}
-
-	protected void refreshFormatPreferences() {
-		fFormatPreferences = null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NoMoveFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NoMoveFormatter.java
deleted file mode 100644
index 7b68ece..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NoMoveFormatter.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * Formats entities which really need no formatting. They are just like text
- * nodes.
- */
-class NoMoveFormatter extends NodeFormatter {
-	protected void formatIndentationBeforeNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		// node nothing
-	}
-
-	protected void formatIndentationAfterNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		// still do nothing
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java
deleted file mode 100644
index f48ed18..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java
+++ /dev/null
@@ -1,753 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     Jesper Steen Møller - xml:space='preserve' support
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatPreferences;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatter;
-import org.eclipse.wst.sse.core.internal.format.StructuredFormatContraints;
-import org.eclipse.wst.sse.core.internal.parser.ContextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.document.CDATASectionImpl;
-import org.eclipse.wst.xml.core.internal.document.CharacterDataImpl;
-import org.eclipse.wst.xml.core.internal.document.CommentImpl;
-import org.eclipse.wst.xml.core.internal.parser.regions.TagNameRegion;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Node;
-
-public class NodeFormatter implements IStructuredFormatter {
-	static protected final String EMPTY_STRING = ""; //$NON-NLS-1$
-	static private final char SPACE_CHAR = ' '; //$NON-NLS-1$
-	static private final char TAB_CHAR = '\t'; //$NON-NLS-1$
-	static private final String TAB = "\t"; //$NON-NLS-1$
-	protected IStructuredFormatContraints fFormatContraints = null;
-	protected IStructuredFormatPreferences fFormatPreferences = null;
-	protected IProgressMonitor fProgressMonitor = null;
-
-	protected boolean firstStructuredDocumentRegionContainsLineDelimiters(IDOMNode node) {
-		boolean result = false;
-
-		if (node != null) {
-			IStructuredDocumentRegion firstStructuredDocumentRegion = node.getFirstStructuredDocumentRegion();
-			if (firstStructuredDocumentRegion != null) {
-				String firstStructuredDocumentRegionText = firstStructuredDocumentRegion.getText();
-				result = StringUtils.containsLineDelimiter(firstStructuredDocumentRegionText);
-			}
-		}
-
-		return result;
-	}
-
-	public void format(Node node) {
-		IStructuredFormatContraints formatContraints = getFormatContraints();
-
-		format(node, formatContraints);
-	}
-
-	public void format(Node node, IStructuredFormatContraints formatContraints) {
-		if (formatContraints.getFormatWithSiblingIndent())
-			formatContraints.setCurrentIndent(getSiblingIndent(node));
-
-		if (node instanceof IDOMNode)
-			formatNode((IDOMNode) node, formatContraints);
-	}
-
-	protected void formatIndentationAfterNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		// [111674] If inside xml:space="preserve" element, we bail
-		if (formatContraints.getInPreserveSpaceElement())
-			return;
-		if (node != null) {
-			IDOMNode nextSibling = (IDOMNode) node.getNextSibling();
-			IStructuredDocument doc = node.getModel().getStructuredDocument();
-			String lineDelimiter = getLineDelimiter(node, doc);
-
-			if (node.getParentNode() != null) {
-				if (node.getParentNode().getNodeType() == Node.DOCUMENT_NODE)
-					if (nextSibling != null)
-						if (nextSibling.getNodeType() == Node.TEXT_NODE)
-							getFormatter(nextSibling).format(nextSibling, formatContraints);
-						else if (nextSibling.getNodeType() == Node.COMMENT_NODE) {
-							// do nothing
-						}
-						else {
-							String lineIndent = formatContraints.getCurrentIndent();
-							insertAfterNode(node, lineDelimiter + lineIndent);
-						}
-					else {
-					}
-
-				else if (nextSibling != null)
-					if (nextSibling.getNodeType() == Node.TEXT_NODE)
-						getFormatter(nextSibling).format(nextSibling, formatContraints);
-					else if (nextSibling.getNodeType() == Node.COMMENT_NODE) {
-						// do nothing
-					}
-					else {
-						String lineIndent = formatContraints.getCurrentIndent();
-						insertAfterNode(node, lineDelimiter + lineIndent);
-					}
-				else {
-					IDOMNode indentNode = getParentIndentNode(node);
-					String lineIndent = getNodeIndent(indentNode);
-					IDOMNode lastChild = getDeepestChildNode(node);
-					boolean clearAllBlankLines = formatContraints.getClearAllBlankLines();
-
-					if (lastChild != null) {
-						if ((lastChild.getNodeType() == Node.TEXT_NODE) && (lastChild.getNodeValue().endsWith(lineDelimiter + lineIndent))) {
-							// this text node already ends with the requested
-							// indentation
-						}
-
-						else if ((lastChild.getNodeType() == Node.TEXT_NODE) && (lastChild.getNodeValue() != null && lastChild.getNodeValue().endsWith(lineDelimiter)))
-							if (clearAllBlankLines) {
-								replaceNodeValue(lastChild, lineDelimiter + lineIndent);
-							}
-							else {
-								// append indentation
-								insertAfterNode(lastChild, lineIndent);
-							}
-						else if (lastChild.getNodeType() == Node.TEXT_NODE)
-							if (lastChild.getNodeValue().length() == 0) {
-								// replace
-								replaceNodeValue(lastChild, lineDelimiter + lineIndent);
-							}
-							else {
-								// append indentation
-								insertAfterNode(lastChild, lineDelimiter + lineIndent);
-							}
-						else {
-							// as long as not at the end of the document
-							IStructuredDocumentRegion endRegion = node.getLastStructuredDocumentRegion();
-							if (endRegion != null && endRegion.getNext() != null)
-								// append indentation
-								insertAfterNode(lastChild, lineDelimiter + lineIndent);
-						}
-					}
-				}
-			}
-		}
-	}
-
-	protected void formatIndentationBeforeNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		// [111674] If inside xml:space="preserve" element, we bail
-		if (formatContraints.getInPreserveSpaceElement())
-			return;
-		if (node != null) {
-			IDOMNode previousSibling = (IDOMNode) node.getPreviousSibling();
-			IStructuredDocument doc = node.getModel().getStructuredDocument();
-			String lineDelimiter = getLineDelimiter(node, doc);
-
-			String lineIndent = formatContraints.getCurrentIndent();
-
-			if (node.getParentNode() != null) {
-				if (node.getParentNode().getNodeType() == Node.DOCUMENT_NODE) {
-					if (previousSibling != null)
-						if (previousSibling.getNodeType() == Node.TEXT_NODE)
-							getFormatter(previousSibling).format(previousSibling, formatContraints);
-						else {
-							insertBeforeNode(node, lineDelimiter + lineIndent);
-						}
-				}
-				else {
-					if (previousSibling == null || previousSibling.getNodeType() != Node.TEXT_NODE) {
-						// 261968 - formatting tag without closing bracket:
-						// <t1><t1
-						// 265673 - Null ptr in formatIndentationBeforeNode
-						int prevEndNodeOffset = -1;
-						int prevEndRegionOffset = -1;
-						if (previousSibling != null) {
-							prevEndNodeOffset = previousSibling.getEndOffset();
-							IStructuredDocumentRegion endRegion = previousSibling.getEndStructuredDocumentRegion();
-							if (endRegion != null) {
-								prevEndRegionOffset = endRegion.getTextEndOffset();
-							}
-						}
-						if ((previousSibling == null) || (prevEndNodeOffset != -1 && prevEndNodeOffset == prevEndRegionOffset)) {
-							insertBeforeNode(node, lineDelimiter + lineIndent);
-						}
-
-					}
-					else {
-						if (previousSibling.getNodeValue().length() == 0) {
-							// replace
-							replaceNodeValue(previousSibling, lineDelimiter + lineIndent);
-						}
-						else {
-							// append indentation
-							if (!previousSibling.getNodeValue().endsWith(lineDelimiter + lineIndent)) {
-								if (previousSibling.getNodeValue().endsWith(lineDelimiter)) {
-									insertAfterNode(previousSibling, lineIndent);
-								}
-								else
-									getFormatter(previousSibling).format(previousSibling, formatContraints);
-							}
-						}
-					}
-				}
-			}
-		}
-	}
-
-	private String getLineDelimiter(IDOMNode node, IStructuredDocument doc) {
-		int line = doc.getLineOfOffset(node.getStartOffset());
-		String lineDelimiter = doc.getLineDelimiter();
-		try {
-			if (line > 0) {
-				lineDelimiter = doc.getLineDelimiter(line - 1);
-			}
-		}
-		catch (BadLocationException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-		// BUG115716: if cannot get line delimiter from current line, just
-		// use default line delimiter
-		if (lineDelimiter == null)
-			lineDelimiter = doc.getLineDelimiter();
-		return lineDelimiter;
-	}
-
-	protected void formatNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		if (node != null && (fProgressMonitor == null || !fProgressMonitor.isCanceled())) {
-			// format indentation before node
-			formatIndentationBeforeNode(node, formatContraints);
-
-			// format indentation after node
-			formatIndentationAfterNode(node, formatContraints);
-		}
-	}
-
-	/**
-	 * This method will compute the correct indentation after this node
-	 * depending on the indentations of its sibling nodes and parent node. Not
-	 * needed anymore?
-	 */
-	protected void formatTrailingText(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		// [111674] If inside xml:space="preserve" element, we bail
-		if (formatContraints.getInPreserveSpaceElement())
-			return;
-
-		String lineDelimiter = node.getModel().getStructuredDocument().getLineDelimiter();
-		String lineIndent = formatContraints.getCurrentIndent();
-		String parentLineIndent = getNodeIndent(node.getParentNode());
-		boolean clearAllBlankLines = formatContraints.getClearAllBlankLines();
-
-		if ((node != null) && (node.getNodeType() != Node.DOCUMENT_NODE)) {
-			IDOMNode nextSibling = (IDOMNode) node.getNextSibling();
-			if ((nextSibling != null) && (nextSibling.getNodeType() == Node.TEXT_NODE)) {
-				String nextSiblingText = nextSibling.getNodeValue();
-				if (nextSibling.getNextSibling() == null)
-					if ((nextSibling.getParentNode().getNodeType() == Node.DOCUMENT_NODE) && (nextSiblingText.trim().length() == 0))
-						// delete spaces at the end of the document
-						replaceNodeValue(nextSibling, EMPTY_STRING);
-					else
-						// replace the text node with parent indentation
-						replaceNodeValue(nextSibling, lineDelimiter + parentLineIndent);
-				else
-					// replace the text node with indentation
-					replaceNodeValue(nextSibling, lineDelimiter + lineIndent);
-			}
-			else {
-				if (nextSibling == null) {
-					lineIndent = parentLineIndent;
-
-					if (node.getParentNode().getNodeType() != Node.DOCUMENT_NODE)
-						if ((node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue().endsWith(lineDelimiter + lineIndent))) {
-							// this text node already ends with the requested
-							// indentation
-						}
-
-						else if ((node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue().endsWith(lineDelimiter)))
-							if (clearAllBlankLines)
-								replaceNodeValue(node, lineDelimiter + lineIndent);
-							else
-								// append indentation
-								insertAfterNode(node, lineIndent);
-						else if (node.getNodeType() == Node.TEXT_NODE)
-							if (node.getNodeValue().length() == 0)
-								// replace
-								replaceNodeValue(node, lineDelimiter + lineIndent);
-							else
-							// append indentation
-							if (!node.getNodeValue().endsWith(lineDelimiter + lineIndent))
-								if (node.getNodeValue().endsWith(lineDelimiter))
-									insertAfterNode(node, lineIndent);
-								else
-									insertAfterNode(node, lineDelimiter + lineIndent);
-							else
-								replaceNodeValue(node, lineDelimiter + lineIndent);
-				}
-				else {
-					if ((node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue().endsWith(lineDelimiter + lineIndent))) {
-						// this text node already ends with the requested
-						// indentation
-					}
-
-					else if ((node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue().endsWith(lineDelimiter)))
-						if (clearAllBlankLines)
-							replaceNodeValue(node, lineDelimiter + lineIndent);
-						else
-							// append indentation
-							insertAfterNode(node, lineIndent);
-					else if (node.getNodeType() == Node.TEXT_NODE)
-						if (node.getNodeValue().length() == 0)
-							// replace
-							replaceNodeValue(node, lineDelimiter + lineIndent);
-						else
-							// append indentation
-							insertAfterNode(node, lineDelimiter + lineIndent);
-					else
-						// append indentation
-						insertAfterNode(node, lineDelimiter + lineIndent);
-				}
-			}
-		}
-	}
-
-	protected IDOMNode getDeepestChildNode(IDOMNode node) {
-		IDOMNode result = null;
-		IDOMNode lastChild = (IDOMNode) node.getLastChild();
-
-		if (lastChild == null)
-			result = node;
-		else {
-			result = getDeepestChildNode(lastChild);
-
-			if ((result.getNodeType() == Node.TEXT_NODE || result.getNodeType() == Node.COMMENT_NODE) && !isEndTagMissing(node))
-				result = node;
-		}
-
-		return result;
-	}
-
-	public IStructuredFormatContraints getFormatContraints() {
-		if (fFormatContraints == null) {
-			fFormatContraints = new StructuredFormatContraints();
-
-			fFormatContraints.setClearAllBlankLines(getFormatPreferences().getClearAllBlankLines());
-		}
-
-		return fFormatContraints;
-	}
-
-	public IStructuredFormatPreferences getFormatPreferences() {
-		if (fFormatPreferences == null) {
-			fFormatPreferences = new StructuredFormatPreferencesXML();
-
-			Preferences preferences = getModelPreferences();
-			if (preferences != null) {
-				fFormatPreferences.setLineWidth(preferences.getInt(XMLCorePreferenceNames.LINE_WIDTH));
-				((StructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
-				((StructuredFormatPreferencesXML) fFormatPreferences).setAlignEndBracket(preferences.getBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET));
-				((StructuredFormatPreferencesXML) fFormatPreferences).setPreservePCDATAContent(preferences.getBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT));
-				fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
-				char indentChar = ' ';
-				String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
-				if (XMLCorePreferenceNames.TAB.equals(indentCharPref)) {
-					indentChar = '\t';
-				}
-				int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
-
-				StringBuffer indent = new StringBuffer();
-				for (int i = 0; i < indentationWidth; i++) {
-					indent.append(indentChar);
-				}
-				fFormatPreferences.setIndent(indent.toString());
-			}
-		}
-
-		return fFormatPreferences;
-	}
-
-	protected IStructuredFormatter getFormatter(IDOMNode node) {
-		// 262135 - NPE during format of empty document
-		if (node == null)
-			return null;
-
-		short nodeType = ((Node) node).getNodeType();
-		IStructuredFormatter formatter = null;
-		switch (nodeType) {
-			case Node.ELEMENT_NODE : {
-				formatter = new ElementNodeFormatter();
-				break;
-			}
-			case Node.TEXT_NODE : {
-				formatter = new TextNodeFormatter();
-				break;
-			}
-			case Node.CDATA_SECTION_NODE : {
-				formatter = new NoMoveFormatter();
-				break;
-			}
-			case Node.COMMENT_NODE : {
-				formatter = new CommentNodeFormatter();
-				break;
-			}
-			case Node.PROCESSING_INSTRUCTION_NODE : {
-				formatter = new NodeFormatter();
-				break;
-			}
-			case Node.DOCUMENT_NODE : {
-				formatter = new DocumentNodeFormatter();
-				break;
-			}
-			case Node.ENTITY_REFERENCE_NODE : {
-				formatter = new NoMoveFormatter();
-				break;
-			}
-			default : {
-				formatter = new NodeFormatter();
-			}
-		}
-
-		// init fomatter
-		formatter.setFormatPreferences(getFormatPreferences());
-		formatter.setProgressMonitor(fProgressMonitor);
-
-		return formatter;
-	}
-
-	protected int getIndentationLength(String indent) {
-		// TODO Kit : The calculation of IndentationLength is not correct
-		// here.
-		// nodeIndentation may contain tabs. Multiply by 4 temporarily to get
-		// approx. width.
-		// Need to re-work.
-
-		int indentationLength = 0;
-
-		for (int i = 0; i < indent.length(); i++) {
-			if (indent.substring(i, i + 1).compareTo(TAB) == 0)
-				indentationLength += 4;
-			else
-				indentationLength++;
-		}
-
-		return indentationLength;
-	}
-
-	protected Preferences getModelPreferences() {
-		return XMLCorePlugin.getDefault().getPluginPreferences();
-	}
-
-	/**
-	 * This method will find the indentation for this node. It will search
-	 * backwards starting from the beginning of the node until a character
-	 * other than a space or a tab is found. If this node is null or it's a
-	 * document node or it's a first level node (node's parent is a document
-	 * node) the default empty string will be returned as the indentation.
-	 */
-	protected String getNodeIndent(Node node) {
-		String result = EMPTY_STRING;
-
-		if ((node != null) && (node.getNodeType() != Node.DOCUMENT_NODE) && (node.getParentNode() != null) && (node.getParentNode().getNodeType() != Node.DOCUMENT_NODE)) {
-			IDOMNode siblingTextNode = (IDOMNode) node.getPreviousSibling();
-			if ((siblingTextNode != null) && (siblingTextNode.getNodeType() == Node.TEXT_NODE)) {
-				// find the indentation
-				String siblingText = siblingTextNode.getNodeValue();
-				int siblingTextLength = siblingText.length();
-				if ((siblingText != null) && (siblingTextLength > 0) && ((siblingText.charAt(siblingTextLength - 1) == SPACE_CHAR) || (siblingText.charAt(siblingTextLength - 1) == TAB_CHAR))) {
-					int searchIndex = siblingTextLength - 1;
-					while ((searchIndex >= 0) && ((siblingText.charAt(searchIndex) == SPACE_CHAR) || (siblingText.charAt(searchIndex) == TAB_CHAR)))
-						searchIndex--;
-
-					if (searchIndex < siblingTextLength)
-						result = siblingText.substring(searchIndex + 1, siblingTextLength);
-				}
-			}
-		}
-
-		return result;
-	}
-
-	protected String getNodeName(IDOMNode node) {
-		return node.getNodeName();
-	}
-
-	protected String getNodeText(IDOMNode node) {
-		String text = null;
-
-		if ((node instanceof CharacterDataImpl) && !(node instanceof CommentImpl) && !(node instanceof CDATASectionImpl) && !isJSPTag(node))
-			text = ((CharacterDataImpl) node).getSource();
-		else
-			text = node.getFirstStructuredDocumentRegion().getText();
-
-		return text;
-	}
-
-	protected IDOMNode getParentIndentNode(IDOMNode node) {
-		IDOMNode result = null;
-		IDOMNode parentNode = (IDOMNode) node.getParentNode();
-
-		if (parentNode.getNodeType() == Node.DOCUMENT_NODE)
-			result = parentNode;
-		else {
-			ITextRegion region = parentNode.getLastStructuredDocumentRegion().getFirstRegion();
-			if (region.getType() == DOMRegionContext.XML_END_TAG_OPEN)
-				result = parentNode;
-			else
-				result = getParentIndentNode(parentNode);
-		}
-
-		return result;
-	}
-
-	/**
-	 * This method will find the indentation for a node sibling to this node.
-	 * It will try to find a sibling node before this node first. If there is
-	 * no sibling node before this node, it will try to find a sibling node
-	 * after this node. If still not found, we will check if this node is
-	 * already indented from its parent. If yes, this node's indentation will
-	 * be used. Otherwise, the parent node's indentation plus one indentation
-	 * will be used. If this node is null or it's a document node or it's a
-	 * first level node (node's parent is a document node) the default empty
-	 * string will be returned as the indentation.
-	 */
-	protected String getSiblingIndent(Node node) {
-		String result = EMPTY_STRING;
-
-		if ((node != null) && (node.getNodeType() != Node.DOCUMENT_NODE) && (node.getParentNode() != null) && (node.getParentNode().getNodeType() != Node.DOCUMENT_NODE)) {
-			// find the text node before the previous non-text sibling
-			// if that's not found, we will try the text node before the next
-			// non-text sibling
-			IDOMNode sibling = (IDOMNode) node.getPreviousSibling();
-			while ((sibling != null) && (sibling.getNodeType() == Node.TEXT_NODE || sibling.getNodeType() == Node.COMMENT_NODE)) {
-				if (sibling.getNodeType() == Node.COMMENT_NODE && sibling.getPreviousSibling() != null && sibling.getPreviousSibling().getNodeType() == Node.TEXT_NODE && StringUtils.containsLineDelimiter(sibling.getPreviousSibling().getNodeValue()))
-					break;
-				sibling = (IDOMNode) sibling.getPreviousSibling();
-			}
-			if (sibling == null) {
-				sibling = (IDOMNode) node.getNextSibling();
-				while ((sibling != null) && (sibling.getNodeType() == Node.TEXT_NODE))
-					sibling = (IDOMNode) sibling.getNextSibling();
-			}
-			String singleIndent = getFormatPreferences().getIndent();
-			String parentLineIndent = getNodeIndent(node.getParentNode());
-
-			if (sibling != null) {
-				String siblingIndent = getNodeIndent(sibling);
-				if (siblingIndent.length() > 0)
-					result = siblingIndent;
-				else {
-					String nodeIndent = getNodeIndent(node);
-					if (nodeIndent.length() > parentLineIndent.length())
-						// this node is indented from its parent, its
-						// indentation will be used
-						result = nodeIndent;
-					else
-						result = parentLineIndent + singleIndent;
-				}
-			}
-			else {
-				String nodeIndent = getNodeIndent(node);
-				if (nodeIndent.length() > parentLineIndent.length())
-					// this node is indented from its parent, its indentation
-					// will be used
-					result = nodeIndent;
-				else
-					result = parentLineIndent + singleIndent;
-			}
-		}
-
-		return result;
-	}
-
-	protected void insertAfterNode(IDOMNode node, String string) {
-		IDOMModel structuredModel = node.getModel();
-		IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
-		int offset = node.getEndOffset();
-		int length = 0;
-
-		// 261968 - formatting tag without closing bracket: <t1><t1
-		if (node.getEndStructuredDocumentRegion() != null) {
-			offset = node.getEndStructuredDocumentRegion().getTextEndOffset();
-			length = node.getEndOffset() - offset;
-		}
-		replace(structuredDocument, offset, length, string);
-	}
-
-	protected void insertBeforeNode(IDOMNode node, String string) {
-		IDOMModel structuredModel = node.getModel();
-		IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
-		replace(structuredDocument, node.getStartOffset(), 0, string);
-	}
-
-	/**
-	 * Allowing the INodeAdapter to compare itself against the type allows it
-	 * to return true in more than one case.
-	 */
-	public boolean isAdapterForType(Object type) {
-		return type.equals(IStructuredFormatter.class);
-	}
-
-	protected boolean isEndTagMissing(IDOMNode node) {
-		boolean result = false;
-
-		if ((node != null) && (node.getNodeType() != Node.DOCUMENT_NODE) && !isJSPTag(node)) {
-			IStructuredDocumentRegion startTagStructuredDocumentRegion = node.getFirstStructuredDocumentRegion();
-			IStructuredDocumentRegion endTagStructuredDocumentRegion = node.getLastStructuredDocumentRegion();
-
-			ITextRegion startTagNameRegion = null;
-			if (startTagStructuredDocumentRegion.getRegions().size() > 1)
-				startTagNameRegion = startTagStructuredDocumentRegion.getRegions().get(1);
-			ITextRegion endTagNameRegion = null;
-			if (endTagStructuredDocumentRegion.getRegions().size() > 1)
-				endTagNameRegion = endTagStructuredDocumentRegion.getRegions().get(1);
-
-			ITextRegionList startTagRegions = startTagStructuredDocumentRegion.getRegions();
-			if (startTagNameRegion == endTagNameRegion && startTagNameRegion != null && (startTagRegions.get(0)).getType() != DOMRegionContext.XML_END_TAG_OPEN && (startTagRegions.get(startTagRegions.size() - 1).getType()) != DOMRegionContext.XML_EMPTY_TAG_CLOSE)
-				// end tag missing
-				result = true;
-		}
-
-		return result;
-	}
-
-	protected boolean nodeHasSiblings(IDOMNode node) {
-		return (node.getPreviousSibling() != null) || (node.getNextSibling() != null);
-	}
-
-	/**
-	 * Node changed. No format should be performed automatically.
-	 */
-	public void notifyChanged(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-	}
-
-	protected void removeRegionSpaces(IDOMNode node, IStructuredDocumentRegion flatNode, ITextRegion region) {
-		if ((region != null) && (region instanceof ContextRegion || region instanceof TagNameRegion) && (flatNode.getEndOffset(region) > flatNode.getTextEndOffset(region))) {
-			IDOMModel structuredModel = node.getModel();
-			IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
-			replace(structuredDocument, flatNode.getTextEndOffset(region), flatNode.getEndOffset(region) - flatNode.getTextEndOffset(region), EMPTY_STRING);
-		}
-	}
-
-	/**
-	 * This method will replace the string at offset and length with a new
-	 * string. If the string to be replaced is the same as the new string, the
-	 * string will not be replaced.
-	 */
-	protected void replace(IStructuredDocument structuredDocument, int offset, int length, String string) {
-		try {
-			String structuredDocumentString = structuredDocument.get(offset, length);
-			if (structuredDocumentString.compareTo(string) != 0)
-				structuredDocument.replaceText(structuredDocument, offset, length, string);
-		}
-		catch (BadLocationException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-	}
-
-	/**
-	 * This method will replace the node value with a new string. If the node
-	 * value to be replaced is the same as the new string, the node value will
-	 * not be replaced.
-	 */
-	protected void replaceNodeValue(IDOMNode node, String string) {
-		IDOMModel structuredModel = node.getModel();
-		IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-		int offset = node.getStartOffset();
-		int length = node.getEndOffset() - node.getStartOffset();
-
-		try {
-			String structuredDocumentString = structuredDocument.get(offset, length);
-			if (structuredDocumentString.compareTo(string) != 0)
-				replace(structuredDocument, offset, length, string);
-		}
-		catch (BadLocationException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-	}
-
-	public void setFormatPreferences(IStructuredFormatPreferences formatPreferences) {
-		fFormatPreferences = formatPreferences;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.format.IStructuredFormatter#setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public void setProgressMonitor(IProgressMonitor monitor) {
-		fProgressMonitor = monitor;
-	}
-
-	/**
-	 * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
-	 * way for expedency. Should be evolved in future to depend on
-	 * "nestedContext".
-	 */
-	private boolean isJSPTag(Node node) {
-
-		final String JSP_CLOSE = "JSP_CLOSE"; //$NON-NLS-1$
-		// final String JSP_COMMENT_CLOSE = "JSP_COMMENT_CLOSE"; //$NON-NLS-1$
-
-		// final String JSP_COMMENT_OPEN = "JSP_COMMENT_OPEN"; //$NON-NLS-1$
-		// final String JSP_COMMENT_TEXT = "JSP_COMMENT_TEXT"; //$NON-NLS-1$
-
-		final String JSP_CONTENT = "JSP_CONTENT"; //$NON-NLS-1$
-		final String JSP_DECLARATION_OPEN = "JSP_DECLARATION_OPEN"; //$NON-NLS-1$
-		final String JSP_DIRECTIVE_CLOSE = "JSP_DIRECTIVE_CLOSE"; //$NON-NLS-1$
-		final String JSP_DIRECTIVE_NAME = "JSP_DIRECTIVE_NAME"; //$NON-NLS-1$
-
-		final String JSP_DIRECTIVE_OPEN = "JSP_DIRECTIVE_OPEN"; //$NON-NLS-1$
-		final String JSP_EXPRESSION_OPEN = "JSP_EXPRESSION_OPEN"; //$NON-NLS-1$
-
-		// final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
-
-		final String JSP_SCRIPTLET_OPEN = "JSP_SCRIPTLET_OPEN"; //$NON-NLS-1$
-
-		boolean result = false;
-
-		if (node instanceof IDOMNode) {
-			IStructuredDocumentRegion flatNode = ((IDOMNode) node).getFirstStructuredDocumentRegion();
-			// in some cases, the nodes exists, but hasn't been associated
-			// with
-			// a flatnode yet (the screen updates can be initiated on a
-			// different thread,
-			// so the request for a flatnode can come in before the node is
-			// fully formed.
-			// if the flatnode is null, we'll just allow the defaults to
-			// apply.
-			if (flatNode != null) {
-				String flatNodeType = flatNode.getType();
-				// should not be null, but just to be sure
-				if (flatNodeType != null) {
-					if ((flatNodeType.equals(JSP_CONTENT)) || (flatNodeType.equals(JSP_EXPRESSION_OPEN)) || (flatNodeType.equals(JSP_SCRIPTLET_OPEN)) || (flatNodeType.equals(JSP_DECLARATION_OPEN)) || (flatNodeType.equals(JSP_DIRECTIVE_CLOSE)) || (flatNodeType.equals(JSP_DIRECTIVE_NAME)) || (flatNodeType.equals(JSP_DIRECTIVE_OPEN)) || (flatNodeType.equals(JSP_CLOSE))) {
-						result = true;
-					}
-				}
-			}
-		}
-
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/StructuredFormatPreferencesXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/StructuredFormatPreferencesXML.java
deleted file mode 100644
index 07024eb..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/StructuredFormatPreferencesXML.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.wst.sse.core.internal.format.StructuredFormatPreferences;
-
-public class StructuredFormatPreferencesXML extends StructuredFormatPreferences {
-	private boolean fSplitMultiAttrs = false;
-	private boolean fPreservePCDATAContent = false;
-	private boolean fAlignEndBracket = false;
-
-	/**
-	 * True if formatter should split elements with multiple attributes onto
-	 * new lines.
-	 * 
-	 * @return boolean
-	 */
-	public boolean getSplitMultiAttrs() {
-		return fSplitMultiAttrs;
-	}
-
-	/**
-	 * Sets whether or not formatter should split elements with multiple
-	 * attributes onto new lines.
-	 * 
-	 * @param splitMultiAttrs
-	 */
-	public void setSplitMultiAttrs(boolean splitMultiAttrs) {
-		fSplitMultiAttrs = splitMultiAttrs;
-	}
-
-	/**
-	 * True if tags with PCDATA content should not have their whitespace
-	 * messed with when formatting.
-	 * 
-	 * @return boolean
-	 */
-	public boolean isPreservePCDATAContent() {
-		return fPreservePCDATAContent;
-	}
-
-	/**
-	 * Sets whether or not formatter should preserve whitespace in tags with
-	 * PCDATA content.
-	 * 
-	 * @param preservePCDATAContent
-	 */
-	public void setPreservePCDATAContent(boolean preservePCDATAContent) {
-		fPreservePCDATAContent = preservePCDATAContent;
-	}
-
-	/**
-	 * True if end brackets of start tags should be placed on a new line if
-	 * the start tag spans more than one line.
-	 * 
-	 * @return
-	 */
-	public boolean isAlignEndBracket() {
-		return fAlignEndBracket;
-	}
-
-	/**
-	 * Sets whether or not formatter should align the end bracket of a start
-	 * tag on a new line if the start tag spans more than one line.
-	 * 
-	 * @param alignEndBracket
-	 */
-	public void setAlignEndBracket(boolean alignEndBracket) {
-		fAlignEndBracket = alignEndBracket;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/TextNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/TextNodeFormatter.java
deleted file mode 100644
index 873ab76..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/TextNodeFormatter.java
+++ /dev/null
@@ -1,385 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     Jesper Steen Møller - xml:space='preserve' support
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-
-public class TextNodeFormatter extends NodeFormatter {
-	static private final String CR = "\r"; //$NON-NLS-1$
-	static private final String DELIMITERS = " \t\n\r\f"; //$NON-NLS-1$
-	static private final String EMPTY_STRING = ""; //$NON-NLS-1$
-	static private final String FF = "\f"; //$NON-NLS-1$
-	static private final String LF = "\n"; //$NON-NLS-1$
-	static private final String SPACE = " "; //$NON-NLS-1$
-	static private final String TAB = "\t"; //$NON-NLS-1$
-
-	private String compressSpaces(String string, IStructuredFormatContraints formatContraints) {
-		/*
-		 * Note that the StructuredTextEditor supports mixed new line
-		 * characters (CR, LF, CRLF) in one file. We have to handle that when
-		 * we try to preserve blank lines.
-		 */
-		String[] stringArray = null;
-		boolean clearAllBlankLines = formatContraints.getClearAllBlankLines();
-
-		if (clearAllBlankLines)
-			stringArray = StringUtils.asArray(string);
-		else
-			stringArray = StringUtils.asArray(string, DELIMITERS, true);
-
-		StringBuffer compressedString = new StringBuffer();
-		if (stringArray.length > 0) {
-			boolean cr = false, lf = false, cr2 = false, nonSpace = true;
-
-			if (stringArray[0].compareTo(CR) == 0)
-				cr = true;
-			else if (stringArray[0].compareTo(LF) == 0)
-				lf = true;
-			else if ((stringArray[0].compareTo(SPACE) != 0) && (stringArray[0].compareTo(TAB) != 0) && (stringArray[0].compareTo(FF) != 0)) {
-				compressedString.append(stringArray[0]);
-				nonSpace = true;
-			}
-
-			for (int i = 1; i < stringArray.length; i++) {
-				if (stringArray[i].compareTo(CR) == 0) {
-					if (cr && lf) {
-						if (nonSpace) {
-							compressedString.append(CR + LF);
-							nonSpace = false;
-						}
-						compressedString.append(stringArray[i]);
-						cr2 = true;
-					}
-					else if (cr) {
-						if (nonSpace) {
-							compressedString.append(CR);
-							nonSpace = false;
-						}
-						compressedString.append(stringArray[i]);
-						cr2 = true;
-					}
-					else
-						cr = true;
-				}
-				else if (stringArray[i].compareTo(LF) == 0) {
-					if (cr && lf && cr2) {
-						compressedString.append(stringArray[i]);
-					}
-					else if (lf) {
-						if (nonSpace) {
-							compressedString.append(LF);
-							nonSpace = false;
-						}
-						compressedString.append(stringArray[i]);
-					}
-					else
-						lf = true;
-				}
-				else if ((stringArray[i].compareTo(SPACE) != 0) && (stringArray[i].compareTo(TAB) != 0) && (stringArray[i].compareTo(FF) != 0)) {
-					if (compressedString.length() > 0)
-						compressedString.append(SPACE);
-					compressedString.append(stringArray[i]);
-
-					cr = false;
-					lf = false;
-					cr2 = false;
-					nonSpace = true;
-				}
-			}
-		}
-
-		return compressedString.toString();
-	}
-
-	protected void formatNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		// [111674] If inside xml:space="preserve" element, we bail
-		if (formatContraints.getInPreserveSpaceElement())
-			return;
-		if (node != null) {
-			IStructuredDocument doc = node.getStructuredDocument();
-
-			int lineWidth = getFormatPreferences().getLineWidth();
-			int currentAvailableLineWidth = computeAvailableLineWidth(doc, node.getStartOffset(), lineWidth);
-
-			String nodeText = getNodeText(node);
-			String compressedText = compressSpaces(nodeText, formatContraints);
-
-			IDOMNode parentNode = (IDOMNode) node.getParentNode();
-
-			if (((enoughSpace(parentNode, currentAvailableLineWidth, compressedText)) && (noSiblingsAndNoFollowingComment(node)) && !firstStructuredDocumentRegionContainsLineDelimiters(parentNode)) || node.getStartOffset() == 0) {
-				handleNoReflow(node, doc, compressedText, parentNode);
-			}
-			else {
-				// not enough space, need to reflow text
-				String nodeIndentation = formatContraints.getCurrentIndent();
-				currentAvailableLineWidth = lineWidth - getIndentationLength(nodeIndentation);
-				List vector = reflowText(compressedText, currentAvailableLineWidth);
-				int vectorSize = vector.size();
-				StringBuffer reflowedTextBuffer = new StringBuffer();
-				String lineDelimiter = getLineDelimiter(doc, node.getStartOffset());
-				// handle first line specially to check for allowWhitespace
-				if (vectorSize > 0) {
-					// determines whether or not to allow whitespace if there
-					// is an entity or cdata before it
-					boolean allowWhitespace = true;
-					// [206072] StringIndexOutOfBoundsException
-					if (nodeText.length() == 0 || !Character.isWhitespace(nodeText.charAt(0))) {
-						Node previousSibling = node.getPreviousSibling();
-						if (previousSibling != null && (previousSibling.getNodeType() == Node.ENTITY_REFERENCE_NODE || previousSibling.getNodeType() == Node.CDATA_SECTION_NODE))
-							allowWhitespace = false;
-					}
-					String theString = (String) vector.get(0);
-					if (allowWhitespace) {
-						reflowedTextBuffer.append(lineDelimiter);
-						if (theString.trim().length() > 0)
-							reflowedTextBuffer.append(nodeIndentation).append(theString);
-					}
-					else {
-						reflowedTextBuffer.append(theString);
-					}
-				}
-				// do the rest of the lines
-				for (int i = 1; i < vectorSize; i++) {
-					String theString = (String) vector.get(i);
-					if (theString.trim().length() > 0)
-						reflowedTextBuffer.append(lineDelimiter).append(nodeIndentation).append(theString);
-					else
-						reflowedTextBuffer.append(lineDelimiter);
-				}
-				String reflowedText = reflowedTextBuffer.toString();
-				if (node.getNextSibling() == null) {
-					if (isEndTagMissing(parentNode)) {
-						// don't add indentation to end if parent end tag is
-						// missing
-					}
-
-					else {
-						// add parent's indentation to end
-						nodeIndentation = getNodeIndent(parentNode);
-						if (!reflowedText.endsWith(lineDelimiter + nodeIndentation)) {
-							reflowedText = StringUtils.appendIfNotEndWith(reflowedText, lineDelimiter);
-							reflowedText = StringUtils.appendIfNotEndWith(reflowedText, nodeIndentation);
-						}
-					}
-				}
-				else {
-					if (!reflowedText.endsWith(lineDelimiter + nodeIndentation)) {
-						// not already ended with the expected indentation
-						Node nextSibling = node.getNextSibling();
-						if (nextSibling.getNodeType() == Node.COMMENT_NODE) {
-							// add indentation to end if
-							// currentTextEndsWithLineDelimiter
-							// or followed by multiLineComment
-
-							int indexOfLastLineDelimiter = StringUtils.indexOfLastLineDelimiter(nodeText);
-							boolean currentTextEndsWithLineDelimiter = indexOfLastLineDelimiter != -1;
-							if (currentTextEndsWithLineDelimiter) {
-								// no more non blank character after the last
-								// line delimiter
-								currentTextEndsWithLineDelimiter = StringUtils.indexOfNonblank(nodeText, indexOfLastLineDelimiter) == -1;
-							}
-
-							String nodeValue = nextSibling.getNodeValue();
-							boolean multiLineComment = StringUtils.containsLineDelimiter(nodeValue);
-
-							if (currentTextEndsWithLineDelimiter || multiLineComment) {
-								reflowedText = StringUtils.appendIfNotEndWith(reflowedText, lineDelimiter);
-								reflowedText = StringUtils.appendIfNotEndWith(reflowedText, nodeIndentation);
-							}
-						}
-						else if (nextSibling.getNodeType() == Node.ENTITY_REFERENCE_NODE || nextSibling.getNodeType() == Node.CDATA_SECTION_NODE) {
-							int textLength = nodeText.length();
-							if (textLength > 0 && Character.isWhitespace(nodeText.charAt(textLength - 1))) {
-								reflowedText = StringUtils.appendIfNotEndWith(reflowedText, lineDelimiter);
-								reflowedText = StringUtils.appendIfNotEndWith(reflowedText, nodeIndentation);
-							}
-						}
-						else {
-							// not a comment, just add add indentation to end
-							reflowedText = StringUtils.appendIfNotEndWith(reflowedText, lineDelimiter);
-							reflowedText = StringUtils.appendIfNotEndWith(reflowedText, nodeIndentation);
-						}
-					}
-				}
-
-				replaceNodeValue(node, reflowedText);
-			}
-		}
-	}
-
-	/**
-	 * Keeps text inline with its parent (no reflow necessary)
-	 * 
-	 * @param node
-	 * @param doc
-	 * @param compressedText
-	 * @param parentNode
-	 */
-	private void handleNoReflow(IDOMNode node, IStructuredDocument doc, String compressedText, IDOMNode parentNode) {
-		String nodeIndentation;
-		// enough space and text has no line delimiters and (node has no
-		// siblings or followed by inline comment) and
-		// parentFirstStructuredDocumentRegionContainsLineDelimiters
-
-		if (isEndTagMissing(parentNode)) {
-			parentNode = (IDOMNode) parentNode.getParentNode();
-			while (isEndTagMissing(parentNode))
-				parentNode = (IDOMNode) parentNode.getParentNode();
-
-			// add parent's indentation to end
-			nodeIndentation = getNodeIndent(parentNode);
-			String lineDelimiter = getLineDelimiter(doc, node.getStartOffset());
-			if (!compressedText.endsWith(lineDelimiter + nodeIndentation)) {
-				compressedText = StringUtils.appendIfNotEndWith(compressedText, lineDelimiter);
-				compressedText = StringUtils.appendIfNotEndWith(compressedText, nodeIndentation);
-			}
-		}
-
-		if ((parentNode != null) && (parentNode.getNodeType() == Node.DOCUMENT_NODE) && (node.getNodeValue().length() > 0) && (node.getNodeValue().trim().length() == 0) && ((node.getPreviousSibling() == null) || (node.getNextSibling() == null)))
-			// delete spaces at the beginning or end of the document
-			compressedText = EMPTY_STRING;
-
-		replaceNodeValue(node, compressedText);
-	}
-
-	private boolean noSiblingsAndNoFollowingComment(IDOMNode node) {
-		IDOMNode nextSibling = (IDOMNode) node.getNextSibling();
-		return !nodeHasSiblings(node) || (noLineDelimiter(node) && isComment(nextSibling) && noLineDelimiter(nextSibling));
-	}
-
-	private boolean isComment(IDOMNode node) {
-		boolean result = false;
-		if (node != null) {
-			result = node.getNodeType() == Node.COMMENT_NODE;
-		}
-		return result;
-	}
-
-	private boolean noLineDelimiter(IDOMNode node) {
-		boolean result = false;
-		if (node != null) {
-			result = !StringUtils.containsLineDelimiter(node.getNodeValue());
-		}
-		return result;
-	}
-
-	/**
-	 * Calculates if there is enough space on the current line for
-	 * compressedText (and for its parent end tag)
-	 * 
-	 * @param parentNode
-	 * @param currentAvailableLineWidth
-	 * @param compressedText
-	 * @return
-	 */
-	private boolean enoughSpace(IDOMNode parentNode, int currentAvailableLineWidth, String compressedText) {
-		int parentEndTagLength = parentNode.getNodeName().length() + 3;
-		return compressedText.length() <= (currentAvailableLineWidth - parentEndTagLength) && !StringUtils.containsLineDelimiter(compressedText);
-	}
-
-	protected Vector reflowText(String text, int availableWidth) {
-		String[] stringArray = null;
-		boolean clearAllBlankLines = getFormatPreferences().getClearAllBlankLines();
-
-		if (clearAllBlankLines)
-			stringArray = StringUtils.asArray(text);
-		else
-			stringArray = StringUtils.asArray(text, DELIMITERS, true);
-
-		Vector output = new Vector();
-		if ((stringArray != null) && (stringArray.length > 0)) {
-			StringBuffer buffer = new StringBuffer();
-			if (stringArray[0].compareTo(CR) != 0)
-				buffer.append(stringArray[0]);
-			int bufferLength = stringArray[0].toString().length();
-			boolean cr = stringArray[0].compareTo(CR) == 0;
-
-			for (int i = 1; i < stringArray.length; i++) {
-				String eachString = stringArray[i];
-				if ((eachString.compareTo(SPACE) != 0) && (eachString.compareTo(TAB) != 0) && (eachString.compareTo(FF) != 0)) {
-					if ((bufferLength + 1 + eachString.length() > availableWidth) || (eachString.compareTo(CR) == 0) || (eachString.compareTo(LF) == 0)) {
-						if ((eachString.compareTo(LF) == 0) && cr) {
-							// do nothing
-						}
-						else {
-							output.add(buffer.toString());
-							buffer = new StringBuffer();
-							bufferLength = 0;
-						}
-						cr = eachString.compareTo(CR) == 0;
-					}
-					else if (buffer.toString().trim().length() > 0) {
-						buffer.append(SPACE);
-						bufferLength++;
-					}
-					if ((eachString.compareTo(CR) != 0) && (eachString.compareTo(LF) != 0)) {
-						buffer.append(eachString);
-						bufferLength = bufferLength + eachString.length();
-					}
-				}
-			}
-			output.add(buffer.toString());
-		}
-		else
-			output.add(text);
-
-		return output;
-	}
-
-	private String getLineDelimiter(IStructuredDocument doc, int nodeOffset) {
-		int line = doc.getLineOfOffset(nodeOffset);
-		String lineDelimiter = doc.getLineDelimiter();
-		try {
-			if (line > 0) {
-				lineDelimiter = doc.getLineDelimiter(line - 1);
-			}
-		}
-		catch (BadLocationException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-		// BUG115716: if cannot get line delimiter from current line, just
-		// use default line delimiter
-		if (lineDelimiter == null)
-			lineDelimiter = doc.getLineDelimiter();
-		return lineDelimiter;
-	}
-
-	private int computeAvailableLineWidth(IStructuredDocument doc, int nodeOffset, int lineWidth) {
-		// compute current available line width
-		int currentAvailableLineWidth = 0;
-		try {
-			int lineOffset = doc.getLineInformationOfOffset(nodeOffset).getOffset();
-			String text = doc.get(lineOffset, nodeOffset - lineOffset);
-			int usedWidth = getIndentationLength(text);
-			currentAvailableLineWidth = lineWidth - usedWidth;
-		}
-		catch (BadLocationException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-		return currentAvailableLineWidth;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/text/IXMLPartitions.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/text/IXMLPartitions.java
deleted file mode 100644
index 5d36751..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/text/IXMLPartitions.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.text;
-
-
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partition types for XML.
- * Clients should reference the partition type Strings defined here directly.
- * 
- * @deprecated use org.eclipse.wst.xml.core.text
- */
-public interface IXMLPartitions {
-	
-	String XML_DEFAULT = "org.eclipse.wst.xml.XML_DEFAULT"; //$NON-NLS-1$
-	String XML_CDATA = "org.eclipse.wst.xml.XML_CDATA"; //$NON-NLS-1$
-	String XML_PI = "org.eclipse.wst.xml.XML_PI"; //$NON-NLS-1$
-	String XML_DECLARATION = "org.eclipse.wst.xml.XML_DECL"; //$NON-NLS-1$
-	String XML_COMMENT = "org.eclipse.wst.xml.XML_COMMENT"; //$NON-NLS-1$
-	
-	/*
-	 * This value is used as a prefix to any unknown processing instructions
-	 * we find. The processor target name is converted to uppercase and
-	 * appended to the prefix to create a unique partition type.
-	 */
-	String PROCESSING_INSTRUCTION_PREFIX = "org.eclipse.wst.xml.PROCESSING_INSTRUCTION:"; //$NON-NLS-1$
-
-	/**
-	 * Should match
-	 * org.eclipse.wst.sse.core.dtd.partitioning.StructuredTextPartitionerForDTD.ST_DTD_SUBSET
-	 */
-	String DTD_SUBSET = "org.eclipse.wst.xml.dtd.internal_subset"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/regions/DOMRegionContext.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/regions/DOMRegionContext.java
deleted file mode 100644
index 4a73d8d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/regions/DOMRegionContext.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.regions;
-
-public interface DOMRegionContext {
-
-	public static final String BLOCK_TEXT = "BLOCK_TEXT"; //$NON-NLS-1$
-
-	public static final String UNDEFINED = "UNDEFINED"; //$NON-NLS-1$
-
-	public static final String WHITE_SPACE = "WHITE_SPACE"; //$NON-NLS-1$
-	public static final String XML_ATTLIST_DECL_CLOSE = "XML_ATTLIST_DECL_CLOSE"; //$NON-NLS-1$
-	public static final String XML_ATTLIST_DECL_CONTENT = "XML_ATTLIST_DECL_CONTENT"; //$NON-NLS-1$
-	public static final String XML_ATTLIST_DECL_NAME = "XML_ATTLIST_DECL_NAME"; //$NON-NLS-1$
-
-	public static final String XML_ATTLIST_DECLARATION = "XML_ATTLIST_DECLARATION"; //$NON-NLS-1$
-	public static final String XML_CDATA_CLOSE = "XML_CDATA_CLOSE"; //$NON-NLS-1$
-	public static final String XML_CDATA_OPEN = "XML_CDATA_OPEN"; //$NON-NLS-1$
-	public static final String XML_CDATA_TEXT = "XML_CDATA_TEXT"; //$NON-NLS-1$
-	public static final String XML_CHAR_REFERENCE = "XML_CHAR_REFERENCE"; //$NON-NLS-1$
-	public static final String XML_COMMENT_CLOSE = "XML_COMMENT_CLOSE"; //$NON-NLS-1$
-
-	public static final String XML_COMMENT_OPEN = "XML_COMMENT_OPEN"; //$NON-NLS-1$
-	public static final String XML_COMMENT_TEXT = "XML_COMMENT_TEXT"; //$NON-NLS-1$
-
-	public static final String XML_CONTENT = "XML_CONTENT"; //$NON-NLS-1$
-	public static final String XML_DECLARATION_CLOSE = "XML_DECLARATION_CLOSE"; //$NON-NLS-1$
-
-	public static final String XML_DECLARATION_OPEN = "XML_DECLARATION_OPEN"; //$NON-NLS-1$
-
-	public static final String XML_DOCTYPE_DECLARATION = "XML_DOCTYPE_DECLARATION"; //$NON-NLS-1$
-	public static final String XML_DOCTYPE_DECLARATION_CLOSE = "XML_DOCTYPE_DECLARATION_CLOSE"; //$NON-NLS-1$
-	public static final String XML_DOCTYPE_EXTERNAL_ID_PUBLIC = "XML_DOCTYPE_EXTERNAL_ID_PUBLIC"; //$NON-NLS-1$
-	public static final String XML_DOCTYPE_EXTERNAL_ID_PUBREF = "XML_DOCTYPE_EXTERNAL_ID_PUBREF"; //$NON-NLS-1$
-	public static final String XML_DOCTYPE_EXTERNAL_ID_SYSREF = "XML_DOCTYPE_EXTERNAL_ID_SYSREF"; //$NON-NLS-1$
-	public static final String XML_DOCTYPE_EXTERNAL_ID_SYSTEM = "XML_DOCTYPE_EXTERNAL_ID_SYSTEM"; //$NON-NLS-1$
-	public static final String XML_DOCTYPE_INTERNAL_SUBSET = "XML_DOCTYPE_INTERNAL_SUBSET"; //$NON-NLS-1$
-	public static final String XML_DOCTYPE_NAME = "XML_DOCTYPE_NAME"; //$NON-NLS-1$
-	public static final String XML_ELEMENT_DECL_CLOSE = "XML_ELEMENT_DECL_CLOSE"; //$NON-NLS-1$
-	public static final String XML_ELEMENT_DECL_CONTENT = "XML_ELEMENT_DECL_CONTENT"; //$NON-NLS-1$
-	public static final String XML_ELEMENT_DECL_NAME = "XML_ELEMENT_DECL_NAME"; //$NON-NLS-1$
-
-	public static final String XML_ELEMENT_DECLARATION = "XML_ELEMENT_DECLARATION"; //$NON-NLS-1$
-	public static final String XML_EMPTY_TAG_CLOSE = "XML_EMPTY_TAG_CLOSE"; //$NON-NLS-1$
-	public static final String XML_END_TAG_OPEN = "XML_END_TAG_OPEN"; //$NON-NLS-1$
-	public static final String XML_ENTITY_REFERENCE = "XML_ENTITY_REFERENCE"; //$NON-NLS-1$
-
-	public static final String XML_PE_REFERENCE = "XML_PE_REFERENCE"; //$NON-NLS-1$
-	public static final String XML_PI_CLOSE = "XML_PI_CLOSE"; //$NON-NLS-1$
-	public static final String XML_PI_CONTENT = "XML_PI_CONTENT"; //$NON-NLS-1$
-	public static final String XML_PI_OPEN = "XML_PI_OPEN"; //$NON-NLS-1$
-	public static final String XML_TAG_ATTRIBUTE_EQUALS = "XML_TAG_ATTRIBUTE_EQUALS"; //$NON-NLS-1$
-	public static final String XML_TAG_ATTRIBUTE_NAME = "XML_TAG_ATTRIBUTE_NAME"; //$NON-NLS-1$
-	public static final String XML_TAG_ATTRIBUTE_VALUE = "XML_TAG_ATTRIBUTE_VALUE"; //$NON-NLS-1$
-	public static final String XML_TAG_CLOSE = "XML_TAG_CLOSE"; //$NON-NLS-1$
-	public static final String XML_TAG_NAME = "XML_TAG_NAME"; //$NON-NLS-1$
-
-	public static final String XML_TAG_OPEN = "XML_TAG_OPEN"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapter.java
deleted file mode 100644
index 74ad2a1..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapter.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.ssemodelquery;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-
-public interface ModelQueryAdapter extends INodeAdapter {
-
-	public CMDocumentCache getCMDocumentCache();
-
-	public URIResolver getIdResolver();
-
-	public ModelQuery getModelQuery();
-
-	void release();
-
-	void setIdResolver(URIResolver newIdResolver);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapterImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapterImpl.java
deleted file mode 100644
index a68e672..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapterImpl.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.ssemodelquery;
-
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-
-
-public class ModelQueryAdapterImpl implements ModelQueryAdapter {
-	protected CMDocumentCache cmDocumentCache;
-	protected URIResolver idResolver;
-
-	protected ModelQuery modelQuery;
-
-	public ModelQueryAdapterImpl(CMDocumentCache cmDocumentCache, ModelQuery modelQuery, URIResolver idResolver) {
-		this.cmDocumentCache = cmDocumentCache;
-		this.modelQuery = modelQuery;
-		this.idResolver = idResolver;
-	}
-
-	public CMDocumentCache getCMDocumentCache() {
-		return cmDocumentCache;
-	}
-
-	public URIResolver getIdResolver() {
-		return idResolver;
-	}
-
-	public ModelQuery getModelQuery() {
-		return modelQuery;
-	}
-
-	/**
-	 * Allowing the INodeAdapter to compare itself against the type allows it
-	 * to return true in more than one case.
-	 */
-	public boolean isAdapterForType(Object type) {
-		return type.equals(ModelQueryAdapter.class);
-	}
-
-	/**
-	 */
-
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-	}
-
-	/**
-	 * @see ModelQueryAdapter#release()
-	 */
-	public void release() {
-	}
-
-	/**
-	 * @see ModelQueryAdapter#setIdResolver(URIResolver)
-	 */
-
-	public void setIdResolver(URIResolver newIdResolver) {
-		idResolver = newIdResolver;
-		if (modelQuery instanceof MovableModelQuery)
-			((MovableModelQuery) modelQuery).setIdResolver(newIdResolver);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/MovableModelQuery.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/MovableModelQuery.java
deleted file mode 100644
index 49d7339..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/MovableModelQuery.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.ssemodelquery;
-
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-
-public interface MovableModelQuery extends ModelQuery {
-
-	void setIdResolver(URIResolver newURIResolver);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/tasks/XMLFileTaskScanner.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/tasks/XMLFileTaskScanner.java
deleted file mode 100644
index 94b8155..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/tasks/XMLFileTaskScanner.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.tasks;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.tasks.StructuredFileTaskScanner;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class XMLFileTaskScanner extends StructuredFileTaskScanner {
-	public XMLFileTaskScanner() {
-		super();
-	}
-
-	protected boolean isCommentRegion(IStructuredDocumentRegion region, ITextRegion textRegion) {
-		return textRegion.getType().equals(DOMRegionContext.XML_COMMENT_TEXT);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/XMLStructuredDocumentRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/XMLStructuredDocumentRegion.java
deleted file mode 100644
index e26bf08..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/XMLStructuredDocumentRegion.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.text;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class XMLStructuredDocumentRegion extends BasicStructuredDocumentRegion implements IStructuredDocumentRegion {
-
-	public XMLStructuredDocumentRegion() {
-		super();
-	}
-
-	public String getType() {
-		String result = super.getType();
-		// normally, we want the second region as the flatnode type ... since
-		// the
-		// first one is usually just "open tag".
-		if ((result != DOMRegionContext.XML_PI_OPEN) && (getRegions().size() > 1)) {
-			result = getRegions().get(1).getType();
-		}
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/rules/StructuredTextPartitionerForXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/rules/StructuredTextPartitionerForXML.java
deleted file mode 100644
index 8b73869..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/rules/StructuredTextPartitionerForXML.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.text.rules;
-
-import java.util.Locale;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextPartitioner;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-
-public class StructuredTextPartitionerForXML extends StructuredTextPartitioner implements IStructuredTextPartitioner {
-
-	private final static String[] configuredContentTypes = new String[]{IXMLPartitions.XML_DEFAULT, IXMLPartitions.XML_CDATA, IXMLPartitions.XML_PI, IXMLPartitions.XML_DECLARATION, IXMLPartitions.XML_COMMENT, IXMLPartitions.DTD_SUBSET};
-
-	public StructuredTextPartitionerForXML() {
-		super();
-	}
-
-	protected void setInternalPartition(int offset, int length, String type) {
-		super.setInternalPartition(offset, length, type);
-	}
-
-	protected void initLegalContentTypes() {
-		fSupportedTypes = configuredContentTypes;
-	}
-
-	public String getPartitionType(ITextRegion region, int offset) {
-		String result = null;
-		if (region.getType() == DOMRegionContext.XML_COMMENT_TEXT)
-			result = IXMLPartitions.XML_COMMENT;
-		else if (region.getType() == DOMRegionContext.XML_CDATA_TEXT)
-			result = IXMLPartitions.XML_CDATA;
-		else if (region.getType() == DOMRegionContext.XML_PI_CONTENT) {
-			/**
-			 * Grammatically, it's impossible to get a PI_CONTENT region
-			 * without a preceding XML_TAG_NAME region. Relying on this,
-			 * extract the target processor name and create a partition type
-			 * dynamically.
-			 */
-			IStructuredDocumentRegion docRegion = fStructuredDocument.getRegionAtCharacterOffset(offset);
-			ITextRegion name = docRegion.getRegionAtCharacterOffset(docRegion.getStartOffset() + region.getStart() - 1);
-			result = IXMLPartitions.PROCESSING_INSTRUCTION_PREFIX + docRegion.getText(name).toUpperCase(Locale.ENGLISH);
-		}
-		else if (region.getType() == DOMRegionContext.XML_PI_OPEN)
-			result = IXMLPartitions.XML_PI;
-		else if (region.getType() == DOMRegionContext.XML_DOCTYPE_DECLARATION)
-			result = IXMLPartitions.XML_DECLARATION;
-		else if (region.getType() == DOMRegionContext.XML_DOCTYPE_INTERNAL_SUBSET)
-			result = IXMLPartitions.DTD_SUBSET;
-		else
-			result = super.getPartitionType(region, offset);
-		return result;
-	}
-
-	protected String getPartitionType(ForeignRegion region, int offset) {
-		// temp added just to dis-ambiguate call from subclass
-		return super.getPartitionType(region, offset);
-	}
-
-	public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, IStructuredDocumentRegion nextNode) {
-		return super.getPartitionTypeBetween(previousNode, nextNode);
-	}
-
-	public String getDefaultPartitionType() {
-		return IXMLPartitions.XML_DEFAULT;
-	}
-
-	public IDocumentPartitioner newInstance() {
-		StructuredTextPartitionerForXML instance = new StructuredTextPartitionerForXML();
-		return instance;
-	}
-
-	/**
-	 * @return
-	 */
-	public static String[] getConfiguredContentTypes() {
-		return configuredContentTypes;
-	}
-
-	protected String getPartitionFromBlockedText(ITextRegion region, int offset, String result) {
-		// was moved to subclass for quick transition
-		String newResult = result;
-		// nsd_TODO: David and I need to discuss, design, and implement this
-		// for all block tags and comments
-		// and make sure is part of "extensible" design of block tags
-		if (region.getType() == DOMRegionContext.BLOCK_TEXT) {
-			// for code safety, we'll always check instanceof, but I think
-			// always true.
-			if (region instanceof ForeignRegion) {
-				// super is used below so won't be ambiguous
-				newResult = getPartitionType((ForeignRegion) region, offset);
-			}
-			else if (region instanceof ForeignRegion) {
-				newResult = getPartitionType((ForeignRegion) region, offset);
-			}
-			else {
-				newResult = getUnknown();
-			}
-		}
-		return newResult;
-	}
-
-	protected boolean doParserSpecificCheck(int offset, boolean partitionFound, IStructuredDocumentRegion sdRegion, IStructuredDocumentRegion previousStructuredDocumentRegion, ITextRegion next, ITextRegion previousStart) {
-		// this was moved down to subclass of StructuredTextPartioner
-		// for quick fix to transition problems. Heirarchy needs lots of
-		// cleanup.
-		if (previousStart != null && previousStart.getType() == DOMRegionContext.XML_TAG_OPEN && next.getType() == DOMRegionContext.XML_END_TAG_OPEN) {
-			ITextRegion previousName = previousStructuredDocumentRegion.getRegionAtCharacterOffset(previousStructuredDocumentRegion.getEndOffset(previousStart));
-			ITextRegion nextName = sdRegion.getRegionAtCharacterOffset(sdRegion.getEndOffset(next));
-			if (previousName != null && nextName != null && previousName.getType() == DOMRegionContext.XML_TAG_NAME && nextName.getType() == DOMRegionContext.XML_TAG_NAME) {
-				setInternalPartition(offset, 0, getPartitionTypeBetween(previousStructuredDocumentRegion, sdRegion));
-				partitionFound = true;
-			}
-		}
-		return partitionFound;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/AbstractPropagatingValidator.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/AbstractPropagatingValidator.java
deleted file mode 100644
index 3fddda3..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/AbstractPropagatingValidator.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validate;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.w3c.dom.Node;
-
-
-public abstract class AbstractPropagatingValidator extends ValidationComponent {
-
-	/**
-	 * Constructor for AbstractPropagatingValidator.
-	 */
-	public AbstractPropagatingValidator() {
-		super();
-	}
-
-	protected abstract ValidationComponent getPropagatee();
-
-	protected abstract ValidationAdapter getValidator();
-
-
-	public void validate(IndexedRegion node) {
-		if (node == null)
-			return;
-		getValidator().validate(node);
-
-		propagateToChildElements(getPropagatee(), (Node) node);
-	}
-
-	private void propagateToChildElements(ValidationComponent validator, Node parent) {
-		if (parent == null)
-			return;
-		Class clazz = validator.getClass();
-
-		Node child = parent.getFirstChild();
-		while (child != null) {
-			if (child.getNodeType() == Node.ELEMENT_NODE) {
-				INodeNotifier notifier = (INodeNotifier) child;
-				ValidationAdapter va = (ValidationAdapter) notifier.getExistingAdapter(clazz);
-				if (va == null) {
-					notifier.addAdapter(validator);
-					va = validator;
-				}
-				// bug 143213 - Can't batch validate open HTML files when
-				// as-you-type validation is enabled
-				va.setReporter(validator.getReporter());
-				va.validate((IndexedRegion) child);
-			}
-			child = child.getNextSibling();
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/Propagator.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/Propagator.java
deleted file mode 100644
index 3ce6569..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/Propagator.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validate;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @deprecated since 2.0 M5 - if propogateToChildElement is needed, just copy
- *             method to your own class
- */
-public class Propagator {
-
-	public static void propagateToChildElements(ValidationComponent validator, Node parent) {
-		if (parent == null)
-			return;
-		Class clazz = validator.getClass();
-
-		NodeList children = parent.getChildNodes();
-		for (int i = 0; i < children.getLength(); i++) {
-			Node child = children.item(i);
-			if (child == null || child.getNodeType() != Node.ELEMENT_NODE)
-				continue;
-
-			INodeNotifier notifier = (INodeNotifier) child;
-			ValidationAdapter va = (ValidationAdapter) notifier.getExistingAdapter(clazz);
-			if (va == null) {
-				notifier.addAdapter(validator);
-				va = validator;
-			}
-			va.validate((IndexedRegion) child);
-		}
-	}
-
-	/**
-	 * Propagator is just a placeholder of utilities. Don't instantiate.
-	 */
-	private Propagator() {
-		super();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/ValidationComponent.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/ValidationComponent.java
deleted file mode 100644
index dfd921f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/ValidationComponent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validate;
-
-
-
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-
-public abstract class ValidationComponent implements ValidationAdapter {
-
-	protected ValidationReporter reporter = null;
-
-	/**
-	 * ValidationComponent constructor comment.
-	 */
-	public ValidationComponent() {
-		super();
-	}
-
-	/**
-	 * Allowing the INodeAdapter to compare itself against the type allows it
-	 * to return true in more than one case.
-	 */
-	public boolean isAdapterForType(Object type) {
-		return (type == ValidationAdapter.class);
-	}
-
-	/**
-	 */
-	public void notifyChanged(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		// This method will be implemented in the V2.
-	}
-
-	/**
-	 */
-	public void setReporter(ValidationReporter reporter) {
-		this.reporter = reporter;
-	}
-
-	ValidationReporter getReporter() {
-		return this.reporter;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/IXMLPartitions.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/IXMLPartitions.java
deleted file mode 100644
index d8da786..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/IXMLPartitions.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.text;
-
-
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partition types for XML.
- * Clients should reference the partition type Strings defined here directly.
- * 
- * @since 1.1
- */
-public interface IXMLPartitions {
-	
-	String XML_DEFAULT = "org.eclipse.wst.xml.XML_DEFAULT"; //$NON-NLS-1$
-	String XML_CDATA = "org.eclipse.wst.xml.XML_CDATA"; //$NON-NLS-1$
-	String XML_PI = "org.eclipse.wst.xml.XML_PI"; //$NON-NLS-1$
-	String XML_DECLARATION = "org.eclipse.wst.xml.XML_DECL"; //$NON-NLS-1$
-	String XML_COMMENT = "org.eclipse.wst.xml.XML_COMMENT"; //$NON-NLS-1$
-	
-	/*
-	 * This value is used as a prefix to any unknown processing instructions
-	 * we find. The processor target name is converted to uppercase and
-	 * appended to the prefix to create a unique partition type.
-	 */
-	String PROCESSING_INSTRUCTION_PREFIX = "org.eclipse.wst.xml.PROCESSING_INSTRUCTION:"; //$NON-NLS-1$
-
-	/**
-	 * Should match
-	 * org.eclipse.wst.sse.core.dtd.partitioning.StructuredTextPartitionerForDTD.ST_DTD_SUBSET
-	 */
-	String DTD_SUBSET = "org.eclipse.wst.xml.dtd.internal_subset"; //$NON-NLS-1$
-}
diff --git a/features/org.eclipse.wst.web_core.feature.patch/buildnotes_org.eclipse.wst.web_core.feature.patch.html b/features/org.eclipse.wst.web_core.feature.patch/buildnotes_org.eclipse.wst.web_core.feature.patch.html
index d67d5b6..6373d85 100644
--- a/features/org.eclipse.wst.web_core.feature.patch/buildnotes_org.eclipse.wst.web_core.feature.patch.html
+++ b/features/org.eclipse.wst.web_core.feature.patch/buildnotes_org.eclipse.wst.web_core.feature.patch.html
@@ -4,16 +4,17 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <meta name="Build" content="Build">
-<title>WTP 2.0.2 Patches</title>
+<title>WTP 3.0.5 Patches</title>
 </head>
 
 <body>
 
-<h1>WTP 2.0.2 Patches</h1>
+<h1>WTP 3.0.5 Patches</h1>
 
 <h2>org.eclipse.wst.web_core.feature</h2>
-<h3>org.eclipse.wst.common.modulecore</h3>
-<p>Bug <a href="https://bugs.eclipse.org/201318">201318</a>.
-EAR Libraries container fails to initalize ...</p>
+<h3>org.eclipse.wst.html.core</h3>
+<p>Bug <a href="https://bugs.eclipse.org/282205">282205</a>. HTMLHeadTokenizer can get stuck in an infinite loop</p>
+<p>Bug <a href='https://bugs.eclipse.org/291225'>291225</a>. Output folder support in JavaEE projects</p>
+<p>Bug <a href='https://bugs.eclipse.org/316551'>316551</a>. [parser] Is HTML DOM correctly treating implicitly-closed tags?</p> 
 </body>
 </html>
diff --git a/features/org.eclipse.wst.web_core.feature.patch/feature.properties b/features/org.eclipse.wst.web_core.feature.patch/feature.properties
index da49220..20a9e6d 100644
--- a/features/org.eclipse.wst.web_core.feature.patch/feature.properties
+++ b/features/org.eclipse.wst.web_core.feature.patch/feature.properties
@@ -15,7 +15,7 @@
 # This file should be translated.
 
 # "featureName" property - name of the feature
-featureName=WST Web Core Patches
+featureName=WTP Patches for org.eclipse.wst.web_core.feature
 
 # "providerName" property - name of the company that provides the feature
 providerName=Eclipse.org
@@ -27,8 +27,10 @@
 description=\
 The bugs and fixes are described in the following bugzilla entries:\n\
 \n\
-Bug https://bugs.eclipse.org/201318 EAR Libraries container fails to initalize ...\n\
-
+Bug https://bugs.eclipse.org/282205 HTMLHeadTokenizer can get stuck in an infinite loop\n\
+Bug https://bugs.eclipse.org/291225 Output folder support in JavaEE projects\n\
+Bug https://bugs.eclipse.org/316551 [parser] Is HTML DOM correctly treating implicitly-closed tags?\n\
+\n\
 # "copyright" property - text of the "Feature Update Copyright"
 copyright=\
 Copyright (c) 2008 IBM Corporation and others.\n\
diff --git a/features/org.eclipse.wst.web_core.feature.patch/feature.xml b/features/org.eclipse.wst.web_core.feature.patch/feature.xml
index 4b3af0b..776bec5 100644
--- a/features/org.eclipse.wst.web_core.feature.patch/feature.xml
+++ b/features/org.eclipse.wst.web_core.feature.patch/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.web_core.feature.patch"
       label="%featureName"
-      version="2.0.2.qualifier"
+      version="3.0.5.qualifier"
       provider-name="%providerName">
 
       <description>%description</description>
@@ -14,11 +14,18 @@
 
 
    <requires>
-      <import feature="org.eclipse.wst.web_core.feature" version="2.0.2.v200802150100-42CN_kE77a8F9XCOEL" patch="true"/>
+      <import feature="org.eclipse.wst.web_core.feature" version="3.0.5.v200904070030-7G2EBCAM217nJZPEYxjAcnk40uRS" patch="true"/>
    </requires>
 
    <plugin
-         id="org.eclipse.wst.common.modulecore"
+         id="org.eclipse.wst.html.core"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.eclipse.wst.web"
          download-size="0"
          install-size="0"
          version="0.0.0"
diff --git a/features/org.eclipse.wst.web_ui.feature.patch/build.properties b/features/org.eclipse.wst.web_ui.feature.patch/build.properties
new file mode 100644
index 0000000..cb50260
--- /dev/null
+++ b/features/org.eclipse.wst.web_ui.feature.patch/build.properties
@@ -0,0 +1,5 @@
+bin.includes = feature.xml,\
+               license.html,\
+               feature.properties,\
+               epl-v10.html,\
+               eclipse_update_120.jpg
diff --git a/features/org.eclipse.wst.web_ui.feature.patch/buildnotes_org.eclipse.wst.web_ui.feature.patch.html b/features/org.eclipse.wst.web_ui.feature.patch/buildnotes_org.eclipse.wst.web_ui.feature.patch.html
new file mode 100644
index 0000000..2d92678
--- /dev/null
+++ b/features/org.eclipse.wst.web_ui.feature.patch/buildnotes_org.eclipse.wst.web_ui.feature.patch.html
@@ -0,0 +1,24 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta name="Build" content="Build">
+<title>WTP 3.0.5 Patches</title>
+</head>
+
+<body>
+
+<h1>WTP 3.0.5 Patches</h1>
+
+<h2>org.eclipse.wst.web_ui.feature</h2>
+
+<p>Bug <a href='https://bugs.eclipse.org/280483'>280483</a>. "A handler conflict occurred. This may disable some commands." warning on restart</p>
+<p>Bug <a href='https://bugs.eclipse.org/285284'>285284</a>. Removing comment end tag and adding it back leaves validation errors</p>
+<p>Bug <a href='https://bugs.eclipse.org/241794'>241794</a>. [validation] Errors when using JSP Expressions inside JavaScript code</p>
+<p>Bug <a href='https://bugs.eclipse.org/303024'>303024</a>. JSP tags in Javascript statements in JSPs show errors at wrong offsets</p>
+<p>Bug <a href='https://bugs.eclipse.org/310347'>310347</a>. Incorrect boundary checking in org.eclipse.wst.jsdt.web.core.javascript.JsTranslation#getProblems()</p>
+<p>Bug <a href='https://bugs.eclipse.org/323849'>323849</a>. [content assist] Filtering down JavaScript content assist proposals does not work for qualified types in web pages</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.web_ui.feature.patch/eclipse_update_120.jpg b/features/org.eclipse.wst.web_ui.feature.patch/eclipse_update_120.jpg
new file mode 100644
index 0000000..bfdf708
--- /dev/null
+++ b/features/org.eclipse.wst.web_ui.feature.patch/eclipse_update_120.jpg
Binary files differ
diff --git a/features/org.eclipse.wst.web_ui.feature.patch/epl-v10.html b/features/org.eclipse.wst.web_ui.feature.patch/epl-v10.html
new file mode 100644
index 0000000..ed4b196
--- /dev/null
+++ b/features/org.eclipse.wst.web_ui.feature.patch/epl-v10.html
@@ -0,0 +1,328 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 9">
+<meta name=Originator content="Microsoft Word 9">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+  <o:Revision>2</o:Revision>
+  <o:TotalTime>3</o:TotalTime>
+  <o:Created>2004-03-05T23:03:00Z</o:Created>
+  <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+  <o:Pages>4</o:Pages>
+  <o:Words>1626</o:Words>
+  <o:Characters>9270</o:Characters>
+   <o:Lines>77</o:Lines>
+  <o:Paragraphs>18</o:Paragraphs>
+  <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+  <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+  <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+	{font-family:Tahoma;
+	panose-1:2 11 6 4 3 5 4 4 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{mso-style-parent:"";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:12.0pt;
+	font-family:"Times New Roman";
+	mso-fareast-font-family:"Times New Roman";}
+p
+	{margin-right:0in;
+	mso-margin-top-alt:auto;
+	mso-margin-bottom-alt:auto;
+	margin-left:0in;
+	mso-pagination:widow-orphan;
+	font-size:12.0pt;
+	font-family:"Times New Roman";
+	mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+	{mso-style-name:"Balloon Text";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:8.0pt;
+	font-family:Tahoma;
+	mso-fareast-font-family:"Times New Roman";}
+@page Section1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.25in 1.0in 1.25in;
+	mso-header-margin:.5in;
+	mso-footer-margin:.5in;
+	mso-paper-source:0;}
+div.Section1
+	{page:Section1;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor (&quot;Commercial
+Contributor&quot;) hereby agrees to defend and indemnify every other
+Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
+costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
+
+</div>
+
+</body>
+
+</html>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.web_ui.feature.patch/feature.properties b/features/org.eclipse.wst.web_ui.feature.patch/feature.properties
new file mode 100644
index 0000000..61ecea4
--- /dev/null
+++ b/features/org.eclipse.wst.web_ui.feature.patch/feature.properties
@@ -0,0 +1,153 @@
+###############################################################################
+# Copyright (c) 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=WTP Patch for org.eclipse.wst.web_ui.feature
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org
+
+# "updateSiteName" property - label for the update site
+updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
+
+# "description" property - description of the feature
+description=\
+Contains fixes for the following bugs: \n\
+\n\
+Bug https://bugs.eclipse.org/280483 "A handler conflict occurred. This may disable some commands." warning on restart\n\
+Bug https://bugs.eclipse.org/285284 Removing comment end tag and adding it back leaves validation errors\n\
+Bug https://bugs.eclipse.org/241794 [validation] Errors when using JSP Expressions inside JavaScript code\n\
+Bug https://bugs.eclipse.org/303024 JSP tags in Javascript statements in JSPs show errors at wrong offsets\n\
+Bug https://bugs.eclipse.org/310347 Incorrect boundary checking in org.eclipse.wst.jsdt.web.core.javascript.JsTranslation#getProblems()\n\
+Bug https://bugs.eclipse.org/323849 [content assist] Filtering down JavaScript content assist proposals does not work for qualified types in web pages\n\
+\n\
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2008 IBM Corporation and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors:\n\
+    IBM Corporation - initial API and implementation\n
+################ end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=\
+ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
+October, 2008\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
+is provided to you under the terms and conditions of the Eclipse Public\n\
+License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
+Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse.org CVS\n\
+repository ("Repository") in CVS modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+   - Content may be structured and packaged into modules to facilitate delivering,\n\
+     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+     plug-in fragments ("Fragments"), and features ("Features").\n\
+   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
+     in a directory named "plugins".\n\
+   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+Features may also include other Features ("Included Features"). Files named\n\
+"feature.xml" may contain a list of the names and version numbers of\n\
+Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+   - The top-level (root) directory\n\
+   - Plug-in and Fragment directories\n\
+   - Inside Plug-ins and Fragments packaged as JARs\n\
+   - Sub-directories of the directory named "src" of certain Plug-ins\n\
+   - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Eclipse Update Manager, you must agree to a license ("Feature Update\n\
+License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties". Such Abouts,\n\
+Feature Licenses and Feature Update Licenses contain the terms and\n\
+conditions (or references to such terms and conditions) that govern your\n\
+use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
+    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use,\n\
+and re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.web_ui.feature.patch/feature.xml b/features/org.eclipse.wst.web_ui.feature.patch/feature.xml
new file mode 100644
index 0000000..7220912
--- /dev/null
+++ b/features/org.eclipse.wst.web_ui.feature.patch/feature.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="org.eclipse.wst.web_ui.feature.patch"
+      label="%featureName"
+      version="3.0.5.qualifier"
+      provider-name="%providerName">
+
+   <description>
+      %description
+   </description>
+
+   <copyright>
+      %copyright
+   </copyright>
+
+   <license url="%licenseURL">
+      %license
+   </license>
+
+   <requires>
+      <import feature="org.eclipse.wst.web_ui.feature" version="3.0.5.v200904070030-7R0EPLE8Ks_vFN8ntF_nOY1stwIC" patch="true"/>
+   </requires>
+
+   <plugin
+         id="org.eclipse.wst.jsdt.web.core"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.eclipse.wst.jsdt.web.ui"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.eclipse.wst.css.ui"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.eclipse.wst.html.ui"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+         
+</feature>
diff --git a/features/org.eclipse.wst.web_ui.feature.patch/license.html b/features/org.eclipse.wst.web_ui.feature.patch/license.html
new file mode 100644
index 0000000..2347060
--- /dev/null
+++ b/features/org.eclipse.wst.web_ui.feature.patch/license.html
@@ -0,0 +1,93 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
+<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
+<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
+<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
+<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
+<BODY lang=EN-US vLink=purple link=blue>
+<H2>Eclipse Foundation Software User Agreement</H2>
+<P>January 28, 2005</P>
+<H3>Usage Of Content</H3>
+<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION 
+AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF 
+THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE 
+TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED 
+BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED 
+BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE 
+AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE 
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY 
+APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU 
+MAY NOT USE THE CONTENT.</P>
+<H3>Applicable Licenses</H3>
+<P>Unless otherwise indicated, all Content made available by the Eclipse 
+Foundation is provided to you under the terms and conditions of the Eclipse 
+Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this 
+Content and is also available at <A 
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>. 
+For purposes of the EPL, "Program" will mean the Content.</P>
+<P>Content includes, but is not limited to, source code, object code, 
+documentation and other files maintained in the Eclipse.org CVS repository 
+("Repository") in CVS modules ("Modules") and made available as downloadable 
+archives ("Downloads").</P>
+<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments 
+("Fragments"), and features ("Features"). A Feature is a bundle of one or more 
+Plug-ins and/or Fragments and associated material. Files named "feature.xml" may 
+contain a list of the names and version numbers of the Plug-ins and/or Fragments 
+associated with a Feature. Plug-ins and Fragments are located in directories 
+named "plugins" and Features are located in directories named "features".</P>
+<P>Features may also include other Features ("Included Features"). Files named 
+"feature.xml" may contain a list of the names and version numbers of Included 
+Features.</P>
+<P>The terms and conditions governing Plug-ins and Fragments should be contained 
+in files named "about.html" ("Abouts"). The terms and conditions governing 
+Features and Included Features should be contained in files named "license.html" 
+("Feature Licenses"). Abouts and Feature Licenses may be located in any 
+directory of a Download or Module including, but not limited to the following 
+locations:</P>
+<UL>
+  <LI>The top-level (root) directory 
+  <LI>Plug-in and Fragment directories 
+  <LI>Subdirectories of the directory named "src" of certain Plug-ins 
+  <LI>Feature directories </LI></UL>
+<P>Note: if a Feature made available by the Eclipse Foundation is installed 
+using the Eclipse Update Manager, you must agree to a license ("Feature Update 
+License") during the installation process. If the Feature contains Included 
+Features, the Feature Update License should either provide you with the terms 
+and conditions governing the Included Features or inform you where you can 
+locate them. Feature Update Licenses may be found in the "license" property of 
+files named "feature.properties". Such Abouts, Feature Licenses and Feature 
+Update Licenses contain the terms and conditions (or references to such terms 
+and conditions) that govern your use of the associated Content in that 
+directory.</P>
+<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL 
+OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE 
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
+<UL>
+  <LI>Common Public License Version 1.0 (available at <A 
+  href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>) 
+
+  <LI>Apache Software License 1.1 (available at <A 
+  href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>) 
+
+  <LI>Apache Software License 2.0 (available at <A 
+  href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>) 
+
+  <LI>IBM Public License 1.0 (available at <A 
+  href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>) 
+
+  <LI>Metro Link Public License 1.00 (available at <A 
+  href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>) 
+
+  <LI>Mozilla Public License Version 1.1 (available at <A 
+  href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>) 
+  </LI></UL>
+<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR 
+TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is 
+provided, please contact the Eclipse Foundation to determine what terms and 
+conditions govern that particular Content.</P>
+<H3>Cryptography</H3>
+<P>Content may contain encryption software. The country in which you are 
+currently may have restrictions on the import, possession, and use, and/or 
+re-export to another country, of encryption software. BEFORE using any 
+encryption software, please check the country's laws, regulations and policies 
+concerning the import, possession, or use, and re-export of encryption software, 
+to see if this is permitted.</P></BODY></HTML>
diff --git a/features/org.eclipse.wst.xml_core.feature.patch/buildnotes_org.eclipse.wst.xml_core.feature.patch.html b/features/org.eclipse.wst.xml_core.feature.patch/buildnotes_org.eclipse.wst.xml_core.feature.patch.html
index 6356913..9185e32 100644
--- a/features/org.eclipse.wst.xml_core.feature.patch/buildnotes_org.eclipse.wst.xml_core.feature.patch.html
+++ b/features/org.eclipse.wst.xml_core.feature.patch/buildnotes_org.eclipse.wst.xml_core.feature.patch.html
@@ -7,9 +7,30 @@
 <body>
 
 
-<h1>WTP 3.0.1 Patches</h1>
+<h1>WTP 3.0.5 Patches</h1>
 
-<p>Bug <a href="https://bugs.eclipse.org/243747">243747</a>.
-"Cannot find the tag library descriptor" after removing a taglib file with duplicate URI.</p>
+<p>Bug <a href='https://bugs.eclipse.org/272389'>272389</a>. tokenizers stuck in loop when input not matched</p>
+<p>Bug <a href="https://bugs.eclipse.org/282205">282205</a>. HTMLHeadTokenizer can get stuck in an infinite loop</p>
+<p>Bug <a href="https://bugs.eclipse.org/285067">285067</a>. BasicStructuredDocument should only acquireLock in a try/finally</p>
+<p>Bug <a href="https://bugs.eclipse.org/285075">285075</a>. Remove automatic promotion of invalid child tags in XMLModelParser</p>
+<p>Bug <a href="https://bugs.eclipse.org/287870">287870</a>. [document] changeAttrName not setting old attr mof value to null</p>
+<p>Bug <a href="https://bugs.eclipse.org/288494">288494</a>. Content model validation utility fails to handle large size documents</p>
+<p>Bug <a href="https://bugs.eclipse.org/289464">289464</a>. IExecutionDelegate should be using ISafeRunnable</p>
+<p>Bug <a href="https://bugs.eclipse.org/290454">290454</a>. DTD Content Model is missing IDREFS data type name</p>
+<p>Bug <a href="https://bugs.eclipse.org/290966">290966</a>. JSP include directives do not handle non-JSP content types</p>
+<p>Bug <a href='https://bugs.eclipse.org/292079'>292079</a>. [parser] Scriptlet in <script> attribute tags can cause the region to not be block text</p>
+<p>Bug <a href='https://bugs.eclipse.org/289745'>289745</a>. [document] StructuredDocumentRegionUtil not compensating for StructuredDocumentRegionProxy</p>
+<p>Bug <a href='https://bugs.eclipse.org/292469'>292469</a>. [parser] XMLSourceParser#regionMatches should compensate for offset</p>
+<p>Bug <a href='https://bugs.eclipse.org/297208'>297208</a>. [formatting] Format Source doesn't format XML files correctly with preserve whitespace mode</p>
+<p>Bug <a href='https://bugs.eclipse.org/299156'>299156</a>. [parser] JSPTokenizer does not detect Unicode character references as you type</p>
+<p>Bug <a href='https://bugs.eclipse.org/299822'>299822</a>. [content model] ModelManagerImpl#_getModelFor fall back to getExisting*(IDocument) before throwing assertion failure</p>
+<p>Bug <a href='https://bugs.eclipse.org/301551'>301551</a>. UI freeze when grammar loading job name is a very long string</p>
+<p>Bug <a href='https://bugs.eclipse.org/278128'>278128</a>. ModelManagerImpl#waitForLoadAttempt() called from UI thread</p>
+<p>Bug <a href='https://bugs.eclipse.org/304369'>304369</a>. Slow performance (or even crash) when opening large XML file</p>
+<p>Bug <a href='https://bugs.eclipse.org/308548'>308548</a>. XSD to XML generator can cause an out of memory error on certain types of documents</p>
+<p>Bug <a href='https://bugs.eclipse.org/316222'>316222</a>. [parser] < or > in attribute values are not supported</p>
+<p>Bug <a href='https://bugs.eclipse.org/316551'>316551</a>. [parser] Is HTML DOM correctly treating implicitly-closed tags?</p>
+<p>Bug <a href='https://bugs.eclipse.org/321794'>321794</a>. ClassCast exception can occur while updating XML model adapted to two EMF models</p>
+<p>Bug <a href='https://bugs.eclipse.org/322836'>322836</a>. Wrong default value generated for base64binary simple types</p>
 </body>
 </head>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.xml_core.feature.patch/feature.properties b/features/org.eclipse.wst.xml_core.feature.patch/feature.properties
index 6edee72..b166f9b 100644
--- a/features/org.eclipse.wst.xml_core.feature.patch/feature.properties
+++ b/features/org.eclipse.wst.xml_core.feature.patch/feature.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2006 IBM Corporation and others.
+# Copyright (c) 2008 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -15,7 +15,7 @@
 # This file should be translated.
 
 # "featureName" property - name of the feature
-featureName=WST XML Core Patch Feature
+featureName=WTP Patches for org.eclipse.wst.xml_core.feature
 
 # "providerName" property - name of the company that provides the feature
 providerName=Eclipse.org
@@ -27,7 +27,30 @@
 description=\
 The bugs and fixes are described in the following bugzilla entries:\n\
 \n\
-Bug https://bugs.eclipse.org/243747 Cannot find the tag library descriptor" after removing a taglib file with duplicate URI.\n\
+Bug https://bugs.eclipse.org/272389 tokenizers stuck in loop when input not matched\n\
+Bug https://bugs.eclipse.org/282205 HTMLHeadTokenizer can get stuck in an infinite loop\n\
+Bug https://bugs.eclipse.org/285067 BasicStructuredDocument should only acquireLock in a try/finally\n\
+Bug https://bugs.eclipse.org/285075 Remove automatic promotion of invalid child tags in XMLModelParser\n\
+Bug https://bugs.eclipse.org/287870 [document] changeAttrName not setting old attr mof value to null\n\
+Bug https://bugs.eclipse.org/288494 Content model validation utility fails to handle large size documents\n\
+Bug https://bugs.eclipse.org/289464 IExecutionDelegate should be using ISafeRunnable\n\
+Bug https://bugs.eclipse.org/290454 DTD Content Model is missing IDREFS data type name\n\
+Bug https://bugs.eclipse.org/290966 JSP include directives do not handle non-JSP content types\n\
+Bug https://bugs.eclipse.org/292079 [parser] Scriptlet in <script> attribute tags can cause the region to not be block text\n\
+Bug https://bugs.eclipse.org/289745 [document] StructuredDocumentRegionUtil not compensating for StructuredDocumentRegionProxy\n\
+Bug https://bugs.eclipse.org/292469 [parser] XMLSourceParser#regionMatches should compensate for offset\n\
+Bug https://bugs.eclipse.org/297208 [formatting] Format Source doesn't format XML files correctly with preserve whitespace mode\n\
+Bug https://bugs.eclipse.org/299156 [parser] JSPTokenizer does not detect Unicode character references as you type\n\
+Bug https://bugs.eclipse.org/299822 [content model] ModelManagerImpl#_getModelFor fall back to getExisting*(IDocument) before throwing assertion failure\n\
+Bug https://bugs.eclipse.org/301551 UI freeze when grammar loading job name is a very long string\n\
+Bug https://bugs.eclipse.org/278128 ModelManagerImpl#waitForLoadAttempt() called from UI thread\n\
+Bug https://bugs.eclipse.org/304369 Slow performance (or even crash) when opening large XML file\n\
+Bug https://bugs.eclipse.org/308548 XSD to XML generator can cause an out of memory error on certain types of documents\n\
+Bug https://bugs.eclipse.org/316222 [parser] < or > in attribute values are not supported\n\
+Bug https://bugs.eclipse.org/316551 [parser] Is HTML DOM correctly treating implicitly-closed tags?\n\
+Bug https://bugs.eclipse.org/321794 ClassCast exception can occur while updating XML model adapted to two EMF models\n\
+Bug https://bugs.eclipse.org/322836 Wrong default value generated for base64binary simple types\n\
+\n\
 
 # "copyright" property - text of the "Feature Update Copyright"
 copyright=\
@@ -49,7 +72,7 @@
 # should be plain text version of license agreement pointed to be "licenseURL"
 license=\
 ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-March 17, 2005\n\
+September, 2008\n\
 \n\
 Usage Of Content\n\
 \n\
diff --git a/features/org.eclipse.wst.xml_core.feature.patch/feature.xml b/features/org.eclipse.wst.xml_core.feature.patch/feature.xml
index 9b23ea4..69eff14 100644
--- a/features/org.eclipse.wst.xml_core.feature.patch/feature.xml
+++ b/features/org.eclipse.wst.xml_core.feature.patch/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.xml_core.feature.patch"
       label="%featureName"
-      version="3.0.1.qualifier"
+      version="3.0.5.qualifier"
       provider-name="%providerName">
 
    <description>
@@ -22,14 +22,35 @@
    </url>
 
    <requires>
-      <import feature="org.eclipse.wst.xml_core.feature" version="3.0.1.v200807220139-7A7NEGuE7QYGHNH_NuKhUl" patch="true"/>
+      <import feature="org.eclipse.wst.xml_core.feature" version="3.0.5.v200903310029-7A7NEH6E7QYGHRHvLuKlbZ" patch="true"/>
    </requires>
 
    <plugin
+         id="org.eclipse.wst.xml.core"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.eclipse.wst.dtd.core"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.eclipse.wst.xsd.core"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
          id="org.eclipse.wst.sse.core"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
 
-</feature>
+   </feature>